@agentprojectcontext/apx 1.74.0 → 1.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/core/desktop/autostart.js +31 -14
- package/src/core/mcp/runner.js +6 -1
- package/src/core/util/index.js +1 -0
- package/src/core/util/path-env.js +73 -0
- package/src/core/voice/transcription.js +28 -3
- package/src/host/daemon/whisper-server.js +27 -0
- package/src/interfaces/web/dist/assets/index-DUXlrW8P.js +819 -0
- package/src/interfaces/web/dist/assets/index-DUXlrW8P.js.map +1 -0
- package/src/interfaces/web/dist/index.html +1 -1
- package/src/interfaces/web/package-lock.json +226 -200
- package/src/interfaces/web/dist/assets/index-BxYXJEtf.js +0 -819
- package/src/interfaces/web/dist/assets/index-BxYXJEtf.js.map +0 -1
|
@@ -1,819 +0,0 @@
|
|
|
1
|
-
function M5(e,t){for(var a=0;a<t.length;a++){const o=t[a];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const i=Object.getOwnPropertyDescriptor(o,l);i&&Object.defineProperty(e,l,i.get?i:{enumerable:!0,get:()=>o[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=a(l);fetch(l.href,i)}})();function sb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vg={exports:{}},uc={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var sj;function O5(){if(sj)return uc;sj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(o,l,i){var d=null;if(i!==void 0&&(d=""+i),l.key!==void 0&&(d=""+l.key),"key"in l){i={};for(var f in l)f!=="key"&&(i[f]=l[f])}else i=l;return l=i.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:i}}return uc.Fragment=t,uc.jsx=a,uc.jsxs=a,uc}var aj;function z5(){return aj||(aj=1,Vg.exports=O5()),Vg.exports}var n=z5(),Fg={exports:{}},ct={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var rj;function D5(){if(rj)return ct;rj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=_&&I[_]||I["@@iterator"],typeof I=="function"?I:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,w={};function E(I,Q,J){this.props=I,this.context=Q,this.refs=w,this.updater=J||N}E.prototype.isReactComponent={},E.prototype.setState=function(I,Q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Q,"setState")},E.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function j(){}j.prototype=E.prototype;function S(I,Q,J){this.props=I,this.context=Q,this.refs=w,this.updater=J||N}var R=S.prototype=new j;R.constructor=S,y(R,E.prototype),R.isPureReactComponent=!0;var A=Array.isArray;function T(){}var O={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function B(I,Q,J){var K=J.ref;return{$$typeof:e,type:I,key:Q,ref:K!==void 0?K:null,props:J}}function P(I,Q){return B(I.type,Q,I.props)}function $(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function D(I){var Q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(J){return Q[J]})}var L=/\/+/g;function H(I,Q){return typeof I=="object"&&I!==null&&I.key!=null?D(""+I.key):Q.toString(36)}function V(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(T,T):(I.status="pending",I.then(function(Q){I.status==="pending"&&(I.status="fulfilled",I.value=Q)},function(Q){I.status==="pending"&&(I.status="rejected",I.reason=Q)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function U(I,Q,J,K,se){var te=typeof I;(te==="undefined"||te==="boolean")&&(I=null);var le=!1;if(I===null)le=!0;else switch(te){case"bigint":case"string":case"number":le=!0;break;case"object":switch(I.$$typeof){case e:case t:le=!0;break;case g:return le=I._init,U(le(I._payload),Q,J,K,se)}}if(le)return se=se(I),le=K===""?"."+H(I,0):K,A(se)?(J="",le!=null&&(J=le.replace(L,"$&/")+"/"),U(se,Q,J,"",function(ve){return ve})):se!=null&&($(se)&&(se=P(se,J+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(L,"$&/")+"/")+le)),Q.push(se)),1;le=0;var W=K===""?".":K+":";if(A(I))for(var ne=0;ne<I.length;ne++)K=I[ne],te=W+H(K,ne),le+=U(K,Q,J,te,se);else if(ne=k(I),typeof ne=="function")for(I=ne.call(I),ne=0;!(K=I.next()).done;)K=K.value,te=W+H(K,ne++),le+=U(K,Q,J,te,se);else if(te==="object"){if(typeof I.then=="function")return U(V(I),Q,J,K,se);throw Q=String(I),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return le}function F(I,Q,J){if(I==null)return I;var K=[],se=0;return U(I,K,"","",function(te){return Q.call(J,te,se++)}),K}function X(I){if(I._status===-1){var Q=I._result;Q=Q(),Q.then(function(J){(I._status===0||I._status===-1)&&(I._status=1,I._result=J)},function(J){(I._status===0||I._status===-1)&&(I._status=2,I._result=J)}),I._status===-1&&(I._status=0,I._result=Q)}if(I._status===1)return I._result.default;throw I._result}var G=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},Y={map:F,forEach:function(I,Q,J){F(I,function(){Q.apply(this,arguments)},J)},count:function(I){var Q=0;return F(I,function(){Q++}),Q},toArray:function(I){return F(I,function(Q){return Q})||[]},only:function(I){if(!$(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return ct.Activity=b,ct.Children=Y,ct.Component=E,ct.Fragment=a,ct.Profiler=l,ct.PureComponent=S,ct.StrictMode=o,ct.Suspense=m,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ct.__COMPILER_RUNTIME={__proto__:null,c:function(I){return O.H.useMemoCache(I)}},ct.cache=function(I){return function(){return I.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(I,Q,J){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var K=y({},I.props),se=I.key;if(Q!=null)for(te in Q.key!==void 0&&(se=""+Q.key),Q)!M.call(Q,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&Q.ref===void 0||(K[te]=Q[te]);var te=arguments.length-2;if(te===1)K.children=J;else if(1<te){for(var le=Array(te),W=0;W<te;W++)le[W]=arguments[W+2];K.children=le}return B(I.type,se,K)},ct.createContext=function(I){return I={$$typeof:d,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:i,_context:I},I},ct.createElement=function(I,Q,J){var K,se={},te=null;if(Q!=null)for(K in Q.key!==void 0&&(te=""+Q.key),Q)M.call(Q,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(se[K]=Q[K]);var le=arguments.length-2;if(le===1)se.children=J;else if(1<le){for(var W=Array(le),ne=0;ne<le;ne++)W[ne]=arguments[ne+2];se.children=W}if(I&&I.defaultProps)for(K in le=I.defaultProps,le)se[K]===void 0&&(se[K]=le[K]);return B(I,te,se)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(I){return{$$typeof:f,render:I}},ct.isValidElement=$,ct.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:X}},ct.memo=function(I,Q){return{$$typeof:h,type:I,compare:Q===void 0?null:Q}},ct.startTransition=function(I){var Q=O.T,J={};O.T=J;try{var K=I(),se=O.S;se!==null&&se(J,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(T,G)}catch(te){G(te)}finally{Q!==null&&J.types!==null&&(Q.types=J.types),O.T=Q}},ct.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ct.use=function(I){return O.H.use(I)},ct.useActionState=function(I,Q,J){return O.H.useActionState(I,Q,J)},ct.useCallback=function(I,Q){return O.H.useCallback(I,Q)},ct.useContext=function(I){return O.H.useContext(I)},ct.useDebugValue=function(){},ct.useDeferredValue=function(I,Q){return O.H.useDeferredValue(I,Q)},ct.useEffect=function(I,Q){return O.H.useEffect(I,Q)},ct.useEffectEvent=function(I){return O.H.useEffectEvent(I)},ct.useId=function(){return O.H.useId()},ct.useImperativeHandle=function(I,Q,J){return O.H.useImperativeHandle(I,Q,J)},ct.useInsertionEffect=function(I,Q){return O.H.useInsertionEffect(I,Q)},ct.useLayoutEffect=function(I,Q){return O.H.useLayoutEffect(I,Q)},ct.useMemo=function(I,Q){return O.H.useMemo(I,Q)},ct.useOptimistic=function(I,Q){return O.H.useOptimistic(I,Q)},ct.useReducer=function(I,Q,J){return O.H.useReducer(I,Q,J)},ct.useRef=function(I){return O.H.useRef(I)},ct.useState=function(I){return O.H.useState(I)},ct.useSyncExternalStore=function(I,Q,J){return O.H.useSyncExternalStore(I,Q,J)},ct.useTransition=function(){return O.H.useTransition()},ct.version="19.2.8",ct}var oj;function Zc(){return oj||(oj=1,Fg.exports=D5()),Fg.exports}var x=Zc();const Jc=sb(x),P5=M5({__proto__:null,default:Jc},[x]);var Gg={exports:{}},dc={},Yg={exports:{}},Kg={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var lj;function L5(){return lj||(lj=1,(function(e){function t(U,F){var X=U.length;U.push(F);e:for(;0<X;){var G=X-1>>>1,Y=U[G];if(0<l(Y,F))U[G]=F,U[X]=Y,X=G;else break e}}function a(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var F=U[0],X=U.pop();if(X!==F){U[0]=X;e:for(var G=0,Y=U.length,I=Y>>>1;G<I;){var Q=2*(G+1)-1,J=U[Q],K=Q+1,se=U[K];if(0>l(J,X))K<Y&&0>l(se,J)?(U[G]=se,U[K]=X,G=K):(U[G]=J,U[Q]=X,G=Q);else if(K<Y&&0>l(se,X))U[G]=se,U[K]=X,G=K;else break e}}return F}function l(U,F){var X=U.sortIndex-F.sortIndex;return X!==0?X:U.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],h=[],g=1,b=null,_=3,k=!1,N=!1,y=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function R(U){for(var F=a(h);F!==null;){if(F.callback===null)o(h);else if(F.startTime<=U)o(h),F.sortIndex=F.expirationTime,t(m,F);else break;F=a(h)}}function A(U){if(y=!1,R(U),!N)if(a(m)!==null)N=!0,T||(T=!0,D());else{var F=a(h);F!==null&&V(A,F.startTime-U)}}var T=!1,O=-1,M=5,B=-1;function P(){return w?!0:!(e.unstable_now()-B<M)}function $(){if(w=!1,T){var U=e.unstable_now();B=U;var F=!0;try{e:{N=!1,y&&(y=!1,j(O),O=-1),k=!0;var X=_;try{t:{for(R(U),b=a(m);b!==null&&!(b.expirationTime>U&&P());){var G=b.callback;if(typeof G=="function"){b.callback=null,_=b.priorityLevel;var Y=G(b.expirationTime<=U);if(U=e.unstable_now(),typeof Y=="function"){b.callback=Y,R(U),F=!0;break t}b===a(m)&&o(m),R(U)}else o(m);b=a(m)}if(b!==null)F=!0;else{var I=a(h);I!==null&&V(A,I.startTime-U),F=!1}}break e}finally{b=null,_=X,k=!1}F=void 0}}finally{F?D():T=!1}}}var D;if(typeof S=="function")D=function(){S($)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,H=L.port2;L.port1.onmessage=$,D=function(){H.postMessage(null)}}else D=function(){E($,0)};function V(U,F){O=E(function(){U(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(U){switch(_){case 1:case 2:case 3:var F=3;break;default:F=_}var X=_;_=F;try{return U()}finally{_=X}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(U,F){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var X=_;_=U;try{return F()}finally{_=X}},e.unstable_scheduleCallback=function(U,F,X){var G=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?G+X:G):X=G,U){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=X+Y,U={id:g++,callback:F,priorityLevel:U,startTime:X,expirationTime:Y,sortIndex:-1},X>G?(U.sortIndex=X,t(h,U),a(m)===null&&U===a(h)&&(y?(j(O),O=-1):y=!0,V(A,X-G))):(U.sortIndex=Y,t(m,U),N||k||(N=!0,T||(T=!0,D()))),U},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(U){var F=_;return function(){var X=_;_=F;try{return U.apply(this,arguments)}finally{_=X}}}})(Kg)),Kg}var ij;function I5(){return ij||(ij=1,Yg.exports=L5()),Yg.exports}var Xg={exports:{}},Fn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var cj;function B5(){if(cj)return Fn;cj=1;var e=Zc();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function i(m,h,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:b==null?null:""+b,children:m,containerInfo:h,implementation:g}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Fn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return i(m,h,null,g)},Fn.flushSync=function(m){var h=d.T,g=o.p;try{if(d.T=null,o.p=2,m)return m()}finally{d.T=h,o.p=g,o.d.f()}},Fn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(m,h))},Fn.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},Fn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,b=f(g,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,k=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:k}):g==="script"&&o.d.X(m,{crossOrigin:b,integrity:_,fetchPriority:k,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Fn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(m)},Fn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,b=f(g,h.crossOrigin);o.d.L(m,g,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Fn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);o.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(m)},Fn.requestFormReset=function(m){o.d.r(m)},Fn.unstable_batchedUpdates=function(m,h){return m(h)},Fn.useFormState=function(m,h,g){return d.H.useFormState(m,h,g)},Fn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Fn.version="19.2.8",Fn}var uj;function h2(){if(uj)return Xg.exports;uj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xg.exports=B5(),Xg.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var dj;function $5(){if(dj)return dc;dj=1;var e=I5(),t=Zc(),a=h2();function o(s){var r="https://react.dev/errors/"+s;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var r=s,c=s;if(s.alternate)for(;r.return;)r=r.return;else{s=r;do r=s,(r.flags&4098)!==0&&(c=r.return),s=r.return;while(s)}return r.tag===3?c:null}function d(s){if(s.tag===13){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function f(s){if(s.tag===31){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function m(s){if(i(s)!==s)throw Error(o(188))}function h(s){var r=s.alternate;if(!r){if(r=i(s),r===null)throw Error(o(188));return r!==s?null:s}for(var c=s,p=r;;){var v=c.return;if(v===null)break;var C=v.alternate;if(C===null){if(p=v.return,p!==null){c=p;continue}break}if(v.child===C.child){for(C=v.child;C;){if(C===c)return m(v),s;if(C===p)return m(v),r;C=C.sibling}throw Error(o(188))}if(c.return!==p.return)c=v,p=C;else{for(var z=!1,q=v.child;q;){if(q===c){z=!0,c=v,p=C;break}if(q===p){z=!0,p=v,c=C;break}q=q.sibling}if(!z){for(q=C.child;q;){if(q===c){z=!0,c=C,p=v;break}if(q===p){z=!0,p=C,c=v;break}q=q.sibling}if(!z)throw Error(o(189))}}if(c.alternate!==p)throw Error(o(190))}if(c.tag!==3)throw Error(o(188));return c.stateNode.current===c?s:r}function g(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(r=g(s),r!==null)return r;s=s.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),S=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function D(s){return s===null||typeof s!="object"?null:(s=$&&s[$]||s["@@iterator"],typeof s=="function"?s:null)}var L=Symbol.for("react.client.reference");function H(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===L?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case y:return"Fragment";case E:return"Profiler";case w:return"StrictMode";case A:return"Suspense";case T:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case N:return"Portal";case S:return s.displayName||"Context";case j:return(s._context.displayName||"Context")+".Consumer";case R:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return r=s.displayName||null,r!==null?r:H(s.type)||"Memo";case M:r=s._payload,s=s._init;try{return H(s(r))}catch{}}return null}var V=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},G=[],Y=-1;function I(s){return{current:s}}function Q(s){0>Y||(s.current=G[Y],G[Y]=null,Y--)}function J(s,r){Y++,G[Y]=s.current,s.current=r}var K=I(null),se=I(null),te=I(null),le=I(null);function W(s,r){switch(J(te,r),J(se,s),J(K,null),r.nodeType){case 9:case 11:s=(s=r.documentElement)&&(s=s.namespaceURI)?C1(s):0;break;default:if(s=r.tagName,r=r.namespaceURI)r=C1(r),s=N1(r,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Q(K),J(K,s)}function ne(){Q(K),Q(se),Q(te)}function ve(s){s.memoizedState!==null&&J(le,s);var r=K.current,c=N1(r,s.type);r!==c&&(J(se,s),J(K,c))}function oe(s){se.current===s&&(Q(K),Q(se)),le.current===s&&(Q(le),oc._currentValue=X)}var fe,we;function Ce(s){if(fe===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);fe=r&&r[1]||"",we=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+fe+s+we}var Le=!1;function $e(s,r){if(!s||Le)return"";Le=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(he){var pe=he}Reflect.construct(s,[],Ne)}else{try{Ne.call()}catch(he){pe=he}s.call(Ne.prototype)}}else{try{throw Error()}catch(he){pe=he}(Ne=s())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}catch(he){if(he&&pe&&typeof he.stack=="string")return[he.stack,pe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=p.DetermineComponentFrameRoot(),z=C[0],q=C[1];if(z&&q){var Z=z.split(`
|
|
44
|
-
`),de=q.split(`
|
|
45
|
-
`);for(v=p=0;p<Z.length&&!Z[p].includes("DetermineComponentFrameRoot");)p++;for(;v<de.length&&!de[v].includes("DetermineComponentFrameRoot");)v++;if(p===Z.length||v===de.length)for(p=Z.length-1,v=de.length-1;1<=p&&0<=v&&Z[p]!==de[v];)v--;for(;1<=p&&0<=v;p--,v--)if(Z[p]!==de[v]){if(p!==1||v!==1)do if(p--,v--,0>v||Z[p]!==de[v]){var ye=`
|
|
46
|
-
`+Z[p].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=p&&0<=v);break}}}finally{Le=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?Ce(c):""}function Ee(s,r){switch(s.tag){case 26:case 27:case 5:return Ce(s.type);case 16:return Ce("Lazy");case 13:return s.child!==r&&r!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return $e(s.type,!1);case 11:return $e(s.type.render,!1);case 1:return $e(s.type,!0);case 31:return Ce("Activity");default:return""}}function _e(s){try{var r="",c=null;do r+=Ee(s,c),c=s,s=s.return;while(s);return r}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var xe=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,Oe=e.unstable_cancelCallback,Pe=e.unstable_shouldYield,Be=e.unstable_requestPaint,me=e.unstable_now,Se=e.unstable_getCurrentPriorityLevel,Ge=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,tt=e.unstable_LowPriority,ot=e.unstable_IdlePriority,vt=e.log,Mt=e.unstable_setDisableYieldValue,lt=null,Rt=null;function je(s){if(typeof vt=="function"&&Mt(s),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(lt,s)}catch{}}var Ie=Math.clz32?Math.clz32:Qe,Xe=Math.log,it=Math.LN2;function Qe(s){return s>>>=0,s===0?32:31-(Xe(s)/it|0)|0}var mt=256,Ot=262144,Jt=4194304;function Wt(s){var r=s&42;if(r!==0)return r;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function en(s,r,c){var p=s.pendingLanes;if(p===0)return 0;var v=0,C=s.suspendedLanes,z=s.pingedLanes;s=s.warmLanes;var q=p&134217727;return q!==0?(p=q&~C,p!==0?v=Wt(p):(z&=q,z!==0?v=Wt(z):c||(c=q&~s,c!==0&&(v=Wt(c))))):(q=p&~C,q!==0?v=Wt(q):z!==0?v=Wt(z):c||(c=p&~s,c!==0&&(v=Wt(c)))),v===0?0:r!==0&&r!==v&&(r&C)===0&&(C=v&-v,c=r&-r,C>=c||C===32&&(c&4194048)!==0)?r:v}function mn(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function rs(s,r){switch(s){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hs(){var s=Jt;return Jt<<=1,(Jt&62914560)===0&&(Jt=4194304),s}function Es(s){for(var r=[],c=0;31>c;c++)r.push(s);return r}function gn(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Rs(s,r,c,p,v,C){var z=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var q=s.entanglements,Z=s.expirationTimes,de=s.hiddenUpdates;for(c=z&~c;0<c;){var ye=31-Ie(c),Ne=1<<ye;q[ye]=0,Z[ye]=-1;var pe=de[ye];if(pe!==null)for(de[ye]=null,ye=0;ye<pe.length;ye++){var he=pe[ye];he!==null&&(he.lane&=-536870913)}c&=~Ne}p!==0&&Sa(s,p,0),C!==0&&v===0&&s.tag!==0&&(s.suspendedLanes|=C&~(z&~r))}function Sa(s,r,c){s.pendingLanes|=r,s.suspendedLanes&=~r;var p=31-Ie(r);s.entangledLanes|=r,s.entanglements[p]=s.entanglements[p]|1073741824|c&261930}function Gs(s,r){var c=s.entangledLanes|=r;for(s=s.entanglements;c;){var p=31-Ie(c),v=1<<p;v&r|s[p]&r&&(s[p]|=r),c&=~v}}function Ca(s,r){var c=r&-r;return c=(c&42)!==0?1:dt(c),(c&(s.suspendedLanes|r))!==0?0:c}function dt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function $t(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function hn(){var s=F.p;return s!==0?s:(s=window.event,s===void 0?32:Q1(s.type))}function Rn(s,r){var c=F.p;try{return F.p=s,r()}finally{F.p=c}}var Sn=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Sn,Ln="__reactProps$"+Sn,oa="__reactContainer$"+Sn,vi="__reactEvents$"+Sn,mu="__reactListeners$"+Sn,jR="__reactHandles$"+Sn,pv="__reactResources$"+Sn,yi="__reactMarker$"+Sn;function Pp(s){delete s[Gt],delete s[Ln],delete s[vi],delete s[mu],delete s[jR]}function Jo(s){var r=s[Gt];if(r)return r;for(var c=s.parentNode;c;){if(r=c[oa]||c[Gt]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(s=z1(s);s!==null;){if(c=s[Gt])return c;s=z1(s)}return r}s=c,c=s.parentNode}return null}function el(s){if(s=s[Gt]||s[oa]){var r=s.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return s}return null}function ji(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s.stateNode;throw Error(o(33))}function tl(s){var r=s[pv];return r||(r=s[pv]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tn(s){s[yi]=!0}var mv=new Set,gv={};function so(s,r){nl(s,r),nl(s+"Capture",r)}function nl(s,r){for(gv[s]=r,s=0;s<r.length;s++)mv.add(r[s])}var kR=RegExp("^[: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]*$"),hv={},xv={};function wR(s){return xe.call(xv,s)?!0:xe.call(hv,s)?!1:kR.test(s)?xv[s]=!0:(hv[s]=!0,!1)}function gu(s,r,c){if(wR(r))if(c===null)s.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(r);return;case"boolean":var p=r.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){s.removeAttribute(r);return}}s.setAttribute(r,""+c)}}function hu(s,r,c){if(c===null)s.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(r);return}s.setAttribute(r,""+c)}}function Na(s,r,c,p){if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(r,c,""+p)}}function Ts(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function bv(s){var r=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function SR(s,r,c){var p=Object.getOwnPropertyDescriptor(s.constructor.prototype,r);if(!s.hasOwnProperty(r)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var v=p.get,C=p.set;return Object.defineProperty(s,r,{configurable:!0,get:function(){return v.call(this)},set:function(z){c=""+z,C.call(this,z)}}),Object.defineProperty(s,r,{enumerable:p.enumerable}),{getValue:function(){return c},setValue:function(z){c=""+z},stopTracking:function(){s._valueTracker=null,delete s[r]}}}}function Lp(s){if(!s._valueTracker){var r=bv(s)?"checked":"value";s._valueTracker=SR(s,r,""+s[r])}}function _v(s){if(!s)return!1;var r=s._valueTracker;if(!r)return!0;var c=r.getValue(),p="";return s&&(p=bv(s)?s.checked?"true":"false":s.value),s=p,s!==c?(r.setValue(s),!0):!1}function xu(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var CR=/[\n"\\]/g;function As(s){return s.replace(CR,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ip(s,r,c,p,v,C,z,q){s.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.type=z:s.removeAttribute("type"),r!=null?z==="number"?(r===0&&s.value===""||s.value!=r)&&(s.value=""+Ts(r)):s.value!==""+Ts(r)&&(s.value=""+Ts(r)):z!=="submit"&&z!=="reset"||s.removeAttribute("value"),r!=null?Bp(s,z,Ts(r)):c!=null?Bp(s,z,Ts(c)):p!=null&&s.removeAttribute("value"),v==null&&C!=null&&(s.defaultChecked=!!C),v!=null&&(s.checked=v&&typeof v!="function"&&typeof v!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.name=""+Ts(q):s.removeAttribute("name")}function vv(s,r,c,p,v,C,z,q){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(s.type=C),r!=null||c!=null){if(!(C!=="submit"&&C!=="reset"||r!=null)){Lp(s);return}c=c!=null?""+Ts(c):"",r=r!=null?""+Ts(r):c,q||r===s.value||(s.value=r),s.defaultValue=r}p=p??v,p=typeof p!="function"&&typeof p!="symbol"&&!!p,s.checked=q?s.checked:!!p,s.defaultChecked=!!p,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(s.name=z),Lp(s)}function Bp(s,r,c){r==="number"&&xu(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function sl(s,r,c,p){if(s=s.options,r){r={};for(var v=0;v<c.length;v++)r["$"+c[v]]=!0;for(c=0;c<s.length;c++)v=r.hasOwnProperty("$"+s[c].value),s[c].selected!==v&&(s[c].selected=v),v&&p&&(s[c].defaultSelected=!0)}else{for(c=""+Ts(c),r=null,v=0;v<s.length;v++){if(s[v].value===c){s[v].selected=!0,p&&(s[v].defaultSelected=!0);return}r!==null||s[v].disabled||(r=s[v])}r!==null&&(r.selected=!0)}}function yv(s,r,c){if(r!=null&&(r=""+Ts(r),r!==s.value&&(s.value=r),c==null)){s.defaultValue!==r&&(s.defaultValue=r);return}s.defaultValue=c!=null?""+Ts(c):""}function jv(s,r,c,p){if(r==null){if(p!=null){if(c!=null)throw Error(o(92));if(V(p)){if(1<p.length)throw Error(o(93));p=p[0]}c=p}c==null&&(c=""),r=c}c=Ts(r),s.defaultValue=c,p=s.textContent,p===c&&p!==""&&p!==null&&(s.value=p),Lp(s)}function al(s,r){if(r){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=r;return}}s.textContent=r}var NR=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function kv(s,r,c){var p=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?p?s.setProperty(r,""):r==="float"?s.cssFloat="":s[r]="":p?s.setProperty(r,c):typeof c!="number"||c===0||NR.has(r)?r==="float"?s.cssFloat=c:s[r]=(""+c).trim():s[r]=c+"px"}function wv(s,r,c){if(r!=null&&typeof r!="object")throw Error(o(62));if(s=s.style,c!=null){for(var p in c)!c.hasOwnProperty(p)||r!=null&&r.hasOwnProperty(p)||(p.indexOf("--")===0?s.setProperty(p,""):p==="float"?s.cssFloat="":s[p]="");for(var v in r)p=r[v],r.hasOwnProperty(v)&&c[v]!==p&&kv(s,v,p)}else for(var C in r)r.hasOwnProperty(C)&&kv(s,C,r[C])}function $p(s){if(s.indexOf("-")===-1)return!1;switch(s){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 ER=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),RR=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bu(s){return RR.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ea(){}var Up=null;function Hp(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var rl=null,ol=null;function Sv(s){var r=el(s);if(r&&(s=r.stateNode)){var c=s[Ln]||null;e:switch(s=r.stateNode,r.type){case"input":if(Ip(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+As(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var p=c[r];if(p!==s&&p.form===s.form){var v=p[Ln]||null;if(!v)throw Error(o(90));Ip(p,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(r=0;r<c.length;r++)p=c[r],p.form===s.form&&_v(p)}break e;case"textarea":yv(s,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&sl(s,!!c.multiple,r,!1)}}}var qp=!1;function Cv(s,r,c){if(qp)return s(r,c);qp=!0;try{var p=s(r);return p}finally{if(qp=!1,(rl!==null||ol!==null)&&(rd(),rl&&(r=rl,s=ol,ol=rl=null,Sv(r),s)))for(r=0;r<s.length;r++)Sv(s[r])}}function ki(s,r){var c=s.stateNode;if(c===null)return null;var p=c[Ln]||null;if(p===null)return null;c=p[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(s=s.type,p=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!p;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(o(231,r,typeof c));return c}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vp=!1;if(Ra)try{var wi={};Object.defineProperty(wi,"passive",{get:function(){Vp=!0}}),window.addEventListener("test",wi,wi),window.removeEventListener("test",wi,wi)}catch{Vp=!1}var fr=null,Fp=null,_u=null;function Nv(){if(_u)return _u;var s,r=Fp,c=r.length,p,v="value"in fr?fr.value:fr.textContent,C=v.length;for(s=0;s<c&&r[s]===v[s];s++);var z=c-s;for(p=1;p<=z&&r[c-p]===v[C-p];p++);return _u=v.slice(s,1<p?1-p:void 0)}function vu(s){var r=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&r===13&&(s=13)):s=r,s===10&&(s=13),32<=s||s===13?s:0}function yu(){return!0}function Ev(){return!1}function os(s){function r(c,p,v,C,z){this._reactName=c,this._targetInst=v,this.type=p,this.nativeEvent=C,this.target=z,this.currentTarget=null;for(var q in s)s.hasOwnProperty(q)&&(c=s[q],this[q]=c?c(C):C[q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?yu:Ev,this.isPropagationStopped=Ev,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),r}var ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ju=os(ao),Si=b({},ao,{view:0,detail:0}),TR=os(Si),Gp,Yp,Ci,ku=b({},Si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ci&&(Ci&&s.type==="mousemove"?(Gp=s.screenX-Ci.screenX,Yp=s.screenY-Ci.screenY):Yp=Gp=0,Ci=s),Gp)},movementY:function(s){return"movementY"in s?s.movementY:Yp}}),Rv=os(ku),AR=b({},ku,{dataTransfer:0}),MR=os(AR),OR=b({},Si,{relatedTarget:0}),Kp=os(OR),zR=b({},ao,{animationName:0,elapsedTime:0,pseudoElement:0}),DR=os(zR),PR=b({},ao,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),LR=os(PR),IR=b({},ao,{data:0}),Tv=os(IR),BR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$R={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"},UR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HR(s){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(s):(s=UR[s])?!!r[s]:!1}function Xp(){return HR}var qR=b({},Si,{key:function(s){if(s.key){var r=BR[s.key]||s.key;if(r!=="Unidentified")return r}return s.type==="keypress"?(s=vu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?$R[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xp,charCode:function(s){return s.type==="keypress"?vu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?vu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),VR=os(qR),FR=b({},ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Av=os(FR),GR=b({},Si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xp}),YR=os(GR),KR=b({},ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),XR=os(KR),QR=b({},ku,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),WR=os(QR),ZR=b({},ao,{newState:0,oldState:0}),JR=os(ZR),eT=[9,13,27,32],Qp=Ra&&"CompositionEvent"in window,Ni=null;Ra&&"documentMode"in document&&(Ni=document.documentMode);var tT=Ra&&"TextEvent"in window&&!Ni,Mv=Ra&&(!Qp||Ni&&8<Ni&&11>=Ni),Ov=" ",zv=!1;function Dv(s,r){switch(s){case"keyup":return eT.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ll=!1;function nT(s,r){switch(s){case"compositionend":return Pv(r);case"keypress":return r.which!==32?null:(zv=!0,Ov);case"textInput":return s=r.data,s===Ov&&zv?null:s;default:return null}}function sT(s,r){if(ll)return s==="compositionend"||!Qp&&Dv(s,r)?(s=Nv(),_u=Fp=fr=null,ll=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Mv&&r.locale!=="ko"?null:r.data;default:return null}}var aT={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 Lv(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r==="input"?!!aT[s.type]:r==="textarea"}function Iv(s,r,c,p){rl?ol?ol.push(p):ol=[p]:rl=p,r=fd(r,"onChange"),0<r.length&&(c=new ju("onChange","change",null,c,p),s.push({event:c,listeners:r}))}var Ei=null,Ri=null;function rT(s){v1(s,0)}function wu(s){var r=ji(s);if(_v(r))return s}function Bv(s,r){if(s==="change")return r}var $v=!1;if(Ra){var Wp;if(Ra){var Zp="oninput"in document;if(!Zp){var Uv=document.createElement("div");Uv.setAttribute("oninput","return;"),Zp=typeof Uv.oninput=="function"}Wp=Zp}else Wp=!1;$v=Wp&&(!document.documentMode||9<document.documentMode)}function Hv(){Ei&&(Ei.detachEvent("onpropertychange",qv),Ri=Ei=null)}function qv(s){if(s.propertyName==="value"&&wu(Ri)){var r=[];Iv(r,Ri,s,Hp(s)),Cv(rT,r)}}function oT(s,r,c){s==="focusin"?(Hv(),Ei=r,Ri=c,Ei.attachEvent("onpropertychange",qv)):s==="focusout"&&Hv()}function lT(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return wu(Ri)}function iT(s,r){if(s==="click")return wu(r)}function cT(s,r){if(s==="input"||s==="change")return wu(r)}function uT(s,r){return s===r&&(s!==0||1/s===1/r)||s!==s&&r!==r}var xs=typeof Object.is=="function"?Object.is:uT;function Ti(s,r){if(xs(s,r))return!0;if(typeof s!="object"||s===null||typeof r!="object"||r===null)return!1;var c=Object.keys(s),p=Object.keys(r);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var v=c[p];if(!xe.call(r,v)||!xs(s[v],r[v]))return!1}return!0}function Vv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Fv(s,r){var c=Vv(s);s=0;for(var p;c;){if(c.nodeType===3){if(p=s+c.textContent.length,s<=r&&p>=r)return{node:c,offset:r-s};s=p}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Vv(c)}}function Gv(s,r){return s&&r?s===r?!0:s&&s.nodeType===3?!1:r&&r.nodeType===3?Gv(s,r.parentNode):"contains"in s?s.contains(r):s.compareDocumentPosition?!!(s.compareDocumentPosition(r)&16):!1:!1}function Yv(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var r=xu(s.document);r instanceof s.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)s=r.contentWindow;else break;r=xu(s.document)}return r}function Jp(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r&&(r==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||r==="textarea"||s.contentEditable==="true")}var dT=Ra&&"documentMode"in document&&11>=document.documentMode,il=null,em=null,Ai=null,tm=!1;function Kv(s,r,c){var p=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;tm||il==null||il!==xu(p)||(p=il,"selectionStart"in p&&Jp(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Ai&&Ti(Ai,p)||(Ai=p,p=fd(em,"onSelect"),0<p.length&&(r=new ju("onSelect","select",null,r,c),s.push({event:r,listeners:p}),r.target=il)))}function ro(s,r){var c={};return c[s.toLowerCase()]=r.toLowerCase(),c["Webkit"+s]="webkit"+r,c["Moz"+s]="moz"+r,c}var cl={animationend:ro("Animation","AnimationEnd"),animationiteration:ro("Animation","AnimationIteration"),animationstart:ro("Animation","AnimationStart"),transitionrun:ro("Transition","TransitionRun"),transitionstart:ro("Transition","TransitionStart"),transitioncancel:ro("Transition","TransitionCancel"),transitionend:ro("Transition","TransitionEnd")},nm={},Xv={};Ra&&(Xv=document.createElement("div").style,"AnimationEvent"in window||(delete cl.animationend.animation,delete cl.animationiteration.animation,delete cl.animationstart.animation),"TransitionEvent"in window||delete cl.transitionend.transition);function oo(s){if(nm[s])return nm[s];if(!cl[s])return s;var r=cl[s],c;for(c in r)if(r.hasOwnProperty(c)&&c in Xv)return nm[s]=r[c];return s}var Qv=oo("animationend"),Wv=oo("animationiteration"),Zv=oo("animationstart"),fT=oo("transitionrun"),pT=oo("transitionstart"),mT=oo("transitioncancel"),Jv=oo("transitionend"),ey=new Map,sm="abort auxClick beforeToggle 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(" ");sm.push("scrollEnd");function Ys(s,r){ey.set(s,r),so(r,[s])}var Su=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ms=[],ul=0,am=0;function Cu(){for(var s=ul,r=am=ul=0;r<s;){var c=Ms[r];Ms[r++]=null;var p=Ms[r];Ms[r++]=null;var v=Ms[r];Ms[r++]=null;var C=Ms[r];if(Ms[r++]=null,p!==null&&v!==null){var z=p.pending;z===null?v.next=v:(v.next=z.next,z.next=v),p.pending=v}C!==0&&ty(c,v,C)}}function Nu(s,r,c,p){Ms[ul++]=s,Ms[ul++]=r,Ms[ul++]=c,Ms[ul++]=p,am|=p,s.lanes|=p,s=s.alternate,s!==null&&(s.lanes|=p)}function rm(s,r,c,p){return Nu(s,r,c,p),Eu(s)}function lo(s,r){return Nu(s,null,null,r),Eu(s)}function ty(s,r,c){s.lanes|=c;var p=s.alternate;p!==null&&(p.lanes|=c);for(var v=!1,C=s.return;C!==null;)C.childLanes|=c,p=C.alternate,p!==null&&(p.childLanes|=c),C.tag===22&&(s=C.stateNode,s===null||s._visibility&1||(v=!0)),s=C,C=C.return;return s.tag===3?(C=s.stateNode,v&&r!==null&&(v=31-Ie(c),s=C.hiddenUpdates,p=s[v],p===null?s[v]=[r]:p.push(r),r.lane=c|536870912),C):null}function Eu(s){if(50<Ji)throw Ji=0,mg=null,Error(o(185));for(var r=s.return;r!==null;)s=r,r=s.return;return s.tag===3?s.stateNode:null}var dl={};function gT(s,r,c,p){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bs(s,r,c,p){return new gT(s,r,c,p)}function om(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ta(s,r){var c=s.alternate;return c===null?(c=bs(s.tag,r,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=r,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&65011712,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,r=s.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function ny(s,r){s.flags&=65011714;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=r,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,r=c.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),s}function Ru(s,r,c,p,v,C){var z=0;if(p=s,typeof s=="function")om(s)&&(z=1);else if(typeof s=="string")z=v5(s,c,K.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=bs(31,c,r,v),s.elementType=B,s.lanes=C,s;case y:return io(c.children,v,C,r);case w:z=8,v|=24;break;case E:return s=bs(12,c,r,v|2),s.elementType=E,s.lanes=C,s;case A:return s=bs(13,c,r,v),s.elementType=A,s.lanes=C,s;case T:return s=bs(19,c,r,v),s.elementType=T,s.lanes=C,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case S:z=10;break e;case j:z=9;break e;case R:z=11;break e;case O:z=14;break e;case M:z=16,p=null;break e}z=29,c=Error(o(130,s===null?"null":typeof s,"")),p=null}return r=bs(z,c,r,v),r.elementType=s,r.type=p,r.lanes=C,r}function io(s,r,c,p){return s=bs(7,s,p,r),s.lanes=c,s}function lm(s,r,c){return s=bs(6,s,null,r),s.lanes=c,s}function sy(s){var r=bs(18,null,null,0);return r.stateNode=s,r}function im(s,r,c){return r=bs(4,s.children!==null?s.children:[],s.key,r),r.lanes=c,r.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},r}var ay=new WeakMap;function Os(s,r){if(typeof s=="object"&&s!==null){var c=ay.get(s);return c!==void 0?c:(r={value:s,source:r,stack:_e(r)},ay.set(s,r),r)}return{value:s,source:r,stack:_e(r)}}var fl=[],pl=0,Tu=null,Mi=0,zs=[],Ds=0,pr=null,la=1,ia="";function Aa(s,r){fl[pl++]=Mi,fl[pl++]=Tu,Tu=s,Mi=r}function ry(s,r,c){zs[Ds++]=la,zs[Ds++]=ia,zs[Ds++]=pr,pr=s;var p=la;s=ia;var v=32-Ie(p)-1;p&=~(1<<v),c+=1;var C=32-Ie(r)+v;if(30<C){var z=v-v%5;C=(p&(1<<z)-1).toString(32),p>>=z,v-=z,la=1<<32-Ie(r)+v|c<<v|p,ia=C+s}else la=1<<C|c<<v|p,ia=s}function cm(s){s.return!==null&&(Aa(s,1),ry(s,1,0))}function um(s){for(;s===Tu;)Tu=fl[--pl],fl[pl]=null,Mi=fl[--pl],fl[pl]=null;for(;s===pr;)pr=zs[--Ds],zs[Ds]=null,ia=zs[--Ds],zs[Ds]=null,la=zs[--Ds],zs[Ds]=null}function oy(s,r){zs[Ds++]=la,zs[Ds++]=ia,zs[Ds++]=pr,la=r.id,ia=r.overflow,pr=s}var In=null,tn=null,Nt=!1,mr=null,Ps=!1,dm=Error(o(519));function gr(s){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oi(Os(r,s)),dm}function ly(s){var r=s.stateNode,c=s.type,p=s.memoizedProps;switch(r[Gt]=s,r[Ln]=p,c){case"dialog":jt("cancel",r),jt("close",r);break;case"iframe":case"object":case"embed":jt("load",r);break;case"video":case"audio":for(c=0;c<tc.length;c++)jt(tc[c],r);break;case"source":jt("error",r);break;case"img":case"image":case"link":jt("error",r),jt("load",r);break;case"details":jt("toggle",r);break;case"input":jt("invalid",r),vv(r,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":jt("invalid",r);break;case"textarea":jt("invalid",r),jv(r,p.value,p.defaultValue,p.children)}c=p.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||p.suppressHydrationWarning===!0||w1(r.textContent,c)?(p.popover!=null&&(jt("beforetoggle",r),jt("toggle",r)),p.onScroll!=null&&jt("scroll",r),p.onScrollEnd!=null&&jt("scrollend",r),p.onClick!=null&&(r.onclick=Ea),r=!0):r=!1,r||gr(s,!0)}function iy(s){for(In=s.return;In;)switch(In.tag){case 5:case 31:case 13:Ps=!1;return;case 27:case 3:Ps=!0;return;default:In=In.return}}function ml(s){if(s!==In)return!1;if(!Nt)return iy(s),Nt=!0,!1;var r=s.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||Rg(s.type,s.memoizedProps)),c=!c),c&&tn&&gr(s),iy(s),r===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));tn=O1(s)}else if(r===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));tn=O1(s)}else r===27?(r=tn,Rr(s.type)?(s=zg,zg=null,tn=s):tn=r):tn=In?Is(s.stateNode.nextSibling):null;return!0}function co(){tn=In=null,Nt=!1}function fm(){var s=mr;return s!==null&&(us===null?us=s:us.push.apply(us,s),mr=null),s}function Oi(s){mr===null?mr=[s]:mr.push(s)}var pm=I(null),uo=null,Ma=null;function hr(s,r,c){J(pm,r._currentValue),r._currentValue=c}function Oa(s){s._currentValue=pm.current,Q(pm)}function mm(s,r,c){for(;s!==null;){var p=s.alternate;if((s.childLanes&r)!==r?(s.childLanes|=r,p!==null&&(p.childLanes|=r)):p!==null&&(p.childLanes&r)!==r&&(p.childLanes|=r),s===c)break;s=s.return}}function gm(s,r,c,p){var v=s.child;for(v!==null&&(v.return=s);v!==null;){var C=v.dependencies;if(C!==null){var z=v.child;C=C.firstContext;e:for(;C!==null;){var q=C;C=v;for(var Z=0;Z<r.length;Z++)if(q.context===r[Z]){C.lanes|=c,q=C.alternate,q!==null&&(q.lanes|=c),mm(C.return,c,s),p||(z=null);break e}C=q.next}}else if(v.tag===18){if(z=v.return,z===null)throw Error(o(341));z.lanes|=c,C=z.alternate,C!==null&&(C.lanes|=c),mm(z,c,s),z=null}else z=v.child;if(z!==null)z.return=v;else for(z=v;z!==null;){if(z===s){z=null;break}if(v=z.sibling,v!==null){v.return=z.return,z=v;break}z=z.return}v=z}}function gl(s,r,c,p){s=null;for(var v=r,C=!1;v!==null;){if(!C){if((v.flags&524288)!==0)C=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var z=v.alternate;if(z===null)throw Error(o(387));if(z=z.memoizedProps,z!==null){var q=v.type;xs(v.pendingProps.value,z.value)||(s!==null?s.push(q):s=[q])}}else if(v===le.current){if(z=v.alternate,z===null)throw Error(o(387));z.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(s!==null?s.push(oc):s=[oc])}v=v.return}s!==null&&gm(r,s,c,p),r.flags|=262144}function Au(s){for(s=s.firstContext;s!==null;){if(!xs(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function fo(s){uo=s,Ma=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Bn(s){return cy(uo,s)}function Mu(s,r){return uo===null&&fo(s),cy(s,r)}function cy(s,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Ma===null){if(s===null)throw Error(o(308));Ma=r,s.dependencies={lanes:0,firstContext:r},s.flags|=524288}else Ma=Ma.next=r;return c}var hT=typeof AbortController<"u"?AbortController:function(){var s=[],r=this.signal={aborted:!1,addEventListener:function(c,p){s.push(p)}};this.abort=function(){r.aborted=!0,s.forEach(function(c){return c()})}},xT=e.unstable_scheduleCallback,bT=e.unstable_NormalPriority,yn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hm(){return{controller:new hT,data:new Map,refCount:0}}function zi(s){s.refCount--,s.refCount===0&&xT(bT,function(){s.controller.abort()})}var Di=null,xm=0,hl=0,xl=null;function _T(s,r){if(Di===null){var c=Di=[];xm=0,hl=vg(),xl={status:"pending",value:void 0,then:function(p){c.push(p)}}}return xm++,r.then(uy,uy),r}function uy(){if(--xm===0&&Di!==null){xl!==null&&(xl.status="fulfilled");var s=Di;Di=null,hl=0,xl=null;for(var r=0;r<s.length;r++)(0,s[r])()}}function vT(s,r){var c=[],p={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return s.then(function(){p.status="fulfilled",p.value=r;for(var v=0;v<c.length;v++)(0,c[v])(r)},function(v){for(p.status="rejected",p.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),p}var dy=U.S;U.S=function(s,r){K0=me(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&_T(s,r),dy!==null&&dy(s,r)};var po=I(null);function bm(){var s=po.current;return s!==null?s:Yt.pooledCache}function Ou(s,r){r===null?J(po,po.current):J(po,r.pool)}function fy(){var s=bm();return s===null?null:{parent:yn._currentValue,pool:s}}var bl=Error(o(460)),_m=Error(o(474)),zu=Error(o(542)),Du={then:function(){}};function py(s){return s=s.status,s==="fulfilled"||s==="rejected"}function my(s,r,c){switch(c=s[c],c===void 0?s.push(r):c!==r&&(r.then(Ea,Ea),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,hy(s),s;default:if(typeof r.status=="string")r.then(Ea,Ea);else{if(s=Yt,s!==null&&100<s.shellSuspendCounter)throw Error(o(482));s=r,s.status="pending",s.then(function(p){if(r.status==="pending"){var v=r;v.status="fulfilled",v.value=p}},function(p){if(r.status==="pending"){var v=r;v.status="rejected",v.reason=p}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,hy(s),s}throw go=r,bl}}function mo(s){try{var r=s._init;return r(s._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(go=c,bl):c}}var go=null;function gy(){if(go===null)throw Error(o(459));var s=go;return go=null,s}function hy(s){if(s===bl||s===zu)throw Error(o(483))}var _l=null,Pi=0;function Pu(s){var r=Pi;return Pi+=1,_l===null&&(_l=[]),my(_l,s,r)}function Li(s,r){r=r.props.ref,s.ref=r!==void 0?r:null}function Lu(s,r){throw r.$$typeof===_?Error(o(525)):(s=Object.prototype.toString.call(r),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":s)))}function xy(s){function r(ae,ee){if(s){var ue=ae.deletions;ue===null?(ae.deletions=[ee],ae.flags|=16):ue.push(ee)}}function c(ae,ee){if(!s)return null;for(;ee!==null;)r(ae,ee),ee=ee.sibling;return null}function p(ae){for(var ee=new Map;ae!==null;)ae.key!==null?ee.set(ae.key,ae):ee.set(ae.index,ae),ae=ae.sibling;return ee}function v(ae,ee){return ae=Ta(ae,ee),ae.index=0,ae.sibling=null,ae}function C(ae,ee,ue){return ae.index=ue,s?(ue=ae.alternate,ue!==null?(ue=ue.index,ue<ee?(ae.flags|=67108866,ee):ue):(ae.flags|=67108866,ee)):(ae.flags|=1048576,ee)}function z(ae){return s&&ae.alternate===null&&(ae.flags|=67108866),ae}function q(ae,ee,ue,ke){return ee===null||ee.tag!==6?(ee=lm(ue,ae.mode,ke),ee.return=ae,ee):(ee=v(ee,ue),ee.return=ae,ee)}function Z(ae,ee,ue,ke){var Je=ue.type;return Je===y?ye(ae,ee,ue.props.children,ke,ue.key):ee!==null&&(ee.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&mo(Je)===ee.type)?(ee=v(ee,ue.props),Li(ee,ue),ee.return=ae,ee):(ee=Ru(ue.type,ue.key,ue.props,null,ae.mode,ke),Li(ee,ue),ee.return=ae,ee)}function de(ae,ee,ue,ke){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ue.containerInfo||ee.stateNode.implementation!==ue.implementation?(ee=im(ue,ae.mode,ke),ee.return=ae,ee):(ee=v(ee,ue.children||[]),ee.return=ae,ee)}function ye(ae,ee,ue,ke,Je){return ee===null||ee.tag!==7?(ee=io(ue,ae.mode,ke,Je),ee.return=ae,ee):(ee=v(ee,ue),ee.return=ae,ee)}function Ne(ae,ee,ue){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=lm(""+ee,ae.mode,ue),ee.return=ae,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case k:return ue=Ru(ee.type,ee.key,ee.props,null,ae.mode,ue),Li(ue,ee),ue.return=ae,ue;case N:return ee=im(ee,ae.mode,ue),ee.return=ae,ee;case M:return ee=mo(ee),Ne(ae,ee,ue)}if(V(ee)||D(ee))return ee=io(ee,ae.mode,ue,null),ee.return=ae,ee;if(typeof ee.then=="function")return Ne(ae,Pu(ee),ue);if(ee.$$typeof===S)return Ne(ae,Mu(ae,ee),ue);Lu(ae,ee)}return null}function pe(ae,ee,ue,ke){var Je=ee!==null?ee.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Je!==null?null:q(ae,ee,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case k:return ue.key===Je?Z(ae,ee,ue,ke):null;case N:return ue.key===Je?de(ae,ee,ue,ke):null;case M:return ue=mo(ue),pe(ae,ee,ue,ke)}if(V(ue)||D(ue))return Je!==null?null:ye(ae,ee,ue,ke,null);if(typeof ue.then=="function")return pe(ae,ee,Pu(ue),ke);if(ue.$$typeof===S)return pe(ae,ee,Mu(ae,ue),ke);Lu(ae,ue)}return null}function he(ae,ee,ue,ke,Je){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return ae=ae.get(ue)||null,q(ee,ae,""+ke,Je);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case k:return ae=ae.get(ke.key===null?ue:ke.key)||null,Z(ee,ae,ke,Je);case N:return ae=ae.get(ke.key===null?ue:ke.key)||null,de(ee,ae,ke,Je);case M:return ke=mo(ke),he(ae,ee,ue,ke,Je)}if(V(ke)||D(ke))return ae=ae.get(ue)||null,ye(ee,ae,ke,Je,null);if(typeof ke.then=="function")return he(ae,ee,ue,Pu(ke),Je);if(ke.$$typeof===S)return he(ae,ee,ue,Mu(ee,ke),Je);Lu(ee,ke)}return null}function Fe(ae,ee,ue,ke){for(var Je=null,Tt=null,Ke=ee,gt=ee=0,wt=null;Ke!==null&><ue.length;gt++){Ke.index>gt?(wt=Ke,Ke=null):wt=Ke.sibling;var At=pe(ae,Ke,ue[gt],ke);if(At===null){Ke===null&&(Ke=wt);break}s&&Ke&&At.alternate===null&&r(ae,Ke),ee=C(At,ee,gt),Tt===null?Je=At:Tt.sibling=At,Tt=At,Ke=wt}if(gt===ue.length)return c(ae,Ke),Nt&&Aa(ae,gt),Je;if(Ke===null){for(;gt<ue.length;gt++)Ke=Ne(ae,ue[gt],ke),Ke!==null&&(ee=C(Ke,ee,gt),Tt===null?Je=Ke:Tt.sibling=Ke,Tt=Ke);return Nt&&Aa(ae,gt),Je}for(Ke=p(Ke);gt<ue.length;gt++)wt=he(Ke,ae,gt,ue[gt],ke),wt!==null&&(s&&wt.alternate!==null&&Ke.delete(wt.key===null?gt:wt.key),ee=C(wt,ee,gt),Tt===null?Je=wt:Tt.sibling=wt,Tt=wt);return s&&Ke.forEach(function(zr){return r(ae,zr)}),Nt&&Aa(ae,gt),Je}function at(ae,ee,ue,ke){if(ue==null)throw Error(o(151));for(var Je=null,Tt=null,Ke=ee,gt=ee=0,wt=null,At=ue.next();Ke!==null&&!At.done;gt++,At=ue.next()){Ke.index>gt?(wt=Ke,Ke=null):wt=Ke.sibling;var zr=pe(ae,Ke,At.value,ke);if(zr===null){Ke===null&&(Ke=wt);break}s&&Ke&&zr.alternate===null&&r(ae,Ke),ee=C(zr,ee,gt),Tt===null?Je=zr:Tt.sibling=zr,Tt=zr,Ke=wt}if(At.done)return c(ae,Ke),Nt&&Aa(ae,gt),Je;if(Ke===null){for(;!At.done;gt++,At=ue.next())At=Ne(ae,At.value,ke),At!==null&&(ee=C(At,ee,gt),Tt===null?Je=At:Tt.sibling=At,Tt=At);return Nt&&Aa(ae,gt),Je}for(Ke=p(Ke);!At.done;gt++,At=ue.next())At=he(Ke,ae,gt,At.value,ke),At!==null&&(s&&At.alternate!==null&&Ke.delete(At.key===null?gt:At.key),ee=C(At,ee,gt),Tt===null?Je=At:Tt.sibling=At,Tt=At);return s&&Ke.forEach(function(A5){return r(ae,A5)}),Nt&&Aa(ae,gt),Je}function qt(ae,ee,ue,ke){if(typeof ue=="object"&&ue!==null&&ue.type===y&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case k:e:{for(var Je=ue.key;ee!==null;){if(ee.key===Je){if(Je=ue.type,Je===y){if(ee.tag===7){c(ae,ee.sibling),ke=v(ee,ue.props.children),ke.return=ae,ae=ke;break e}}else if(ee.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&mo(Je)===ee.type){c(ae,ee.sibling),ke=v(ee,ue.props),Li(ke,ue),ke.return=ae,ae=ke;break e}c(ae,ee);break}else r(ae,ee);ee=ee.sibling}ue.type===y?(ke=io(ue.props.children,ae.mode,ke,ue.key),ke.return=ae,ae=ke):(ke=Ru(ue.type,ue.key,ue.props,null,ae.mode,ke),Li(ke,ue),ke.return=ae,ae=ke)}return z(ae);case N:e:{for(Je=ue.key;ee!==null;){if(ee.key===Je)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){c(ae,ee.sibling),ke=v(ee,ue.children||[]),ke.return=ae,ae=ke;break e}else{c(ae,ee);break}else r(ae,ee);ee=ee.sibling}ke=im(ue,ae.mode,ke),ke.return=ae,ae=ke}return z(ae);case M:return ue=mo(ue),qt(ae,ee,ue,ke)}if(V(ue))return Fe(ae,ee,ue,ke);if(D(ue)){if(Je=D(ue),typeof Je!="function")throw Error(o(150));return ue=Je.call(ue),at(ae,ee,ue,ke)}if(typeof ue.then=="function")return qt(ae,ee,Pu(ue),ke);if(ue.$$typeof===S)return qt(ae,ee,Mu(ae,ue),ke);Lu(ae,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ee!==null&&ee.tag===6?(c(ae,ee.sibling),ke=v(ee,ue),ke.return=ae,ae=ke):(c(ae,ee),ke=lm(ue,ae.mode,ke),ke.return=ae,ae=ke),z(ae)):c(ae,ee)}return function(ae,ee,ue,ke){try{Pi=0;var Je=qt(ae,ee,ue,ke);return _l=null,Je}catch(Ke){if(Ke===bl||Ke===zu)throw Ke;var Tt=bs(29,Ke,null,ae.mode);return Tt.lanes=ke,Tt.return=ae,Tt}finally{}}}var ho=xy(!0),by=xy(!1),xr=!1;function vm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ym(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function br(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function _r(s,r,c){var p=s.updateQueue;if(p===null)return null;if(p=p.shared,(zt&2)!==0){var v=p.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),p.pending=r,r=Eu(s),ty(s,null,c),r}return Nu(s,p,r,c),Eu(s)}function Ii(s,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var p=r.lanes;p&=s.pendingLanes,c|=p,r.lanes=c,Gs(s,c)}}function jm(s,r){var c=s.updateQueue,p=s.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var v=null,C=null;if(c=c.firstBaseUpdate,c!==null){do{var z={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};C===null?v=C=z:C=C.next=z,c=c.next}while(c!==null);C===null?v=C=r:C=C.next=r}else v=C=r;c={baseState:p.baseState,firstBaseUpdate:v,lastBaseUpdate:C,shared:p.shared,callbacks:p.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=r:s.next=r,c.lastBaseUpdate=r}var km=!1;function Bi(){if(km){var s=xl;if(s!==null)throw s}}function $i(s,r,c,p){km=!1;var v=s.updateQueue;xr=!1;var C=v.firstBaseUpdate,z=v.lastBaseUpdate,q=v.shared.pending;if(q!==null){v.shared.pending=null;var Z=q,de=Z.next;Z.next=null,z===null?C=de:z.next=de,z=Z;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,q=ye.lastBaseUpdate,q!==z&&(q===null?ye.firstBaseUpdate=de:q.next=de,ye.lastBaseUpdate=Z))}if(C!==null){var Ne=v.baseState;z=0,ye=de=Z=null,q=C;do{var pe=q.lane&-536870913,he=pe!==q.lane;if(he?(kt&pe)===pe:(p&pe)===pe){pe!==0&&pe===hl&&(km=!0),ye!==null&&(ye=ye.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Fe=s,at=q;pe=r;var qt=c;switch(at.tag){case 1:if(Fe=at.payload,typeof Fe=="function"){Ne=Fe.call(qt,Ne,pe);break e}Ne=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=at.payload,pe=typeof Fe=="function"?Fe.call(qt,Ne,pe):Fe,pe==null)break e;Ne=b({},Ne,pe);break e;case 2:xr=!0}}pe=q.callback,pe!==null&&(s.flags|=64,he&&(s.flags|=8192),he=v.callbacks,he===null?v.callbacks=[pe]:he.push(pe))}else he={lane:pe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ye===null?(de=ye=he,Z=Ne):ye=ye.next=he,z|=pe;if(q=q.next,q===null){if(q=v.shared.pending,q===null)break;he=q,q=he.next,he.next=null,v.lastBaseUpdate=he,v.shared.pending=null}}while(!0);ye===null&&(Z=Ne),v.baseState=Z,v.firstBaseUpdate=de,v.lastBaseUpdate=ye,C===null&&(v.shared.lanes=0),wr|=z,s.lanes=z,s.memoizedState=Ne}}function _y(s,r){if(typeof s!="function")throw Error(o(191,s));s.call(r)}function vy(s,r){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)_y(c[s],r)}var vl=I(null),Iu=I(0);function yy(s,r){s=Ha,J(Iu,s),J(vl,r),Ha=s|r.baseLanes}function wm(){J(Iu,Ha),J(vl,vl.current)}function Sm(){Ha=Iu.current,Q(vl),Q(Iu)}var _s=I(null),Ls=null;function vr(s){var r=s.alternate;J(xn,xn.current&1),J(_s,s),Ls===null&&(r===null||vl.current!==null||r.memoizedState!==null)&&(Ls=s)}function Cm(s){J(xn,xn.current),J(_s,s),Ls===null&&(Ls=s)}function jy(s){s.tag===22?(J(xn,xn.current),J(_s,s),Ls===null&&(Ls=s)):yr()}function yr(){J(xn,xn.current),J(_s,_s.current)}function vs(s){Q(_s),Ls===s&&(Ls=null),Q(xn)}var xn=I(0);function Bu(s){for(var r=s;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Mg(c)||Og(c)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var za=0,ft=null,Ut=null,jn=null,$u=!1,yl=!1,xo=!1,Uu=0,Ui=0,jl=null,yT=0;function dn(){throw Error(o(321))}function Nm(s,r){if(r===null)return!1;for(var c=0;c<r.length&&c<s.length;c++)if(!xs(s[c],r[c]))return!1;return!0}function Em(s,r,c,p,v,C){return za=C,ft=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,U.H=s===null||s.memoizedState===null?r0:qm,xo=!1,C=c(p,v),xo=!1,yl&&(C=wy(r,c,p,v)),ky(s),C}function ky(s){U.H=Vi;var r=Ut!==null&&Ut.next!==null;if(za=0,jn=Ut=ft=null,$u=!1,Ui=0,jl=null,r)throw Error(o(300));s===null||kn||(s=s.dependencies,s!==null&&Au(s)&&(kn=!0))}function wy(s,r,c,p){ft=s;var v=0;do{if(yl&&(jl=null),Ui=0,yl=!1,25<=v)throw Error(o(301));if(v+=1,jn=Ut=null,s.updateQueue!=null){var C=s.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}U.H=o0,C=r(c,p)}while(yl);return C}function jT(){var s=U.H,r=s.useState()[0];return r=typeof r.then=="function"?Hi(r):r,s=s.useState()[0],(Ut!==null?Ut.memoizedState:null)!==s&&(ft.flags|=1024),r}function Rm(){var s=Uu!==0;return Uu=0,s}function Tm(s,r,c){r.updateQueue=s.updateQueue,r.flags&=-2053,s.lanes&=~c}function Am(s){if($u){for(s=s.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}$u=!1}za=0,jn=Ut=ft=null,yl=!1,Ui=Uu=0,jl=null}function Wn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?ft.memoizedState=jn=s:jn=jn.next=s,jn}function bn(){if(Ut===null){var s=ft.alternate;s=s!==null?s.memoizedState:null}else s=Ut.next;var r=jn===null?ft.memoizedState:jn.next;if(r!==null)jn=r,Ut=s;else{if(s===null)throw ft.alternate===null?Error(o(467)):Error(o(310));Ut=s,s={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},jn===null?ft.memoizedState=jn=s:jn=jn.next=s}return jn}function Hu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hi(s){var r=Ui;return Ui+=1,jl===null&&(jl=[]),s=my(jl,s,r),r=ft,(jn===null?r.memoizedState:jn.next)===null&&(r=r.alternate,U.H=r===null||r.memoizedState===null?r0:qm),s}function qu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Hi(s);if(s.$$typeof===S)return Bn(s)}throw Error(o(438,String(s)))}function Mm(s){var r=null,c=ft.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var p=ft.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(r={data:p.data.map(function(v){return v.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Hu(),ft.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(s),p=0;p<s;p++)c[p]=P;return r.index++,c}function Da(s,r){return typeof r=="function"?r(s):r}function Vu(s){var r=bn();return Om(r,Ut,s)}function Om(s,r,c){var p=s.queue;if(p===null)throw Error(o(311));p.lastRenderedReducer=c;var v=s.baseQueue,C=p.pending;if(C!==null){if(v!==null){var z=v.next;v.next=C.next,C.next=z}r.baseQueue=v=C,p.pending=null}if(C=s.baseState,v===null)s.memoizedState=C;else{r=v.next;var q=z=null,Z=null,de=r,ye=!1;do{var Ne=de.lane&-536870913;if(Ne!==de.lane?(kt&Ne)===Ne:(za&Ne)===Ne){var pe=de.revertLane;if(pe===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),Ne===hl&&(ye=!0);else if((za&pe)===pe){de=de.next,pe===hl&&(ye=!0);continue}else Ne={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Z===null?(q=Z=Ne,z=C):Z=Z.next=Ne,ft.lanes|=pe,wr|=pe;Ne=de.action,xo&&c(C,Ne),C=de.hasEagerState?de.eagerState:c(C,Ne)}else pe={lane:Ne,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Z===null?(q=Z=pe,z=C):Z=Z.next=pe,ft.lanes|=Ne,wr|=Ne;de=de.next}while(de!==null&&de!==r);if(Z===null?z=C:Z.next=q,!xs(C,s.memoizedState)&&(kn=!0,ye&&(c=xl,c!==null)))throw c;s.memoizedState=C,s.baseState=z,s.baseQueue=Z,p.lastRenderedState=C}return v===null&&(p.lanes=0),[s.memoizedState,p.dispatch]}function zm(s){var r=bn(),c=r.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=s;var p=c.dispatch,v=c.pending,C=r.memoizedState;if(v!==null){c.pending=null;var z=v=v.next;do C=s(C,z.action),z=z.next;while(z!==v);xs(C,r.memoizedState)||(kn=!0),r.memoizedState=C,r.baseQueue===null&&(r.baseState=C),c.lastRenderedState=C}return[C,p]}function Sy(s,r,c){var p=ft,v=bn(),C=Nt;if(C){if(c===void 0)throw Error(o(407));c=c()}else c=r();var z=!xs((Ut||v).memoizedState,c);if(z&&(v.memoizedState=c,kn=!0),v=v.queue,Lm(Ey.bind(null,p,v,s),[s]),v.getSnapshot!==r||z||jn!==null&&jn.memoizedState.tag&1){if(p.flags|=2048,kl(9,{destroy:void 0},Ny.bind(null,p,v,c,r),null),Yt===null)throw Error(o(349));C||(za&127)!==0||Cy(p,r,c)}return c}function Cy(s,r,c){s.flags|=16384,s={getSnapshot:r,value:c},r=ft.updateQueue,r===null?(r=Hu(),ft.updateQueue=r,r.stores=[s]):(c=r.stores,c===null?r.stores=[s]:c.push(s))}function Ny(s,r,c,p){r.value=c,r.getSnapshot=p,Ry(r)&&Ty(s)}function Ey(s,r,c){return c(function(){Ry(r)&&Ty(s)})}function Ry(s){var r=s.getSnapshot;s=s.value;try{var c=r();return!xs(s,c)}catch{return!0}}function Ty(s){var r=lo(s,2);r!==null&&ds(r,s,2)}function Dm(s){var r=Wn();if(typeof s=="function"){var c=s;if(s=c(),xo){je(!0);try{c()}finally{je(!1)}}}return r.memoizedState=r.baseState=s,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:s},r}function Ay(s,r,c,p){return s.baseState=c,Om(s,Ut,typeof p=="function"?p:Da)}function kT(s,r,c,p,v){if(Yu(s))throw Error(o(485));if(s=r.action,s!==null){var C={payload:v,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){C.listeners.push(z)}};U.T!==null?c(!0):C.isTransition=!1,p(C),c=r.pending,c===null?(C.next=r.pending=C,My(r,C)):(C.next=c.next,r.pending=c.next=C)}}function My(s,r){var c=r.action,p=r.payload,v=s.state;if(r.isTransition){var C=U.T,z={};U.T=z;try{var q=c(v,p),Z=U.S;Z!==null&&Z(z,q),Oy(s,r,q)}catch(de){Pm(s,r,de)}finally{C!==null&&z.types!==null&&(C.types=z.types),U.T=C}}else try{C=c(v,p),Oy(s,r,C)}catch(de){Pm(s,r,de)}}function Oy(s,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(p){zy(s,r,p)},function(p){return Pm(s,r,p)}):zy(s,r,c)}function zy(s,r,c){r.status="fulfilled",r.value=c,Dy(r),s.state=c,r=s.pending,r!==null&&(c=r.next,c===r?s.pending=null:(c=c.next,r.next=c,My(s,c)))}function Pm(s,r,c){var p=s.pending;if(s.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=c,Dy(r),r=r.next;while(r!==p)}s.action=null}function Dy(s){s=s.listeners;for(var r=0;r<s.length;r++)(0,s[r])()}function Py(s,r){return r}function Ly(s,r){if(Nt){var c=Yt.formState;if(c!==null){e:{var p=ft;if(Nt){if(tn){t:{for(var v=tn,C=Ps;v.nodeType!==8;){if(!C){v=null;break t}if(v=Is(v.nextSibling),v===null){v=null;break t}}C=v.data,v=C==="F!"||C==="F"?v:null}if(v){tn=Is(v.nextSibling),p=v.data==="F!";break e}}gr(p)}p=!1}p&&(r=c[0])}}return c=Wn(),c.memoizedState=c.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Py,lastRenderedState:r},c.queue=p,c=n0.bind(null,ft,p),p.dispatch=c,p=Dm(!1),C=Hm.bind(null,ft,!1,p.queue),p=Wn(),v={state:r,dispatch:null,action:s,pending:null},p.queue=v,c=kT.bind(null,ft,v,C,c),v.dispatch=c,p.memoizedState=s,[r,c,!1]}function Iy(s){var r=bn();return By(r,Ut,s)}function By(s,r,c){if(r=Om(s,r,Py)[0],s=Vu(Da)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=Hi(r)}catch(z){throw z===bl?zu:z}else p=r;r=bn();var v=r.queue,C=v.dispatch;return c!==r.memoizedState&&(ft.flags|=2048,kl(9,{destroy:void 0},wT.bind(null,v,c),null)),[p,C,s]}function wT(s,r){s.action=r}function $y(s){var r=bn(),c=Ut;if(c!==null)return By(r,c,s);bn(),r=r.memoizedState,c=bn();var p=c.queue.dispatch;return c.memoizedState=s,[r,p,!1]}function kl(s,r,c,p){return s={tag:s,create:c,deps:p,inst:r,next:null},r=ft.updateQueue,r===null&&(r=Hu(),ft.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=s.next=s:(p=c.next,c.next=s,s.next=p,r.lastEffect=s),s}function Uy(){return bn().memoizedState}function Fu(s,r,c,p){var v=Wn();ft.flags|=s,v.memoizedState=kl(1|r,{destroy:void 0},c,p===void 0?null:p)}function Gu(s,r,c,p){var v=bn();p=p===void 0?null:p;var C=v.memoizedState.inst;Ut!==null&&p!==null&&Nm(p,Ut.memoizedState.deps)?v.memoizedState=kl(r,C,c,p):(ft.flags|=s,v.memoizedState=kl(1|r,C,c,p))}function Hy(s,r){Fu(8390656,8,s,r)}function Lm(s,r){Gu(2048,8,s,r)}function ST(s){ft.flags|=4;var r=ft.updateQueue;if(r===null)r=Hu(),ft.updateQueue=r,r.events=[s];else{var c=r.events;c===null?r.events=[s]:c.push(s)}}function qy(s){var r=bn().memoizedState;return ST({ref:r,nextImpl:s}),function(){if((zt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function Vy(s,r){return Gu(4,2,s,r)}function Fy(s,r){return Gu(4,4,s,r)}function Gy(s,r){if(typeof r=="function"){s=s();var c=r(s);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return s=s(),r.current=s,function(){r.current=null}}function Yy(s,r,c){c=c!=null?c.concat([s]):null,Gu(4,4,Gy.bind(null,r,s),c)}function Im(){}function Ky(s,r){var c=bn();r=r===void 0?null:r;var p=c.memoizedState;return r!==null&&Nm(r,p[1])?p[0]:(c.memoizedState=[s,r],s)}function Xy(s,r){var c=bn();r=r===void 0?null:r;var p=c.memoizedState;if(r!==null&&Nm(r,p[1]))return p[0];if(p=s(),xo){je(!0);try{s()}finally{je(!1)}}return c.memoizedState=[p,r],p}function Bm(s,r,c){return c===void 0||(za&1073741824)!==0&&(kt&261930)===0?s.memoizedState=r:(s.memoizedState=c,s=Q0(),ft.lanes|=s,wr|=s,c)}function Qy(s,r,c,p){return xs(c,r)?c:vl.current!==null?(s=Bm(s,c,p),xs(s,r)||(kn=!0),s):(za&42)===0||(za&1073741824)!==0&&(kt&261930)===0?(kn=!0,s.memoizedState=c):(s=Q0(),ft.lanes|=s,wr|=s,r)}function Wy(s,r,c,p,v){var C=F.p;F.p=C!==0&&8>C?C:8;var z=U.T,q={};U.T=q,Hm(s,!1,r,c);try{var Z=v(),de=U.S;if(de!==null&&de(q,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ye=vT(Z,p);qi(s,r,ye,ks(s))}else qi(s,r,p,ks(s))}catch(Ne){qi(s,r,{then:function(){},status:"rejected",reason:Ne},ks())}finally{F.p=C,z!==null&&q.types!==null&&(z.types=q.types),U.T=z}}function CT(){}function $m(s,r,c,p){if(s.tag!==5)throw Error(o(476));var v=Zy(s).queue;Wy(s,v,r,X,c===null?CT:function(){return Jy(s),c(p)})}function Zy(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:X},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:c},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function Jy(s){var r=Zy(s);r.next===null&&(r=s.alternate.memoizedState),qi(s,r.next.queue,{},ks())}function Um(){return Bn(oc)}function e0(){return bn().memoizedState}function t0(){return bn().memoizedState}function NT(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var c=ks();s=br(c);var p=_r(r,s,c);p!==null&&(ds(p,r,c),Ii(p,r,c)),r={cache:hm()},s.payload=r;return}r=r.return}}function ET(s,r,c){var p=ks();c={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Yu(s)?s0(r,c):(c=rm(s,r,c,p),c!==null&&(ds(c,s,p),a0(c,r,p)))}function n0(s,r,c){var p=ks();qi(s,r,c,p)}function qi(s,r,c,p){var v={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Yu(s))s0(r,v);else{var C=s.alternate;if(s.lanes===0&&(C===null||C.lanes===0)&&(C=r.lastRenderedReducer,C!==null))try{var z=r.lastRenderedState,q=C(z,c);if(v.hasEagerState=!0,v.eagerState=q,xs(q,z))return Nu(s,r,v,0),Yt===null&&Cu(),!1}catch{}finally{}if(c=rm(s,r,v,p),c!==null)return ds(c,s,p),a0(c,r,p),!0}return!1}function Hm(s,r,c,p){if(p={lane:2,revertLane:vg(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Yu(s)){if(r)throw Error(o(479))}else r=rm(s,c,p,2),r!==null&&ds(r,s,2)}function Yu(s){var r=s.alternate;return s===ft||r!==null&&r===ft}function s0(s,r){yl=$u=!0;var c=s.pending;c===null?r.next=r:(r.next=c.next,c.next=r),s.pending=r}function a0(s,r,c){if((c&4194048)!==0){var p=r.lanes;p&=s.pendingLanes,c|=p,r.lanes=c,Gs(s,c)}}var Vi={readContext:Bn,use:qu,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useLayoutEffect:dn,useInsertionEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useSyncExternalStore:dn,useId:dn,useHostTransitionStatus:dn,useFormState:dn,useActionState:dn,useOptimistic:dn,useMemoCache:dn,useCacheRefresh:dn};Vi.useEffectEvent=dn;var r0={readContext:Bn,use:qu,useCallback:function(s,r){return Wn().memoizedState=[s,r===void 0?null:r],s},useContext:Bn,useEffect:Hy,useImperativeHandle:function(s,r,c){c=c!=null?c.concat([s]):null,Fu(4194308,4,Gy.bind(null,r,s),c)},useLayoutEffect:function(s,r){return Fu(4194308,4,s,r)},useInsertionEffect:function(s,r){Fu(4,2,s,r)},useMemo:function(s,r){var c=Wn();r=r===void 0?null:r;var p=s();if(xo){je(!0);try{s()}finally{je(!1)}}return c.memoizedState=[p,r],p},useReducer:function(s,r,c){var p=Wn();if(c!==void 0){var v=c(r);if(xo){je(!0);try{c(r)}finally{je(!1)}}}else v=r;return p.memoizedState=p.baseState=v,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:v},p.queue=s,s=s.dispatch=ET.bind(null,ft,s),[p.memoizedState,s]},useRef:function(s){var r=Wn();return s={current:s},r.memoizedState=s},useState:function(s){s=Dm(s);var r=s.queue,c=n0.bind(null,ft,r);return r.dispatch=c,[s.memoizedState,c]},useDebugValue:Im,useDeferredValue:function(s,r){var c=Wn();return Bm(c,s,r)},useTransition:function(){var s=Dm(!1);return s=Wy.bind(null,ft,s.queue,!0,!1),Wn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,c){var p=ft,v=Wn();if(Nt){if(c===void 0)throw Error(o(407));c=c()}else{if(c=r(),Yt===null)throw Error(o(349));(kt&127)!==0||Cy(p,r,c)}v.memoizedState=c;var C={value:c,getSnapshot:r};return v.queue=C,Hy(Ey.bind(null,p,C,s),[s]),p.flags|=2048,kl(9,{destroy:void 0},Ny.bind(null,p,C,c,r),null),c},useId:function(){var s=Wn(),r=Yt.identifierPrefix;if(Nt){var c=ia,p=la;c=(p&~(1<<32-Ie(p)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Uu++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=yT++,r="_"+r+"r_"+c.toString(32)+"_";return s.memoizedState=r},useHostTransitionStatus:Um,useFormState:Ly,useActionState:Ly,useOptimistic:function(s){var r=Wn();r.memoizedState=r.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=Hm.bind(null,ft,!0,c),c.dispatch=r,[s,r]},useMemoCache:Mm,useCacheRefresh:function(){return Wn().memoizedState=NT.bind(null,ft)},useEffectEvent:function(s){var r=Wn(),c={impl:s};return r.memoizedState=c,function(){if((zt&2)!==0)throw Error(o(440));return c.impl.apply(void 0,arguments)}}},qm={readContext:Bn,use:qu,useCallback:Ky,useContext:Bn,useEffect:Lm,useImperativeHandle:Yy,useInsertionEffect:Vy,useLayoutEffect:Fy,useMemo:Xy,useReducer:Vu,useRef:Uy,useState:function(){return Vu(Da)},useDebugValue:Im,useDeferredValue:function(s,r){var c=bn();return Qy(c,Ut.memoizedState,s,r)},useTransition:function(){var s=Vu(Da)[0],r=bn().memoizedState;return[typeof s=="boolean"?s:Hi(s),r]},useSyncExternalStore:Sy,useId:e0,useHostTransitionStatus:Um,useFormState:Iy,useActionState:Iy,useOptimistic:function(s,r){var c=bn();return Ay(c,Ut,s,r)},useMemoCache:Mm,useCacheRefresh:t0};qm.useEffectEvent=qy;var o0={readContext:Bn,use:qu,useCallback:Ky,useContext:Bn,useEffect:Lm,useImperativeHandle:Yy,useInsertionEffect:Vy,useLayoutEffect:Fy,useMemo:Xy,useReducer:zm,useRef:Uy,useState:function(){return zm(Da)},useDebugValue:Im,useDeferredValue:function(s,r){var c=bn();return Ut===null?Bm(c,s,r):Qy(c,Ut.memoizedState,s,r)},useTransition:function(){var s=zm(Da)[0],r=bn().memoizedState;return[typeof s=="boolean"?s:Hi(s),r]},useSyncExternalStore:Sy,useId:e0,useHostTransitionStatus:Um,useFormState:$y,useActionState:$y,useOptimistic:function(s,r){var c=bn();return Ut!==null?Ay(c,Ut,s,r):(c.baseState=s,[s,c.queue.dispatch])},useMemoCache:Mm,useCacheRefresh:t0};o0.useEffectEvent=qy;function Vm(s,r,c,p){r=s.memoizedState,c=c(p,r),c=c==null?r:b({},r,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Fm={enqueueSetState:function(s,r,c){s=s._reactInternals;var p=ks(),v=br(p);v.payload=r,c!=null&&(v.callback=c),r=_r(s,v,p),r!==null&&(ds(r,s,p),Ii(r,s,p))},enqueueReplaceState:function(s,r,c){s=s._reactInternals;var p=ks(),v=br(p);v.tag=1,v.payload=r,c!=null&&(v.callback=c),r=_r(s,v,p),r!==null&&(ds(r,s,p),Ii(r,s,p))},enqueueForceUpdate:function(s,r){s=s._reactInternals;var c=ks(),p=br(c);p.tag=2,r!=null&&(p.callback=r),r=_r(s,p,c),r!==null&&(ds(r,s,c),Ii(r,s,c))}};function l0(s,r,c,p,v,C,z){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(p,C,z):r.prototype&&r.prototype.isPureReactComponent?!Ti(c,p)||!Ti(v,C):!0}function i0(s,r,c,p){s=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,p),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,p),r.state!==s&&Fm.enqueueReplaceState(r,r.state,null)}function bo(s,r){var c=r;if("ref"in r){c={};for(var p in r)p!=="ref"&&(c[p]=r[p])}if(s=s.defaultProps){c===r&&(c=b({},c));for(var v in s)c[v]===void 0&&(c[v]=s[v])}return c}function c0(s){Su(s)}function u0(s){console.error(s)}function d0(s){Su(s)}function Ku(s,r){try{var c=s.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function f0(s,r,c){try{var p=s.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Gm(s,r,c){return c=br(c),c.tag=3,c.payload={element:null},c.callback=function(){Ku(s,r)},c}function p0(s){return s=br(s),s.tag=3,s}function m0(s,r,c,p){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var C=p.value;s.payload=function(){return v(C)},s.callback=function(){f0(r,c,p)}}var z=c.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(s.callback=function(){f0(r,c,p),typeof v!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var q=p.stack;this.componentDidCatch(p.value,{componentStack:q!==null?q:""})})}function RT(s,r,c,p,v){if(c.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=c.alternate,r!==null&&gl(r,c,v,!0),c=_s.current,c!==null){switch(c.tag){case 31:case 13:return Ls===null?od():c.alternate===null&&fn===0&&(fn=3),c.flags&=-257,c.flags|=65536,c.lanes=v,p===Du?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([p]):r.add(p),xg(s,p,v)),!1;case 22:return c.flags|=65536,p===Du?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([p]):c.add(p)),xg(s,p,v)),!1}throw Error(o(435,c.tag))}return xg(s,p,v),od(),!1}if(Nt)return r=_s.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,p!==dm&&(s=Error(o(422),{cause:p}),Oi(Os(s,c)))):(p!==dm&&(r=Error(o(423),{cause:p}),Oi(Os(r,c))),s=s.current.alternate,s.flags|=65536,v&=-v,s.lanes|=v,p=Os(p,c),v=Gm(s.stateNode,p,v),jm(s,v),fn!==4&&(fn=2)),!1;var C=Error(o(520),{cause:p});if(C=Os(C,c),Zi===null?Zi=[C]:Zi.push(C),fn!==4&&(fn=2),r===null)return!0;p=Os(p,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,s=v&-v,c.lanes|=s,s=Gm(c.stateNode,p,s),jm(c,s),!1;case 1:if(r=c.type,C=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Sr===null||!Sr.has(C))))return c.flags|=65536,v&=-v,c.lanes|=v,v=p0(v),m0(v,s,c,p),jm(c,v),!1}c=c.return}while(c!==null);return!1}var Ym=Error(o(461)),kn=!1;function $n(s,r,c,p){r.child=s===null?by(r,null,c,p):ho(r,s.child,c,p)}function g0(s,r,c,p,v){c=c.render;var C=r.ref;if("ref"in p){var z={};for(var q in p)q!=="ref"&&(z[q]=p[q])}else z=p;return fo(r),p=Em(s,r,c,z,C,v),q=Rm(),s!==null&&!kn?(Tm(s,r,v),Pa(s,r,v)):(Nt&&q&&cm(r),r.flags|=1,$n(s,r,p,v),r.child)}function h0(s,r,c,p,v){if(s===null){var C=c.type;return typeof C=="function"&&!om(C)&&C.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=C,x0(s,r,C,p,v)):(s=Ru(c.type,null,p,r,r.mode,v),s.ref=r.ref,s.return=r,r.child=s)}if(C=s.child,!tg(s,v)){var z=C.memoizedProps;if(c=c.compare,c=c!==null?c:Ti,c(z,p)&&s.ref===r.ref)return Pa(s,r,v)}return r.flags|=1,s=Ta(C,p),s.ref=r.ref,s.return=r,r.child=s}function x0(s,r,c,p,v){if(s!==null){var C=s.memoizedProps;if(Ti(C,p)&&s.ref===r.ref)if(kn=!1,r.pendingProps=p=C,tg(s,v))(s.flags&131072)!==0&&(kn=!0);else return r.lanes=s.lanes,Pa(s,r,v)}return Km(s,r,c,p,v)}function b0(s,r,c,p){var v=p.children,C=s!==null?s.memoizedState:null;if(s===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((r.flags&128)!==0){if(C=C!==null?C.baseLanes|c:c,s!==null){for(p=r.child=s.child,v=0;p!==null;)v=v|p.lanes|p.childLanes,p=p.sibling;p=v&~C}else p=0,r.child=null;return _0(s,r,C,c,p)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},s!==null&&Ou(r,C!==null?C.cachePool:null),C!==null?yy(r,C):wm(),jy(r);else return p=r.lanes=536870912,_0(s,r,C!==null?C.baseLanes|c:c,c,p)}else C!==null?(Ou(r,C.cachePool),yy(r,C),yr(),r.memoizedState=null):(s!==null&&Ou(r,null),wm(),yr());return $n(s,r,v,c),r.child}function Fi(s,r){return s!==null&&s.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function _0(s,r,c,p,v){var C=bm();return C=C===null?null:{parent:yn._currentValue,pool:C},r.memoizedState={baseLanes:c,cachePool:C},s!==null&&Ou(r,null),wm(),jy(r),s!==null&&gl(s,r,p,!0),r.childLanes=v,null}function Xu(s,r){return r=Wu({mode:r.mode,children:r.children},s.mode),r.ref=s.ref,s.child=r,r.return=s,r}function v0(s,r,c){return ho(r,s.child,null,c),s=Xu(r,r.pendingProps),s.flags|=2,vs(r),r.memoizedState=null,s}function TT(s,r,c){var p=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,s===null){if(Nt){if(p.mode==="hidden")return s=Xu(r,p),r.lanes=536870912,Fi(null,s);if(Cm(r),(s=tn)?(s=M1(s,Ps),s=s!==null&&s.data==="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:pr!==null?{id:la,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},c=sy(s),c.return=r,r.child=c,In=r,tn=null)):s=null,s===null)throw gr(r);return r.lanes=536870912,null}return Xu(r,p)}var C=s.memoizedState;if(C!==null){var z=C.dehydrated;if(Cm(r),v)if(r.flags&256)r.flags&=-257,r=v0(s,r,c);else if(r.memoizedState!==null)r.child=s.child,r.flags|=128,r=null;else throw Error(o(558));else if(kn||gl(s,r,c,!1),v=(c&s.childLanes)!==0,kn||v){if(p=Yt,p!==null&&(z=Ca(p,c),z!==0&&z!==C.retryLane))throw C.retryLane=z,lo(s,z),ds(p,s,z),Ym;od(),r=v0(s,r,c)}else s=C.treeContext,tn=Is(z.nextSibling),In=r,Nt=!0,mr=null,Ps=!1,s!==null&&oy(r,s),r=Xu(r,p),r.flags|=4096;return r}return s=Ta(s.child,{mode:p.mode,children:p.children}),s.ref=r.ref,r.child=s,s.return=r,s}function Qu(s,r){var c=r.ref;if(c===null)s!==null&&s.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(o(284));(s===null||s.ref!==c)&&(r.flags|=4194816)}}function Km(s,r,c,p,v){return fo(r),c=Em(s,r,c,p,void 0,v),p=Rm(),s!==null&&!kn?(Tm(s,r,v),Pa(s,r,v)):(Nt&&p&&cm(r),r.flags|=1,$n(s,r,c,v),r.child)}function y0(s,r,c,p,v,C){return fo(r),r.updateQueue=null,c=wy(r,p,c,v),ky(s),p=Rm(),s!==null&&!kn?(Tm(s,r,C),Pa(s,r,C)):(Nt&&p&&cm(r),r.flags|=1,$n(s,r,c,C),r.child)}function j0(s,r,c,p,v){if(fo(r),r.stateNode===null){var C=dl,z=c.contextType;typeof z=="object"&&z!==null&&(C=Bn(z)),C=new c(p,C),r.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Fm,r.stateNode=C,C._reactInternals=r,C=r.stateNode,C.props=p,C.state=r.memoizedState,C.refs={},vm(r),z=c.contextType,C.context=typeof z=="object"&&z!==null?Bn(z):dl,C.state=r.memoizedState,z=c.getDerivedStateFromProps,typeof z=="function"&&(Vm(r,c,z,p),C.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(z=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),z!==C.state&&Fm.enqueueReplaceState(C,C.state,null),$i(r,p,C,v),Bi(),C.state=r.memoizedState),typeof C.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(s===null){C=r.stateNode;var q=r.memoizedProps,Z=bo(c,q);C.props=Z;var de=C.context,ye=c.contextType;z=dl,typeof ye=="object"&&ye!==null&&(z=Bn(ye));var Ne=c.getDerivedStateFromProps;ye=typeof Ne=="function"||typeof C.getSnapshotBeforeUpdate=="function",q=r.pendingProps!==q,ye||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(q||de!==z)&&i0(r,C,p,z),xr=!1;var pe=r.memoizedState;C.state=pe,$i(r,p,C,v),Bi(),de=r.memoizedState,q||pe!==de||xr?(typeof Ne=="function"&&(Vm(r,c,Ne,p),de=r.memoizedState),(Z=xr||l0(r,c,Z,p,pe,de,z))?(ye||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(r.flags|=4194308)):(typeof C.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=p,r.memoizedState=de),C.props=p,C.state=de,C.context=z,p=Z):(typeof C.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{C=r.stateNode,ym(s,r),z=r.memoizedProps,ye=bo(c,z),C.props=ye,Ne=r.pendingProps,pe=C.context,de=c.contextType,Z=dl,typeof de=="object"&&de!==null&&(Z=Bn(de)),q=c.getDerivedStateFromProps,(de=typeof q=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(z!==Ne||pe!==Z)&&i0(r,C,p,Z),xr=!1,pe=r.memoizedState,C.state=pe,$i(r,p,C,v),Bi();var he=r.memoizedState;z!==Ne||pe!==he||xr||s!==null&&s.dependencies!==null&&Au(s.dependencies)?(typeof q=="function"&&(Vm(r,c,q,p),he=r.memoizedState),(ye=xr||l0(r,c,ye,p,pe,he,Z)||s!==null&&s.dependencies!==null&&Au(s.dependencies))?(de||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(p,he,Z),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(p,he,Z)),typeof C.componentDidUpdate=="function"&&(r.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof C.componentDidUpdate!="function"||z===s.memoizedProps&&pe===s.memoizedState||(r.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&pe===s.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=he),C.props=p,C.state=he,C.context=Z,p=ye):(typeof C.componentDidUpdate!="function"||z===s.memoizedProps&&pe===s.memoizedState||(r.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&pe===s.memoizedState||(r.flags|=1024),p=!1)}return C=p,Qu(s,r),p=(r.flags&128)!==0,C||p?(C=r.stateNode,c=p&&typeof c.getDerivedStateFromError!="function"?null:C.render(),r.flags|=1,s!==null&&p?(r.child=ho(r,s.child,null,v),r.child=ho(r,null,c,v)):$n(s,r,c,v),r.memoizedState=C.state,s=r.child):s=Pa(s,r,v),s}function k0(s,r,c,p){return co(),r.flags|=256,$n(s,r,c,p),r.child}var Xm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qm(s){return{baseLanes:s,cachePool:fy()}}function Wm(s,r,c){return s=s!==null?s.childLanes&~c:0,r&&(s|=js),s}function w0(s,r,c){var p=r.pendingProps,v=!1,C=(r.flags&128)!==0,z;if((z=C)||(z=s!==null&&s.memoizedState===null?!1:(xn.current&2)!==0),z&&(v=!0,r.flags&=-129),z=(r.flags&32)!==0,r.flags&=-33,s===null){if(Nt){if(v?vr(r):yr(),(s=tn)?(s=M1(s,Ps),s=s!==null&&s.data!=="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:pr!==null?{id:la,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},c=sy(s),c.return=r,r.child=c,In=r,tn=null)):s=null,s===null)throw gr(r);return Og(s)?r.lanes=32:r.lanes=536870912,null}var q=p.children;return p=p.fallback,v?(yr(),v=r.mode,q=Wu({mode:"hidden",children:q},v),p=io(p,v,c,null),q.return=r,p.return=r,q.sibling=p,r.child=q,p=r.child,p.memoizedState=Qm(c),p.childLanes=Wm(s,z,c),r.memoizedState=Xm,Fi(null,p)):(vr(r),Zm(r,q))}var Z=s.memoizedState;if(Z!==null&&(q=Z.dehydrated,q!==null)){if(C)r.flags&256?(vr(r),r.flags&=-257,r=Jm(s,r,c)):r.memoizedState!==null?(yr(),r.child=s.child,r.flags|=128,r=null):(yr(),q=p.fallback,v=r.mode,p=Wu({mode:"visible",children:p.children},v),q=io(q,v,c,null),q.flags|=2,p.return=r,q.return=r,p.sibling=q,r.child=p,ho(r,s.child,null,c),p=r.child,p.memoizedState=Qm(c),p.childLanes=Wm(s,z,c),r.memoizedState=Xm,r=Fi(null,p));else if(vr(r),Og(q)){if(z=q.nextSibling&&q.nextSibling.dataset,z)var de=z.dgst;z=de,p=Error(o(419)),p.stack="",p.digest=z,Oi({value:p,source:null,stack:null}),r=Jm(s,r,c)}else if(kn||gl(s,r,c,!1),z=(c&s.childLanes)!==0,kn||z){if(z=Yt,z!==null&&(p=Ca(z,c),p!==0&&p!==Z.retryLane))throw Z.retryLane=p,lo(s,p),ds(z,s,p),Ym;Mg(q)||od(),r=Jm(s,r,c)}else Mg(q)?(r.flags|=192,r.child=s.child,r=null):(s=Z.treeContext,tn=Is(q.nextSibling),In=r,Nt=!0,mr=null,Ps=!1,s!==null&&oy(r,s),r=Zm(r,p.children),r.flags|=4096);return r}return v?(yr(),q=p.fallback,v=r.mode,Z=s.child,de=Z.sibling,p=Ta(Z,{mode:"hidden",children:p.children}),p.subtreeFlags=Z.subtreeFlags&65011712,de!==null?q=Ta(de,q):(q=io(q,v,c,null),q.flags|=2),q.return=r,p.return=r,p.sibling=q,r.child=p,Fi(null,p),p=r.child,q=s.child.memoizedState,q===null?q=Qm(c):(v=q.cachePool,v!==null?(Z=yn._currentValue,v=v.parent!==Z?{parent:Z,pool:Z}:v):v=fy(),q={baseLanes:q.baseLanes|c,cachePool:v}),p.memoizedState=q,p.childLanes=Wm(s,z,c),r.memoizedState=Xm,Fi(s.child,p)):(vr(r),c=s.child,s=c.sibling,c=Ta(c,{mode:"visible",children:p.children}),c.return=r,c.sibling=null,s!==null&&(z=r.deletions,z===null?(r.deletions=[s],r.flags|=16):z.push(s)),r.child=c,r.memoizedState=null,c)}function Zm(s,r){return r=Wu({mode:"visible",children:r},s.mode),r.return=s,s.child=r}function Wu(s,r){return s=bs(22,s,null,r),s.lanes=0,s}function Jm(s,r,c){return ho(r,s.child,null,c),s=Zm(r,r.pendingProps.children),s.flags|=2,r.memoizedState=null,s}function S0(s,r,c){s.lanes|=r;var p=s.alternate;p!==null&&(p.lanes|=r),mm(s.return,r,c)}function eg(s,r,c,p,v,C){var z=s.memoizedState;z===null?s.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:v,treeForkCount:C}:(z.isBackwards=r,z.rendering=null,z.renderingStartTime=0,z.last=p,z.tail=c,z.tailMode=v,z.treeForkCount=C)}function C0(s,r,c){var p=r.pendingProps,v=p.revealOrder,C=p.tail;p=p.children;var z=xn.current,q=(z&2)!==0;if(q?(z=z&1|2,r.flags|=128):z&=1,J(xn,z),$n(s,r,p,c),p=Nt?Mi:0,!q&&s!==null&&(s.flags&128)!==0)e:for(s=r.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&S0(s,c,r);else if(s.tag===19)S0(s,c,r);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(v){case"forwards":for(c=r.child,v=null;c!==null;)s=c.alternate,s!==null&&Bu(s)===null&&(v=c),c=c.sibling;c=v,c===null?(v=r.child,r.child=null):(v=c.sibling,c.sibling=null),eg(r,!1,v,c,C,p);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=r.child,r.child=null;v!==null;){if(s=v.alternate,s!==null&&Bu(s)===null){r.child=v;break}s=v.sibling,v.sibling=c,c=v,v=s}eg(r,!0,c,null,C,p);break;case"together":eg(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function Pa(s,r,c){if(s!==null&&(r.dependencies=s.dependencies),wr|=r.lanes,(c&r.childLanes)===0)if(s!==null){if(gl(s,r,c,!1),(c&r.childLanes)===0)return null}else return null;if(s!==null&&r.child!==s.child)throw Error(o(153));if(r.child!==null){for(s=r.child,c=Ta(s,s.pendingProps),r.child=c,c.return=r;s.sibling!==null;)s=s.sibling,c=c.sibling=Ta(s,s.pendingProps),c.return=r;c.sibling=null}return r.child}function tg(s,r){return(s.lanes&r)!==0?!0:(s=s.dependencies,!!(s!==null&&Au(s)))}function AT(s,r,c){switch(r.tag){case 3:W(r,r.stateNode.containerInfo),hr(r,yn,s.memoizedState.cache),co();break;case 27:case 5:ve(r);break;case 4:W(r,r.stateNode.containerInfo);break;case 10:hr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Cm(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(vr(r),r.flags|=128,null):(c&r.child.childLanes)!==0?w0(s,r,c):(vr(r),s=Pa(s,r,c),s!==null?s.sibling:null);vr(r);break;case 19:var v=(s.flags&128)!==0;if(p=(c&r.childLanes)!==0,p||(gl(s,r,c,!1),p=(c&r.childLanes)!==0),v){if(p)return C0(s,r,c);r.flags|=128}if(v=r.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),J(xn,xn.current),p)break;return null;case 22:return r.lanes=0,b0(s,r,c,r.pendingProps);case 24:hr(r,yn,s.memoizedState.cache)}return Pa(s,r,c)}function N0(s,r,c){if(s!==null)if(s.memoizedProps!==r.pendingProps)kn=!0;else{if(!tg(s,c)&&(r.flags&128)===0)return kn=!1,AT(s,r,c);kn=(s.flags&131072)!==0}else kn=!1,Nt&&(r.flags&1048576)!==0&&ry(r,Mi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(s=mo(r.elementType),r.type=s,typeof s=="function")om(s)?(p=bo(s,p),r.tag=1,r=j0(null,r,s,p,c)):(r.tag=0,r=Km(null,r,s,p,c));else{if(s!=null){var v=s.$$typeof;if(v===R){r.tag=11,r=g0(null,r,s,p,c);break e}else if(v===O){r.tag=14,r=h0(null,r,s,p,c);break e}}throw r=H(s)||s,Error(o(306,r,""))}}return r;case 0:return Km(s,r,r.type,r.pendingProps,c);case 1:return p=r.type,v=bo(p,r.pendingProps),j0(s,r,p,v,c);case 3:e:{if(W(r,r.stateNode.containerInfo),s===null)throw Error(o(387));p=r.pendingProps;var C=r.memoizedState;v=C.element,ym(s,r),$i(r,p,null,c);var z=r.memoizedState;if(p=z.cache,hr(r,yn,p),p!==C.cache&&gm(r,[yn],c,!0),Bi(),p=z.element,C.isDehydrated)if(C={element:p,isDehydrated:!1,cache:z.cache},r.updateQueue.baseState=C,r.memoizedState=C,r.flags&256){r=k0(s,r,p,c);break e}else if(p!==v){v=Os(Error(o(424)),r),Oi(v),r=k0(s,r,p,c);break e}else{switch(s=r.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(tn=Is(s.firstChild),In=r,Nt=!0,mr=null,Ps=!0,c=by(r,null,p,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(co(),p===v){r=Pa(s,r,c);break e}$n(s,r,p,c)}r=r.child}return r;case 26:return Qu(s,r),s===null?(c=I1(r.type,null,r.pendingProps,null))?r.memoizedState=c:Nt||(c=r.type,s=r.pendingProps,p=pd(te.current).createElement(c),p[Gt]=r,p[Ln]=s,Un(p,c,s),Tn(p),r.stateNode=p):r.memoizedState=I1(r.type,s.memoizedProps,r.pendingProps,s.memoizedState),null;case 27:return ve(r),s===null&&Nt&&(p=r.stateNode=D1(r.type,r.pendingProps,te.current),In=r,Ps=!0,v=tn,Rr(r.type)?(zg=v,tn=Is(p.firstChild)):tn=v),$n(s,r,r.pendingProps.children,c),Qu(s,r),s===null&&(r.flags|=4194304),r.child;case 5:return s===null&&Nt&&((v=p=tn)&&(p=l5(p,r.type,r.pendingProps,Ps),p!==null?(r.stateNode=p,In=r,tn=Is(p.firstChild),Ps=!1,v=!0):v=!1),v||gr(r)),ve(r),v=r.type,C=r.pendingProps,z=s!==null?s.memoizedProps:null,p=C.children,Rg(v,C)?p=null:z!==null&&Rg(v,z)&&(r.flags|=32),r.memoizedState!==null&&(v=Em(s,r,jT,null,null,c),oc._currentValue=v),Qu(s,r),$n(s,r,p,c),r.child;case 6:return s===null&&Nt&&((s=c=tn)&&(c=i5(c,r.pendingProps,Ps),c!==null?(r.stateNode=c,In=r,tn=null,s=!0):s=!1),s||gr(r)),null;case 13:return w0(s,r,c);case 4:return W(r,r.stateNode.containerInfo),p=r.pendingProps,s===null?r.child=ho(r,null,p,c):$n(s,r,p,c),r.child;case 11:return g0(s,r,r.type,r.pendingProps,c);case 7:return $n(s,r,r.pendingProps,c),r.child;case 8:return $n(s,r,r.pendingProps.children,c),r.child;case 12:return $n(s,r,r.pendingProps.children,c),r.child;case 10:return p=r.pendingProps,hr(r,r.type,p.value),$n(s,r,p.children,c),r.child;case 9:return v=r.type._context,p=r.pendingProps.children,fo(r),v=Bn(v),p=p(v),r.flags|=1,$n(s,r,p,c),r.child;case 14:return h0(s,r,r.type,r.pendingProps,c);case 15:return x0(s,r,r.type,r.pendingProps,c);case 19:return C0(s,r,c);case 31:return TT(s,r,c);case 22:return b0(s,r,c,r.pendingProps);case 24:return fo(r),p=Bn(yn),s===null?(v=bm(),v===null&&(v=Yt,C=hm(),v.pooledCache=C,C.refCount++,C!==null&&(v.pooledCacheLanes|=c),v=C),r.memoizedState={parent:p,cache:v},vm(r),hr(r,yn,v)):((s.lanes&c)!==0&&(ym(s,r),$i(r,null,null,c),Bi()),v=s.memoizedState,C=r.memoizedState,v.parent!==p?(v={parent:p,cache:p},r.memoizedState=v,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=v),hr(r,yn,p)):(p=C.cache,hr(r,yn,p),p!==v.cache&&gm(r,[yn],c,!0))),$n(s,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function La(s){s.flags|=4}function ng(s,r,c,p,v){if((r=(s.mode&32)!==0)&&(r=!1),r){if(s.flags|=16777216,(v&335544128)===v)if(s.stateNode.complete)s.flags|=8192;else if(e1())s.flags|=8192;else throw go=Du,_m}else s.flags&=-16777217}function E0(s,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!q1(r))if(e1())s.flags|=8192;else throw go=Du,_m}function Zu(s,r){r!==null&&(s.flags|=4),s.flags&16384&&(r=s.tag!==22?hs():536870912,s.lanes|=r,Nl|=r)}function Gi(s,r){if(!Nt)switch(s.tailMode){case"hidden":r=s.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?r||s.tail===null?s.tail=null:s.tail.sibling=null:p.sibling=null}}function nn(s){var r=s.alternate!==null&&s.alternate.child===s.child,c=0,p=0;if(r)for(var v=s.child;v!==null;)c|=v.lanes|v.childLanes,p|=v.subtreeFlags&65011712,p|=v.flags&65011712,v.return=s,v=v.sibling;else for(v=s.child;v!==null;)c|=v.lanes|v.childLanes,p|=v.subtreeFlags,p|=v.flags,v.return=s,v=v.sibling;return s.subtreeFlags|=p,s.childLanes=c,r}function MT(s,r,c){var p=r.pendingProps;switch(um(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(r),null;case 1:return nn(r),null;case 3:return c=r.stateNode,p=null,s!==null&&(p=s.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Oa(yn),ne(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(ml(r)?La(r):s===null||s.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,fm())),nn(r),null;case 26:var v=r.type,C=r.memoizedState;return s===null?(La(r),C!==null?(nn(r),E0(r,C)):(nn(r),ng(r,v,null,p,c))):C?C!==s.memoizedState?(La(r),nn(r),E0(r,C)):(nn(r),r.flags&=-16777217):(s=s.memoizedProps,s!==p&&La(r),nn(r),ng(r,v,s,p,c)),null;case 27:if(oe(r),c=te.current,v=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==p&&La(r);else{if(!p){if(r.stateNode===null)throw Error(o(166));return nn(r),null}s=K.current,ml(r)?ly(r):(s=D1(v,p,c),r.stateNode=s,La(r))}return nn(r),null;case 5:if(oe(r),v=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==p&&La(r);else{if(!p){if(r.stateNode===null)throw Error(o(166));return nn(r),null}if(C=K.current,ml(r))ly(r);else{var z=pd(te.current);switch(C){case 1:C=z.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:C=z.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":C=z.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":C=z.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":C=z.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof p.is=="string"?z.createElement("select",{is:p.is}):z.createElement("select"),p.multiple?C.multiple=!0:p.size&&(C.size=p.size);break;default:C=typeof p.is=="string"?z.createElement(v,{is:p.is}):z.createElement(v)}}C[Gt]=r,C[Ln]=p;e:for(z=r.child;z!==null;){if(z.tag===5||z.tag===6)C.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===r)break e;for(;z.sibling===null;){if(z.return===null||z.return===r)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}r.stateNode=C;e:switch(Un(C,v,p),v){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&La(r)}}return nn(r),ng(r,r.type,s===null?null:s.memoizedProps,r.pendingProps,c),null;case 6:if(s&&r.stateNode!=null)s.memoizedProps!==p&&La(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(o(166));if(s=te.current,ml(r)){if(s=r.stateNode,c=r.memoizedProps,p=null,v=In,v!==null)switch(v.tag){case 27:case 5:p=v.memoizedProps}s[Gt]=r,s=!!(s.nodeValue===c||p!==null&&p.suppressHydrationWarning===!0||w1(s.nodeValue,c)),s||gr(r,!0)}else s=pd(s).createTextNode(p),s[Gt]=r,r.stateNode=s}return nn(r),null;case 31:if(c=r.memoizedState,s===null||s.memoizedState!==null){if(p=ml(r),c!==null){if(s===null){if(!p)throw Error(o(318));if(s=r.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(557));s[Gt]=r}else co(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),s=!1}else c=fm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=c),s=!0;if(!s)return r.flags&256?(vs(r),r):(vs(r),null);if((r.flags&128)!==0)throw Error(o(558))}return nn(r),null;case 13:if(p=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(v=ml(r),p!==null&&p.dehydrated!==null){if(s===null){if(!v)throw Error(o(318));if(v=r.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(o(317));v[Gt]=r}else co(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),v=!1}else v=fm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),v=!0;if(!v)return r.flags&256?(vs(r),r):(vs(r),null)}return vs(r),(r.flags&128)!==0?(r.lanes=c,r):(c=p!==null,s=s!==null&&s.memoizedState!==null,c&&(p=r.child,v=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(v=p.alternate.memoizedState.cachePool.pool),C=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(C=p.memoizedState.cachePool.pool),C!==v&&(p.flags|=2048)),c!==s&&c&&(r.child.flags|=8192),Zu(r,r.updateQueue),nn(r),null);case 4:return ne(),s===null&&wg(r.stateNode.containerInfo),nn(r),null;case 10:return Oa(r.type),nn(r),null;case 19:if(Q(xn),p=r.memoizedState,p===null)return nn(r),null;if(v=(r.flags&128)!==0,C=p.rendering,C===null)if(v)Gi(p,!1);else{if(fn!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(C=Bu(s),C!==null){for(r.flags|=128,Gi(p,!1),s=C.updateQueue,r.updateQueue=s,Zu(r,s),r.subtreeFlags=0,s=c,c=r.child;c!==null;)ny(c,s),c=c.sibling;return J(xn,xn.current&1|2),Nt&&Aa(r,p.treeForkCount),r.child}s=s.sibling}p.tail!==null&&me()>sd&&(r.flags|=128,v=!0,Gi(p,!1),r.lanes=4194304)}else{if(!v)if(s=Bu(C),s!==null){if(r.flags|=128,v=!0,s=s.updateQueue,r.updateQueue=s,Zu(r,s),Gi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!C.alternate&&!Nt)return nn(r),null}else 2*me()-p.renderingStartTime>sd&&c!==536870912&&(r.flags|=128,v=!0,Gi(p,!1),r.lanes=4194304);p.isBackwards?(C.sibling=r.child,r.child=C):(s=p.last,s!==null?s.sibling=C:r.child=C,p.last=C)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=me(),s.sibling=null,c=xn.current,J(xn,v?c&1|2:c&1),Nt&&Aa(r,p.treeForkCount),s):(nn(r),null);case 22:case 23:return vs(r),Sm(),p=r.memoizedState!==null,s!==null?s.memoizedState!==null!==p&&(r.flags|=8192):p&&(r.flags|=8192),p?(c&536870912)!==0&&(r.flags&128)===0&&(nn(r),r.subtreeFlags&6&&(r.flags|=8192)):nn(r),c=r.updateQueue,c!==null&&Zu(r,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),p=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),p!==c&&(r.flags|=2048),s!==null&&Q(po),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Oa(yn),nn(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function OT(s,r){switch(um(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return Oa(yn),ne(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return oe(r),null;case 31:if(r.memoizedState!==null){if(vs(r),r.alternate===null)throw Error(o(340));co()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 13:if(vs(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(o(340));co()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return Q(xn),null;case 4:return ne(),null;case 10:return Oa(r.type),null;case 22:case 23:return vs(r),Sm(),s!==null&&Q(po),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return Oa(yn),null;case 25:return null;default:return null}}function R0(s,r){switch(um(r),r.tag){case 3:Oa(yn),ne();break;case 26:case 27:case 5:oe(r);break;case 4:ne();break;case 31:r.memoizedState!==null&&vs(r);break;case 13:vs(r);break;case 19:Q(xn);break;case 10:Oa(r.type);break;case 22:case 23:vs(r),Sm(),s!==null&&Q(po);break;case 24:Oa(yn)}}function Yi(s,r){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&s)===s){p=void 0;var C=c.create,z=c.inst;p=C(),z.destroy=p}c=c.next}while(c!==v)}}catch(q){It(r,r.return,q)}}function jr(s,r,c){try{var p=r.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var C=v.next;p=C;do{if((p.tag&s)===s){var z=p.inst,q=z.destroy;if(q!==void 0){z.destroy=void 0,v=r;var Z=c,de=q;try{de()}catch(ye){It(v,Z,ye)}}}p=p.next}while(p!==C)}}catch(ye){It(r,r.return,ye)}}function T0(s){var r=s.updateQueue;if(r!==null){var c=s.stateNode;try{vy(r,c)}catch(p){It(s,s.return,p)}}}function A0(s,r,c){c.props=bo(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(p){It(s,r,p)}}function Ki(s,r){try{var c=s.ref;if(c!==null){switch(s.tag){case 26:case 27:case 5:var p=s.stateNode;break;case 30:p=s.stateNode;break;default:p=s.stateNode}typeof c=="function"?s.refCleanup=c(p):c.current=p}}catch(v){It(s,r,v)}}function ca(s,r){var c=s.ref,p=s.refCleanup;if(c!==null)if(typeof p=="function")try{p()}catch(v){It(s,r,v)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){It(s,r,v)}else c.current=null}function M0(s){var r=s.type,c=s.memoizedProps,p=s.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&p.focus();break e;case"img":c.src?p.src=c.src:c.srcSet&&(p.srcset=c.srcSet)}}catch(v){It(s,s.return,v)}}function sg(s,r,c){try{var p=s.stateNode;t5(p,s.type,c,r),p[Ln]=r}catch(v){It(s,s.return,v)}}function O0(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Rr(s.type)||s.tag===4}function ag(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||O0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Rr(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function rg(s,r,c){var p=s.tag;if(p===5||p===6)s=s.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(s,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(s),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=Ea));else if(p!==4&&(p===27&&Rr(s.type)&&(c=s.stateNode,r=null),s=s.child,s!==null))for(rg(s,r,c),s=s.sibling;s!==null;)rg(s,r,c),s=s.sibling}function Ju(s,r,c){var p=s.tag;if(p===5||p===6)s=s.stateNode,r?c.insertBefore(s,r):c.appendChild(s);else if(p!==4&&(p===27&&Rr(s.type)&&(c=s.stateNode),s=s.child,s!==null))for(Ju(s,r,c),s=s.sibling;s!==null;)Ju(s,r,c),s=s.sibling}function z0(s){var r=s.stateNode,c=s.memoizedProps;try{for(var p=s.type,v=r.attributes;v.length;)r.removeAttributeNode(v[0]);Un(r,p,c),r[Gt]=s,r[Ln]=c}catch(C){It(s,s.return,C)}}var Ia=!1,wn=!1,og=!1,D0=typeof WeakSet=="function"?WeakSet:Set,An=null;function zT(s,r){if(s=s.containerInfo,Ng=vd,s=Yv(s),Jp(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var v=p.anchorOffset,C=p.focusNode;p=p.focusOffset;try{c.nodeType,C.nodeType}catch{c=null;break e}var z=0,q=-1,Z=-1,de=0,ye=0,Ne=s,pe=null;t:for(;;){for(var he;Ne!==c||v!==0&&Ne.nodeType!==3||(q=z+v),Ne!==C||p!==0&&Ne.nodeType!==3||(Z=z+p),Ne.nodeType===3&&(z+=Ne.nodeValue.length),(he=Ne.firstChild)!==null;)pe=Ne,Ne=he;for(;;){if(Ne===s)break t;if(pe===c&&++de===v&&(q=z),pe===C&&++ye===p&&(Z=z),(he=Ne.nextSibling)!==null)break;Ne=pe,pe=Ne.parentNode}Ne=he}c=q===-1||Z===-1?null:{start:q,end:Z}}else c=null}c=c||{start:0,end:0}}else c=null;for(Eg={focusedElem:s,selectionRange:c},vd=!1,An=r;An!==null;)if(r=An,s=r.child,(r.subtreeFlags&1028)!==0&&s!==null)s.return=r,An=s;else for(;An!==null;){switch(r=An,C=r.alternate,s=r.flags,r.tag){case 0:if((s&4)!==0&&(s=r.updateQueue,s=s!==null?s.events:null,s!==null))for(c=0;c<s.length;c++)v=s[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&C!==null){s=void 0,c=r,v=C.memoizedProps,C=C.memoizedState,p=c.stateNode;try{var Fe=bo(c.type,v);s=p.getSnapshotBeforeUpdate(Fe,C),p.__reactInternalSnapshotBeforeUpdate=s}catch(at){It(c,c.return,at)}}break;case 3:if((s&1024)!==0){if(s=r.stateNode.containerInfo,c=s.nodeType,c===9)Ag(s);else if(c===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Ag(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(o(163))}if(s=r.sibling,s!==null){s.return=r.return,An=s;break}An=r.return}}function P0(s,r,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:$a(s,c),p&4&&Yi(5,c);break;case 1:if($a(s,c),p&4)if(s=c.stateNode,r===null)try{s.componentDidMount()}catch(z){It(c,c.return,z)}else{var v=bo(c.type,r.memoizedProps);r=r.memoizedState;try{s.componentDidUpdate(v,r,s.__reactInternalSnapshotBeforeUpdate)}catch(z){It(c,c.return,z)}}p&64&&T0(c),p&512&&Ki(c,c.return);break;case 3:if($a(s,c),p&64&&(s=c.updateQueue,s!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{vy(s,r)}catch(z){It(c,c.return,z)}}break;case 27:r===null&&p&4&&z0(c);case 26:case 5:$a(s,c),r===null&&p&4&&M0(c),p&512&&Ki(c,c.return);break;case 12:$a(s,c);break;case 31:$a(s,c),p&4&&B0(s,c);break;case 13:$a(s,c),p&4&&$0(s,c),p&64&&(s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(c=qT.bind(null,c),c5(s,c))));break;case 22:if(p=c.memoizedState!==null||Ia,!p){r=r!==null&&r.memoizedState!==null||wn,v=Ia;var C=wn;Ia=p,(wn=r)&&!C?Ua(s,c,(c.subtreeFlags&8772)!==0):$a(s,c),Ia=v,wn=C}break;case 30:break;default:$a(s,c)}}function L0(s){var r=s.alternate;r!==null&&(s.alternate=null,L0(r)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(r=s.stateNode,r!==null&&Pp(r)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var on=null,ls=!1;function Ba(s,r,c){for(c=c.child;c!==null;)I0(s,r,c),c=c.sibling}function I0(s,r,c){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(lt,c)}catch{}switch(c.tag){case 26:wn||ca(c,r),Ba(s,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:wn||ca(c,r);var p=on,v=ls;Rr(c.type)&&(on=c.stateNode,ls=!1),Ba(s,r,c),sc(c.stateNode),on=p,ls=v;break;case 5:wn||ca(c,r);case 6:if(p=on,v=ls,on=null,Ba(s,r,c),on=p,ls=v,on!==null)if(ls)try{(on.nodeType===9?on.body:on.nodeName==="HTML"?on.ownerDocument.body:on).removeChild(c.stateNode)}catch(C){It(c,r,C)}else try{on.removeChild(c.stateNode)}catch(C){It(c,r,C)}break;case 18:on!==null&&(ls?(s=on,T1(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,c.stateNode),Dl(s)):T1(on,c.stateNode));break;case 4:p=on,v=ls,on=c.stateNode.containerInfo,ls=!0,Ba(s,r,c),on=p,ls=v;break;case 0:case 11:case 14:case 15:jr(2,c,r),wn||jr(4,c,r),Ba(s,r,c);break;case 1:wn||(ca(c,r),p=c.stateNode,typeof p.componentWillUnmount=="function"&&A0(c,r,p)),Ba(s,r,c);break;case 21:Ba(s,r,c);break;case 22:wn=(p=wn)||c.memoizedState!==null,Ba(s,r,c),wn=p;break;default:Ba(s,r,c)}}function B0(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Dl(s)}catch(c){It(r,r.return,c)}}}function $0(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Dl(s)}catch(c){It(r,r.return,c)}}function DT(s){switch(s.tag){case 31:case 13:case 19:var r=s.stateNode;return r===null&&(r=s.stateNode=new D0),r;case 22:return s=s.stateNode,r=s._retryCache,r===null&&(r=s._retryCache=new D0),r;default:throw Error(o(435,s.tag))}}function ed(s,r){var c=DT(s);r.forEach(function(p){if(!c.has(p)){c.add(p);var v=VT.bind(null,s,p);p.then(v,v)}})}function is(s,r){var c=r.deletions;if(c!==null)for(var p=0;p<c.length;p++){var v=c[p],C=s,z=r,q=z;e:for(;q!==null;){switch(q.tag){case 27:if(Rr(q.type)){on=q.stateNode,ls=!1;break e}break;case 5:on=q.stateNode,ls=!1;break e;case 3:case 4:on=q.stateNode.containerInfo,ls=!0;break e}q=q.return}if(on===null)throw Error(o(160));I0(C,z,v),on=null,ls=!1,C=v.alternate,C!==null&&(C.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)U0(r,s),r=r.sibling}var Ks=null;function U0(s,r){var c=s.alternate,p=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:is(r,s),cs(s),p&4&&(jr(3,s,s.return),Yi(3,s),jr(5,s,s.return));break;case 1:is(r,s),cs(s),p&512&&(wn||c===null||ca(c,c.return)),p&64&&Ia&&(s=s.updateQueue,s!==null&&(p=s.callbacks,p!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:var v=Ks;if(is(r,s),cs(s),p&512&&(wn||c===null||ca(c,c.return)),p&4){var C=c!==null?c.memoizedState:null;if(p=s.memoizedState,c===null)if(p===null)if(s.stateNode===null){e:{p=s.type,c=s.memoizedProps,v=v.ownerDocument||v;t:switch(p){case"title":C=v.getElementsByTagName("title")[0],(!C||C[yi]||C[Gt]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=v.createElement(p),v.head.insertBefore(C,v.querySelector("head > title"))),Un(C,p,c),C[Gt]=s,Tn(C),p=C;break e;case"link":var z=U1("link","href",v).get(p+(c.href||""));if(z){for(var q=0;q<z.length;q++)if(C=z[q],C.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&C.getAttribute("rel")===(c.rel==null?null:c.rel)&&C.getAttribute("title")===(c.title==null?null:c.title)&&C.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){z.splice(q,1);break t}}C=v.createElement(p),Un(C,p,c),v.head.appendChild(C);break;case"meta":if(z=U1("meta","content",v).get(p+(c.content||""))){for(q=0;q<z.length;q++)if(C=z[q],C.getAttribute("content")===(c.content==null?null:""+c.content)&&C.getAttribute("name")===(c.name==null?null:c.name)&&C.getAttribute("property")===(c.property==null?null:c.property)&&C.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&C.getAttribute("charset")===(c.charSet==null?null:c.charSet)){z.splice(q,1);break t}}C=v.createElement(p),Un(C,p,c),v.head.appendChild(C);break;default:throw Error(o(468,p))}C[Gt]=s,Tn(C),p=C}s.stateNode=p}else H1(v,s.type,s.stateNode);else s.stateNode=$1(v,p,s.memoizedProps);else C!==p?(C===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):C.count--,p===null?H1(v,s.type,s.stateNode):$1(v,p,s.memoizedProps)):p===null&&s.stateNode!==null&&sg(s,s.memoizedProps,c.memoizedProps)}break;case 27:is(r,s),cs(s),p&512&&(wn||c===null||ca(c,c.return)),c!==null&&p&4&&sg(s,s.memoizedProps,c.memoizedProps);break;case 5:if(is(r,s),cs(s),p&512&&(wn||c===null||ca(c,c.return)),s.flags&32){v=s.stateNode;try{al(v,"")}catch(Fe){It(s,s.return,Fe)}}p&4&&s.stateNode!=null&&(v=s.memoizedProps,sg(s,v,c!==null?c.memoizedProps:v)),p&1024&&(og=!0);break;case 6:if(is(r,s),cs(s),p&4){if(s.stateNode===null)throw Error(o(162));p=s.memoizedProps,c=s.stateNode;try{c.nodeValue=p}catch(Fe){It(s,s.return,Fe)}}break;case 3:if(hd=null,v=Ks,Ks=md(r.containerInfo),is(r,s),Ks=v,cs(s),p&4&&c!==null&&c.memoizedState.isDehydrated)try{Dl(r.containerInfo)}catch(Fe){It(s,s.return,Fe)}og&&(og=!1,H0(s));break;case 4:p=Ks,Ks=md(s.stateNode.containerInfo),is(r,s),cs(s),Ks=p;break;case 12:is(r,s),cs(s);break;case 31:is(r,s),cs(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,ed(s,p)));break;case 13:is(r,s),cs(s),s.child.flags&8192&&s.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(nd=me()),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,ed(s,p)));break;case 22:v=s.memoizedState!==null;var Z=c!==null&&c.memoizedState!==null,de=Ia,ye=wn;if(Ia=de||v,wn=ye||Z,is(r,s),wn=ye,Ia=de,cs(s),p&8192)e:for(r=s.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(c===null||Z||Ia||wn||_o(s)),c=null,r=s;;){if(r.tag===5||r.tag===26){if(c===null){Z=c=r;try{if(C=Z.stateNode,v)z=C.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{q=Z.stateNode;var Ne=Z.memoizedProps.style,pe=Ne!=null&&Ne.hasOwnProperty("display")?Ne.display:null;q.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Fe){It(Z,Z.return,Fe)}}}else if(r.tag===6){if(c===null){Z=r;try{Z.stateNode.nodeValue=v?"":Z.memoizedProps}catch(Fe){It(Z,Z.return,Fe)}}}else if(r.tag===18){if(c===null){Z=r;try{var he=Z.stateNode;v?A1(he,!0):A1(Z.stateNode,!1)}catch(Fe){It(Z,Z.return,Fe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===s)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}p&4&&(p=s.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,ed(s,c))));break;case 19:is(r,s),cs(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,ed(s,p)));break;case 30:break;case 21:break;default:is(r,s),cs(s)}}function cs(s){var r=s.flags;if(r&2){try{for(var c,p=s.return;p!==null;){if(O0(p)){c=p;break}p=p.return}if(c==null)throw Error(o(160));switch(c.tag){case 27:var v=c.stateNode,C=ag(s);Ju(s,C,v);break;case 5:var z=c.stateNode;c.flags&32&&(al(z,""),c.flags&=-33);var q=ag(s);Ju(s,q,z);break;case 3:case 4:var Z=c.stateNode.containerInfo,de=ag(s);rg(s,de,Z);break;default:throw Error(o(161))}}catch(ye){It(s,s.return,ye)}s.flags&=-3}r&4096&&(s.flags&=-4097)}function H0(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var r=s;H0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),s=s.sibling}}function $a(s,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)P0(s,r.alternate,r),r=r.sibling}function _o(s){for(s=s.child;s!==null;){var r=s;switch(r.tag){case 0:case 11:case 14:case 15:jr(4,r,r.return),_o(r);break;case 1:ca(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&A0(r,r.return,c),_o(r);break;case 27:sc(r.stateNode);case 26:case 5:ca(r,r.return),_o(r);break;case 22:r.memoizedState===null&&_o(r);break;case 30:_o(r);break;default:_o(r)}s=s.sibling}}function Ua(s,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,v=s,C=r,z=C.flags;switch(C.tag){case 0:case 11:case 15:Ua(v,C,c),Yi(4,C);break;case 1:if(Ua(v,C,c),p=C,v=p.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(de){It(p,p.return,de)}if(p=C,v=p.updateQueue,v!==null){var q=p.stateNode;try{var Z=v.shared.hiddenCallbacks;if(Z!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Z.length;v++)_y(Z[v],q)}catch(de){It(p,p.return,de)}}c&&z&64&&T0(C),Ki(C,C.return);break;case 27:z0(C);case 26:case 5:Ua(v,C,c),c&&p===null&&z&4&&M0(C),Ki(C,C.return);break;case 12:Ua(v,C,c);break;case 31:Ua(v,C,c),c&&z&4&&B0(v,C);break;case 13:Ua(v,C,c),c&&z&4&&$0(v,C);break;case 22:C.memoizedState===null&&Ua(v,C,c),Ki(C,C.return);break;case 30:break;default:Ua(v,C,c)}r=r.sibling}}function lg(s,r){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&zi(c))}function ig(s,r){s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&zi(s))}function Xs(s,r,c,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)q0(s,r,c,p),r=r.sibling}function q0(s,r,c,p){var v=r.flags;switch(r.tag){case 0:case 11:case 15:Xs(s,r,c,p),v&2048&&Yi(9,r);break;case 1:Xs(s,r,c,p);break;case 3:Xs(s,r,c,p),v&2048&&(s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&zi(s)));break;case 12:if(v&2048){Xs(s,r,c,p),s=r.stateNode;try{var C=r.memoizedProps,z=C.id,q=C.onPostCommit;typeof q=="function"&&q(z,r.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){It(r,r.return,Z)}}else Xs(s,r,c,p);break;case 31:Xs(s,r,c,p);break;case 13:Xs(s,r,c,p);break;case 23:break;case 22:C=r.stateNode,z=r.alternate,r.memoizedState!==null?C._visibility&2?Xs(s,r,c,p):Xi(s,r):C._visibility&2?Xs(s,r,c,p):(C._visibility|=2,wl(s,r,c,p,(r.subtreeFlags&10256)!==0||!1)),v&2048&&lg(z,r);break;case 24:Xs(s,r,c,p),v&2048&&ig(r.alternate,r);break;default:Xs(s,r,c,p)}}function wl(s,r,c,p,v){for(v=v&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var C=s,z=r,q=c,Z=p,de=z.flags;switch(z.tag){case 0:case 11:case 15:wl(C,z,q,Z,v),Yi(8,z);break;case 23:break;case 22:var ye=z.stateNode;z.memoizedState!==null?ye._visibility&2?wl(C,z,q,Z,v):Xi(C,z):(ye._visibility|=2,wl(C,z,q,Z,v)),v&&de&2048&&lg(z.alternate,z);break;case 24:wl(C,z,q,Z,v),v&&de&2048&&ig(z.alternate,z);break;default:wl(C,z,q,Z,v)}r=r.sibling}}function Xi(s,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=s,p=r,v=p.flags;switch(p.tag){case 22:Xi(c,p),v&2048&&lg(p.alternate,p);break;case 24:Xi(c,p),v&2048&&ig(p.alternate,p);break;default:Xi(c,p)}r=r.sibling}}var Qi=8192;function Sl(s,r,c){if(s.subtreeFlags&Qi)for(s=s.child;s!==null;)V0(s,r,c),s=s.sibling}function V0(s,r,c){switch(s.tag){case 26:Sl(s,r,c),s.flags&Qi&&s.memoizedState!==null&&y5(c,Ks,s.memoizedState,s.memoizedProps);break;case 5:Sl(s,r,c);break;case 3:case 4:var p=Ks;Ks=md(s.stateNode.containerInfo),Sl(s,r,c),Ks=p;break;case 22:s.memoizedState===null&&(p=s.alternate,p!==null&&p.memoizedState!==null?(p=Qi,Qi=16777216,Sl(s,r,c),Qi=p):Sl(s,r,c));break;default:Sl(s,r,c)}}function F0(s){var r=s.alternate;if(r!==null&&(s=r.child,s!==null)){r.child=null;do r=s.sibling,s.sibling=null,s=r;while(s!==null)}}function Wi(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];An=p,Y0(p,s)}F0(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)G0(s),s=s.sibling}function G0(s){switch(s.tag){case 0:case 11:case 15:Wi(s),s.flags&2048&&jr(9,s,s.return);break;case 3:Wi(s);break;case 12:Wi(s);break;case 22:var r=s.stateNode;s.memoizedState!==null&&r._visibility&2&&(s.return===null||s.return.tag!==13)?(r._visibility&=-3,td(s)):Wi(s);break;default:Wi(s)}}function td(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];An=p,Y0(p,s)}F0(s)}for(s=s.child;s!==null;){switch(r=s,r.tag){case 0:case 11:case 15:jr(8,r,r.return),td(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,td(r));break;default:td(r)}s=s.sibling}}function Y0(s,r){for(;An!==null;){var c=An;switch(c.tag){case 0:case 11:case 15:jr(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var p=c.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:zi(c.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,An=p;else e:for(c=s;An!==null;){p=An;var v=p.sibling,C=p.return;if(L0(p),p===c){An=null;break e}if(v!==null){v.return=C,An=v;break e}An=C}}}var PT={getCacheForType:function(s){var r=Bn(yn),c=r.data.get(s);return c===void 0&&(c=s(),r.data.set(s,c)),c},cacheSignal:function(){return Bn(yn).controller.signal}},LT=typeof WeakMap=="function"?WeakMap:Map,zt=0,Yt=null,yt=null,kt=0,Lt=0,ys=null,kr=!1,Cl=!1,cg=!1,Ha=0,fn=0,wr=0,vo=0,ug=0,js=0,Nl=0,Zi=null,us=null,dg=!1,nd=0,K0=0,sd=1/0,ad=null,Sr=null,Cn=0,Cr=null,El=null,qa=0,fg=0,pg=null,X0=null,Ji=0,mg=null;function ks(){return(zt&2)!==0&&kt!==0?kt&-kt:U.T!==null?vg():hn()}function Q0(){if(js===0)if((kt&536870912)===0||Nt){var s=Ot;Ot<<=1,(Ot&3932160)===0&&(Ot=262144),js=s}else js=536870912;return s=_s.current,s!==null&&(s.flags|=32),js}function ds(s,r,c){(s===Yt&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)&&(Rl(s,0),Nr(s,kt,js,!1)),gn(s,c),((zt&2)===0||s!==Yt)&&(s===Yt&&((zt&2)===0&&(vo|=c),fn===4&&Nr(s,kt,js,!1)),ua(s))}function W0(s,r,c){if((zt&6)!==0)throw Error(o(327));var p=!c&&(r&127)===0&&(r&s.expiredLanes)===0||mn(s,r),v=p?$T(s,r):hg(s,r,!0),C=p;do{if(v===0){Cl&&!p&&Nr(s,r,0,!1);break}else{if(c=s.current.alternate,C&&!IT(c)){v=hg(s,r,!1),C=!1;continue}if(v===2){if(C=r,s.errorRecoveryDisabledLanes&C)var z=0;else z=s.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){r=z;e:{var q=s;v=Zi;var Z=q.current.memoizedState.isDehydrated;if(Z&&(Rl(q,z).flags|=256),z=hg(q,z,!1),z!==2){if(cg&&!Z){q.errorRecoveryDisabledLanes|=C,vo|=C,v=4;break e}C=us,us=v,C!==null&&(us===null?us=C:us.push.apply(us,C))}v=z}if(C=!1,v!==2)continue}}if(v===1){Rl(s,0),Nr(s,r,0,!0);break}e:{switch(p=s,C=v,C){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Nr(p,r,js,!kr);break e;case 2:us=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(v=nd+300-me(),10<v)){if(Nr(p,r,js,!kr),en(p,0,!0)!==0)break e;qa=r,p.timeoutHandle=E1(Z0.bind(null,p,c,us,ad,dg,r,js,vo,Nl,kr,C,"Throttled",-0,0),v);break e}Z0(p,c,us,ad,dg,r,js,vo,Nl,kr,C,null,-0,0)}}break}while(!0);ua(s)}function Z0(s,r,c,p,v,C,z,q,Z,de,ye,Ne,pe,he){if(s.timeoutHandle=-1,Ne=r.subtreeFlags,Ne&8192||(Ne&16785408)===16785408){Ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},V0(r,C,Ne);var Fe=(C&62914560)===C?nd-me():(C&4194048)===C?K0-me():0;if(Fe=j5(Ne,Fe),Fe!==null){qa=C,s.cancelPendingCommit=Fe(o1.bind(null,s,r,C,c,p,v,z,q,Z,ye,Ne,null,pe,he)),Nr(s,C,z,!de);return}}o1(s,r,C,c,p,v,z,q,Z)}function IT(s){for(var r=s;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var v=c[p],C=v.getSnapshot;v=v.value;try{if(!xs(C(),v))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;else{if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Nr(s,r,c,p){r&=~ug,r&=~vo,s.suspendedLanes|=r,s.pingedLanes&=~r,p&&(s.warmLanes|=r),p=s.expirationTimes;for(var v=r;0<v;){var C=31-Ie(v),z=1<<C;p[C]=-1,v&=~z}c!==0&&Sa(s,c,r)}function rd(){return(zt&6)===0?(ec(0),!1):!0}function gg(){if(yt!==null){if(Lt===0)var s=yt.return;else s=yt,Ma=uo=null,Am(s),_l=null,Pi=0,s=yt;for(;s!==null;)R0(s.alternate,s),s=s.return;yt=null}}function Rl(s,r){var c=s.timeoutHandle;c!==-1&&(s.timeoutHandle=-1,a5(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),qa=0,gg(),Yt=s,yt=c=Ta(s.current,null),kt=r,Lt=0,ys=null,kr=!1,Cl=mn(s,r),cg=!1,Nl=js=ug=vo=wr=fn=0,us=Zi=null,dg=!1,(r&8)!==0&&(r|=r&32);var p=s.entangledLanes;if(p!==0)for(s=s.entanglements,p&=r;0<p;){var v=31-Ie(p),C=1<<v;r|=s[v],p&=~C}return Ha=r,Cu(),c}function J0(s,r){ft=null,U.H=Vi,r===bl||r===zu?(r=gy(),Lt=3):r===_m?(r=gy(),Lt=4):Lt=r===Ym?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ys=r,yt===null&&(fn=1,Ku(s,Os(r,s.current)))}function e1(){var s=_s.current;return s===null?!0:(kt&4194048)===kt?Ls===null:(kt&62914560)===kt||(kt&536870912)!==0?s===Ls:!1}function t1(){var s=U.H;return U.H=Vi,s===null?Vi:s}function n1(){var s=U.A;return U.A=PT,s}function od(){fn=4,kr||(kt&4194048)!==kt&&_s.current!==null||(Cl=!0),(wr&134217727)===0&&(vo&134217727)===0||Yt===null||Nr(Yt,kt,js,!1)}function hg(s,r,c){var p=zt;zt|=2;var v=t1(),C=n1();(Yt!==s||kt!==r)&&(ad=null,Rl(s,r)),r=!1;var z=fn;e:do try{if(Lt!==0&&yt!==null){var q=yt,Z=ys;switch(Lt){case 8:gg(),z=6;break e;case 3:case 2:case 9:case 6:_s.current===null&&(r=!0);var de=Lt;if(Lt=0,ys=null,Tl(s,q,Z,de),c&&Cl){z=0;break e}break;default:de=Lt,Lt=0,ys=null,Tl(s,q,Z,de)}}BT(),z=fn;break}catch(ye){J0(s,ye)}while(!0);return r&&s.shellSuspendCounter++,Ma=uo=null,zt=p,U.H=v,U.A=C,yt===null&&(Yt=null,kt=0,Cu()),z}function BT(){for(;yt!==null;)s1(yt)}function $T(s,r){var c=zt;zt|=2;var p=t1(),v=n1();Yt!==s||kt!==r?(ad=null,sd=me()+500,Rl(s,r)):Cl=mn(s,r);e:do try{if(Lt!==0&&yt!==null){r=yt;var C=ys;t:switch(Lt){case 1:Lt=0,ys=null,Tl(s,r,C,1);break;case 2:case 9:if(py(C)){Lt=0,ys=null,a1(r);break}r=function(){Lt!==2&&Lt!==9||Yt!==s||(Lt=7),ua(s)},C.then(r,r);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:py(C)?(Lt=0,ys=null,a1(r)):(Lt=0,ys=null,Tl(s,r,C,7));break;case 5:var z=null;switch(yt.tag){case 26:z=yt.memoizedState;case 5:case 27:var q=yt;if(z?q1(z):q.stateNode.complete){Lt=0,ys=null;var Z=q.sibling;if(Z!==null)yt=Z;else{var de=q.return;de!==null?(yt=de,ld(de)):yt=null}break t}}Lt=0,ys=null,Tl(s,r,C,5);break;case 6:Lt=0,ys=null,Tl(s,r,C,6);break;case 8:gg(),fn=6;break e;default:throw Error(o(462))}}UT();break}catch(ye){J0(s,ye)}while(!0);return Ma=uo=null,U.H=p,U.A=v,zt=c,yt!==null?0:(Yt=null,kt=0,Cu(),fn)}function UT(){for(;yt!==null&&!Pe();)s1(yt)}function s1(s){var r=N0(s.alternate,s,Ha);s.memoizedProps=s.pendingProps,r===null?ld(s):yt=r}function a1(s){var r=s,c=r.alternate;switch(r.tag){case 15:case 0:r=y0(c,r,r.pendingProps,r.type,void 0,kt);break;case 11:r=y0(c,r,r.pendingProps,r.type.render,r.ref,kt);break;case 5:Am(r);default:R0(c,r),r=yt=ny(r,Ha),r=N0(c,r,Ha)}s.memoizedProps=s.pendingProps,r===null?ld(s):yt=r}function Tl(s,r,c,p){Ma=uo=null,Am(r),_l=null,Pi=0;var v=r.return;try{if(RT(s,v,r,c,kt)){fn=1,Ku(s,Os(c,s.current)),yt=null;return}}catch(C){if(v!==null)throw yt=v,C;fn=1,Ku(s,Os(c,s.current)),yt=null;return}r.flags&32768?(Nt||p===1?s=!0:Cl||(kt&536870912)!==0?s=!1:(kr=s=!0,(p===2||p===9||p===3||p===6)&&(p=_s.current,p!==null&&p.tag===13&&(p.flags|=16384))),r1(r,s)):ld(r)}function ld(s){var r=s;do{if((r.flags&32768)!==0){r1(r,kr);return}s=r.return;var c=MT(r.alternate,r,Ha);if(c!==null){yt=c;return}if(r=r.sibling,r!==null){yt=r;return}yt=r=s}while(r!==null);fn===0&&(fn=5)}function r1(s,r){do{var c=OT(s.alternate,s);if(c!==null){c.flags&=32767,yt=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(s=s.sibling,s!==null)){yt=s;return}yt=s=c}while(s!==null);fn=6,yt=null}function o1(s,r,c,p,v,C,z,q,Z){s.cancelPendingCommit=null;do id();while(Cn!==0);if((zt&6)!==0)throw Error(o(327));if(r!==null){if(r===s.current)throw Error(o(177));if(C=r.lanes|r.childLanes,C|=am,Rs(s,c,C,z,q,Z),s===Yt&&(yt=Yt=null,kt=0),El=r,Cr=s,qa=c,fg=C,pg=v,X0=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,FT(ze,function(){return d1(),null})):(s.callbackNode=null,s.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=U.T,U.T=null,v=F.p,F.p=2,z=zt,zt|=4;try{zT(s,r,c)}finally{zt=z,F.p=v,U.T=p}}Cn=1,l1(),i1(),c1()}}function l1(){if(Cn===1){Cn=0;var s=Cr,r=El,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=U.T,U.T=null;var p=F.p;F.p=2;var v=zt;zt|=4;try{U0(r,s);var C=Eg,z=Yv(s.containerInfo),q=C.focusedElem,Z=C.selectionRange;if(z!==q&&q&&q.ownerDocument&&Gv(q.ownerDocument.documentElement,q)){if(Z!==null&&Jp(q)){var de=Z.start,ye=Z.end;if(ye===void 0&&(ye=de),"selectionStart"in q)q.selectionStart=de,q.selectionEnd=Math.min(ye,q.value.length);else{var Ne=q.ownerDocument||document,pe=Ne&&Ne.defaultView||window;if(pe.getSelection){var he=pe.getSelection(),Fe=q.textContent.length,at=Math.min(Z.start,Fe),qt=Z.end===void 0?at:Math.min(Z.end,Fe);!he.extend&&at>qt&&(z=qt,qt=at,at=z);var ae=Fv(q,at),ee=Fv(q,qt);if(ae&&ee&&(he.rangeCount!==1||he.anchorNode!==ae.node||he.anchorOffset!==ae.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var ue=Ne.createRange();ue.setStart(ae.node,ae.offset),he.removeAllRanges(),at>qt?(he.addRange(ue),he.extend(ee.node,ee.offset)):(ue.setEnd(ee.node,ee.offset),he.addRange(ue))}}}}for(Ne=[],he=q;he=he.parentNode;)he.nodeType===1&&Ne.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<Ne.length;q++){var ke=Ne[q];ke.element.scrollLeft=ke.left,ke.element.scrollTop=ke.top}}vd=!!Ng,Eg=Ng=null}finally{zt=v,F.p=p,U.T=c}}s.current=r,Cn=2}}function i1(){if(Cn===2){Cn=0;var s=Cr,r=El,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=U.T,U.T=null;var p=F.p;F.p=2;var v=zt;zt|=4;try{P0(s,r.alternate,r)}finally{zt=v,F.p=p,U.T=c}}Cn=3}}function c1(){if(Cn===4||Cn===3){Cn=0,Be();var s=Cr,r=El,c=qa,p=X0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Cn=5:(Cn=0,El=Cr=null,u1(s,s.pendingLanes));var v=s.pendingLanes;if(v===0&&(Sr=null),$t(c),r=r.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(lt,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=U.T,v=F.p,F.p=2,U.T=null;try{for(var C=s.onRecoverableError,z=0;z<p.length;z++){var q=p[z];C(q.value,{componentStack:q.stack})}}finally{U.T=r,F.p=v}}(qa&3)!==0&&id(),ua(s),v=s.pendingLanes,(c&261930)!==0&&(v&42)!==0?s===mg?Ji++:(Ji=0,mg=s):Ji=0,ec(0)}}function u1(s,r){(s.pooledCacheLanes&=r)===0&&(r=s.pooledCache,r!=null&&(s.pooledCache=null,zi(r)))}function id(){return l1(),i1(),c1(),d1()}function d1(){if(Cn!==5)return!1;var s=Cr,r=fg;fg=0;var c=$t(qa),p=U.T,v=F.p;try{F.p=32>c?32:c,U.T=null,c=pg,pg=null;var C=Cr,z=qa;if(Cn=0,El=Cr=null,qa=0,(zt&6)!==0)throw Error(o(331));var q=zt;if(zt|=4,G0(C.current),q0(C,C.current,z,c),zt=q,ec(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(lt,C)}catch{}return!0}finally{F.p=v,U.T=p,u1(s,r)}}function f1(s,r,c){r=Os(c,r),r=Gm(s.stateNode,r,2),s=_r(s,r,2),s!==null&&(gn(s,2),ua(s))}function It(s,r,c){if(s.tag===3)f1(s,s,c);else for(;r!==null;){if(r.tag===3){f1(r,s,c);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Sr===null||!Sr.has(p))){s=Os(c,s),c=p0(2),p=_r(r,c,2),p!==null&&(m0(c,p,r,s),gn(p,2),ua(p));break}}r=r.return}}function xg(s,r,c){var p=s.pingCache;if(p===null){p=s.pingCache=new LT;var v=new Set;p.set(r,v)}else v=p.get(r),v===void 0&&(v=new Set,p.set(r,v));v.has(c)||(cg=!0,v.add(c),s=HT.bind(null,s,r,c),r.then(s,s))}function HT(s,r,c){var p=s.pingCache;p!==null&&p.delete(r),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,Yt===s&&(kt&c)===c&&(fn===4||fn===3&&(kt&62914560)===kt&&300>me()-nd?(zt&2)===0&&Rl(s,0):ug|=c,Nl===kt&&(Nl=0)),ua(s)}function p1(s,r){r===0&&(r=hs()),s=lo(s,r),s!==null&&(gn(s,r),ua(s))}function qT(s){var r=s.memoizedState,c=0;r!==null&&(c=r.retryLane),p1(s,c)}function VT(s,r){var c=0;switch(s.tag){case 31:case 13:var p=s.stateNode,v=s.memoizedState;v!==null&&(c=v.retryLane);break;case 19:p=s.stateNode;break;case 22:p=s.stateNode._retryCache;break;default:throw Error(o(314))}p!==null&&p.delete(r),p1(s,c)}function FT(s,r){return Re(s,r)}var cd=null,Al=null,bg=!1,ud=!1,_g=!1,Er=0;function ua(s){s!==Al&&s.next===null&&(Al===null?cd=Al=s:Al=Al.next=s),ud=!0,bg||(bg=!0,YT())}function ec(s,r){if(!_g&&ud){_g=!0;do for(var c=!1,p=cd;p!==null;){if(s!==0){var v=p.pendingLanes;if(v===0)var C=0;else{var z=p.suspendedLanes,q=p.pingedLanes;C=(1<<31-Ie(42|s)+1)-1,C&=v&~(z&~q),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(c=!0,x1(p,C))}else C=kt,C=en(p,p===Yt?C:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(C&3)===0||mn(p,C)||(c=!0,x1(p,C));p=p.next}while(c);_g=!1}}function GT(){m1()}function m1(){ud=bg=!1;var s=0;Er!==0&&s5()&&(s=Er);for(var r=me(),c=null,p=cd;p!==null;){var v=p.next,C=g1(p,r);C===0?(p.next=null,c===null?cd=v:c.next=v,v===null&&(Al=c)):(c=p,(s!==0||(C&3)!==0)&&(ud=!0)),p=v}Cn!==0&&Cn!==5||ec(s),Er!==0&&(Er=0)}function g1(s,r){for(var c=s.suspendedLanes,p=s.pingedLanes,v=s.expirationTimes,C=s.pendingLanes&-62914561;0<C;){var z=31-Ie(C),q=1<<z,Z=v[z];Z===-1?((q&c)===0||(q&p)!==0)&&(v[z]=rs(q,r)):Z<=r&&(s.expiredLanes|=q),C&=~q}if(r=Yt,c=kt,c=en(s,s===r?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p=s.callbackNode,c===0||s===r&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)return p!==null&&p!==null&&Oe(p),s.callbackNode=null,s.callbackPriority=0;if((c&3)===0||mn(s,c)){if(r=c&-c,r===s.callbackPriority)return r;switch(p!==null&&Oe(p),$t(c)){case 2:case 8:c=Ae;break;case 32:c=ze;break;case 268435456:c=ot;break;default:c=ze}return p=h1.bind(null,s),c=Re(c,p),s.callbackPriority=r,s.callbackNode=c,r}return p!==null&&p!==null&&Oe(p),s.callbackPriority=2,s.callbackNode=null,2}function h1(s,r){if(Cn!==0&&Cn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var c=s.callbackNode;if(id()&&s.callbackNode!==c)return null;var p=kt;return p=en(s,s===Yt?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p===0?null:(W0(s,p,r),g1(s,me()),s.callbackNode!=null&&s.callbackNode===c?h1.bind(null,s):null)}function x1(s,r){if(id())return null;W0(s,r,!0)}function YT(){r5(function(){(zt&6)!==0?Re(Ge,GT):m1()})}function vg(){if(Er===0){var s=hl;s===0&&(s=mt,mt<<=1,(mt&261888)===0&&(mt=256)),Er=s}return Er}function b1(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:bu(""+s)}function _1(s,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,s.id&&c.setAttribute("form",s.id),r.parentNode.insertBefore(c,r),s=new FormData(s),c.parentNode.removeChild(c),s}function KT(s,r,c,p,v){if(r==="submit"&&c&&c.stateNode===v){var C=b1((v[Ln]||null).action),z=p.submitter;z&&(r=(r=z[Ln]||null)?b1(r.formAction):z.getAttribute("formAction"),r!==null&&(C=r,z=null));var q=new ju("action","action",null,p,v);s.push({event:q,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Er!==0){var Z=z?_1(v,z):new FormData(v);$m(c,{pending:!0,data:Z,method:v.method,action:C},null,Z)}}else typeof C=="function"&&(q.preventDefault(),Z=z?_1(v,z):new FormData(v),$m(c,{pending:!0,data:Z,method:v.method,action:C},C,Z))},currentTarget:v}]})}}for(var yg=0;yg<sm.length;yg++){var jg=sm[yg],XT=jg.toLowerCase(),QT=jg[0].toUpperCase()+jg.slice(1);Ys(XT,"on"+QT)}Ys(Qv,"onAnimationEnd"),Ys(Wv,"onAnimationIteration"),Ys(Zv,"onAnimationStart"),Ys("dblclick","onDoubleClick"),Ys("focusin","onFocus"),Ys("focusout","onBlur"),Ys(fT,"onTransitionRun"),Ys(pT,"onTransitionStart"),Ys(mT,"onTransitionCancel"),Ys(Jv,"onTransitionEnd"),nl("onMouseEnter",["mouseout","mouseover"]),nl("onMouseLeave",["mouseout","mouseover"]),nl("onPointerEnter",["pointerout","pointerover"]),nl("onPointerLeave",["pointerout","pointerover"]),so("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),so("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),so("onBeforeInput",["compositionend","keypress","textInput","paste"]),so("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),WT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tc));function v1(s,r){r=(r&4)!==0;for(var c=0;c<s.length;c++){var p=s[c],v=p.event;p=p.listeners;e:{var C=void 0;if(r)for(var z=p.length-1;0<=z;z--){var q=p[z],Z=q.instance,de=q.currentTarget;if(q=q.listener,Z!==C&&v.isPropagationStopped())break e;C=q,v.currentTarget=de;try{C(v)}catch(ye){Su(ye)}v.currentTarget=null,C=Z}else for(z=0;z<p.length;z++){if(q=p[z],Z=q.instance,de=q.currentTarget,q=q.listener,Z!==C&&v.isPropagationStopped())break e;C=q,v.currentTarget=de;try{C(v)}catch(ye){Su(ye)}v.currentTarget=null,C=Z}}}}function jt(s,r){var c=r[vi];c===void 0&&(c=r[vi]=new Set);var p=s+"__bubble";c.has(p)||(y1(r,s,2,!1),c.add(p))}function kg(s,r,c){var p=0;r&&(p|=4),y1(c,s,p,r)}var dd="_reactListening"+Math.random().toString(36).slice(2);function wg(s){if(!s[dd]){s[dd]=!0,mv.forEach(function(c){c!=="selectionchange"&&(WT.has(c)||kg(c,!1,s),kg(c,!0,s))});var r=s.nodeType===9?s:s.ownerDocument;r===null||r[dd]||(r[dd]=!0,kg("selectionchange",!1,r))}}function y1(s,r,c,p){switch(Q1(r)){case 2:var v=S5;break;case 8:v=C5;break;default:v=Bg}c=v.bind(null,r,c,s),v=void 0,!Vp||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(v=!0),p?v!==void 0?s.addEventListener(r,c,{capture:!0,passive:v}):s.addEventListener(r,c,!0):v!==void 0?s.addEventListener(r,c,{passive:v}):s.addEventListener(r,c,!1)}function Sg(s,r,c,p,v){var C=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var z=p.tag;if(z===3||z===4){var q=p.stateNode.containerInfo;if(q===v)break;if(z===4)for(z=p.return;z!==null;){var Z=z.tag;if((Z===3||Z===4)&&z.stateNode.containerInfo===v)return;z=z.return}for(;q!==null;){if(z=Jo(q),z===null)return;if(Z=z.tag,Z===5||Z===6||Z===26||Z===27){p=C=z;continue e}q=q.parentNode}}p=p.return}Cv(function(){var de=C,ye=Hp(c),Ne=[];e:{var pe=ey.get(s);if(pe!==void 0){var he=ju,Fe=s;switch(s){case"keypress":if(vu(c)===0)break e;case"keydown":case"keyup":he=VR;break;case"focusin":Fe="focus",he=Kp;break;case"focusout":Fe="blur",he=Kp;break;case"beforeblur":case"afterblur":he=Kp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Rv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=MR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=YR;break;case Qv:case Wv:case Zv:he=DR;break;case Jv:he=XR;break;case"scroll":case"scrollend":he=TR;break;case"wheel":he=WR;break;case"copy":case"cut":case"paste":he=LR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Av;break;case"toggle":case"beforetoggle":he=JR}var at=(r&4)!==0,qt=!at&&(s==="scroll"||s==="scrollend"),ae=at?pe!==null?pe+"Capture":null:pe;at=[];for(var ee=de,ue;ee!==null;){var ke=ee;if(ue=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||ue===null||ae===null||(ke=ki(ee,ae),ke!=null&&at.push(nc(ee,ke,ue))),qt)break;ee=ee.return}0<at.length&&(pe=new he(pe,Fe,null,c,ye),Ne.push({event:pe,listeners:at}))}}if((r&7)===0){e:{if(pe=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",pe&&c!==Up&&(Fe=c.relatedTarget||c.fromElement)&&(Jo(Fe)||Fe[oa]))break e;if((he||pe)&&(pe=ye.window===ye?ye:(pe=ye.ownerDocument)?pe.defaultView||pe.parentWindow:window,he?(Fe=c.relatedTarget||c.toElement,he=de,Fe=Fe?Jo(Fe):null,Fe!==null&&(qt=i(Fe),at=Fe.tag,Fe!==qt||at!==5&&at!==27&&at!==6)&&(Fe=null)):(he=null,Fe=de),he!==Fe)){if(at=Rv,ke="onMouseLeave",ae="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(at=Av,ke="onPointerLeave",ae="onPointerEnter",ee="pointer"),qt=he==null?pe:ji(he),ue=Fe==null?pe:ji(Fe),pe=new at(ke,ee+"leave",he,c,ye),pe.target=qt,pe.relatedTarget=ue,ke=null,Jo(ye)===de&&(at=new at(ae,ee+"enter",Fe,c,ye),at.target=ue,at.relatedTarget=qt,ke=at),qt=ke,he&&Fe)t:{for(at=ZT,ae=he,ee=Fe,ue=0,ke=ae;ke;ke=at(ke))ue++;ke=0;for(var Je=ee;Je;Je=at(Je))ke++;for(;0<ue-ke;)ae=at(ae),ue--;for(;0<ke-ue;)ee=at(ee),ke--;for(;ue--;){if(ae===ee||ee!==null&&ae===ee.alternate){at=ae;break t}ae=at(ae),ee=at(ee)}at=null}else at=null;he!==null&&j1(Ne,pe,he,at,!1),Fe!==null&&qt!==null&&j1(Ne,qt,Fe,at,!0)}}e:{if(pe=de?ji(de):window,he=pe.nodeName&&pe.nodeName.toLowerCase(),he==="select"||he==="input"&&pe.type==="file")var Tt=Bv;else if(Lv(pe))if($v)Tt=cT;else{Tt=lT;var Ke=oT}else he=pe.nodeName,!he||he.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?de&&$p(de.elementType)&&(Tt=Bv):Tt=iT;if(Tt&&(Tt=Tt(s,de))){Iv(Ne,Tt,c,ye);break e}Ke&&Ke(s,pe,de),s==="focusout"&&de&&pe.type==="number"&&de.memoizedProps.value!=null&&Bp(pe,"number",pe.value)}switch(Ke=de?ji(de):window,s){case"focusin":(Lv(Ke)||Ke.contentEditable==="true")&&(il=Ke,em=de,Ai=null);break;case"focusout":Ai=em=il=null;break;case"mousedown":tm=!0;break;case"contextmenu":case"mouseup":case"dragend":tm=!1,Kv(Ne,c,ye);break;case"selectionchange":if(dT)break;case"keydown":case"keyup":Kv(Ne,c,ye)}var gt;if(Qp)e:{switch(s){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else ll?Dv(s,c)&&(wt="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(wt="onCompositionStart");wt&&(Mv&&c.locale!=="ko"&&(ll||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&ll&&(gt=Nv()):(fr=ye,Fp="value"in fr?fr.value:fr.textContent,ll=!0)),Ke=fd(de,wt),0<Ke.length&&(wt=new Tv(wt,s,null,c,ye),Ne.push({event:wt,listeners:Ke}),gt?wt.data=gt:(gt=Pv(c),gt!==null&&(wt.data=gt)))),(gt=tT?nT(s,c):sT(s,c))&&(wt=fd(de,"onBeforeInput"),0<wt.length&&(Ke=new Tv("onBeforeInput","beforeinput",null,c,ye),Ne.push({event:Ke,listeners:wt}),Ke.data=gt)),KT(Ne,s,de,c,ye)}v1(Ne,r)})}function nc(s,r,c){return{instance:s,listener:r,currentTarget:c}}function fd(s,r){for(var c=r+"Capture",p=[];s!==null;){var v=s,C=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||C===null||(v=ki(s,c),v!=null&&p.unshift(nc(s,v,C)),v=ki(s,r),v!=null&&p.push(nc(s,v,C))),s.tag===3)return p;s=s.return}return[]}function ZT(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function j1(s,r,c,p,v){for(var C=r._reactName,z=[];c!==null&&c!==p;){var q=c,Z=q.alternate,de=q.stateNode;if(q=q.tag,Z!==null&&Z===p)break;q!==5&&q!==26&&q!==27||de===null||(Z=de,v?(de=ki(c,C),de!=null&&z.unshift(nc(c,de,Z))):v||(de=ki(c,C),de!=null&&z.push(nc(c,de,Z)))),c=c.return}z.length!==0&&s.push({event:r,listeners:z})}var JT=/\r\n?/g,e5=/\u0000|\uFFFD/g;function k1(s){return(typeof s=="string"?s:""+s).replace(JT,`
|
|
49
|
-
`).replace(e5,"")}function w1(s,r){return r=k1(r),k1(s)===r}function Ht(s,r,c,p,v,C){switch(c){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||al(s,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&al(s,""+p);break;case"className":hu(s,"class",p);break;case"tabIndex":hu(s,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":hu(s,c,p);break;case"style":wv(s,p,C);break;case"data":if(r!=="object"){hu(s,"data",p);break}case"src":case"href":if(p===""&&(r!=="a"||c!=="href")){s.removeAttribute(c);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(c);break}p=bu(""+p),s.setAttribute(c,p);break;case"action":case"formAction":if(typeof p=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(c==="formAction"?(r!=="input"&&Ht(s,r,"name",v.name,v,null),Ht(s,r,"formEncType",v.formEncType,v,null),Ht(s,r,"formMethod",v.formMethod,v,null),Ht(s,r,"formTarget",v.formTarget,v,null)):(Ht(s,r,"encType",v.encType,v,null),Ht(s,r,"method",v.method,v,null),Ht(s,r,"target",v.target,v,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(c);break}p=bu(""+p),s.setAttribute(c,p);break;case"onClick":p!=null&&(s.onclick=Ea);break;case"onScroll":p!=null&&jt("scroll",s);break;case"onScrollEnd":p!=null&&jt("scrollend",s);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(o(61));if(c=p.__html,c!=null){if(v.children!=null)throw Error(o(60));s.innerHTML=c}}break;case"multiple":s.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":s.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){s.removeAttribute("xlink:href");break}c=bu(""+p),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(c,""+p):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":p===!0?s.setAttribute(c,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(c,p):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?s.setAttribute(c,p):s.removeAttribute(c);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?s.removeAttribute(c):s.setAttribute(c,p);break;case"popover":jt("beforetoggle",s),jt("toggle",s),gu(s,"popover",p);break;case"xlinkActuate":Na(s,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Na(s,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Na(s,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Na(s,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Na(s,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Na(s,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Na(s,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Na(s,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Na(s,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":gu(s,"is",p);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=ER.get(c)||c,gu(s,c,p))}}function Cg(s,r,c,p,v,C){switch(c){case"style":wv(s,p,C);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(o(61));if(c=p.__html,c!=null){if(v.children!=null)throw Error(o(60));s.innerHTML=c}}break;case"children":typeof p=="string"?al(s,p):(typeof p=="number"||typeof p=="bigint")&&al(s,""+p);break;case"onScroll":p!=null&&jt("scroll",s);break;case"onScrollEnd":p!=null&&jt("scrollend",s);break;case"onClick":p!=null&&(s.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gv.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),r=c.slice(2,v?c.length-7:void 0),C=s[Ln]||null,C=C!=null?C[c]:null,typeof C=="function"&&s.removeEventListener(r,C,v),typeof p=="function")){typeof C!="function"&&C!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(r,p,v);break e}c in s?s[c]=p:p===!0?s.setAttribute(c,""):gu(s,c,p)}}}function Un(s,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",s),jt("load",s);var p=!1,v=!1,C;for(C in c)if(c.hasOwnProperty(C)){var z=c[C];if(z!=null)switch(C){case"src":p=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Ht(s,r,C,z,c,null)}}v&&Ht(s,r,"srcSet",c.srcSet,c,null),p&&Ht(s,r,"src",c.src,c,null);return;case"input":jt("invalid",s);var q=C=z=v=null,Z=null,de=null;for(p in c)if(c.hasOwnProperty(p)){var ye=c[p];if(ye!=null)switch(p){case"name":v=ye;break;case"type":z=ye;break;case"checked":Z=ye;break;case"defaultChecked":de=ye;break;case"value":C=ye;break;case"defaultValue":q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(o(137,r));break;default:Ht(s,r,p,ye,c,null)}}vv(s,C,q,Z,de,z,v,!1);return;case"select":jt("invalid",s),p=z=C=null;for(v in c)if(c.hasOwnProperty(v)&&(q=c[v],q!=null))switch(v){case"value":C=q;break;case"defaultValue":z=q;break;case"multiple":p=q;default:Ht(s,r,v,q,c,null)}r=C,c=z,s.multiple=!!p,r!=null?sl(s,!!p,r,!1):c!=null&&sl(s,!!p,c,!0);return;case"textarea":jt("invalid",s),C=v=p=null;for(z in c)if(c.hasOwnProperty(z)&&(q=c[z],q!=null))switch(z){case"value":p=q;break;case"defaultValue":v=q;break;case"children":C=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(91));break;default:Ht(s,r,z,q,c,null)}jv(s,p,v,C);return;case"option":for(Z in c)if(c.hasOwnProperty(Z)&&(p=c[Z],p!=null))switch(Z){case"selected":s.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ht(s,r,Z,p,c,null)}return;case"dialog":jt("beforetoggle",s),jt("toggle",s),jt("cancel",s),jt("close",s);break;case"iframe":case"object":jt("load",s);break;case"video":case"audio":for(p=0;p<tc.length;p++)jt(tc[p],s);break;case"image":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"embed":case"source":case"link":jt("error",s),jt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in c)if(c.hasOwnProperty(de)&&(p=c[de],p!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Ht(s,r,de,p,c,null)}return;default:if($p(r)){for(ye in c)c.hasOwnProperty(ye)&&(p=c[ye],p!==void 0&&Cg(s,r,ye,p,c,void 0));return}}for(q in c)c.hasOwnProperty(q)&&(p=c[q],p!=null&&Ht(s,r,q,p,c,null))}function t5(s,r,c,p){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,C=null,z=null,q=null,Z=null,de=null,ye=null;for(he in c){var Ne=c[he];if(c.hasOwnProperty(he)&&Ne!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=Ne;default:p.hasOwnProperty(he)||Ht(s,r,he,null,p,Ne)}}for(var pe in p){var he=p[pe];if(Ne=c[pe],p.hasOwnProperty(pe)&&(he!=null||Ne!=null))switch(pe){case"type":C=he;break;case"name":v=he;break;case"checked":de=he;break;case"defaultChecked":ye=he;break;case"value":z=he;break;case"defaultValue":q=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,r));break;default:he!==Ne&&Ht(s,r,pe,he,p,Ne)}}Ip(s,z,q,Z,de,ye,C,v);return;case"select":he=z=q=pe=null;for(C in c)if(Z=c[C],c.hasOwnProperty(C)&&Z!=null)switch(C){case"value":break;case"multiple":he=Z;default:p.hasOwnProperty(C)||Ht(s,r,C,null,p,Z)}for(v in p)if(C=p[v],Z=c[v],p.hasOwnProperty(v)&&(C!=null||Z!=null))switch(v){case"value":pe=C;break;case"defaultValue":q=C;break;case"multiple":z=C;default:C!==Z&&Ht(s,r,v,C,p,Z)}r=q,c=z,p=he,pe!=null?sl(s,!!c,pe,!1):!!p!=!!c&&(r!=null?sl(s,!!c,r,!0):sl(s,!!c,c?[]:"",!1));return;case"textarea":he=pe=null;for(q in c)if(v=c[q],c.hasOwnProperty(q)&&v!=null&&!p.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Ht(s,r,q,null,p,v)}for(z in p)if(v=p[z],C=c[z],p.hasOwnProperty(z)&&(v!=null||C!=null))switch(z){case"value":pe=v;break;case"defaultValue":he=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(o(91));break;default:v!==C&&Ht(s,r,z,v,p,C)}yv(s,pe,he);return;case"option":for(var Fe in c)if(pe=c[Fe],c.hasOwnProperty(Fe)&&pe!=null&&!p.hasOwnProperty(Fe))switch(Fe){case"selected":s.selected=!1;break;default:Ht(s,r,Fe,null,p,pe)}for(Z in p)if(pe=p[Z],he=c[Z],p.hasOwnProperty(Z)&&pe!==he&&(pe!=null||he!=null))switch(Z){case"selected":s.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:Ht(s,r,Z,pe,p,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in c)pe=c[at],c.hasOwnProperty(at)&&pe!=null&&!p.hasOwnProperty(at)&&Ht(s,r,at,null,p,pe);for(de in p)if(pe=p[de],he=c[de],p.hasOwnProperty(de)&&pe!==he&&(pe!=null||he!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(o(137,r));break;default:Ht(s,r,de,pe,p,he)}return;default:if($p(r)){for(var qt in c)pe=c[qt],c.hasOwnProperty(qt)&&pe!==void 0&&!p.hasOwnProperty(qt)&&Cg(s,r,qt,void 0,p,pe);for(ye in p)pe=p[ye],he=c[ye],!p.hasOwnProperty(ye)||pe===he||pe===void 0&&he===void 0||Cg(s,r,ye,pe,p,he);return}}for(var ae in c)pe=c[ae],c.hasOwnProperty(ae)&&pe!=null&&!p.hasOwnProperty(ae)&&Ht(s,r,ae,null,p,pe);for(Ne in p)pe=p[Ne],he=c[Ne],!p.hasOwnProperty(Ne)||pe===he||pe==null&&he==null||Ht(s,r,Ne,pe,p,he)}function S1(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n5(){if(typeof performance.getEntriesByType=="function"){for(var s=0,r=0,c=performance.getEntriesByType("resource"),p=0;p<c.length;p++){var v=c[p],C=v.transferSize,z=v.initiatorType,q=v.duration;if(C&&q&&S1(z)){for(z=0,q=v.responseEnd,p+=1;p<c.length;p++){var Z=c[p],de=Z.startTime;if(de>q)break;var ye=Z.transferSize,Ne=Z.initiatorType;ye&&S1(Ne)&&(Z=Z.responseEnd,z+=ye*(Z<q?1:(q-de)/(Z-de)))}if(--p,r+=8*(C+z)/(v.duration/1e3),s++,10<s)break}}if(0<s)return r/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Ng=null,Eg=null;function pd(s){return s.nodeType===9?s:s.ownerDocument}function C1(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function N1(s,r){if(s===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&r==="foreignObject"?0:s}function Rg(s,r){return s==="textarea"||s==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Tg=null;function s5(){var s=window.event;return s&&s.type==="popstate"?s===Tg?!1:(Tg=s,!0):(Tg=null,!1)}var E1=typeof setTimeout=="function"?setTimeout:void 0,a5=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,r5=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(s){return R1.resolve(null).then(s).catch(o5)}:E1;function o5(s){setTimeout(function(){throw s})}function Rr(s){return s==="head"}function T1(s,r){var c=r,p=0;do{var v=c.nextSibling;if(s.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(p===0){s.removeChild(v),Dl(r);return}p--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")p++;else if(c==="html")sc(s.ownerDocument.documentElement);else if(c==="head"){c=s.ownerDocument.head,sc(c);for(var C=c.firstChild;C;){var z=C.nextSibling,q=C.nodeName;C[yi]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&C.rel.toLowerCase()==="stylesheet"||c.removeChild(C),C=z}}else c==="body"&&sc(s.ownerDocument.body);c=v}while(c);Dl(r)}function A1(s,r){var c=s;s=0;do{var p=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),p&&p.nodeType===8)if(c=p.data,c==="/$"){if(s===0)break;s--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||s++;c=p}while(c)}function Ag(s){var r=s.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ag(c),Pp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function l5(s,r,c,p){for(;s.nodeType===1;){var v=c;if(s.nodeName.toLowerCase()!==r.toLowerCase()){if(!p&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(p){if(!s[yi])switch(r){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(C=s.getAttribute("rel"),C==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(C!==v.rel||s.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||s.getAttribute("title")!==(v.title==null?null:v.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(C=s.getAttribute("src"),(C!==(v.src==null?null:v.src)||s.getAttribute("type")!==(v.type==null?null:v.type)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&C&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(r==="input"&&s.type==="hidden"){var C=v.name==null?null:""+v.name;if(v.type==="hidden"&&s.getAttribute("name")===C)return s}else return s;if(s=Is(s.nextSibling),s===null)break}return null}function i5(s,r,c){if(r==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Is(s.nextSibling),s===null))return null;return s}function M1(s,r){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!r||(s=Is(s.nextSibling),s===null))return null;return s}function Mg(s){return s.data==="$?"||s.data==="$~"}function Og(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function c5(s,r){var c=s.ownerDocument;if(s.data==="$~")s._reactRetry=r;else if(s.data!=="$?"||c.readyState!=="loading")r();else{var p=function(){r(),c.removeEventListener("DOMContentLoaded",p)};c.addEventListener("DOMContentLoaded",p),s._reactRetry=p}}function Is(s){for(;s!=null;s=s.nextSibling){var r=s.nodeType;if(r===1||r===3)break;if(r===8){if(r=s.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return s}var zg=null;function O1(s){s=s.nextSibling;for(var r=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"||c==="/&"){if(r===0)return Is(s.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}s=s.nextSibling}return null}function z1(s){s=s.previousSibling;for(var r=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return s;r--}else c!=="/$"&&c!=="/&"||r++}s=s.previousSibling}return null}function D1(s,r,c){switch(r=pd(c),s){case"html":if(s=r.documentElement,!s)throw Error(o(452));return s;case"head":if(s=r.head,!s)throw Error(o(453));return s;case"body":if(s=r.body,!s)throw Error(o(454));return s;default:throw Error(o(451))}}function sc(s){for(var r=s.attributes;r.length;)s.removeAttributeNode(r[0]);Pp(s)}var Bs=new Map,P1=new Set;function md(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Va=F.d;F.d={f:u5,r:d5,D:f5,C:p5,L:m5,m:g5,X:x5,S:h5,M:b5};function u5(){var s=Va.f(),r=rd();return s||r}function d5(s){var r=el(s);r!==null&&r.tag===5&&r.type==="form"?Jy(r):Va.r(s)}var Ml=typeof document>"u"?null:document;function L1(s,r,c){var p=Ml;if(p&&typeof r=="string"&&r){var v=As(r);v='link[rel="'+s+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),P1.has(v)||(P1.add(v),s={rel:s,crossOrigin:c,href:r},p.querySelector(v)===null&&(r=p.createElement("link"),Un(r,"link",s),Tn(r),p.head.appendChild(r)))}}function f5(s){Va.D(s),L1("dns-prefetch",s,null)}function p5(s,r){Va.C(s,r),L1("preconnect",s,r)}function m5(s,r,c){Va.L(s,r,c);var p=Ml;if(p&&s&&r){var v='link[rel="preload"][as="'+As(r)+'"]';r==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+As(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+As(c.imageSizes)+'"]')):v+='[href="'+As(s)+'"]';var C=v;switch(r){case"style":C=Ol(s);break;case"script":C=zl(s)}Bs.has(C)||(s=b({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:s,as:r},c),Bs.set(C,s),p.querySelector(v)!==null||r==="style"&&p.querySelector(ac(C))||r==="script"&&p.querySelector(rc(C))||(r=p.createElement("link"),Un(r,"link",s),Tn(r),p.head.appendChild(r)))}}function g5(s,r){Va.m(s,r);var c=Ml;if(c&&s){var p=r&&typeof r.as=="string"?r.as:"script",v='link[rel="modulepreload"][as="'+As(p)+'"][href="'+As(s)+'"]',C=v;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=zl(s)}if(!Bs.has(C)&&(s=b({rel:"modulepreload",href:s},r),Bs.set(C,s),c.querySelector(v)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(rc(C)))return}p=c.createElement("link"),Un(p,"link",s),Tn(p),c.head.appendChild(p)}}}function h5(s,r,c){Va.S(s,r,c);var p=Ml;if(p&&s){var v=tl(p).hoistableStyles,C=Ol(s);r=r||"default";var z=v.get(C);if(!z){var q={loading:0,preload:null};if(z=p.querySelector(ac(C)))q.loading=5;else{s=b({rel:"stylesheet",href:s,"data-precedence":r},c),(c=Bs.get(C))&&Dg(s,c);var Z=z=p.createElement("link");Tn(Z),Un(Z,"link",s),Z._p=new Promise(function(de,ye){Z.onload=de,Z.onerror=ye}),Z.addEventListener("load",function(){q.loading|=1}),Z.addEventListener("error",function(){q.loading|=2}),q.loading|=4,gd(z,r,p)}z={type:"stylesheet",instance:z,count:1,state:q},v.set(C,z)}}}function x5(s,r){Va.X(s,r);var c=Ml;if(c&&s){var p=tl(c).hoistableScripts,v=zl(s),C=p.get(v);C||(C=c.querySelector(rc(v)),C||(s=b({src:s,async:!0},r),(r=Bs.get(v))&&Pg(s,r),C=c.createElement("script"),Tn(C),Un(C,"link",s),c.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},p.set(v,C))}}function b5(s,r){Va.M(s,r);var c=Ml;if(c&&s){var p=tl(c).hoistableScripts,v=zl(s),C=p.get(v);C||(C=c.querySelector(rc(v)),C||(s=b({src:s,async:!0,type:"module"},r),(r=Bs.get(v))&&Pg(s,r),C=c.createElement("script"),Tn(C),Un(C,"link",s),c.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},p.set(v,C))}}function I1(s,r,c,p){var v=(v=te.current)?md(v):null;if(!v)throw Error(o(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Ol(c.href),c=tl(v).hoistableStyles,p=c.get(r),p||(p={type:"style",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Ol(c.href);var C=tl(v).hoistableStyles,z=C.get(s);if(z||(v=v.ownerDocument||v,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(s,z),(C=v.querySelector(ac(s)))&&!C._p&&(z.instance=C,z.state.loading=5),Bs.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Bs.set(s,c),C||_5(v,s,c,z.state))),r&&p===null)throw Error(o(528,""));return z}if(r&&p!==null)throw Error(o(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=zl(c),c=tl(v).hoistableScripts,p=c.get(r),p||(p={type:"script",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,s))}}function Ol(s){return'href="'+As(s)+'"'}function ac(s){return'link[rel="stylesheet"]['+s+"]"}function B1(s){return b({},s,{"data-precedence":s.precedence,precedence:null})}function _5(s,r,c,p){s.querySelector('link[rel="preload"][as="style"]['+r+"]")?p.loading=1:(r=s.createElement("link"),p.preload=r,r.addEventListener("load",function(){return p.loading|=1}),r.addEventListener("error",function(){return p.loading|=2}),Un(r,"link",c),Tn(r),s.head.appendChild(r))}function zl(s){return'[src="'+As(s)+'"]'}function rc(s){return"script[async]"+s}function $1(s,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var p=s.querySelector('style[data-href~="'+As(c.href)+'"]');if(p)return r.instance=p,Tn(p),p;var v=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return p=(s.ownerDocument||s).createElement("style"),Tn(p),Un(p,"style",v),gd(p,c.precedence,s),r.instance=p;case"stylesheet":v=Ol(c.href);var C=s.querySelector(ac(v));if(C)return r.state.loading|=4,r.instance=C,Tn(C),C;p=B1(c),(v=Bs.get(v))&&Dg(p,v),C=(s.ownerDocument||s).createElement("link"),Tn(C);var z=C;return z._p=new Promise(function(q,Z){z.onload=q,z.onerror=Z}),Un(C,"link",p),r.state.loading|=4,gd(C,c.precedence,s),r.instance=C;case"script":return C=zl(c.src),(v=s.querySelector(rc(C)))?(r.instance=v,Tn(v),v):(p=c,(v=Bs.get(C))&&(p=b({},c),Pg(p,v)),s=s.ownerDocument||s,v=s.createElement("script"),Tn(v),Un(v,"link",p),s.head.appendChild(v),r.instance=v);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(p=r.instance,r.state.loading|=4,gd(p,c.precedence,s));return r.instance}function gd(s,r,c){for(var p=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=p.length?p[p.length-1]:null,C=v,z=0;z<p.length;z++){var q=p[z];if(q.dataset.precedence===r)C=q;else if(C!==v)break}C?C.parentNode.insertBefore(s,C.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(s,r.firstChild))}function Dg(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.title==null&&(s.title=r.title)}function Pg(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.integrity==null&&(s.integrity=r.integrity)}var hd=null;function U1(s,r,c){if(hd===null){var p=new Map,v=hd=new Map;v.set(c,p)}else v=hd,p=v.get(c),p||(p=new Map,v.set(c,p));if(p.has(s))return p;for(p.set(s,null),c=c.getElementsByTagName(s),v=0;v<c.length;v++){var C=c[v];if(!(C[yi]||C[Gt]||s==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var z=C.getAttribute(r)||"";z=s+z;var q=p.get(z);q?q.push(C):p.set(z,[C])}}return p}function H1(s,r,c){s=s.ownerDocument||s,s.head.insertBefore(c,r==="title"?s.querySelector("head > title"):null)}function v5(s,r,c){if(c===1||r.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return s=r.disabled,typeof r.precedence=="string"&&s==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function q1(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function y5(s,r,c,p){if(c.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Ol(p.href),C=r.querySelector(ac(v));if(C){r=C._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(s.count++,s=xd.bind(s),r.then(s,s)),c.state.loading|=4,c.instance=C,Tn(C);return}C=r.ownerDocument||r,p=B1(p),(v=Bs.get(v))&&Dg(p,v),C=C.createElement("link"),Tn(C);var z=C;z._p=new Promise(function(q,Z){z.onload=q,z.onerror=Z}),Un(C,"link",p),c.instance=C}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(c,r),(r=c.state.preload)&&(c.state.loading&3)===0&&(s.count++,c=xd.bind(s),r.addEventListener("load",c),r.addEventListener("error",c))}}var Lg=0;function j5(s,r){return s.stylesheets&&s.count===0&&_d(s,s.stylesheets),0<s.count||0<s.imgCount?function(c){var p=setTimeout(function(){if(s.stylesheets&&_d(s,s.stylesheets),s.unsuspend){var C=s.unsuspend;s.unsuspend=null,C()}},6e4+r);0<s.imgBytes&&Lg===0&&(Lg=62500*n5());var v=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&_d(s,s.stylesheets),s.unsuspend)){var C=s.unsuspend;s.unsuspend=null,C()}},(s.imgBytes>Lg?50:800)+r);return s.unsuspend=c,function(){s.unsuspend=null,clearTimeout(p),clearTimeout(v)}}:null}function xd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_d(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var bd=null;function _d(s,r){s.stylesheets=null,s.unsuspend!==null&&(s.count++,bd=new Map,r.forEach(k5,s),bd=null,xd.call(s))}function k5(s,r){if(!(r.state.loading&4)){var c=bd.get(s);if(c)var p=c.get(null);else{c=new Map,bd.set(s,c);for(var v=s.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<v.length;C++){var z=v[C];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(c.set(z.dataset.precedence,z),p=z)}p&&c.set(null,p)}v=r.instance,z=v.getAttribute("data-precedence"),C=c.get(z)||p,C===p&&c.set(null,v),c.set(z,v),this.count++,p=xd.bind(this),v.addEventListener("load",p),v.addEventListener("error",p),C?C.parentNode.insertBefore(v,C.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(v,s.firstChild)),r.state.loading|=4}}var oc={$$typeof:S,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function w5(s,r,c,p,v,C,z,q,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Es(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Es(0),this.hiddenUpdates=Es(null),this.identifierPrefix=p,this.onUncaughtError=v,this.onCaughtError=C,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function V1(s,r,c,p,v,C,z,q,Z,de,ye,Ne){return s=new w5(s,r,c,z,Z,de,ye,Ne,q),r=1,C===!0&&(r|=24),C=bs(3,null,null,r),s.current=C,C.stateNode=s,r=hm(),r.refCount++,s.pooledCache=r,r.refCount++,C.memoizedState={element:p,isDehydrated:c,cache:r},vm(C),s}function F1(s){return s?(s=dl,s):dl}function G1(s,r,c,p,v,C){v=F1(v),p.context===null?p.context=v:p.pendingContext=v,p=br(r),p.payload={element:c},C=C===void 0?null:C,C!==null&&(p.callback=C),c=_r(s,p,r),c!==null&&(ds(c,s,r),Ii(c,s,r))}function Y1(s,r){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<r?c:r}}function Ig(s,r){Y1(s,r),(s=s.alternate)&&Y1(s,r)}function K1(s){if(s.tag===13||s.tag===31){var r=lo(s,67108864);r!==null&&ds(r,s,67108864),Ig(s,67108864)}}function X1(s){if(s.tag===13||s.tag===31){var r=ks();r=dt(r);var c=lo(s,r);c!==null&&ds(c,s,r),Ig(s,r)}}var vd=!0;function S5(s,r,c,p){var v=U.T;U.T=null;var C=F.p;try{F.p=2,Bg(s,r,c,p)}finally{F.p=C,U.T=v}}function C5(s,r,c,p){var v=U.T;U.T=null;var C=F.p;try{F.p=8,Bg(s,r,c,p)}finally{F.p=C,U.T=v}}function Bg(s,r,c,p){if(vd){var v=$g(p);if(v===null)Sg(s,r,p,yd,c),W1(s,p);else if(E5(v,s,r,c,p))p.stopPropagation();else if(W1(s,p),r&4&&-1<N5.indexOf(s)){for(;v!==null;){var C=el(v);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var z=Wt(C.pendingLanes);if(z!==0){var q=C;for(q.pendingLanes|=2,q.entangledLanes|=2;z;){var Z=1<<31-Ie(z);q.entanglements[1]|=Z,z&=~Z}ua(C),(zt&6)===0&&(sd=me()+500,ec(0))}}break;case 31:case 13:q=lo(C,2),q!==null&&ds(q,C,2),rd(),Ig(C,2)}if(C=$g(p),C===null&&Sg(s,r,p,yd,c),C===v)break;v=C}v!==null&&p.stopPropagation()}else Sg(s,r,p,null,c)}}function $g(s){return s=Hp(s),Ug(s)}var yd=null;function Ug(s){if(yd=null,s=Jo(s),s!==null){var r=i(s);if(r===null)s=null;else{var c=r.tag;if(c===13){if(s=d(r),s!==null)return s;s=null}else if(c===31){if(s=f(r),s!==null)return s;s=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;s=null}else r!==s&&(s=null)}}return yd=s,null}function Q1(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Se()){case Ge:return 2;case Ae:return 8;case ze:case tt:return 32;case ot:return 268435456;default:return 32}default:return 32}}var Hg=!1,Tr=null,Ar=null,Mr=null,lc=new Map,ic=new Map,Or=[],N5="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".split(" ");function W1(s,r){switch(s){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":lc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(r.pointerId)}}function cc(s,r,c,p,v,C){return s===null||s.nativeEvent!==C?(s={blockedOn:r,domEventName:c,eventSystemFlags:p,nativeEvent:C,targetContainers:[v]},r!==null&&(r=el(r),r!==null&&K1(r)),s):(s.eventSystemFlags|=p,r=s.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),s)}function E5(s,r,c,p,v){switch(r){case"focusin":return Tr=cc(Tr,s,r,c,p,v),!0;case"dragenter":return Ar=cc(Ar,s,r,c,p,v),!0;case"mouseover":return Mr=cc(Mr,s,r,c,p,v),!0;case"pointerover":var C=v.pointerId;return lc.set(C,cc(lc.get(C)||null,s,r,c,p,v)),!0;case"gotpointercapture":return C=v.pointerId,ic.set(C,cc(ic.get(C)||null,s,r,c,p,v)),!0}return!1}function Z1(s){var r=Jo(s.target);if(r!==null){var c=i(r);if(c!==null){if(r=c.tag,r===13){if(r=d(c),r!==null){s.blockedOn=r,Rn(s.priority,function(){X1(c)});return}}else if(r===31){if(r=f(c),r!==null){s.blockedOn=r,Rn(s.priority,function(){X1(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function jd(s){if(s.blockedOn!==null)return!1;for(var r=s.targetContainers;0<r.length;){var c=$g(s.nativeEvent);if(c===null){c=s.nativeEvent;var p=new c.constructor(c.type,c);Up=p,c.target.dispatchEvent(p),Up=null}else return r=el(c),r!==null&&K1(r),s.blockedOn=c,!1;r.shift()}return!0}function J1(s,r,c){jd(s)&&c.delete(r)}function R5(){Hg=!1,Tr!==null&&jd(Tr)&&(Tr=null),Ar!==null&&jd(Ar)&&(Ar=null),Mr!==null&&jd(Mr)&&(Mr=null),lc.forEach(J1),ic.forEach(J1)}function kd(s,r){s.blockedOn===r&&(s.blockedOn=null,Hg||(Hg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R5)))}var wd=null;function ej(s){wd!==s&&(wd=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wd===s&&(wd=null);for(var r=0;r<s.length;r+=3){var c=s[r],p=s[r+1],v=s[r+2];if(typeof p!="function"){if(Ug(p||c)===null)continue;break}var C=el(c);C!==null&&(s.splice(r,3),r-=3,$m(C,{pending:!0,data:v,method:c.method,action:p},p,v))}}))}function Dl(s){function r(Z){return kd(Z,s)}Tr!==null&&kd(Tr,s),Ar!==null&&kd(Ar,s),Mr!==null&&kd(Mr,s),lc.forEach(r),ic.forEach(r);for(var c=0;c<Or.length;c++){var p=Or[c];p.blockedOn===s&&(p.blockedOn=null)}for(;0<Or.length&&(c=Or[0],c.blockedOn===null);)Z1(c),c.blockedOn===null&&Or.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(p=0;p<c.length;p+=3){var v=c[p],C=c[p+1],z=v[Ln]||null;if(typeof C=="function")z||ej(c);else if(z){var q=null;if(C&&C.hasAttribute("formAction")){if(v=C,z=C[Ln]||null)q=z.formAction;else if(Ug(v)!==null)continue}else q=z.action;typeof q=="function"?c[p+1]=q:(c.splice(p,3),p-=3),ej(c)}}}function tj(){function s(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(z){return v=z})},focusReset:"manual",scroll:"manual"})}function r(){v!==null&&(v(),v=null),p||setTimeout(c,20)}function c(){if(!p&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,v=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){p=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),v!==null&&(v(),v=null)}}}function qg(s){this._internalRoot=s}Sd.prototype.render=qg.prototype.render=function(s){var r=this._internalRoot;if(r===null)throw Error(o(409));var c=r.current,p=ks();G1(c,p,s,r,null,null)},Sd.prototype.unmount=qg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var r=s.containerInfo;G1(s.current,2,null,s,null,null),rd(),r[oa]=null}};function Sd(s){this._internalRoot=s}Sd.prototype.unstable_scheduleHydration=function(s){if(s){var r=hn();s={blockedOn:null,target:s,priority:r};for(var c=0;c<Or.length&&r!==0&&r<Or[c].priority;c++);Or.splice(c,0,s),c===0&&Z1(s)}};var nj=t.version;if(nj!=="19.2.8")throw Error(o(527,nj,"19.2.8"));F.findDOMNode=function(s){var r=s._reactInternals;if(r===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=h(r),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var T5={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cd.isDisabled&&Cd.supportsFiber)try{lt=Cd.inject(T5),Rt=Cd}catch{}}return dc.createRoot=function(s,r){if(!l(s))throw Error(o(299));var c=!1,p="",v=c0,C=u0,z=d0;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(C=r.onCaughtError),r.onRecoverableError!==void 0&&(z=r.onRecoverableError)),r=V1(s,1,!1,null,null,c,p,null,v,C,z,tj),s[oa]=r.current,wg(s),new qg(r)},dc.hydrateRoot=function(s,r,c){if(!l(s))throw Error(o(299));var p=!1,v="",C=c0,z=u0,q=d0,Z=null;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(C=c.onUncaughtError),c.onCaughtError!==void 0&&(z=c.onCaughtError),c.onRecoverableError!==void 0&&(q=c.onRecoverableError),c.formState!==void 0&&(Z=c.formState)),r=V1(s,1,!0,r,c??null,p,v,Z,C,z,q,tj),r.context=F1(null),c=r.current,p=ks(),p=dt(p),v=br(p),v.callback=null,_r(c,v,p),c=p,r.current.lanes=c,gn(r,c),ua(r),s[oa]=r.current,wg(s),new Sd(r)},dc.version="19.2.8",dc}var fj;function U5(){if(fj)return Gg.exports;fj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gg.exports=$5(),Gg.exports}var H5=U5();const q5=sb(H5);/**
|
|
50
|
-
* react-router v7.18.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var ab=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,x2=/^[\\/]{2}/;function V5(e,t){return t+e.replace(/\\/g,"/")}var pj="popstate";function mj(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function F5(e={}){function t(o,l){let i=l.state?.masked,{pathname:d,search:f,hash:m}=i||o.location;return px("",{pathname:d,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",i?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,l){return typeof l=="string"?l:$c(l)}return Y5(t,a,null,e)}function ln(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Vs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function G5(){return Math.random().toString(36).substring(2,10)}function gj(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function px(e,t,a=null,o,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?fi(t):t,state:a,key:t&&t.key||o||G5(),mask:l}}function $c({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function fi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function Y5(e,t,a,o={}){let{window:l=document.defaultView,v5Compat:i=!1}=o,d=l.history,f="POP",m=null,h=g();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function g(){return(d.state||{idx:null}).idx}function b(){f="POP";let w=g(),E=w==null?null:w-h;h=w,m&&m({action:f,location:y.location,delta:E})}function _(w,E){f="PUSH";let j=mj(w)?w:px(y.location,w,E);h=g()+1;let S=gj(j,h),R=y.createHref(j.mask||j);try{d.pushState(S,"",R)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;l.location.assign(R)}i&&m&&m({action:f,location:y.location,delta:1})}function k(w,E){f="REPLACE";let j=mj(w)?w:px(y.location,w,E);h=g();let S=gj(j,h),R=y.createHref(j.mask||j);d.replaceState(S,"",R),i&&m&&m({action:f,location:y.location,delta:0})}function N(w){return K5(l,w)}let y={get action(){return f},get location(){return e(l,d)},listen(w){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(pj,b),m=w,()=>{l.removeEventListener(pj,b),m=null}},createHref(w){return t(l,w)},createURL:N,encodeLocation(w){let E=N(w);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:_,replace:k,go(w){return d.go(w)}};return y}function K5(e,t,a=!1){let o="http://localhost";e&&(o=e.location.origin!=="null"?e.location.origin:e.location.href),ln(o,"No window.location.(origin|href) available to create URL");let l=typeof t=="string"?t:$c(t);return l=l.replace(/ $/,"%20"),!a&&x2.test(l)&&(l=o+l),new URL(l,o)}function b2(e,t,a="/"){return X5(e,t,a,!1)}function X5(e,t,a,o,l){let i=typeof t=="string"?fi(t):t,d=nr(i.pathname||"/",a);if(d==null)return null;let f=Q5(e),m=null,h=l3(d);for(let g=0;m==null&&g<f.length;++g)m=o3(f[g],h,o);return m}function Q5(e){let t=_2(e);return W5(t),t}function _2(e,t=[],a=[],o="",l=!1){let i=(d,f,m=l,h)=>{let g={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&m)return;ln(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let b=ea([o,g.relativePath]),_=a.concat(g);d.children&&d.children.length>0&&(ln(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),_2(d.children,t,_,b,m)),!(d.path==null&&!d.index)&&t.push({path:b,score:a3(b,d.index),routesMeta:_.map((k,N)=>{let[y,w]=j2(k.relativePath,k.caseSensitive,N===_.length-1);return{...k,matcher:y,compiledParams:w}})})};return e.forEach((d,f)=>{if(d.path===""||!d.path?.includes("?"))i(d,f);else for(let m of v2(d.path))i(d,f,!0,m)}),t}function v2(e){let t=e.split("/");if(t.length===0)return[];let[a,...o]=t,l=a.endsWith("?"),i=a.replace(/\?$/,"");if(o.length===0)return l?[i,""]:[i];let d=v2(o.join("/")),f=[];return f.push(...d.map(m=>m===""?i:[i,m].join("/"))),l&&f.push(...d),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function W5(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:r3(t.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var Z5=/^:[\w-]+$/,J5=3,e3=2,t3=1,n3=10,s3=-2,hj=e=>e==="*";function a3(e,t){let a=e.split("/"),o=a.length;return a.some(hj)&&(o+=s3),t&&(o+=e3),a.filter(l=>!hj(l)).reduce((l,i)=>l+(Z5.test(i)?J5:i===""?t3:n3),o)}function r3(e,t){return e.length===t.length&&e.slice(0,-1).every((o,l)=>o===t[l])?e[e.length-1]-t[t.length-1]:0}function o3(e,t,a=!1){let{routesMeta:o}=e,l={},i="/",d=[];for(let f=0;f<o.length;++f){let m=o[f],h=f===o.length-1,g=i==="/"?t:t.slice(i.length)||"/",b={path:m.relativePath,caseSensitive:m.caseSensitive,end:h},_=m.matcher&&m.compiledParams?y2(b,g,m.matcher,m.compiledParams):ff(b,g),k=m.route;if(!_&&h&&a&&!o[o.length-1].route.index&&(_=ff({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!_)return null;Object.assign(l,_.params),d.push({params:l,pathname:ea([i,_.pathname]),pathnameBase:u3(ea([i,_.pathnameBase])),route:k}),_.pathnameBase!=="/"&&(i=ea([i,_.pathnameBase]))}return d}function ff(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,o]=j2(e.path,e.caseSensitive,e.end);return y2(e,t,a,o)}function y2(e,t,a,o){let l=t.match(a);if(!l)return null;let i=l[0],d=i.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:o.reduce((h,{paramName:g,isOptional:b},_)=>{if(g==="*"){let N=f[_]||"";d=i.slice(0,i.length-N.length).replace(/(.)\/+$/,"$1")}const k=f[_];return b&&!k?h[g]=void 0:h[g]=(k||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:d,pattern:e}}function j2(e,t=!1,a=!0){Vs(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m,h,g)=>{if(o.push({paramName:f,isOptional:m!=null}),m){let b=g.charAt(h+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),o]}function l3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vs(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function nr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,o=e.charAt(a);return o&&o!=="/"?null:e.slice(a)||"/"}function i3(e,t="/"){let{pathname:a,search:o="",hash:l=""}=typeof e=="string"?fi(e):e,i;return a?(a=k2(a),a.startsWith("/")?i=xj(a.substring(1),"/"):i=xj(a,t)):i=t,{pathname:i,search:d3(o),hash:f3(l)}}function xj(e,t){let a=pf(t).split("/");return e.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function Qg(e,t,a,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function c3(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function rb(e){let t=c3(e);return t.map((a,o)=>o===t.length-1?a.pathname:a.pathnameBase)}function qf(e,t,a,o=!1){let l;typeof e=="string"?l=fi(e):(l={...e},ln(!l.pathname||!l.pathname.includes("?"),Qg("?","pathname","search",l)),ln(!l.pathname||!l.pathname.includes("#"),Qg("#","pathname","hash",l)),ln(!l.search||!l.search.includes("#"),Qg("#","search","hash",l)));let i=e===""||l.pathname==="",d=i?"/":l.pathname,f;if(d==null)f=a;else{let b=t.length-1;if(!o&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),b-=1;l.pathname=_.join("/")}f=b>=0?t[b]:"/"}let m=i3(l,f),h=d&&d!=="/"&&d.endsWith("/"),g=(i||d===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var k2=e=>e.replace(/[\\/]{2,}/g,"/"),ea=e=>k2(e.join("/")),pf=e=>e.replace(/\/+$/,""),u3=e=>pf(e).replace(/^\/*/,"/"),d3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,f3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,p3=class{constructor(e,t,a,o=!1){this.status=e,this.statusText=t||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function m3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function g3(e){let t=e.map(a=>a.route.path).filter(Boolean);return ea(t)||"/"}var w2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function S2(e,t){let a=e;if(typeof a!="string"||!ab.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,l=!1;if(w2)try{let i=new URL(window.location.href),d=x2.test(a)?new URL(V5(a,i.protocol)):new URL(a),f=nr(d.pathname,t);d.origin===i.origin&&f!=null?a=f+d.search+d.hash:l=!0}catch{Vs(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:l,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var C2=["POST","PUT","PATCH","DELETE"];new Set(C2);var h3=["GET",...C2];new Set(h3);var x3=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function b3(e){try{return x3.includes(new URL(e).protocol)}catch{return!1}}var pi=x.createContext(null);pi.displayName="DataRouter";var Vf=x.createContext(null);Vf.displayName="DataRouterState";var N2=x.createContext(!1);function _3(){return x.useContext(N2)}var E2=x.createContext({isTransitioning:!1});E2.displayName="ViewTransition";var v3=x.createContext(new Map);v3.displayName="Fetchers";var y3=x.createContext(null);y3.displayName="Await";var Ns=x.createContext(null);Ns.displayName="Navigation";var eu=x.createContext(null);eu.displayName="Location";var na=x.createContext({outlet:null,matches:[],isDataRoute:!1});na.displayName="Route";var ob=x.createContext(null);ob.displayName="RouteError";var R2="REACT_ROUTER_ERROR",j3="REDIRECT",k3="ROUTE_ERROR_RESPONSE";function w3(e){if(e.startsWith(`${R2}:${j3}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function S3(e){if(e.startsWith(`${R2}:${k3}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new p3(t.status,t.statusText,t.data)}catch{}}function C3(e,{relative:t}={}){ln(mi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=x.useContext(Ns),{hash:l,pathname:i,search:d}=tu(e,{relative:t}),f=i;return a!=="/"&&(f=i==="/"?a:ea([a,i])),o.createHref({pathname:f,search:d,hash:l})}function mi(){return x.useContext(eu)!=null}function ss(){return ln(mi(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(eu).location}var T2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function A2(e){x.useContext(Ns).static||x.useLayoutEffect(e)}function Pn(){let{isDataRoute:e}=x.useContext(na);return e?B3():N3()}function N3(){ln(mi(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(pi),{basename:t,navigator:a}=x.useContext(Ns),{matches:o}=x.useContext(na),{pathname:l}=ss(),i=JSON.stringify(rb(o)),d=x.useRef(!1);return A2(()=>{d.current=!0}),x.useCallback((m,h={})=>{if(Vs(d.current,T2),!d.current)return;if(typeof m=="number"){a.go(m);return}let g=qf(m,JSON.parse(i),l,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ea([t,g.pathname])),(h.replace?a.replace:a.push)(g,h.state,h)},[t,a,i,l,e])}x.createContext(null);function M2(){let{matches:e}=x.useContext(na);return e[e.length-1]?.params??{}}function tu(e,{relative:t}={}){let{matches:a}=x.useContext(na),{pathname:o}=ss(),l=JSON.stringify(rb(a));return x.useMemo(()=>qf(e,JSON.parse(l),o,t==="path"),[e,l,o,t])}function E3(e,t){return O2(e,t)}function O2(e,t,a){ln(mi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(Ns),{matches:l}=x.useContext(na),i=l[l.length-1],d=i?i.params:{},f=i?i.pathname:"/",m=i?i.pathnameBase:"/",h=i&&i.route;{let w=h&&h.path||"";D2(f,!h||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let g=ss(),b;if(t){let w=typeof t=="string"?fi(t):t;ln(m==="/"||w.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${w.pathname}" was given in the \`location\` prop.`),b=w}else b=g;let _=b.pathname||"/",k=_;if(m!=="/"){let w=m.replace(/^\//,"").split("/");k="/"+_.replace(/^\//,"").split("/").slice(w.length).join("/")}let N=a&&a.state.matches.length?a.state.matches.map(w=>Object.assign(w,{route:a.manifest[w.route.id]||w.route})):b2(e,{pathname:k});Vs(h||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Vs(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=O3(N&&N.map(w=>Object.assign({},w,{params:Object.assign({},d,w.params),pathname:ea([m,o.encodeLocation?o.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?m:ea([m,o.encodeLocation?o.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),l,a);return t&&y?x.createElement(eu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},y):y}function R3(){let e=I3(),t=m3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),a?x.createElement("pre",{style:l},a):null,d)}var T3=x.createElement(R3,null),z2=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=S3(e.digest);a&&(e=a)}let t=e!==void 0?x.createElement(na.Provider,{value:this.props.routeContext},x.createElement(ob.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(A3,{error:e},t):t}};z2.contextType=N2;var Wg=new WeakMap;function A3({children:e,error:t}){let{basename:a}=x.useContext(Ns);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=w3(t.digest);if(o){let l=Wg.get(t);if(l)throw l;let i=S2(o.location,a),d=i.absoluteURL||i.to;if(b3(d))throw new Error("Invalid redirect location");if(w2&&!Wg.get(t))if(i.isExternal||o.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Wg.set(t,f),f}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function M3({routeContext:e,match:t,children:a}){let o=x.useContext(pi);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(na.Provider,{value:e},a)}function O3(e,t=[],a){let o=a?.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(t.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let l=e,i=o?.errors;if(i!=null){let g=l.findIndex(b=>b.route.id&&i?.[b.route.id]!==void 0);ln(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let d=!1,f=-1;if(a&&o){d=o.renderFallback;for(let g=0;g<l.length;g++){let b=l[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=g),b.route.id){let{loaderData:_,errors:k}=o,N=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!k||k[b.route.id]===void 0);if(b.route.lazy||N){a.isStatic&&(d=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=a?.onError,h=o&&m?(g,b)=>{m(g,{location:o.location,params:o.matches?.[0]?.params??{},pattern:g3(o.matches),errorInfo:b})}:void 0;return l.reduceRight((g,b,_)=>{let k,N=!1,y=null,w=null;o&&(k=i&&b.route.id?i[b.route.id]:void 0,y=b.route.errorElement||T3,d&&(f<0&&_===0?(D2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,w=null):f===_&&(N=!0,w=b.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,_+1)),j=()=>{let S;return k?S=y:N?S=w:b.route.Component?S=x.createElement(b.route.Component,null):b.route.element?S=b.route.element:S=g,x.createElement(M3,{match:b,routeContext:{outlet:g,matches:E,isDataRoute:o!=null},children:S})};return o&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?x.createElement(z2,{location:o.location,revalidation:o.revalidation,component:y,error:k,children:j(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):j()},null)}function lb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function z3(e){let t=x.useContext(pi);return ln(t,lb(e)),t}function D3(e){let t=x.useContext(Vf);return ln(t,lb(e)),t}function P3(e){let t=x.useContext(na);return ln(t,lb(e)),t}function ib(e){let t=P3(e),a=t.matches[t.matches.length-1];return ln(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function L3(){return ib("useRouteId")}function I3(){let e=x.useContext(ob),t=D3("useRouteError"),a=ib("useRouteError");return e!==void 0?e:t.errors?.[a]}function B3(){let{router:e}=z3("useNavigate"),t=ib("useNavigate"),a=x.useRef(!1);return A2(()=>{a.current=!0}),x.useCallback(async(l,i={})=>{Vs(a.current,T2),a.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...i}))},[e,t])}var bj={};function D2(e,t,a){!t&&!bj[e]&&(bj[e]=!0,Vs(!1,a))}x.memo($3);function $3({routes:e,manifest:t,future:a,state:o,isStatic:l,onError:i}){return O2(e,void 0,{manifest:t,state:o,isStatic:l,onError:i})}function U3({to:e,replace:t,state:a,relative:o}){ln(mi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(Ns);Vs(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(na),{pathname:d}=ss(),f=Pn(),m=qf(e,rb(i),d,o==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:o})},[f,h,o,t,a]),null}function Dt(e){ln(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function H3({basename:e="/",children:t=null,location:a,navigationType:o="POP",navigator:l,static:i=!1,useTransitions:d}){ln(!mi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:i,useTransitions:d,future:{}}),[f,l,i,d]);typeof a=="string"&&(a=fi(a));let{pathname:h="/",search:g="",hash:b="",state:_=null,key:k="default",mask:N}=a,y=x.useMemo(()=>{let w=nr(h,f);return w==null?null:{location:{pathname:w,search:g,hash:b,state:_,key:k,mask:N},navigationType:o}},[f,h,g,b,_,k,o,N]);return Vs(y!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:x.createElement(Ns.Provider,{value:m},x.createElement(eu.Provider,{children:t,value:y}))}function P2({children:e,location:t}){return E3(mx(e),t)}function mx(e,t=[]){let a=[];return x.Children.forEach(e,(o,l)=>{if(!x.isValidElement(o))return;let i=[...t,l];if(o.type===x.Fragment){a.push.apply(a,mx(o.props.children,i));return}ln(o.type===Dt,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ln(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||i.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=mx(o.props.children,i)),a.push(d)}),a}var tf="get",nf="application/x-www-form-urlencoded";function Ff(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function q3(e){return Ff(e)&&e.tagName.toLowerCase()==="button"}function V3(e){return Ff(e)&&e.tagName.toLowerCase()==="form"}function F3(e){return Ff(e)&&e.tagName.toLowerCase()==="input"}function G3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y3(e,t){return e.button===0&&(!t||t==="_self")&&!G3(e)}function gx(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let o=e[a];return t.concat(Array.isArray(o)?o.map(l=>[a,l]):[[a,o]])},[]))}function K3(e,t){let a=gx(e);return t&&t.forEach((o,l)=>{a.has(l)||t.getAll(l).forEach(i=>{a.append(l,i)})}),a}var Nd=null;function X3(){if(Nd===null)try{new FormData(document.createElement("form"),0),Nd=!1}catch{Nd=!0}return Nd}var Q3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zg(e){return e!=null&&!Q3.has(e)?(Vs(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nf}"`),null):e}function W3(e,t){let a,o,l,i,d;if(V3(e)){let f=e.getAttribute("action");o=f?nr(f,t):null,a=e.getAttribute("method")||tf,l=Zg(e.getAttribute("enctype"))||nf,i=new FormData(e)}else if(q3(e)||F3(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(o=m?nr(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||tf,l=Zg(e.getAttribute("formenctype"))||Zg(f.getAttribute("enctype"))||nf,i=new FormData(f,e),!X3()){let{name:h,type:g,value:b}=e;if(g==="image"){let _=h?`${h}.`:"";i.append(`${_}x`,"0"),i.append(`${_}y`,"0")}else h&&i.append(h,b)}}else{if(Ff(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=tf,o=null,l=nf,d=e}return i&&l==="text/plain"&&(d=i,i=void 0),{action:o,method:a.toLowerCase(),encType:l,formData:i,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function L2(e,t,a,o){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${o}`:l.pathname=`${l.pathname}.${o}`:l.pathname==="/"?l.pathname=`_root.${o}`:t&&nr(l.pathname,t)==="/"?l.pathname=`${pf(t)}/_root.${o}`:l.pathname=`${pf(l.pathname)}.${o}`,l}async function Z3(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function J3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function eA(e,t,a){let o=await Promise.all(e.map(async l=>{let i=t.routes[l.route.id];if(i){let d=await Z3(i,a);return d.links?d.links():[]}return[]}));return aA(o.flat(1).filter(J3).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function _j(e,t,a,o,l,i){let d=(m,h)=>a[h]?m.route.id!==a[h].route.id:!0,f=(m,h)=>a[h].pathname!==m.pathname||a[h].route.path?.endsWith("*")&&a[h].params["*"]!==m.params["*"];return i==="assets"?t.filter((m,h)=>d(m,h)||f(m,h)):i==="data"?t.filter((m,h)=>{let g=o.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(d(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function tA(e,t,{includeHydrateFallback:a}={}){return nA(e.map(o=>{let l=t.routes[o.route.id];if(!l)return[];let i=[l.module];return l.clientActionModule&&(i=i.concat(l.clientActionModule)),l.clientLoaderModule&&(i=i.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(i=i.concat(l.hydrateFallbackModule)),l.imports&&(i=i.concat(l.imports)),i}).flat(1))}function nA(e){return[...new Set(e)]}function sA(e){let t={},a=Object.keys(e).sort();for(let o of a)t[o]=e[o];return t}function aA(e,t){let a=new Set;return new Set(t),e.reduce((o,l)=>{let i=JSON.stringify(sA(l));return a.has(i)||(a.add(i),o.push({key:i,link:l})),o},[])}function ub(){let e=x.useContext(pi);return cb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function rA(){let e=x.useContext(Vf);return cb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var db=x.createContext(void 0);db.displayName="FrameworkContext";function Gf(){let e=x.useContext(db);return cb(e,"You must render this element inside a <HydratedRouter> element"),e}function oA(e,t){let a=x.useContext(db),[o,l]=x.useState(!1),[i,d]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:b}=t,_=x.useRef(null);x.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let y=E=>{E.forEach(j=>{d(j.isIntersecting)})},w=new IntersectionObserver(y,{threshold:.5});return _.current&&w.observe(_.current),()=>{w.disconnect()}}},[e]),x.useEffect(()=>{if(o){let y=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(y)}}},[o]);let k=()=>{l(!0)},N=()=>{l(!1),d(!1)};return a?e!=="intent"?[i,_,{}]:[i,_,{onFocus:fc(f,k),onBlur:fc(m,N),onMouseEnter:fc(h,k),onMouseLeave:fc(g,N),onTouchStart:fc(b,k)}]:[!1,_,{}]}function fc(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function lA({page:e,...t}){let a=_3(),{nonce:o}=Gf(),{router:l}=ub(),i=x.useMemo(()=>b2(l.routes,e,l.basename),[l.routes,e,l.basename]);return i?(t.nonce==null&&o&&(t={...t,nonce:o}),a?x.createElement(cA,{page:e,matches:i,...t}):x.createElement(uA,{page:e,matches:i,...t})):null}function iA(e){let{manifest:t,routeModules:a}=Gf(),[o,l]=x.useState([]);return x.useEffect(()=>{let i=!1;return eA(e,t,a).then(d=>{i||l(d)}),()=>{i=!0}},[e,t,a]),o}function cA({page:e,matches:t,...a}){let o=ss(),{future:l}=Gf(),{basename:i}=ub(),d=x.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let f=L2(e,i,l.v8_trailingSlashAwareDataRequests,"rsc"),m=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?m=!0:h.push(g.route.id);return m&&h.length>0&&f.searchParams.set("_routes",h.join(",")),[f.pathname+f.search]},[i,l.v8_trailingSlashAwareDataRequests,e,o,t]);return x.createElement(x.Fragment,null,d.map(f=>x.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function uA({page:e,matches:t,...a}){let o=ss(),{future:l,manifest:i,routeModules:d}=Gf(),{basename:f}=ub(),{loaderData:m,matches:h}=rA(),g=x.useMemo(()=>_j(e,t,h,i,o,"data"),[e,t,h,i,o]),b=x.useMemo(()=>_j(e,t,h,i,o,"assets"),[e,t,h,i,o]),_=x.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let y=new Set,w=!1;if(t.forEach(j=>{let S=i.routes[j.route.id];!S||!S.hasLoader||(!g.some(R=>R.route.id===j.route.id)&&j.route.id in m&&d[j.route.id]?.shouldRevalidate||S.hasClientLoader?w=!0:y.add(j.route.id))}),y.size===0)return[];let E=L2(e,f,l.v8_trailingSlashAwareDataRequests,"data");return w&&y.size>0&&E.searchParams.set("_routes",t.filter(j=>y.has(j.route.id)).map(j=>j.route.id).join(",")),[E.pathname+E.search]},[f,l.v8_trailingSlashAwareDataRequests,m,o,i,g,t,e,d]),k=x.useMemo(()=>tA(b,i),[b,i]),N=iA(b);return x.createElement(x.Fragment,null,_.map(y=>x.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...a})),k.map(y=>x.createElement("link",{key:y,rel:"modulepreload",href:y,...a})),N.map(({key:y,link:w})=>x.createElement("link",{key:y,nonce:a.nonce,...w,crossOrigin:w.crossOrigin??a.crossOrigin})))}function dA(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var fA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fA&&(window.__reactRouterVersion="7.18.1")}catch{}function pA({basename:e,children:t,useTransitions:a,window:o}){let l=x.useRef();l.current==null&&(l.current=F5({window:o,v5Compat:!0}));let i=l.current,[d,f]=x.useState({action:i.action,location:i.location}),m=x.useCallback(h=>{a===!1?f(h):x.startTransition(()=>f(h))},[a]);return x.useLayoutEffect(()=>i.listen(m),[i,m]),x.createElement(H3,{basename:e,children:t,location:d.location,navigationType:d.action,navigator:i,useTransitions:a})}var Yf=x.forwardRef(function({onClick:t,discover:a="render",prefetch:o="none",relative:l,reloadDocument:i,replace:d,mask:f,state:m,target:h,to:g,preventScrollReset:b,viewTransition:_,defaultShouldRevalidate:k,...N},y){let{basename:w,navigator:E,useTransitions:j}=x.useContext(Ns),S=typeof g=="string"&&ab.test(g),R=S2(g,w);g=R.to;let A=C3(g,{relative:l}),T=ss(),O=null;if(f){let V=qf(f,[],T.mask?T.mask.pathname:"/",!0);w!=="/"&&(V.pathname=V.pathname==="/"?w:ea([w,V.pathname])),O=E.createHref(V)}let[M,B,P]=oA(o,N),$=hA(g,{replace:d,mask:f,state:m,target:h,preventScrollReset:b,relative:l,viewTransition:_,defaultShouldRevalidate:k,useTransitions:j});function D(V){t&&t(V),V.defaultPrevented||$(V)}let L=!(R.isExternal||i),H=x.createElement("a",{...N,...P,href:(L?O:void 0)||R.absoluteURL||A,onClick:L?D:t,ref:dA(y,B),target:h,"data-discover":!S&&a==="render"?"true":void 0});return M&&!S?x.createElement(x.Fragment,null,H,x.createElement(lA,{page:A})):H});Yf.displayName="Link";var mf=x.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:o="",end:l=!1,style:i,to:d,viewTransition:f,children:m,...h},g){let b=tu(d,{relative:h.relative}),_=ss(),k=x.useContext(Vf),{navigator:N,basename:y}=x.useContext(Ns),w=k!=null&&yA(b)&&f===!0,E=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,j=_.pathname,S=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;a||(j=j.toLowerCase(),S=S?S.toLowerCase():null,E=E.toLowerCase()),S&&y&&(S=nr(S,y)||S);const R=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let A=j===E||!l&&j.startsWith(E)&&j.charAt(R)==="/",T=S!=null&&(S===E||!l&&S.startsWith(E)&&S.charAt(E.length)==="/"),O={isActive:A,isPending:T,isTransitioning:w},M=A?t:void 0,B;typeof o=="function"?B=o(O):B=[o,A?"active":null,T?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let P=typeof i=="function"?i(O):i;return x.createElement(Yf,{...h,"aria-current":M,className:B,ref:g,style:P,to:d,viewTransition:f},typeof m=="function"?m(O):m)});mf.displayName="NavLink";var mA=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:o,replace:l,state:i,method:d=tf,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:_,...k},N)=>{let{useTransitions:y}=x.useContext(Ns),w=_A(),E=vA(f,{relative:h}),j=d.toLowerCase()==="get"?"get":"post",S=typeof f=="string"&&ab.test(f),R=A=>{if(m&&m(A),A.defaultPrevented)return;A.preventDefault();let T=A.nativeEvent.submitter,O=T?.getAttribute("formmethod")||d,M=()=>w(T||A.currentTarget,{fetcherKey:t,method:O,navigate:a,replace:l,state:i,relative:h,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:_});y&&a!==!1?x.startTransition(()=>M()):M()};return x.createElement("form",{ref:N,method:j,action:E,onSubmit:o?m:R,...k,"data-discover":!S&&e==="render"?"true":void 0})});mA.displayName="Form";function gA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I2(e){let t=x.useContext(pi);return ln(t,gA(e)),t}function hA(e,{target:t,replace:a,mask:o,state:l,preventScrollReset:i,relative:d,viewTransition:f,defaultShouldRevalidate:m,useTransitions:h}={}){let g=Pn(),b=ss(),_=tu(e,{relative:d});return x.useCallback(k=>{if(Y3(k,t)){k.preventDefault();let N=a!==void 0?a:$c(b)===$c(_),y=()=>g(e,{replace:N,mask:o,state:l,preventScrollReset:i,relative:d,viewTransition:f,defaultShouldRevalidate:m});h?x.startTransition(()=>y()):y()}},[b,g,_,a,o,l,t,e,i,d,f,m,h])}function Vo(e){Vs(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(gx(e)),a=x.useRef(!1),o=ss(),l=x.useMemo(()=>K3(o.search,a.current?null:t.current),[o.search]),i=Pn(),d=x.useCallback((f,m)=>{const h=gx(typeof f=="function"?f(new URLSearchParams(l)):f);a.current=!0,i("?"+h,m)},[i,l]);return[l,d]}var xA=0,bA=()=>`__${String(++xA)}__`;function _A(){let{router:e}=I2("useSubmit"),{basename:t}=x.useContext(Ns),a=L3(),o=e.fetch,l=e.navigate;return x.useCallback(async(i,d={})=>{let{action:f,method:m,encType:h,formData:g,body:b}=W3(i,t);if(d.navigate===!1){let _=d.fetcherKey||bA();await o(_,a,d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:b,formMethod:d.method||m,formEncType:d.encType||h,flushSync:d.flushSync})}else await l(d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:b,formMethod:d.method||m,formEncType:d.encType||h,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,l,t,a])}function vA(e,{relative:t}={}){let{basename:a}=x.useContext(Ns),o=x.useContext(na);ln(o,"useFormAction must be used inside a RouteContext");let[l]=o.matches.slice(-1),i={...tu(e||".",{relative:t})},d=ss();if(e==null){i.search=d.search;let f=new URLSearchParams(i.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(b=>b).forEach(b=>f.append("index",b));let g=f.toString();i.search=g?`?${g}`:""}}return(!e||e===".")&&l.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(i.pathname=i.pathname==="/"?a:ea([a,i.pathname])),$c(i)}function yA(e,{relative:t}={}){let a=x.useContext(E2);ln(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=I2("useViewTransitionState"),l=tu(e,{relative:t});if(!a.isTransitioning)return!1;let i=nr(a.currentLocation.pathname,o)||a.currentLocation.pathname,d=nr(a.nextLocation.pathname,o)||a.nextLocation.pathname;return ff(l.pathname,d)!=null||ff(l.pathname,i)!=null}var Fs=h2();/**
|
|
61
|
-
* @license lucide-react v0.469.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const jA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),B2=(...e)=>e.filter((t,a,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===a).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.469.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var kA={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"};/**
|
|
71
|
-
* @license lucide-react v0.469.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const wA=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...f},m)=>x.createElement("svg",{ref:m,...kA,width:t,height:t,stroke:e,strokeWidth:o?Number(a)*24/Number(t):a,className:B2("lucide",l),...f},[...d.map(([h,g])=>x.createElement(h,g)),...Array.isArray(i)?i:[i]]));/**
|
|
76
|
-
* @license lucide-react v0.469.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const be=(e,t)=>{const a=x.forwardRef(({className:o,...l},i)=>x.createElement(wA,{ref:i,iconNode:t,className:B2(`lucide-${jA(e)}`,o),...l}));return a.displayName=`${e}`,a};/**
|
|
81
|
-
* @license lucide-react v0.469.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const Kf=be("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"}]]);/**
|
|
86
|
-
* @license lucide-react v0.469.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const $2=be("ArrowDownLeft",[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]);/**
|
|
91
|
-
* @license lucide-react v0.469.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const SA=be("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
96
|
-
* @license lucide-react v0.469.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const U2=be("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
101
|
-
* @license lucide-react v0.469.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const H2=be("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
106
|
-
* @license lucide-react v0.469.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const CA=be("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
111
|
-
* @license lucide-react v0.469.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const NA=be("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
116
|
-
* @license lucide-react v0.469.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const EA=be("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"}]]);/**
|
|
121
|
-
* @license lucide-react v0.469.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const rn=be("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"}]]);/**
|
|
126
|
-
* @license lucide-react v0.469.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const RA=be("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"}]]);/**
|
|
131
|
-
* @license lucide-react v0.469.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const TA=be("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
136
|
-
* @license lucide-react v0.469.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const Uc=be("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"}]]);/**
|
|
141
|
-
* @license lucide-react v0.469.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const fb=be("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
146
|
-
* @license lucide-react v0.469.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const AA=be("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
151
|
-
* @license lucide-react v0.469.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const MA=be("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
|
|
156
|
-
* @license lucide-react v0.469.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const Gr=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
161
|
-
* @license lucide-react v0.469.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const ms=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
166
|
-
* @license lucide-react v0.469.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const OA=be("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
171
|
-
* @license lucide-react v0.469.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const Qr=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
176
|
-
* @license lucide-react v0.469.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const pb=be("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
181
|
-
* @license lucide-react v0.469.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const zA=be("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
186
|
-
* @license lucide-react v0.469.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const DA=be("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
191
|
-
* @license lucide-react v0.469.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const mb=be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
196
|
-
* @license lucide-react v0.469.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const PA=be("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
201
|
-
* @license lucide-react v0.469.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const LA=be("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"}]]);/**
|
|
206
|
-
* @license lucide-react v0.469.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const q2=be("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
211
|
-
* @license lucide-react v0.469.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const IA=be("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
216
|
-
* @license lucide-react v0.469.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const V2=be("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
221
|
-
* @license lucide-react v0.469.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const BA=be("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
226
|
-
* @license lucide-react v0.469.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const $A=be("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
231
|
-
* @license lucide-react v0.469.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const UA=be("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
236
|
-
* @license lucide-react v0.469.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const HA=be("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"}]]);/**
|
|
241
|
-
* @license lucide-react v0.469.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const Ao=be("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"}]]);/**
|
|
246
|
-
* @license lucide-react v0.469.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const qA=be("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
251
|
-
* @license lucide-react v0.469.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const VA=be("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
|
|
256
|
-
* @license lucide-react v0.469.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const gb=be("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"}]]);/**
|
|
261
|
-
* @license lucide-react v0.469.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const ba=be("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
266
|
-
* @license lucide-react v0.469.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const F2=be("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
271
|
-
* @license lucide-react v0.469.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const FA=be("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"}]]);/**
|
|
276
|
-
* @license lucide-react v0.469.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const GA=be("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
|
|
281
|
-
* @license lucide-react v0.469.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const hb=be("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"}]]);/**
|
|
286
|
-
* @license lucide-react v0.469.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const G2=be("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"}]]);/**
|
|
291
|
-
* @license lucide-react v0.469.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const nu=be("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"}]]);/**
|
|
296
|
-
* @license lucide-react v0.469.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const xb=be("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
301
|
-
* @license lucide-react v0.469.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const YA=be("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
306
|
-
* @license lucide-react v0.469.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const gf=be("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
|
|
311
|
-
* @license lucide-react v0.469.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const hx=be("FilePlus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]);/**
|
|
316
|
-
* @license lucide-react v0.469.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const KA=be("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
321
|
-
* @license lucide-react v0.469.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const XA=be("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
326
|
-
* @license lucide-react v0.469.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const Xf=be("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
331
|
-
* @license lucide-react v0.469.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const QA=be("FileX2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m8 12.5-5 5",key:"b853mi"}],["path",{d:"m3 12.5 5 5",key:"1qls4r"}]]);/**
|
|
336
|
-
* @license lucide-react v0.469.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const Y2=be("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
341
|
-
* @license lucide-react v0.469.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const xx=be("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
346
|
-
* @license lucide-react v0.469.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const WA=be("FolderGit2",[["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
|
|
351
|
-
* @license lucide-react v0.469.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const K2=be("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
|
|
356
|
-
* @license lucide-react v0.469.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const Fo=be("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"}]]);/**
|
|
361
|
-
* @license lucide-react v0.469.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const bb=be("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
|
|
366
|
-
* @license lucide-react v0.469.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const X2=be("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
371
|
-
* @license lucide-react v0.469.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const ZA=be("Folders",[["path",{d:"M20 17a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.9a2 2 0 0 1-1.69-.9l-.81-1.2a2 2 0 0 0-1.67-.9H8a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2Z",key:"4u7rpt"}],["path",{d:"M2 8v11a2 2 0 0 0 2 2h14",key:"1eicx1"}]]);/**
|
|
376
|
-
* @license lucide-react v0.469.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const JA=be("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
|
|
381
|
-
* @license lucide-react v0.469.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const Qf=be("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
386
|
-
* @license lucide-react v0.469.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const eM=be("Gem",[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]]);/**
|
|
391
|
-
* @license lucide-react v0.469.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const su=be("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
396
|
-
* @license lucide-react v0.469.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const tM=be("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
401
|
-
* @license lucide-react v0.469.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const Q2=be("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
406
|
-
* @license lucide-react v0.469.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const W2=be("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"}]]);/**
|
|
411
|
-
* @license lucide-react v0.469.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const nM=be("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
|
|
416
|
-
* @license lucide-react v0.469.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const sM=be("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
421
|
-
* @license lucide-react v0.469.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const Mo=be("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
|
|
426
|
-
* @license lucide-react v0.469.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const aM=be("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
431
|
-
* @license lucide-react v0.469.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const Z2=be("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
436
|
-
* @license lucide-react v0.469.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const bx=be("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
441
|
-
* @license lucide-react v0.469.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const J2=be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
446
|
-
* @license lucide-react v0.469.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const eS=be("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
451
|
-
* @license lucide-react v0.469.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const rM=be("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
|
|
456
|
-
* @license lucide-react v0.469.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const oM=be("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"}]]);/**
|
|
461
|
-
* @license lucide-react v0.469.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const lM=be("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
466
|
-
* @license lucide-react v0.469.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const iM=be("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
471
|
-
* @license lucide-react v0.469.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const cM=be("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
476
|
-
* @license lucide-react v0.469.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const Js=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
481
|
-
* @license lucide-react v0.469.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const tS=be("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
486
|
-
* @license lucide-react v0.469.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const uM=be("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
491
|
-
* @license lucide-react v0.469.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const nS=be("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["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"}]]);/**
|
|
496
|
-
* @license lucide-react v0.469.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const _b=be("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
501
|
-
* @license lucide-react v0.469.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const Wf=be("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
|
|
506
|
-
* @license lucide-react v0.469.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const vb=be("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
511
|
-
* @license lucide-react v0.469.0 - ISC
|
|
512
|
-
*
|
|
513
|
-
* This source code is licensed under the ISC license.
|
|
514
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
-
*/const dM=be("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
516
|
-
* @license lucide-react v0.469.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* This source code is licensed under the ISC license.
|
|
519
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
-
*/const fM=be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
521
|
-
* @license lucide-react v0.469.0 - ISC
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the ISC license.
|
|
524
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/const yb=be("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"}]]);/**
|
|
526
|
-
* @license lucide-react v0.469.0 - ISC
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the ISC license.
|
|
529
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/const pM=be("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
531
|
-
* @license lucide-react v0.469.0 - ISC
|
|
532
|
-
*
|
|
533
|
-
* This source code is licensed under the ISC license.
|
|
534
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const mM=be("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
536
|
-
* @license lucide-react v0.469.0 - ISC
|
|
537
|
-
*
|
|
538
|
-
* This source code is licensed under the ISC license.
|
|
539
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
540
|
-
*/const gM=be("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
541
|
-
* @license lucide-react v0.469.0 - ISC
|
|
542
|
-
*
|
|
543
|
-
* This source code is licensed under the ISC license.
|
|
544
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
545
|
-
*/const sS=be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
546
|
-
* @license lucide-react v0.469.0 - ISC
|
|
547
|
-
*
|
|
548
|
-
* This source code is licensed under the ISC license.
|
|
549
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
550
|
-
*/const hM=be("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
551
|
-
* @license lucide-react v0.469.0 - ISC
|
|
552
|
-
*
|
|
553
|
-
* This source code is licensed under the ISC license.
|
|
554
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
555
|
-
*/const xM=be("PencilLine",[["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"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]);/**
|
|
556
|
-
* @license lucide-react v0.469.0 - ISC
|
|
557
|
-
*
|
|
558
|
-
* This source code is licensed under the ISC license.
|
|
559
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
560
|
-
*/const ya=be("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
561
|
-
* @license lucide-react v0.469.0 - ISC
|
|
562
|
-
*
|
|
563
|
-
* This source code is licensed under the ISC license.
|
|
564
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
565
|
-
*/const jb=be("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
566
|
-
* @license lucide-react v0.469.0 - ISC
|
|
567
|
-
*
|
|
568
|
-
* This source code is licensed under the ISC license.
|
|
569
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
570
|
-
*/const bM=be("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"}]]);/**
|
|
571
|
-
* @license lucide-react v0.469.0 - ISC
|
|
572
|
-
*
|
|
573
|
-
* This source code is licensed under the ISC license.
|
|
574
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
575
|
-
*/const Pt=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
576
|
-
* @license lucide-react v0.469.0 - ISC
|
|
577
|
-
*
|
|
578
|
-
* This source code is licensed under the ISC license.
|
|
579
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
580
|
-
*/const Zf=be("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
581
|
-
* @license lucide-react v0.469.0 - ISC
|
|
582
|
-
*
|
|
583
|
-
* This source code is licensed under the ISC license.
|
|
584
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
585
|
-
*/const _M=be("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
|
|
586
|
-
* @license lucide-react v0.469.0 - ISC
|
|
587
|
-
*
|
|
588
|
-
* This source code is licensed under the ISC license.
|
|
589
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
590
|
-
*/const vM=be("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
591
|
-
* @license lucide-react v0.469.0 - ISC
|
|
592
|
-
*
|
|
593
|
-
* This source code is licensed under the ISC license.
|
|
594
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
595
|
-
*/const Ss=be("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"}]]);/**
|
|
596
|
-
* @license lucide-react v0.469.0 - ISC
|
|
597
|
-
*
|
|
598
|
-
* This source code is licensed under the ISC license.
|
|
599
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
600
|
-
*/const gi=be("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
601
|
-
* @license lucide-react v0.469.0 - ISC
|
|
602
|
-
*
|
|
603
|
-
* This source code is licensed under the ISC license.
|
|
604
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
605
|
-
*/const Jg=be("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
606
|
-
* @license lucide-react v0.469.0 - ISC
|
|
607
|
-
*
|
|
608
|
-
* This source code is licensed under the ISC license.
|
|
609
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
610
|
-
*/const eh=be("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
|
|
611
|
-
* @license lucide-react v0.469.0 - ISC
|
|
612
|
-
*
|
|
613
|
-
* This source code is licensed under the ISC license.
|
|
614
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
615
|
-
*/const Jf=be("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"}]]);/**
|
|
616
|
-
* @license lucide-react v0.469.0 - ISC
|
|
617
|
-
*
|
|
618
|
-
* This source code is licensed under the ISC license.
|
|
619
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
620
|
-
*/const kb=be("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["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"}]]);/**
|
|
621
|
-
* @license lucide-react v0.469.0 - ISC
|
|
622
|
-
*
|
|
623
|
-
* This source code is licensed under the ISC license.
|
|
624
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
625
|
-
*/const Fl=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
626
|
-
* @license lucide-react v0.469.0 - ISC
|
|
627
|
-
*
|
|
628
|
-
* This source code is licensed under the ISC license.
|
|
629
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
630
|
-
*/const ja=be("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
631
|
-
* @license lucide-react v0.469.0 - ISC
|
|
632
|
-
*
|
|
633
|
-
* This source code is licensed under the ISC license.
|
|
634
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
635
|
-
*/const aS=be("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"}]]);/**
|
|
636
|
-
* @license lucide-react v0.469.0 - ISC
|
|
637
|
-
*
|
|
638
|
-
* This source code is licensed under the ISC license.
|
|
639
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
640
|
-
*/const yM=be("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
641
|
-
* @license lucide-react v0.469.0 - ISC
|
|
642
|
-
*
|
|
643
|
-
* This source code is licensed under the ISC license.
|
|
644
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
645
|
-
*/const ep=be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
646
|
-
* @license lucide-react v0.469.0 - ISC
|
|
647
|
-
*
|
|
648
|
-
* This source code is licensed under the ISC license.
|
|
649
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
650
|
-
*/const jM=be("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
651
|
-
* @license lucide-react v0.469.0 - ISC
|
|
652
|
-
*
|
|
653
|
-
* This source code is licensed under the ISC license.
|
|
654
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
655
|
-
*/const kM=be("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
656
|
-
* @license lucide-react v0.469.0 - ISC
|
|
657
|
-
*
|
|
658
|
-
* This source code is licensed under the ISC license.
|
|
659
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
660
|
-
*/const wM=be("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
661
|
-
* @license lucide-react v0.469.0 - ISC
|
|
662
|
-
*
|
|
663
|
-
* This source code is licensed under the ISC license.
|
|
664
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
665
|
-
*/const sa=be("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"}]]);/**
|
|
666
|
-
* @license lucide-react v0.469.0 - ISC
|
|
667
|
-
*
|
|
668
|
-
* This source code is licensed under the ISC license.
|
|
669
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
670
|
-
*/const SM=be("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
671
|
-
* @license lucide-react v0.469.0 - ISC
|
|
672
|
-
*
|
|
673
|
-
* This source code is licensed under the ISC license.
|
|
674
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
675
|
-
*/const wb=be("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
676
|
-
* @license lucide-react v0.469.0 - ISC
|
|
677
|
-
*
|
|
678
|
-
* This source code is licensed under the ISC license.
|
|
679
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
680
|
-
*/const CM=be("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
681
|
-
* @license lucide-react v0.469.0 - ISC
|
|
682
|
-
*
|
|
683
|
-
* This source code is licensed under the ISC license.
|
|
684
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
685
|
-
*/const _a=be("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
686
|
-
* @license lucide-react v0.469.0 - ISC
|
|
687
|
-
*
|
|
688
|
-
* This source code is licensed under the ISC license.
|
|
689
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
690
|
-
*/const NM=be("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
691
|
-
* @license lucide-react v0.469.0 - ISC
|
|
692
|
-
*
|
|
693
|
-
* This source code is licensed under the ISC license.
|
|
694
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
695
|
-
*/const vn=be("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"}]]);/**
|
|
696
|
-
* @license lucide-react v0.469.0 - ISC
|
|
697
|
-
*
|
|
698
|
-
* This source code is licensed under the ISC license.
|
|
699
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
700
|
-
*/const rS=be("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"}]]);/**
|
|
701
|
-
* @license lucide-react v0.469.0 - ISC
|
|
702
|
-
*
|
|
703
|
-
* This source code is licensed under the ISC license.
|
|
704
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
705
|
-
*/const oS=be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
706
|
-
* @license lucide-react v0.469.0 - ISC
|
|
707
|
-
*
|
|
708
|
-
* This source code is licensed under the ISC license.
|
|
709
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
710
|
-
*/const Sb=be("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"}]]);/**
|
|
711
|
-
* @license lucide-react v0.469.0 - ISC
|
|
712
|
-
*
|
|
713
|
-
* This source code is licensed under the ISC license.
|
|
714
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
715
|
-
*/const EM=be("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
716
|
-
* @license lucide-react v0.469.0 - ISC
|
|
717
|
-
*
|
|
718
|
-
* This source code is licensed under the ISC license.
|
|
719
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
720
|
-
*/const RM=be("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
721
|
-
* @license lucide-react v0.469.0 - ISC
|
|
722
|
-
*
|
|
723
|
-
* This source code is licensed under the ISC license.
|
|
724
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
725
|
-
*/const TM=be("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
726
|
-
* @license lucide-react v0.469.0 - ISC
|
|
727
|
-
*
|
|
728
|
-
* This source code is licensed under the ISC license.
|
|
729
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
730
|
-
*/const aa=be("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"}]]);/**
|
|
731
|
-
* @license lucide-react v0.469.0 - ISC
|
|
732
|
-
*
|
|
733
|
-
* This source code is licensed under the ISC license.
|
|
734
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
735
|
-
*/const gs=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
736
|
-
* @license lucide-react v0.469.0 - ISC
|
|
737
|
-
*
|
|
738
|
-
* This source code is licensed under the ISC license.
|
|
739
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
740
|
-
*/const hi=be("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"}]]),tp={health:5e3,projects:15e3,telegramStatus:8e3,pairList:12e3},zn={theme:"apx.theme",token:"apx.token",sidebarCollapsed:"apx.sidebar.collapsed",language:"apx.lang",robyChat:"apx.roby.chat"},Cb=["total","automatico","permiso"],vj=["sky","violet","emerald","amber","rose","indigo","teal","fuchsia"],AM={icon:{light:"/logo/logo_only_white.webp",dark:"/logo/logo_only_dark.webp"},full:{light:"/logo/logo_white.webp",dark:"/logo/logo_dark.webp"},vertical:{light:"/logo/logo_vertical_white.webp",dark:"/logo/logo_vertical_dark.webp"}};function MM(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function th(e){return e==="system"?MM()?"dark":"light":e}function yj(){if(typeof window>"u")return"dark";const e=localStorage.getItem(zn.theme);return e==="light"||e==="dark"||e==="system"?e:"dark"}const lS=x.createContext(null);function OM({children:e}){const[t,a]=x.useState(yj),[o,l]=x.useState(()=>th(yj()));x.useEffect(()=>{const f=()=>{const m=th(t);l(m),document.documentElement.classList.toggle("dark",m==="dark")};f();try{localStorage.setItem(zn.theme,t)}catch{}if(t==="system"&&typeof window.matchMedia=="function"){const m=window.matchMedia("(prefers-color-scheme: dark)");return m.addEventListener("change",f),()=>m.removeEventListener("change",f)}},[t]);const i=x.useCallback(()=>{a(f=>th(f)==="dark"?"light":"dark")},[]),d=x.useMemo(()=>({theme:o,preference:t,toggle:i,set:a}),[o,t,i]);return n.jsx(lS.Provider,{value:d,children:e})}function Nb(){const e=x.useContext(lS);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const zM=1367/458,DM=735/1016;function PM({size:e=32,title:t="APX",variant:a="icon"}){const{theme:o}=Nb(),l=AM[a][o];if(a==="full"){const i=e,d=Math.round(e*zM);return n.jsx("img",{src:l,alt:t,width:d,height:i,className:"block object-contain",draggable:!1})}if(a==="vertical"){const i=e,d=Math.round(e/DM);return n.jsx("img",{src:l,alt:t,width:i,height:d,className:"block object-contain",draggable:!1})}return n.jsx("img",{src:l,alt:t,width:e,height:e,className:"block object-contain",draggable:!1})}function iS(e){var t,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(a=iS(e[t]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function Hc(){for(var e,t,a=0,o="",l=arguments.length;a<l;a++)(e=arguments[a])&&(t=iS(e))&&(o&&(o+=" "),o+=t);return o}const Eb="-",LM=e=>{const t=BM(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{const f=d.split(Eb);return f[0]===""&&f.length!==1&&f.shift(),cS(f,t)||IM(d)},getConflictingClassGroupIds:(d,f)=>{const m=a[d]||[];return f&&o[d]?[...m,...o[d]]:m}}},cS=(e,t)=>{if(e.length===0)return t.classGroupId;const a=e[0],o=t.nextPart.get(a),l=o?cS(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;const i=e.join(Eb);return t.validators.find(({validator:d})=>d(i))?.classGroupId},jj=/^\[(.+)\]$/,IM=e=>{if(jj.test(e)){const t=jj.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},BM=e=>{const{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return UM(Object.entries(e.classGroups),a).forEach(([i,d])=>{_x(d,o,i,t)}),o},_x=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){const i=l===""?t:kj(t,l);i.classGroupId=a;return}if(typeof l=="function"){if($M(l)){_x(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([i,d])=>{_x(d,kj(t,i),a,o)})})},kj=(e,t)=>{let a=e;return t.split(Eb).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},$M=e=>e.isThemeGetter,UM=(e,t)=>t?e.map(([a,o])=>{const l=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,f])=>[t+d,f])):i);return[a,l]}):e,HM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map;const l=(i,d)=>{a.set(i,d),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let d=a.get(i);if(d!==void 0)return d;if((d=o.get(i))!==void 0)return l(i,d),d},set(i,d){a.has(i)?a.set(i,d):l(i,d)}}},uS="!",qM=e=>{const{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],i=t.length,d=f=>{const m=[];let h=0,g=0,b;for(let w=0;w<f.length;w++){let E=f[w];if(h===0){if(E===l&&(o||f.slice(w,w+i)===t)){m.push(f.slice(g,w)),g=w+i;continue}if(E==="/"){b=w;continue}}E==="["?h++:E==="]"&&h--}const _=m.length===0?f:f.substring(g),k=_.startsWith(uS),N=k?_.substring(1):_,y=b&&b>g?b-g:void 0;return{modifiers:m,hasImportantModifier:k,baseClassName:N,maybePostfixModifierPosition:y}};return a?f=>a({className:f,parseClassName:d}):d},VM=e=>{if(e.length<=1)return e;const t=[];let a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},FM=e=>({cache:HM(e.cacheSize),parseClassName:qM(e),...LM(e)}),GM=/\s+/,YM=(e,t)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,i=[],d=e.trim().split(GM);let f="";for(let m=d.length-1;m>=0;m-=1){const h=d[m],{modifiers:g,hasImportantModifier:b,baseClassName:_,maybePostfixModifierPosition:k}=a(h);let N=!!k,y=o(N?_.substring(0,k):_);if(!y){if(!N){f=h+(f.length>0?" "+f:f);continue}if(y=o(_),!y){f=h+(f.length>0?" "+f:f);continue}N=!1}const w=VM(g).join(":"),E=b?w+uS:w,j=E+y;if(i.includes(j))continue;i.push(j);const S=l(y,N);for(let R=0;R<S.length;++R){const A=S[R];i.push(E+A)}f=h+(f.length>0?" "+f:f)}return f};function KM(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=dS(t))&&(o&&(o+=" "),o+=a);return o}const dS=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=dS(e[o]))&&(a&&(a+=" "),a+=t);return a};function XM(e,...t){let a,o,l,i=d;function d(m){const h=t.reduce((g,b)=>b(g),e());return a=FM(h),o=a.cache.get,l=a.cache.set,i=f,f(m)}function f(m){const h=o(m);if(h)return h;const g=YM(m,a);return l(m,g),g}return function(){return i(KM.apply(null,arguments))}}const sn=e=>{const t=a=>a[e]||[];return t.isThemeGetter=!0,t},fS=/^\[(?:([a-z-]+):)?(.+)\]$/i,QM=/^\d+\/\d+$/,WM=new Set(["px","full","screen"]),ZM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JM=/\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$/,e4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,t4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fa=e=>Gl(e)||WM.has(e)||QM.test(e),Dr=e=>xi(e,"length",u4),Gl=e=>!!e&&!Number.isNaN(Number(e)),nh=e=>xi(e,"number",Gl),pc=e=>!!e&&Number.isInteger(Number(e)),s4=e=>e.endsWith("%")&&Gl(e.slice(0,-1)),ht=e=>fS.test(e),Pr=e=>ZM.test(e),a4=new Set(["length","size","percentage"]),r4=e=>xi(e,a4,pS),o4=e=>xi(e,"position",pS),l4=new Set(["image","url"]),i4=e=>xi(e,l4,f4),c4=e=>xi(e,"",d4),mc=()=>!0,xi=(e,t,a)=>{const o=fS.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},u4=e=>JM.test(e)&&!e4.test(e),pS=()=>!1,d4=e=>t4.test(e),f4=e=>n4.test(e),p4=()=>{const e=sn("colors"),t=sn("spacing"),a=sn("blur"),o=sn("brightness"),l=sn("borderColor"),i=sn("borderRadius"),d=sn("borderSpacing"),f=sn("borderWidth"),m=sn("contrast"),h=sn("grayscale"),g=sn("hueRotate"),b=sn("invert"),_=sn("gap"),k=sn("gradientColorStops"),N=sn("gradientColorStopPositions"),y=sn("inset"),w=sn("margin"),E=sn("opacity"),j=sn("padding"),S=sn("saturate"),R=sn("scale"),A=sn("sepia"),T=sn("skew"),O=sn("space"),M=sn("translate"),B=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ht,t],D=()=>[ht,t],L=()=>["",Fa,Dr],H=()=>["auto",Gl,ht],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",ht],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[Gl,ht];return{cacheSize:500,separator:":",theme:{colors:[mc],spacing:[Fa,Dr],blur:["none","",Pr,ht],brightness:I(),borderColor:[e],borderRadius:["none","","full",Pr,ht],borderSpacing:D(),borderWidth:L(),contrast:I(),grayscale:G(),hueRotate:I(),invert:G(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[s4,Dr],inset:$(),margin:$(),opacity:I(),padding:D(),saturate:I(),scale:I(),sepia:G(),skew:I(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",ht]}],container:["container"],columns:[{columns:[Pr]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...V(),ht]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pc,ht]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ht]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",pc,ht]}],"grid-cols":[{"grid-cols":[mc]}],"col-start-end":[{col:["auto",{span:["full",pc,ht]},ht]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[mc]}],"row-start-end":[{row:["auto",{span:[pc,ht]},ht]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ht]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ht,t]}],"min-w":[{"min-w":[ht,t,"min","max","fit"]}],"max-w":[{"max-w":[ht,t,"none","full","min","max","fit","prose",{screen:[Pr]},Pr]}],h:[{h:[ht,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ht,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ht,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ht,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pr,Dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",nh]}],"font-family":[{font:[mc]}],"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",ht]}],"line-clamp":[{"line-clamp":["none",Gl,nh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fa,ht]}],"list-image":[{"list-image":["none",ht]}],"list-style-type":[{list:["none","disc","decimal",ht]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fa,Dr]}],"underline-offset":[{"underline-offset":["auto",Fa,ht]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht]}],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",ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),o4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},i4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[f]}],"border-w-x":[{"border-x":[f]}],"border-w-y":[{"border-y":[f]}],"border-w-s":[{"border-s":[f]}],"border-w-e":[{"border-e":[f]}],"border-w-t":[{"border-t":[f]}],"border-w-r":[{"border-r":[f]}],"border-w-b":[{"border-b":[f]}],"border-w-l":[{"border-l":[f]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[f]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[f]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:U()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Fa,ht]}],"outline-w":[{outline:[Fa,Dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Fa,Dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pr,c4]}],"shadow-color":[{shadow:[mc]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",Pr,ht]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[b]}],saturate:[{saturate:[S]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ht]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",ht]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[pc,ht]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ht]}],accent:[{accent:["auto",e]}],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",ht]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",ht]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fa,Dr,nh]}],stroke:[{stroke:[e,"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"]}}},mS=XM(p4);function ge(...e){return mS(Hc(e))}const wj={};function ns(e,t){const a=x.useRef(wj);return a.current===wj&&(a.current=e(t)),a}const vx=[];let yx;function m4(){return yx}function g4(e){vx.push(e)}function Rb(e){const t=(a,o)=>{const l=ns(h4).current;let i;try{yx=l;for(const d of vx)d.before(l);i=e(a,o);for(const d of vx)d.after(l);l.didInitialize=!0}finally{yx=void 0}return i};return t.displayName=e.displayName||e.name,t}function gS(e){return x.forwardRef(Rb(e))}function h4(){return{didInitialize:!1}}const x4=()=>{},De=typeof document<"u"?x.useLayoutEffect:x4;function b4(e,t){return function(o,...l){const i=new URL(e);return i.searchParams.set("code",o.toString()),l.forEach(d=>i.searchParams.append("args[]",d)),`${t} error #${o}; visit ${i} for the full message.`}}const cn=b4("https://base-ui.com/production-error","Base UI"),hS=x.createContext(void 0);function au(e){const t=x.useContext(hS);if(t===void 0&&!e)throw new Error(cn(72));return t}const _4=[];function Tb(e){x.useEffect(e,_4)}const gc=0;class ta{static create(){return new ta}currentId=gc;start(t,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=gc,a()},t)}isStarted(){return this.currentId!==gc}clear=()=>{this.currentId!==gc&&(clearTimeout(this.currentId),this.currentId=gc)};disposeEffect=()=>this.clear}function En(){const e=ns(ta.create).current;return Tb(e.disposeEffect),e}function v4(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:y4,platform:j4,maxTouchPoints:k4}=v4(),np=y4.toLowerCase(),qc=j4.toLowerCase(),sp=/^i(os$|p)/.test(qc)||qc==="macintel"&&k4>1,Sj="android",jx=qc===Sj||np.includes(Sj),Ab=!sp&&qc.startsWith("mac");qc.startsWith("win");const w4=Ab||sp,Wr=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Wr&&np.includes("firefox");!Wr&&np.includes("chrom");const S4=w4,Mb=/jsdom|happydom/.test(np);function fa(e){e.preventDefault(),e.stopPropagation()}function C4(e){return"nativeEvent"in e}function Ob(e){return e.pointerType===""&&e.isTrusted?!0:jx&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xS(e){return Mb?!1:!jx&&e.width===0&&e.height===0||jx&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Oo(e,t){const a=["mouse","pen"];return t||a.push("",void 0),a.includes(e)}function N4(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function ap(){return typeof window<"u"}function Vn(e){return zb(e)?(e.nodeName||"").toLowerCase():"#document"}function Qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cr(e){var t;return(t=(zb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zb(e){return ap()?e instanceof Node||e instanceof Qt(e).Node:!1}function _t(e){return ap()?e instanceof Element||e instanceof Qt(e).Element:!1}function Kt(e){return ap()?e instanceof HTMLElement||e instanceof Qt(e).HTMLElement:!1}function ti(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qt(e).ShadowRoot}function Go(e){const{overflow:t,overflowX:a,overflowY:o,display:l}=Cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+a)&&l!=="inline"&&l!=="contents"}function E4(e){return/^(table|td|th)$/.test(Vn(e))}function rp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const R4=/transform|translate|scale|rotate|perspective|filter/,T4=/paint|layout|strict|content/,yo=e=>!!e&&e!=="none";let sh;function Db(e){const t=_t(e)?Cs(e):e;return yo(t.transform)||yo(t.translate)||yo(t.scale)||yo(t.rotate)||yo(t.perspective)||!Pb()&&(yo(t.backdropFilter)||yo(t.filter))||R4.test(t.willChange||"")||T4.test(t.contain||"")}function A4(e){let t=sr(e);for(;Kt(t)&&!Ja(t);){if(Db(t))return t;if(rp(t))return null;t=sr(t)}return null}function Pb(){return sh==null&&(sh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),sh}function Ja(e){return/^(html|body|#document)$/.test(Vn(e))}function Cs(e){return Qt(e).getComputedStyle(e)}function op(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sr(e){if(Vn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ti(e)&&e.host||cr(e);return ti(t)?t.host:t}function bS(e){const t=sr(e);return Ja(t)?(e.ownerDocument||e).body:Kt(t)&&Go(t)?t:bS(t)}function Vc(e,t,a){var o;t===void 0&&(t=[]),a===void 0&&(a=!0);const l=bS(e),i=l===((o=e.ownerDocument)==null?void 0:o.body),d=Qt(l);if(i){const f=kx(d);return t.concat(d,d.visualViewport||[],Go(l)?l:[],f&&a?Vc(f):[])}else return t.concat(l,Vc(l,[],a))}function kx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const wx="data-base-ui-focusable",_S="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",lp="ArrowLeft",ip="ArrowRight",vS="ArrowUp",Lb="ArrowDown";function Yn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function We(e,t){if(!e||!t)return!1;const a=t.getRootNode?.();if(e.contains(t))return!0;if(a&&ti(a)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function qn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function hf(e,t){if(!_t(e))return!1;const a=e;if(t.hasElement(a))return!a.hasAttribute("data-trigger-disabled");for(const[,o]of t.entries())if(We(o,a))return!o.hasAttribute("data-trigger-disabled");return!1}function ah(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const a=e;return a.target!=null&&t.contains(a.target)}function M4(e){return e.matches("html,body")}function cp(e){return Kt(e)&&e.matches(_S)}function O4(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${_S}`)!=null}function Sx(e){return e?e.getAttribute("role")==="combobox"&&cp(e):!1}function z4(e){if(!e||Mb)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function xf(e){return e?e.hasAttribute(wx)?e:e.querySelector(`[${wx}]`)||e:null}function D4(e,t){return t!=null&&!Oo(t)?0:typeof e=="function"?e():e}function ni(e,t,a){const o=D4(e,a);return typeof o=="number"?o:o?.[t]}function Cj(e){return typeof e=="function"?e():e}function yS(e,t){return t||e==="click"||e==="mousedown"}function P4(e){return e?.includes("mouse")&&e!=="mousedown"}function Mn(){}const ar=Object.freeze([]),Xt=Object.freeze({}),va="none",bi="trigger-press",On="trigger-hover",Yl="trigger-focus",up="outside-press",Kl="item-press",L4="close-press",zo="focus-out",dp="escape-key",Cx="list-navigation",jS="cancel-open",wc="sibling-open",kS="disabled",Nj="missing",Ej="initial",Ib="imperative-action",I4="window-resize";function st(e,t,a,o){let l=!1,i=!1;const d=o??Xt;return{reason:e,event:t??new Event("base-ui"),cancel(){l=!0},allowPropagation(){i=!0},get isCanceled(){return l},get isPropagationAllowed(){return i},trigger:a,...d}}const wS=x.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ta,currentIdRef:{current:null},currentContextRef:{current:null}});function B4(e,t){e.current=t.current}function $4(e){const{children:t,delay:a,timeoutMs:o=0}=e,l=x.useRef(a),i=x.useRef(a),d=x.useRef(null),f=x.useRef(null),m=En();return De(()=>{if(i.current=a,!d.current){l.current=a;return}l.current={open:ni(l.current,"open"),close:ni(a,"close")}},[a,d,l,i]),n.jsx(wS.Provider,{value:x.useMemo(()=>({hasProvider:!0,delayRef:l,initialDelayRef:i,currentIdRef:d,timeoutMs:o,currentContextRef:f,timeout:m}),[o,m]),children:t})}function U4(e,t={open:!1}){const{open:a}=t,o="rootStore"in e?e.rootStore:e,l=o.useState("floatingId"),i=x.useContext(wS),{currentIdRef:d,delayRef:f,timeoutMs:m,initialDelayRef:h,currentContextRef:g,hasProvider:b,timeout:_}=i,[k,N]=x.useState(!1),y=x.useRef(a),w=x.useRef(!1);return De(()=>{y.current=a},[a]),De(()=>()=>{w.current=!0},[]),De(()=>{function E(){w.current||N(!1),g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,f.current=h.current,_.clear()}if(d.current&&!a&&d.current===l){if(N(!1),m){const j=l;return _.start(m,()=>{o.select("open")||d.current&&d.current!==j||E()}),()=>{(y.current||d.current!==j)&&_.clear()}}E()}},[a,l,d,f,m,h,g,_,o]),De(()=>{if(!a)return;const E=g.current,j=d.current;_.clear(),g.current={onOpenChange:o.setOpen,setIsInstantPhase:N},d.current=l,f.current={open:0,close:ni(h.current,"close")},j!==null&&j!==l?(N(!0),E?.setIsInstantPhase(!0),E?.onOpenChange(!1,st(va))):(N(!1),E?.setIsInstantPhase(!1))},[a,l,o,d,f,h,g,_]),De(()=>()=>{if(d.current===l){if(g.current=null,!y.current)return;d.current=null,B4(f,h),_.clear()}},[g,d,f,l,h,_]),x.useMemo(()=>({hasProvider:b,delayRef:f,isInstantPhase:k}),[b,f,k])}function bt(e,t,a,o){return e.addEventListener(t,a,o),()=>{e.removeEventListener(t,a,o)}}function xa(...e){return()=>{for(let t=0;t<e.length;t+=1){const a=e[t];a&&a()}}}function rr(e,t,a,o){const l=ns(SS).current;return q4(l,e,t,a,o)&&CS(l,[e,t,a,o]),l.callback}function H4(e){const t=ns(SS).current;return V4(t,e)&&CS(t,e),t.callback}function SS(){return{callback:null,cleanup:null,refs:[]}}function q4(e,t,a,o,l){return e.refs[0]!==t||e.refs[1]!==a||e.refs[2]!==o||e.refs[3]!==l}function V4(e,t){return e.refs.length!==t.length||e.refs.some((a,o)=>a!==t[o])}function CS(e,t){if(e.refs=t,t.every(a=>a==null)){e.callback=null;return}e.callback=a=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),a!=null){const o=Array(t.length).fill(null);for(let l=0;l<t.length;l+=1){const i=t[l];if(i!=null)switch(typeof i){case"function":{const d=i(a);typeof d=="function"&&(o[l]=d);break}case"object":{i.current=a;break}}}e.cleanup=()=>{for(let l=0;l<t.length;l+=1){const i=t[l];if(i!=null)switch(typeof i){case"function":{const d=o[l];typeof d=="function"?d():i(null);break}case"object":{i.current=null;break}}}}}}}function pn(e){const t=ns(F4,e).current;return t.next=e,De(t.effect),t}function F4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Bb={...P5},rh=Bb.useInsertionEffect,G4=rh&&rh!==Bb.useLayoutEffect?rh:e=>e();function Ue(e){const t=ns(Y4).current;return t.next=e,G4(t.effect),t.trampoline}function Y4(){const e={next:void 0,callback:K4,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function K4(){}const Ed=null;class X4{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const a=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let l=0;l<a.length;l+=1)a[l]?.(t)};request(t){const a=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(t){const a=t-this.startId;a<0||a>=this.callbacks.length||(this.callbacks[a]=null,this.callbacksCount-=1)}}const Rd=new X4;class ma{static create(){return new ma}static request(t){return Rd.request(t)}static cancel(t){return Rd.cancel(t)}currentId=Ed;request(t){this.cancel(),this.currentId=Rd.request(()=>{this.currentId=Ed,t()})}cancel=()=>{this.currentId!==Ed&&(Rd.cancel(this.currentId),this.currentId=Ed)};disposeEffect=()=>this.cancel}function si(){const e=ns(ma.create).current;return Tb(e.disposeEffect),e}function xt(e){return e?.ownerDocument||document}const NS={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$b={...NS,position:"fixed",top:0,left:0},ES={...NS,position:"absolute"},ai=x.forwardRef(function(t,a){const[o,l]=x.useState();De(()=>{S4&&Wr&&l("button")},[]);const i={tabIndex:0,role:o};return n.jsx("span",{...t,ref:a,style:$b,"aria-hidden":o?void 0:!0,...i,"data-base-ui-focus-guard":""})}),Q4=["top","right","bottom","left"],ri=Math.min,er=Math.max,bf=Math.round,Td=Math.floor,tr=e=>({x:e,y:e}),W4={left:"right",right:"left",bottom:"top",top:"bottom"};function RS(e,t,a){return er(e,ri(t,a))}function or(e,t){return typeof e=="function"?e(t):e}function ws(e){return e.split("-")[0]}function Zr(e){return e.split("-")[1]}function Ub(e){return e==="x"?"y":"x"}function Hb(e){return e==="y"?"height":"width"}function qs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qb(e){return Ub(qs(e))}function Z4(e,t,a){a===void 0&&(a=!1);const o=Zr(e),l=qb(e),i=Hb(l);let d=l==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(d=_f(d)),[d,_f(d)]}function J4(e){const t=_f(e);return[Nx(e),t,Nx(t)]}function Nx(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Rj=["left","right"],Tj=["right","left"],eO=["top","bottom"],tO=["bottom","top"];function nO(e,t,a){switch(e){case"top":case"bottom":return a?t?Tj:Rj:t?Rj:Tj;case"left":case"right":return t?eO:tO;default:return[]}}function sO(e,t,a,o){const l=Zr(e);let i=nO(ws(e),a==="start",o);return l&&(i=i.map(d=>d+"-"+l),t&&(i=i.concat(i.map(Nx)))),i}function _f(e){const t=ws(e);return W4[t]+e.slice(t.length)}function aO(e){var t,a,o,l;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(o=e.bottom)!=null?o:0,left:(l=e.left)!=null?l:0}}function TS(e){return typeof e!="number"?aO(e):{top:e,right:e,bottom:e,left:e}}function Fc(e){const{x:t,y:a,width:o,height:l}=e;return{width:o,height:l,top:a,left:t,right:t+o,bottom:a+l,x:t,y:a}}function Oc(e,t){return t<0||t>=e.length}function sf(e,t){return Qa(e.current,{disabledIndices:t})}function Ex(e,t){return Qa(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Qa(e,{startingIndex:t=-1,decrement:a=!1,disabledIndices:o,amount:l=1}={}){let i=t;do i+=a?-l:l;while(i>=0&&i<=e.length-1&&vf(e,i,o));return i}function vf(e,t,a){if(typeof a=="function"?a(t):a?.includes(t)??!1)return!0;const l=e[t];return l?fp(l)?!a&&(l.hasAttribute("disabled")||l.getAttribute("aria-disabled")==="true"):!0:!1}function rO(e){return e.visibility==="hidden"||e.visibility==="collapse"}function fp(e,t=e?Cs(e):null){return!e||!e.isConnected||!t||rO(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const oO='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function lO(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const a=e.getRootNode();return ti(a)?a.host:null}function Rx(e){for(const t of Array.from(e.children))if(Vn(t)==="summary")return t;return null}function iO(e,t){const a=Rx(t);return!!a&&(e===a||We(a,e))}function AS(e){const t=e?Vn(e):"";return e!=null&&e.matches(oO)&&(t!=="summary"||e.parentElement!=null&&Vn(e.parentElement)==="details"&&Rx(e.parentElement)===e)&&(t!=="details"||Rx(e)==null)&&(t!=="input"||e.type!=="hidden")}function MS(e){if(!AS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=lO(t)){const a=t!==e,o=Vn(t)==="slot";if(t.hasAttribute("inert")||a&&Vn(t)==="details"&&!t.open&&!iO(e,t)||t.hasAttribute("hidden")||!o&&!cO(t,a))return!1}return!0}function cO(e,t){const a=Cs(e);return t?a.display!=="none":fp(e,a)}function OS(e){const t=e.tabIndex;if(t<0){const a=Vn(e);if(a==="details"||a==="audio"||a==="video"||Kt(e)&&e.isContentEditable)return 0}return t}function oh(e){if(Vn(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function uO(e,t){const a=oh(e);if(!a)return!0;const o=t.find(l=>{const i=oh(l);return i?.name===a.name&&i.form===a.form&&i.checked});return o?o===a:t.find(l=>{const i=oh(l);return i?.name===a.name&&i.form===a.form})===a}function zS(e){if(Kt(e)&&Vn(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Kt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function DS(e,t){zS(e).forEach(a=>{AS(a)&&t.push(a),DS(a,t)})}function PS(e,t,a){zS(e).forEach(o=>{Kt(o)&&o.matches(t)&&a.push(o),PS(o,t,a)})}function Vb(e){return MS(e)&&OS(e)>=0}function LS(e){const t=[];return DS(e,t),t.filter(MS)}function ru(e){const t=LS(e);return t.filter(a=>OS(a)>=0&&uO(a,t))}function IS(e,t){const a=ru(e),o=a.length;if(o===0)return;const l=Yn(xt(e)),i=a.indexOf(l),d=i===-1?t===1?0:o-1:i+t;return a[d]}function Fb(e){return IS(xt(e).body,1)||e}function BS(e){return IS(xt(e).body,-1)||e}function $S(e,t){if(!e)return null;const a=ru(xt(e).body),o=a.length;if(o===0)return null;const l=a.indexOf(e);if(l===-1)return null;const i=(l+t+o)%o;return a[i]}function dO(e){return $S(e,1)}function fO(e){return $S(e,-1)}function Xl(e,t){const a=t||e.currentTarget,o=e.relatedTarget;return!o||!We(a,o)}function pO(e){ru(e).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function Aj(e){const t=[];PS(e,"[data-tabindex]",t),t.forEach(a=>{const o=a.dataset.tabindex;delete a.dataset.tabindex,o?a.setAttribute("tabindex",o):a.removeAttribute("tabindex")})}function Yr(e,t,a=!0){return e.filter(l=>l.parentId===t).flatMap(l=>[...!a||l.context?.open?[l]:[],...Yr(e,l.id,a)])}function Mj(e,t){let a=[],o=e.find(l=>l.id===t)?.parentId;for(;o;){const l=e.find(i=>i.id===o);o=l?.parentId,l&&(a=a.concat(l))}return a}function Gc(e){return`data-base-ui-${e}`}let Ad=0;function af(e,t={}){const{preventScroll:a=!1,sync:o=!1,shouldFocus:l}=t;cancelAnimationFrame(Ad);function i(){l&&!l()||e?.focus({preventScroll:a})}if(o)return i(),Mn;const d=requestAnimationFrame(i);return Ad=d,()=>{Ad===d&&(cancelAnimationFrame(d),Ad=0)}}const lh={inert:new WeakMap,"aria-hidden":new WeakMap},Oj="data-base-ui-inert",Tx={inert:new WeakSet,"aria-hidden":new WeakSet};let hc=new WeakMap,ih=0;function mO(e){return Tx[e]}function US(e){return e?ti(e)?e.host:US(e.parentNode):null}const zj=(e,t)=>t.map(a=>{if(e.contains(a))return a;const o=US(a);return e.contains(o)?o:null}).filter(a=>a!=null),Dj=e=>{const t=new Set;return e.forEach(a=>{let o=a;for(;o&&!t.has(o);)t.add(o),o=o.parentNode}),t},Pj=(e,t,a)=>{const o=[],l=i=>{!i||a.has(i)||Array.from(i.children).forEach(d=>{Vn(d)!=="script"&&(t.has(d)?l(d):o.push(d))})};return l(e),o};function gO(e,t,a,o,{mark:l=!0}){let i=null;o?i="inert":a&&(i="aria-hidden");let d=null,f=null;const m=zj(t,e),h=l?Pj(t,Dj(m),new Set(m)):[],g=[],b=[];if(i){const _=lh[i],k=mO(i);f=k,d=_;const N=zj(t,Array.from(t.querySelectorAll("[aria-live]"))),y=m.concat(N);Pj(t,Dj(y),new Set(y)).forEach(E=>{const j=E.getAttribute(i),S=j!==null&&j!=="false",R=(_.get(E)||0)+1;_.set(E,R),g.push(E),R===1&&S&&k.add(E),S||E.setAttribute(i,i==="inert"?"":"true")})}return l&&h.forEach(_=>{const k=(hc.get(_)||0)+1;hc.set(_,k),b.push(_),k===1&&_.setAttribute(Oj,"")}),ih+=1,()=>{d&&g.forEach(_=>{const N=(d.get(_)||0)-1;d.set(_,N),N||(!f?.has(_)&&i&&_.removeAttribute(i),f?.delete(_))}),l&&b.forEach(_=>{const k=(hc.get(_)||0)-1;hc.set(_,k),k||_.removeAttribute(Oj)}),ih-=1,ih||(lh.inert=new WeakMap,lh["aria-hidden"]=new WeakMap,Tx.inert=new WeakSet,Tx["aria-hidden"]=new WeakSet,hc=new WeakMap)}}function Lj(e,t={}){const{ariaHidden:a=!1,inert:o=!1,mark:l=!0}=t,i=xt(e[0]).body;return gO(e,i,a,o,{mark:l})}let Ij=0;function hO(e,t="mui"){const[a,o]=x.useState(e),l=e||a;return x.useEffect(()=>{a==null&&(Ij+=1,o(`${t}-${Ij}`))},[a,t]),l}const Bj=Bb.useId;function Do(e,t){if(Bj!==void 0){const a=Bj();return e??(t?`${t}-${a}`:a)}return hO(e,t)}const xO=parseInt(x.version,10);function Gb(e){return xO>=e}function $j(e){if(!x.isValidElement(e))return null;const t=e,a=t.props;return(Gb(19)?a?.ref:t.ref)??null}function Ax(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function bO(e,t){const a={};for(const o in e){const l=e[o];if(t?.hasOwnProperty(o)){const i=t[o](l);i!=null&&Object.assign(a,i);continue}l===!0?a[`data-${o.toLowerCase()}`]="":l&&(a[`data-${o.toLowerCase()}`]=l.toString())}return a}function _O(e,t){return typeof e=="function"?e(t):e}function vO(e,t){return typeof e=="function"?e(t):e}const Yb={};function Qn(e,t,a,o,l){if(!a&&!o&&!l&&!e)return yf(t);let i=yf(e);return t&&(i=Sc(i,t)),a&&(i=Sc(i,a)),o&&(i=Sc(i,o)),l&&(i=Sc(i,l)),i}function yO(e){if(e.length===0)return Yb;if(e.length===1)return yf(e[0]);let t=yf(e[0]);for(let a=1;a<e.length;a+=1)t=Sc(t,e[a]);return t}function yf(e){return Kb(e)?{...qS(e,Yb)}:jO(e)}function Sc(e,t){return Kb(t)?qS(t,e):kO(e,t)}function jO(e){const t={...e};for(const a in t){const o=t[a];HS(a,o)&&(t[a]=VS(o))}return t}function kO(e,t){if(!t)return e;for(const a in t){const o=t[a];switch(a){case"style":{e[a]=Ax(e.style,o);break}case"className":{e[a]=FS(e.className,o);break}default:HS(a,o)?e[a]=wO(e[a],o):e[a]=o}}return e}function HS(e,t){const a=e.charCodeAt(0),o=e.charCodeAt(1),l=e.charCodeAt(2);return a===111&&o===110&&l>=65&&l<=90&&(typeof t=="function"||typeof t>"u")}function Kb(e){return typeof e=="function"}function qS(e,t){return Kb(e)?e(t):e??Yb}function wO(e,t){return t?e?(...a)=>{const o=a[0];if(GS(o)){const i=o;jf(i);const d=t(...a);return i.baseUIHandlerPrevented||e?.(...a),d}const l=t(...a);return e?.(...a),l}:VS(t):e}function VS(e){return e&&((...t)=>{const a=t[0];return GS(a)&&jf(a),e(...t)})}function jf(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function FS(e,t){return t?e?t+" "+e:t:e}function GS(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Et(e,t,a={}){const o=t.render,l=SO(t,a);if(a.enabled===!1)return null;const i=a.state??Xt;return EO(e,o,l,i)}function SO(e,t={}){const{className:a,style:o,render:l}=e,{state:i=Xt,ref:d,props:f,stateAttributesMapping:m,enabled:h=!0}=t,g=h?_O(a,i):void 0,b=h?vO(o,i):void 0,_=h?bO(i,m):Xt,k=h&&f?CO(f):void 0,N=h?Ax(_,k)??{}:Xt;return typeof document<"u"&&(h?Array.isArray(d)?N.ref=H4([N.ref,$j(l),...d]):N.ref=rr(N.ref,$j(l),d):rr(null,null)),h?(g!==void 0&&(N.className=FS(N.className,g)),b!==void 0&&(N.style=Ax(N.style,b)),N):Xt}function CO(e){return Array.isArray(e)?yO(e):Qn(void 0,e)}const NO=Symbol.for("react.lazy");function EO(e,t,a,o){if(t){if(typeof t=="function")return t(a,o);const l=Qn(a,t.props);l.ref=a.ref;let i=t;return i?.$$typeof===NO&&(i=x.Children.toArray(t)[0]),x.cloneElement(i,l)}if(e&&typeof e=="string")return RO(e,a);throw new Error(cn(8))}function RO(e,t){return e==="button"?x.createElement("button",{type:"button",...t,key:t.key}):e==="img"?x.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const TO=500,AO=500,MO={style:{transition:"none"}},OO="data-base-ui-click-trigger",YS={fallbackAxisSide:"none"},KS={fallbackAxisSide:"end"},zO={clipPath:"inset(50%)",position:"fixed",top:0,left:0},XS=x.createContext(null),QS=()=>x.useContext(XS),DO=Gc("portal");function WS(e={}){const{ref:t,container:a,componentProps:o=Xt,elementProps:l}=e,i=Do(),f=QS()?.portalNode,[m,h]=x.useState(null),[g,b]=x.useState(null),_=Ue(w=>{w!==null&&b(w)}),k=x.useRef(null);De(()=>{if(a===null){k.current&&(k.current=null,b(null),h(null));return}if(i==null)return;const w=(a&&(zb(a)?a:a.current))??f??document.body;if(w==null){k.current&&(k.current=null,b(null),h(null));return}k.current!==w&&(k.current=w,b(null),h(w))},[a,f,i]);const N=Et("div",o,{ref:[t,_],props:[{id:i,[DO]:""},l]});return{portalNode:g,portalSubtree:m&&N?Fs.createPortal(N,m):null}}const Xb=x.forwardRef(function(t,a){const{render:o,className:l,style:i,children:d,container:f,renderGuards:m,...h}=t,{portalNode:g,portalSubtree:b}=WS({container:f,ref:a,componentProps:t,elementProps:h}),_=x.useRef(null),k=x.useRef(null),N=x.useRef(null),y=x.useRef(null),[w,E]=x.useState(null),j=x.useRef(!1),S=w?.modal,R=w?.open,A=typeof m=="boolean"?m:!!w&&!w.modal&&w.open&&!!g;x.useEffect(()=>{if(!g||S)return;function O(M){g&&M.relatedTarget&&Xl(M)&&(M.type==="focusin"?j.current&&(Aj(g),j.current=!1):(pO(g),j.current=!0))}return xa(bt(g,"focusin",O,!0),bt(g,"focusout",O,!0))},[g,S]),De(()=>{!g||R!==!0||!j.current||(Aj(g),j.current=!1)},[R,g]);const T=x.useMemo(()=>({beforeOutsideRef:_,afterOutsideRef:k,beforeInsideRef:N,afterInsideRef:y,portalNode:g,setFocusManagerState:E}),[g]);return n.jsxs(x.Fragment,{children:[b,n.jsxs(XS.Provider,{value:T,children:[A&&g&&n.jsx(ai,{"data-type":"outside",ref:_,onFocus:O=>{if(Xl(O,g))N.current?.focus();else{const M=w?w.domReference:null;BS(M)?.focus()}}}),A&&g&&n.jsx("span",{"aria-owns":g.id,style:zO}),g&&Fs.createPortal(d,g),A&&g&&n.jsx(ai,{"data-type":"outside",ref:k,onFocus:O=>{if(Xl(O,g))y.current?.focus();else{const M=w?w.domReference:null;Fb(M)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,st(zo,O.nativeEvent))}}})]})]})});function ZS(){const e=new Map;return{emit(t,a){e.get(t)?.forEach(o=>o(a))},on(t,a){e.has(t)||e.set(t,new Set),e.get(t).add(a)},off(t,a){e.get(t)?.delete(a)}}}class Qb{nodesRef={current:[]};events=ZS();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const a=this.nodesRef.current.findIndex(o=>o===t);a!==-1&&this.nodesRef.current.splice(a,1)}}const JS=x.createContext(null),eC=x.createContext(null),Jr=()=>x.useContext(JS)?.id||null,eo=e=>{const t=x.useContext(eC);return e??t};function tC(e){const t=Do(),a=eo(e),o=Jr();return De(()=>{if(!t)return;const l={id:t,parentId:o};return a?.addNode(l),()=>{a?.removeNode(l)}},[a,t,o]),t}function PO(e){const{children:t,id:a}=e,o=Jr();return n.jsx(JS.Provider,{value:x.useMemo(()=>({id:a,parentId:o}),[a,o]),children:t})}function LO(e){const{children:t,externalTree:a}=e,o=ns(()=>a??new Qb).current;return n.jsx(eC.Provider,{value:o,children:t})}function Ka(e){return e==null?e:"current"in e?e.current:e}function IO(e,t){const a=Qt(qn(e));return e instanceof a.KeyboardEvent?"keyboard":e instanceof a.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof a.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Uj=20;let Ur=[];function Wb(){Ur=Ur.filter(e=>e.deref()?.isConnected)}function Hj(e){Wb(),e&&Vn(e)!=="body"&&(Ur.push(new WeakRef(e)),Ur.length>Uj&&(Ur=Ur.slice(-Uj)))}function qj(){return Wb(),Ur[Ur.length-1]?.deref()}function BO(e){return e?Vb(e)?e:ru(e)[0]||e:null}function Vj(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const a=LS(e).filter(l=>{const i=l.getAttribute("data-tabindex")||"";return Vb(l)||l.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=e.getAttribute("tabindex");a.length===0?o!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Zb(e){const{context:t,children:a,disabled:o=!1,initialFocus:l=!0,returnFocus:i=!0,restoreFocus:d=!1,modal:f=!0,closeOnFocusOut:m=!0,openInteractionType:h="",nextFocusableElement:g,previousFocusableElement:b,beforeContentFocusGuardRef:_,externalTree:k,getInsideElements:N}=e,y="rootStore"in t?t.rootStore:t,w=y.useState("open"),E=y.useState("domReferenceElement"),j=y.useState("floatingElement"),{events:S,dataRef:R}=y.context,A=Ue(()=>R.current.floatingContext?.nodeId),T=l===!1,O=Sx(E)&&T,M=pn(l),B=pn(i),P=pn(h),$=pn(w),D=eo(k),L=QS(),H=x.useRef(!1),V=x.useRef(!1),U=x.useRef(!1),F=x.useRef(null),X=x.useRef(""),G=x.useRef(""),Y=x.useRef(null),I=x.useRef(null),Q=rr(Y,_,L?.beforeInsideRef),J=rr(I,L?.afterInsideRef),K=En(),se=En(),te=si(),le=L!=null,W=xf(j),ne=Ue((fe=W)=>fe?ru(fe):[]),ve=Ue(()=>N?.().filter(fe=>fe!=null)??[]);x.useEffect(()=>{if(o||!f)return;function fe(Ce){Ce.key==="Tab"&&We(W,Yn(xt(W)))&&ne().length===0&&!O&&fa(Ce)}const we=xt(W);return bt(we,"keydown",fe)},[o,W,f,O,ne]),x.useEffect(()=>{if(o||!w)return;const fe=xt(W);function we(){U.current=!1}function Ce($e){const Ee=qn($e),_e=ve(),xe=We(j,Ee)||We(E,Ee)||We(L?.portalNode,Ee)||_e.some(Re=>Re===Ee||We(Re,Ee));U.current=!xe,G.current=$e.pointerType||"keyboard",Ee?.closest(`[${OO}]`)&&(V.current=!0,se.start(0,()=>{V.current=!1}))}function Le(){G.current="keyboard"}return xa(bt(fe,"pointerdown",Ce,!0),bt(fe,"pointerup",we,!0),bt(fe,"pointercancel",we,!0),bt(fe,"keydown",Le,!0),we)},[o,j,E,W,w,L,se,ve]),x.useEffect(()=>{if(o||!m)return;const fe=xt(W);function we(){V.current=!0,se.start(0,()=>{V.current=!1})}function Ce(_e){const xe=qn(_e);Vb(xe)&&(F.current=xe)}function Le(_e){const xe=_e.relatedTarget,Re=_e.currentTarget,Oe=qn(_e);f&&xe==null&&Oe!=null&&We(j,Oe)&&Hj(Oe),queueMicrotask(()=>{const Pe=A(),Be=y.context.triggerElements,me=ve(),Se=xe?.hasAttribute(Gc("focus-guard"))&&[Y.current,I.current,L?.beforeInsideRef.current,L?.afterInsideRef.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,Ka(b),Ka(g)].includes(xe),Ge=!(We(E,xe)||We(j,xe)||We(xe,j)||We(L?.portalNode,xe)||me.some(Ae=>Ae===xe||We(Ae,xe))||xe!=null&&Be.hasElement(xe)||Be.hasMatchingElement(Ae=>We(Ae,xe))||Se||D&&(Yr(D.nodesRef.current,Pe).find(Ae=>We(Ae.context?.elements.floating,xe)||We(Ae.context?.elements.domReference,xe))||Mj(D.nodesRef.current,Pe).find(Ae=>[Ae.context?.elements.floating,xf(Ae.context?.elements.floating)].includes(xe)||Ae.context?.elements.domReference===xe)));if(Re===E&&W&&Vj(W),d&&Re!==E&&!fp(Oe)&&Yn(fe)===fe.body){if(Kt(W)&&(W.focus(),d==="popup")){te.request(()=>{W.focus()});return}const Ae=ne(),ze=F.current,tt=(ze&&Ae.includes(ze)?ze:null)||Ae[Ae.length-1]||W;Kt(tt)&&tt.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(O||!f)&&xe&&Ge&&!V.current&&(O||xe!==qj())&&(H.current=!0,y.setOpen(!1,st(zo,_e)))})}function $e(){U.current||(R.current.insideReactTree=!0,K.start(0,()=>{R.current.insideReactTree=!1}))}const Ee=Kt(E)?E:null;if(!(!j&&!Ee))return xa(Ee&&bt(Ee,"focusout",Le),Ee&&bt(Ee,"pointerdown",we),j&&bt(j,"focusin",Ce),j&&bt(j,"focusout",Le),j&&L&&bt(j,"focusout",$e,!0))},[o,E,j,W,f,D,L,y,m,d,ne,O,A,R,K,se,te,g,b,ve]),x.useEffect(()=>{if(o||!j||!w)return;const fe=Array.from(L?.portalNode?.querySelectorAll(`[${Gc("portal")}]`)||[]),Ce=(D?Mj(D.nodesRef.current,A()):[]).find(Re=>Sx(Re.context?.elements.domReference||null))?.context?.elements.domReference,$e=[...[j,...fe,Y.current,I.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,...ve()],Ce,Ka(b),Ka(g),O?E:null].filter(Re=>Re!=null),Ee=Lj($e,{ariaHidden:f||O,mark:!1}),_e=[j,...fe].filter(Re=>Re!=null),xe=Lj(_e);return()=>{xe(),Ee()}},[w,o,E,j,f,L,O,D,A,g,b,ve]),De(()=>{if(!w||o||!Kt(W))return;const fe=xt(W),we=Yn(fe);queueMicrotask(()=>{const Ce=M.current,Le=typeof Ce=="function"?Ce(P.current||""):Ce;if(Le===void 0||Le===!1||We(W,we))return;let Ee=null;const _e=()=>(Ee==null&&(Ee=ne(W)),Ee[0]||W);let xe;Le===!0||Le===null?xe=_e():xe=Ka(Le),xe=xe||_e();const Re=We(W,Yn(fe));af(xe,{preventScroll:xe===W,shouldFocus(){if(!$.current)return!1;if(Re)return!0;const Oe=Yn(fe);return!(Oe!==xe&&We(W,Oe))}})})},[o,w,W,ne,M,P,$]),De(()=>{if(o||!W)return;const fe=xt(W),we=Yn(fe),Ce=P.current==null;Hj(we);function Le(Ee){if(Ee.open||(X.current=IO(Ee.nativeEvent,G.current)),Ee.reason===On&&Ee.nativeEvent.type==="mouseleave"&&(H.current=!0),Ee.reason===up)if(Ee.nested)H.current=!1;else if(Ob(Ee.nativeEvent)||xS(Ee.nativeEvent))H.current=!1;else{let _e=!1;xt(W).createElement("div").focus({get preventScroll(){return _e=!0,!1}}),_e?H.current=!1:H.current=!0}}S.on("openchange",Le);function $e(){const Ee=B.current;let _e=typeof Ee=="function"?Ee(X.current):Ee;if(_e===void 0||_e===!1)return null;_e===null&&(_e=!0);const xe=E?.isConnected?E:null,Re=we?.isConnected&&Vn(we)!=="body"?we:null;let Oe=Ce?Re||xe:xe||Re;return Oe||(Oe=qj()||null),typeof _e=="boolean"?Oe:Ka(_e)||Oe||null}return()=>{S.off("openchange",Le);const Ee=Yn(fe),_e=ve(),xe=We(j,Ee)||_e.some(Pe=>Pe===Ee||We(Pe,Ee))||D&&Yr(D.nodesRef.current,A(),!1).some(Pe=>We(Pe.context?.elements.floating,Ee)),Re=B.current,Oe=$e();queueMicrotask(()=>{const Pe=BO(Oe),Be=typeof Re!="boolean";Re&&!H.current&&Kt(Pe)&&(!(!Be&&Pe!==Ee&&Ee!==fe.body)||xe)&&Pe.focus({preventScroll:!0}),H.current=!1})}},[o,j,W,B,P,S,D,E,A,ve]),De(()=>{if(!Wr||w||!j)return;const fe=Yn(xt(j));!Kt(fe)||!cp(fe)||We(j,fe)&&fe.blur()},[w,j]),De(()=>{if(!(o||!L))return L.setFocusManagerState({modal:f,closeOnFocusOut:m,open:w,onOpenChange:y.setOpen,domReference:E}),()=>{L.setFocusManagerState(null)}},[o,L,f,w,y,m,E]),De(()=>{if(!(o||!W))return Vj(W),()=>{queueMicrotask(Wb)}},[o,W]);const oe=!o&&(f?!O:!0)&&(le||f);return n.jsxs(x.Fragment,{children:[oe&&n.jsx(ai,{"data-type":"inside",ref:Q,onFocus:fe=>{if(f){const we=ne();af(we[we.length-1])}else L?.portalNode&&(H.current=!1,Xl(fe,L.portalNode)?Fb(E)?.focus():Ka(b??L.beforeOutsideRef)?.focus())}}),a,oe&&n.jsx(ai,{"data-type":"inside",ref:J,onFocus:fe=>{f?af(ne()[0]):L?.portalNode&&(m&&(H.current=!0),Xl(fe,L.portalNode)?BS(E)?.focus():Ka(g??L.afterOutsideRef)?.focus())}})]})}function nC(e,t={}){const{enabled:a=!0,event:o="click",toggle:l=!0,ignoreMouse:i=!1,stickIfOpen:d=!0,touchOpenDelay:f=0,reason:m=bi}=t,h="rootStore"in e?e.rootStore:e,g=h.context.dataRef,b=x.useRef(void 0),_=si(),k=En(),N=x.useMemo(()=>{function y(E,j,S,R){const A=st(m,j,S);E&&R==="touch"&&f>0?k.start(f,()=>{h.setOpen(!0,A)}):h.setOpen(E,A)}function w(E,j,S){const R=g.current.openEvent,A=h.select("domReferenceElement")!==j;return E&&A||!E||!l?!0:R&&d?!S(R.type):!1}return{onPointerDown(E){b.current=E.pointerType},onMouseDown(E){const j=b.current,S=E.nativeEvent,R=h.select("open");if(E.button!==0||o==="click"||Oo(j,!0)&&i)return;const A=w(R,E.currentTarget,M=>M==="click"||M==="mousedown"),T=qn(S);if(cp(T)){y(A,S,T,j);return}const O=E.currentTarget;_.request(()=>{y(A,S,O,j)})},onClick(E){if(o==="mousedown-only")return;const j=b.current;if(o==="mousedown"&&j){b.current=void 0;return}if(Oo(j,!0)&&i)return;const S=h.select("open"),R=w(S,E.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");y(R,E.nativeEvent,E.currentTarget,j)},onKeyDown(){b.current=void 0}}},[g,o,i,m,h,d,l,_,k,f]);return x.useMemo(()=>a?{reference:N}:Xt,[a,N])}function $O(e,t){let a=null,o=null,l=!1;return{contextElement:e||void 0,getBoundingClientRect(){const i=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=t.axis==="x"||t.axis==="both",f=t.axis==="y"||t.axis==="both",m=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let h=i.width,g=i.height,b=i.x,_=i.y;return a==null&&t.x&&d&&(a=i.x-t.x),o==null&&t.y&&f&&(o=i.y-t.y),b-=a||0,_-=o||0,h=0,g=0,!l||m?(h=t.axis==="y"?i.width:0,g=t.axis==="x"?i.height:0,b=d&&t.x!=null?t.x:b,_=f&&t.y!=null?t.y:_):l&&!m&&(g=t.axis==="x"?i.height:g,h=t.axis==="y"?i.width:h),l=!0,{width:h,height:g,x:b,y:_,top:_,right:b+h,bottom:_+g,left:b}}}}function Fj(e){return e!=null&&e.clientX!=null}function UO(e,t={}){const{enabled:a=!0,axis:o="both"}=t,l="rootStore"in e?e.rootStore:e,i=l.useState("open"),d=l.useState("floatingElement"),f=l.useState("domReferenceElement"),m=l.context.dataRef,h=x.useRef(!1),g=x.useRef(null),[b,_]=x.useState(),[k,N]=x.useState([]),y=Ue(R=>{l.set("positionReference",R)}),w=Ue((R,A,T)=>{h.current||m.current.openEvent&&!Fj(m.current.openEvent)||l.set("positionReference",$O(T??f,{x:R,y:A,axis:o,dataRef:m,pointerType:b}))}),E=Ue(R=>{i?g.current||(w(R.clientX,R.clientY,R.currentTarget),N([])):w(R.clientX,R.clientY,R.currentTarget)}),j=Oo(b)?d:i;x.useEffect(()=>{if(!a){y(f);return}if(!j)return;function R(){g.current?.(),g.current=null}const A=Qt(d);function T(O){const M=qn(O);We(d,M)?R():w(O.clientX,O.clientY)}return!m.current.openEvent||Fj(m.current.openEvent)?g.current=bt(A,"mousemove",T):y(f),R},[j,a,d,m,f,l,w,y,k]),x.useEffect(()=>()=>{l.set("positionReference",null)},[l]),x.useEffect(()=>{a&&!d&&(h.current=!1)},[a,d]),x.useEffect(()=>{!a&&i&&(h.current=!0)},[a,i]);const S=x.useMemo(()=>{function R(A){_(A.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:E,onMouseEnter:E}},[E]);return x.useMemo(()=>a?{reference:S,trigger:S}:{},[a,S])}function HO(){return!1}function qO(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function pp(e,t={}){const{enabled:a=!0,escapeKey:o=!0,outsidePress:l=!0,outsidePressEvent:i="sloppy",referencePress:d=HO,bubbles:f,externalTree:m}=t,h="rootStore"in e?e.rootStore:e,g=h.useState("open"),b=h.useState("floatingElement"),{dataRef:_}=h.context,k=eo(m),N=Ue(typeof l=="function"?l:()=>!1),y=typeof l=="function"?N:l,w=y!==!1,E=Ue(()=>i),{escapeKey:j,outsidePress:S}=qO(f),R=x.useRef(!1),A=x.useRef(!1),T=x.useRef(!1),O=x.useRef(!1),M=x.useRef(""),B=x.useRef(null),P=En(),$=En(),D=Ue(()=>{$.clear(),_.current.insideReactTree=!1}),L=Ue(Q=>{const J=_.current.floatingContext?.nodeId;return(k?Yr(k.nodesRef.current,J):[]).some(se=>se.context?.open&&!se.context.dataRef.current[Q])}),H=Ue(Q=>ah(Q,h.select("floatingElement"))||ah(Q,h.select("domReferenceElement"))),V=Ue(Q=>{d()&&h.setOpen(!1,st(bi,Q.nativeEvent))}),U=Ue(Q=>{if(!g||!a||!o||Q.key!=="Escape"||O.current||!j&&L("__escapeKeyBubbles"))return;const J=C4(Q)?Q.nativeEvent:Q,K=st(dp,J);h.setOpen(!1,K),K.isCanceled||Q.preventDefault(),!j&&!K.isPropagationAllowed&&Q.stopPropagation()}),F=Ue(()=>{_.current.insideReactTree=!0,$.start(0,D)}),X=Ue(Q=>{if(!g||!a||Q.button!==0)return;const J=qn(Q.nativeEvent);We(h.select("floatingElement"),J)&&(R.current||(R.current=!0,A.current=!1))}),G=Ue(Q=>{!g||!a||(Q.defaultPrevented||Q.nativeEvent.defaultPrevented)&&R.current&&(A.current=!0)});x.useEffect(()=>{if(!g||!a)return;_.current.__escapeKeyBubbles=j,_.current.__outsidePressBubbles=S;const Q=new ta,J=new ta;function K(){Q.clear(),O.current=!0}function se(){Q.start(Wr?5:0,()=>{O.current=!1})}function te(){T.current=!0,J.start(0,()=>{T.current=!1})}function le(){R.current=!1,A.current=!1}function W(){const me=M.current,Se=me==="pen"||!me?"mouse":me,Ge=E(),Ae=typeof Ge=="function"?Ge():Ge;return typeof Ae=="string"?Ae:Ae[Se]}function ne(me){const Se=W();return Se==="intentional"&&me.type!=="click"||Se==="sloppy"&&me.type==="click"}function ve(me){const Se=_.current.floatingContext?.nodeId,Ge=k&&Yr(k.nodesRef.current,Se).some(Ae=>ah(me,Ae.context?.elements.floating));return H(me)||Ge}function oe(me){if(ne(me)){me.type!=="click"&&!H(me)&&(J.clear(),T.current=!1),D();return}if(_.current.insideReactTree){D();return}const Se=qn(me),Ge=`[${Gc("inert")}]`,Ae=_t(Se)?Se.getRootNode():null,ze=Array.from((ti(Ae)?Ae:xt(h.select("floatingElement"))).querySelectorAll(Ge)),tt=h.context.triggerElements;if(Se&&(tt.hasElement(Se)||tt.hasMatchingElement(vt=>We(vt,Se))))return;let ot=_t(Se)?Se:null;for(;ot&&!Ja(ot);){const vt=sr(ot);if(Ja(vt)||!_t(vt))break;ot=vt}if(!(ze.length&&_t(Se)&&!M4(Se)&&!We(Se,h.select("floatingElement"))&&ze.every(vt=>!We(ot,vt)))){if(Kt(Se)&&!("touches"in me)){const vt=Ja(Se),Mt=Cs(Se),lt=/auto|scroll/,Rt=vt||lt.test(Mt.overflowX),je=vt||lt.test(Mt.overflowY),Ie=Rt&&Se.clientWidth>0&&Se.scrollWidth>Se.clientWidth,Xe=je&&Se.clientHeight>0&&Se.scrollHeight>Se.clientHeight,it=Mt.direction==="rtl",Qe=Xe&&(it?me.offsetX<=Se.offsetWidth-Se.clientWidth:me.offsetX>Se.clientWidth),mt=Ie&&me.offsetY>Se.clientHeight;if(Qe||mt)return}if(!ve(me)){if(W()==="intentional"&&T.current){J.clear(),T.current=!1;return}typeof y=="function"&&!y(me)||L("__outsidePressBubbles")||(h.setOpen(!1,st(up,me)),D())}}}function fe(me){W()!=="sloppy"||me.pointerType==="touch"||!h.select("open")||!a||H(me)||oe(me)}function we(me){if(W()!=="sloppy"||!h.select("open")||!a||H(me))return;const Se=me.touches[0];Se&&(B.current={startTime:Date.now(),startX:Se.clientX,startY:Se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function Ce(me,Se){const Ge=qn(me);if(!Ge)return;const Ae=bt(Ge,me.type,()=>{Se(me),Ae()})}function Le(me){M.current="touch",Ce(me,we)}function $e(me){P.clear(),me.type==="pointerdown"&&(M.current=me.pointerType),!(me.type==="mousedown"&&B.current&&!B.current.dismissOnMouseDown)&&Ce(me,Se=>{Se.type==="pointerdown"?fe(Se):oe(Se)})}function Ee(me){if(!R.current)return;const Se=A.current;if(le(),W()==="intentional"){if(me.type==="pointercancel"){Se&&te();return}if(!ve(me)){if(Se){te();return}typeof y=="function"&&!y(me)||(J.clear(),T.current=!0,D())}}}function _e(me){if(W()!=="sloppy"||!B.current||H(me))return;const Se=me.touches[0];if(!Se)return;const Ge=Math.abs(Se.clientX-B.current.startX),Ae=Math.abs(Se.clientY-B.current.startY),ze=Math.sqrt(Ge*Ge+Ae*Ae);ze>5&&(B.current.dismissOnTouchEnd=!0),ze>10&&(oe(me),P.clear(),B.current=null)}function xe(me){Ce(me,_e)}function Re(me){W()!=="sloppy"||!B.current||H(me)||(B.current.dismissOnTouchEnd&&oe(me),P.clear(),B.current=null)}function Oe(me){Ce(me,Re)}const Pe=xt(b),Be=xa(o&&xa(bt(Pe,"keydown",U),bt(Pe,"compositionstart",K),bt(Pe,"compositionend",se)),w&&xa(bt(Pe,"click",$e,!0),bt(Pe,"pointerdown",$e,!0),bt(Pe,"pointerup",Ee,!0),bt(Pe,"pointercancel",Ee,!0),bt(Pe,"mousedown",$e,!0),bt(Pe,"mouseup",Ee,!0),bt(Pe,"touchstart",Le,!0),bt(Pe,"touchmove",xe,!0),bt(Pe,"touchend",Oe,!0)));return()=>{Be(),Q.clear(),J.clear(),le(),T.current=!1}},[_,b,o,w,y,g,a,j,S,U,D,E,L,H,k,h,P]),x.useEffect(D,[y,D]);const Y=x.useMemo(()=>({onKeyDown:U,onPointerDown:V,onClick:V}),[U,V]),I=x.useMemo(()=>({onKeyDown:U,onPointerDown:G,onMouseDown:G,onClickCapture:F,onMouseDownCapture(Q){F(),X(Q)},onPointerDownCapture(Q){F(),X(Q)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[U,F,X,G]);return x.useMemo(()=>a?{reference:Y,floating:I,trigger:Y}:{},[a,Y,I])}function Gj(e,t,a){let{reference:o,floating:l}=e;const i=qs(t),d=qb(t),f=Hb(d),m=ws(t),h=i==="y",g=o.x+o.width/2-l.width/2,b=o.y+o.height/2-l.height/2,_=o[f]/2-l[f]/2;let k;switch(m){case"top":k={x:g,y:o.y-l.height};break;case"bottom":k={x:g,y:o.y+o.height};break;case"right":k={x:o.x+o.width,y:b};break;case"left":k={x:o.x-l.width,y:b};break;default:k={x:o.x,y:o.y}}const N=Zr(t);return N&&(k[d]+=_*(N==="end"?1:-1)*(a&&h?-1:1)),k}async function VO(e,t){var a;t===void 0&&(t={});const{x:o,y:l,platform:i,rects:d,elements:f,strategy:m}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:b="floating",altBoundary:_=!1,padding:k=0}=or(t,e),N=TS(k),w=f[_?b==="floating"?"reference":"floating":b],E=Fc(await i.getClippingRect({element:(a=await(i.isElement==null?void 0:i.isElement(w)))==null||a?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(f.floating)),boundary:h,rootBoundary:g,strategy:m})),j=b==="floating"?{x:o,y:l,width:d.floating.width,height:d.floating.height}:d.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f.floating)),R=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},A=Fc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:j,offsetParent:S,strategy:m}):j);return{top:(E.top-A.top+N.top)/R.y,bottom:(A.bottom-E.bottom+N.bottom)/R.y,left:(E.left-A.left+N.left)/R.x,right:(A.right-E.right+N.right)/R.x}}const FO=50,GO=async(e,t,a)=>{const{placement:o="bottom",strategy:l="absolute",middleware:i=[],platform:d}=a,f=d.detectOverflow?d:{...d,detectOverflow:VO},m=await(d.isRTL==null?void 0:d.isRTL(t));let h=await d.getElementRects({reference:e,floating:t,strategy:l}),{x:g,y:b}=Gj(h,o,m),_=o,k=0;const N={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:E,fn:j}=w,{x:S,y:R,data:A,reset:T}=await j({x:g,y:b,initialPlacement:o,placement:_,strategy:l,middlewareData:N,rects:h,platform:f,elements:{reference:e,floating:t}});g=S??g,b=R??b,N[E]={...N[E],...A},T&&k<FO&&(k++,typeof T=="object"&&(T.placement&&(_=T.placement),T.rects&&(h=T.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:l}):T.rects),{x:g,y:b}=Gj(h,_,m)),y=-1)}return{x:g,y:b,placement:_,strategy:l,middlewareData:N}},YO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,o;const{placement:l,middlewareData:i,rects:d,initialPlacement:f,platform:m,elements:h}=t,{mainAxis:g=!0,crossAxis:b=!0,fallbackPlacements:_,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:y=!0,...w}=or(e,t);if((a=i.arrow)!=null&&a.alignmentOffset)return{};const E=ws(l),j=qs(f),S=ws(f)===f,R=await(m.isRTL==null?void 0:m.isRTL(h.floating)),A=_||(S||!y?[_f(f)]:J4(f)),T=N!=="none";!_&&T&&A.push(...sO(f,y,N,R));const O=[f,...A],M=await m.detectOverflow(t,w),B=[];let P=((o=i.flip)==null?void 0:o.overflows)||[];if(g&&B.push(M[E]),b){const H=Z4(l,d,R);B.push(M[H[0]],M[H[1]])}if(P=[...P,{placement:l,overflows:B}],!B.every(H=>H<=0)){var $,D;const H=((($=i.flip)==null?void 0:$.index)||0)+1,V=O[H];if(V&&(!(b==="alignment"?j!==qs(V):!1)||P.every(X=>qs(X.placement)===j?X.overflows[0]>0:!0)))return{data:{index:H,overflows:P},reset:{placement:V}};let U=(D=P.filter(F=>F.overflows[0]<=0).sort((F,X)=>F.overflows[1]-X.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(k){case"bestFit":{var L;const F=(L=P.filter(X=>{if(T){const G=qs(X.placement);return G===j||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,Y)=>G+Y,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:L[0];F&&(U=F);break}case"initialPlacement":U=f;break}if(l!==U)return{reset:{placement:U}}}return{}}}};function Yj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kj(e){return Q4.some(t=>e[t]>=0)}const KO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:o}=t,{strategy:l="referenceHidden",...i}=or(e,t);switch(l){case"referenceHidden":{const d=await o.detectOverflow(t,{...i,elementContext:"reference"}),f=Yj(d,a.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Kj(f)}}}case"escaped":{const d=await o.detectOverflow(t,{...i,altBoundary:!0}),f=Yj(d,a.floating);return{data:{escapedOffsets:f,escaped:Kj(f)}}}default:return{}}}}},sC=new Set(["left","top"]);async function XO(e,t){const{placement:a,platform:o,elements:l}=e,i=await(o.isRTL==null?void 0:o.isRTL(l.floating)),d=ws(a),f=Zr(a),m=qs(a)==="y",h=sC.has(d)?-1:1,g=i&&m?-1:1,b=or(t,e);let{mainAxis:_,crossAxis:k,alignmentAxis:N}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return f&&typeof N=="number"&&(k=f==="end"?N*-1:N),m?{x:k*g,y:_*h}:{x:_*h,y:k*g}}const QO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,o;const{x:l,y:i,placement:d,middlewareData:f}=t,m=await XO(t,e);return d===((a=f.offset)==null?void 0:a.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:l+m.x,y:i+m.y,data:{...m,placement:d}}}}},WO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:o,placement:l,platform:i}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:m={fn:j=>{let{x:S,y:R}=j;return{x:S,y:R}}},...h}=or(e,t),g={x:a,y:o},b=await i.detectOverflow(t,h),_=qs(l),k=Ub(_);let N=g[k],y=g[_];const w=(j,S)=>RS(S+b[j==="y"?"top":"left"],S,S-b[j==="y"?"bottom":"right"]);d&&(N=w(k,N)),f&&(y=w(_,y));const E=m.fn({...t,[k]:N,[_]:y});return{...E,data:{x:E.x-a,y:E.y-o,enabled:{[k]:d,[_]:f}}}}}},ZO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,o;const{x:l,y:i,placement:d,rects:f,middlewareData:m}=t,{offset:h=0,mainAxis:g=!0,crossAxis:b=!0}=or(e,t),_={x:l,y:i},k=qs(d),N=Ub(k);let y=_[N],w=_[k];const E=or(h,t),j=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(a=E.mainAxis)!=null?a:0,crossAxis:(o=E.crossAxis)!=null?o:0};if(g){const A=N==="y"?"height":"width",T=f.reference[N]-f.floating[A]+j.mainAxis,O=f.reference[N]+f.reference[A]-j.mainAxis;y<T?y=T:y>O&&(y=O)}if(b){var S,R;const A=N==="y"?"width":"height",T=sC.has(ws(d)),O=f.reference[k]-f.floating[A]+(T&&((S=m.offset)==null?void 0:S[k])||0)+(T?0:j.crossAxis),M=f.reference[k]+f.reference[A]+(T?0:((R=m.offset)==null?void 0:R[k])||0)-(T?j.crossAxis:0);w<O?w=O:w>M&&(w=M)}return{[N]:y,[k]:w}}}},JO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:o,platform:l,elements:i}=t,{apply:d=()=>{},...f}=or(e,t),m=await l.detectOverflow(t,f),h=ws(a),g=Zr(a),b=qs(a)==="y",{width:_,height:k}=o.floating;let N,y;h==="top"||h==="bottom"?(N=h,y=g===(await(l.isRTL==null?void 0:l.isRTL(i.floating))?"start":"end")?"left":"right"):(y=h,N=g==="end"?"top":"bottom");const w=k-m.top-m.bottom,E=_-m.left-m.right,j=ri(k-m[N],w),S=ri(_-m[y],E),R=t.middlewareData.shift,A=!R;let T=j,O=S;R!=null&&R.enabled.x&&(O=E),R!=null&&R.enabled.y&&(T=w),A&&!g&&(b?O=_-2*er(m.left,m.right):T=k-2*er(m.top,m.bottom)),await d({...t,availableWidth:O,availableHeight:T});const M=await l.getDimensions(i.floating);return _!==M.width||k!==M.height?{reset:{rects:!0}}:{}}}};function aC(e){const t=Cs(e);let a=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=Kt(e),i=l?e.offsetWidth:a,d=l?e.offsetHeight:o,f=bf(a)!==i||bf(o)!==d;return f&&(a=i,o=d),{width:a,height:o,$:f}}function Jb(e){return _t(e)?e:e.contextElement}function Ql(e){const t=Jb(e);if(!Kt(t))return tr(1);const a=t.getBoundingClientRect(),{width:o,height:l,$:i}=aC(t);let d=(i?bf(a.width):a.width)/o,f=(i?bf(a.height):a.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const ez=tr(0);function rC(e){const t=Qt(e);return!Pb()||!t.visualViewport?ez:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tz(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Qt(e)}function Po(e,t,a,o){t===void 0&&(t=!1),a===void 0&&(a=!1);const l=e.getBoundingClientRect(),i=Jb(e);let d=tr(1);t&&(o?_t(o)&&(d=Ql(o)):d=Ql(e));const f=tz(i,a,o)?rC(i):tr(0);let m=(l.left+f.x)/d.x,h=(l.top+f.y)/d.y,g=l.width/d.x,b=l.height/d.y;if(i&&o){const _=Qt(i),k=_t(o)?Qt(o):o;let N=_,y=kx(N);for(;y&&k!==N;){const w=Ql(y),E=y.getBoundingClientRect(),j=Cs(y),S=E.left+(y.clientLeft+parseFloat(j.paddingLeft))*w.x,R=E.top+(y.clientTop+parseFloat(j.paddingTop))*w.y;m*=w.x,h*=w.y,g*=w.x,b*=w.y,m+=S,h+=R,N=Qt(y),y=kx(N)}}return Fc({width:g,height:b,x:m,y:h})}function mp(e,t){const a=op(e).scrollLeft;return t?t.left+a:Po(cr(e)).left+a}function oC(e,t){const a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-mp(e,a),l=a.top+t.scrollTop;return{x:o,y:l}}function nz(e){let{elements:t,rect:a,offsetParent:o,strategy:l}=e;const i=l==="fixed",d=cr(o),f=t?rp(t.floating):!1;if(o===d||f&&i)return a;let m={scrollLeft:0,scrollTop:0},h=tr(1);const g=tr(0),b=Kt(o);if((b||!i)&&((Vn(o)!=="body"||Go(d))&&(m=op(o)),b)){const k=Po(o);h=Ql(o),g.x=k.x+o.clientLeft,g.y=k.y+o.clientTop}const _=d&&!b&&!i?oC(d,m):tr(0);return{width:a.width*h.x,height:a.height*h.y,x:a.x*h.x-m.scrollLeft*h.x+g.x+_.x,y:a.y*h.y-m.scrollTop*h.y+g.y+_.y}}function sz(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function az(e){const t=op(e),a=e.ownerDocument.body,o=er(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),l=er(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let i=-t.scrollLeft+mp(e);const d=-t.scrollTop;return Cs(a).direction==="rtl"&&(i+=er(e.clientWidth,a.clientWidth)-o),{width:o,height:l,x:i,y:d}}const rz=25;function oz(e,t,a){a===void 0&&(a="viewport");const o=a==="layoutViewport",l=Qt(e),i=cr(e),d=l.visualViewport;let f=i.clientWidth,m=i.clientHeight,h=0,g=0;if(d){const _=!Pb()||t==="fixed";o?_||(h=-d.offsetLeft,g=-d.offsetTop):(f=d.width,m=d.height,_&&(h=d.offsetLeft,g=d.offsetTop))}if(mp(i)<=0){const _=i.ownerDocument,k=_.body,N=getComputedStyle(k),y=_.compatMode==="CSS1Compat"&&parseFloat(N.marginLeft)+parseFloat(N.marginRight)||0,w=Math.abs(i.clientWidth-k.clientWidth-y),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;E<=rz&&(f-=E)}return{width:f,height:m,x:h,y:g}}function lz(e,t){const a=Po(e,!0,t==="fixed"),o=a.top+e.clientTop,l=a.left+e.clientLeft,i=Ql(e),d=e.clientWidth*i.x,f=e.clientHeight*i.y,m=l*i.x,h=o*i.y;return{width:d,height:f,x:m,y:h}}function Xj(e,t,a){let o;if(t==="viewport"||t==="layoutViewport")o=oz(e,a,t);else if(t==="document")o=az(cr(e));else if(_t(t))o=lz(t,a);else{const l=rC(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return Fc(o)}function iz(e,t){const a=t.get(e);if(a)return a;let o=Vc(e,[],!1).filter(f=>_t(f)&&Vn(f)!=="body"),l=null;const i=Cs(e).position==="fixed";let d=i?sr(e):e;for(;_t(d)&&!Ja(d);){const f=Cs(d),m=Db(d),h=l?l.position:i?"fixed":"";!m&&(h==="fixed"||h==="absolute"&&f.position==="static")?o=o.filter(b=>b!==d):l=f,d=sr(d)}return t.set(e,o),o}function cz(e){let{element:t,boundary:a,rootBoundary:o,strategy:l}=e;const d=[...a==="clippingAncestors"?rp(t)?[]:iz(t,this._c):[].concat(a),o],f=Xj(t,d[0],l);let m=f.top,h=f.right,g=f.bottom,b=f.left;for(let _=1;_<d.length;_++){const k=Xj(t,d[_],l);m=er(k.top,m),h=ri(k.right,h),g=ri(k.bottom,g),b=er(k.left,b)}return{width:h-b,height:g-m,x:b,y:m}}function uz(e){const{width:t,height:a}=aC(e);return{width:t,height:a}}function dz(e,t,a){const o=Kt(t),l=cr(t),i=a==="fixed",d=Po(e,!0,i,t);let f={scrollLeft:0,scrollTop:0};const m=tr(0);if((o||!i)&&((Vn(t)!=="body"||Go(l))&&(f=op(t)),o)){const _=Po(t,!0,i,t);m.x=_.x+t.clientLeft,m.y=_.y+t.clientTop}!o&&l&&(m.x=mp(l));const h=l&&!o&&!i?oC(l,f):tr(0),g=d.left+f.scrollLeft-m.x-h.x,b=d.top+f.scrollTop-m.y-h.y;return{x:g,y:b,width:d.width,height:d.height}}function ch(e){return Cs(e).position==="static"}function Qj(e,t){if(!Kt(e)||Cs(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return cr(e)===a&&(a=a.ownerDocument.body),a}function lC(e,t){const a=Qt(e);if(rp(e))return a;if(!Kt(e)){let l=sr(e);for(;l&&!Ja(l);){if(_t(l)&&!ch(l))return l;l=sr(l)}return a}let o=Qj(e,t);for(;o&&E4(o)&&ch(o);)o=Qj(o,t);return o&&Ja(o)&&ch(o)&&!Db(o)?a:o||A4(e)||a}const fz=async function(e){const t=this.getOffsetParent||lC,a=this.getDimensions,o=await a(e.floating);return{reference:dz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pz(e){return Cs(e).direction==="rtl"}const iC={convertOffsetParentRelativeRectToViewportRelativeRect:nz,getDocumentElement:cr,getClippingRect:cz,getOffsetParent:lC,getElementRects:fz,getClientRects:sz,getDimensions:uz,getScale:Ql,isElement:_t,isRTL:pz};function cC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mz(e,t,a){let o=null,l;const i=cr(e);function d(){var g;clearTimeout(l),(g=o)==null||g.disconnect(),o=null}function f(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),d();const _=e.getBoundingClientRect(),{left:k,top:N,width:y,height:w}=_;if(g||t(),!y||!w)return;const E=Td(N),j=Td(i.clientWidth-(k+y)),S=Td(i.clientHeight-(N+w)),R=Td(k),T={rootMargin:-E+"px "+-j+"px "+-S+"px "+-R+"px",threshold:er(0,ri(1,b))||1};let O=!0;function M(B){const P=B[0].intersectionRatio;if(!cC(_,e.getBoundingClientRect()))return f();if(P!==b){if(!O)return f();P?f(!1,P):l=setTimeout(()=>{f(!1,1e-7)},1e3)}O=!1}try{o=new IntersectionObserver(M,{...T,root:i.ownerDocument})}catch{o=new IntersectionObserver(M,T)}o.observe(e)}const m=Qt(e),h=()=>f(a);return m.addEventListener("resize",h),f(!0),()=>{m.removeEventListener("resize",h),d()}}function Wj(e,t,a,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:i=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,h=Jb(e),g=l||i?[...h?Vc(h):[],...t?Vc(t):[]]:[];g.forEach(E=>{l&&E.addEventListener("scroll",a),i&&E.addEventListener("resize",a)});const b=h&&f?mz(h,a,i):null;let _=-1,k=null;d&&(k=new ResizeObserver(E=>{let[j]=E;j&&j.target===h&&k&&t&&(k.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var S;(S=k)==null||S.observe(t)})),a()}),h&&!m&&k.observe(h),t&&k.observe(t));let N,y=m?Po(e):null;m&&w();function w(){const E=Po(e);y&&!cC(y,E)&&a(),y=E,N=requestAnimationFrame(w)}return a(),()=>{var E;g.forEach(j=>{l&&j.removeEventListener("scroll",a),i&&j.removeEventListener("resize",a)}),b?.(),(E=k)==null||E.disconnect(),k=null,m&&cancelAnimationFrame(N)}}const gz=QO,hz=WO,xz=YO,bz=JO,_z=KO,vz=ZO,yz=(e,t,a)=>{const o=new Map,l=a??{},i={...iC,...l.platform,_c:o};return GO(e,t,{...l,platform:i})};var jz=typeof document<"u",kz=function(){},rf=jz?x.useLayoutEffect:kz;function kf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(o=a;o--!==0;)if(!kf(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),a=l.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=a;o--!==0;){const i=l[o];if(!(i==="_owner"&&e.$$typeof)&&!kf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function uC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zj(e,t){const a=uC(e);return Math.round(t*a)/a}function uh(e){const t=x.useRef(e);return rf(()=>{t.current=e}),t}function wz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:o=[],platform:l,elements:{reference:i,floating:d}={},transform:f=!0,whileElementsMounted:m,open:h}=e,[g,b]=x.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[_,k]=x.useState(o);kf(_,o)||k(o);const[N,y]=x.useState(null),[w,E]=x.useState(null),j=x.useCallback(X=>{X!==T.current&&(T.current=X,y(X))},[]),S=x.useCallback(X=>{X!==O.current&&(O.current=X,E(X))},[]),R=i||N,A=d||w,T=x.useRef(null),O=x.useRef(null),M=x.useRef(g),B=m!=null,P=uh(m),$=uh(l),D=uh(h),L=x.useCallback(()=>{if(!T.current||!O.current)return;const X={placement:t,strategy:a,middleware:_};$.current&&(X.platform=$.current),yz(T.current,O.current,X).then(G=>{const Y={...G,isPositioned:D.current!==!1};H.current&&!kf(M.current,Y)&&(M.current=Y,Fs.flushSync(()=>{b(Y)}))})},[_,t,a,$,D]);rf(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,b(X=>({...X,isPositioned:!1})))},[h]);const H=x.useRef(!1);rf(()=>(H.current=!0,()=>{H.current=!1}),[]),rf(()=>{if(R&&(T.current=R),A&&(O.current=A),R&&A){if(P.current)return P.current(R,A,L);L()}},[R,A,L,P,B]);const V=x.useMemo(()=>({reference:T,floating:O,setReference:j,setFloating:S}),[j,S]),U=x.useMemo(()=>({reference:R,floating:A}),[R,A]),F=x.useMemo(()=>{const X={position:a,left:0,top:0};if(!U.floating)return X;const G=Zj(U.floating,g.x),Y=Zj(U.floating,g.y);return f?{...X,transform:"translate("+G+"px, "+Y+"px)",...uC(U.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:G,top:Y}},[a,f,U.floating,g.x,g.y]);return x.useMemo(()=>({...g,update:L,refs:V,elements:U,floatingStyles:F}),[g,L,V,U,F])}const Sz=(e,t)=>{const a=gz(e);return{name:a.name,fn:a.fn,options:[e,t]}},Cz=(e,t)=>{const a=hz(e);return{name:a.name,fn:a.fn,options:[e,t]}},Nz=(e,t)=>({fn:vz(e).fn,options:[e,t]}),Ez=(e,t)=>{const a=xz(e);return{name:a.name,fn:a.fn,options:[e,t]}},Rz=(e,t)=>{const a=bz(e);return{name:a.name,fn:a.fn,options:[e,t]}},Tz=(e,t)=>{const a=_z(e);return{name:a.name,fn:a.fn,options:[e,t]}};function e_(e){const t=x.useRef(!0);t.current&&(t.current=!1,e())}const Me=(e,t,a,o,l,i,...d)=>{if(d.length>0)throw new Error(cn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var dh={exports:{}},fh={};/**
|
|
741
|
-
* @license React
|
|
742
|
-
* use-sync-external-store-shim.production.js
|
|
743
|
-
*
|
|
744
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
745
|
-
*
|
|
746
|
-
* This source code is licensed under the MIT license found in the
|
|
747
|
-
* LICENSE file in the root directory of this source tree.
|
|
748
|
-
*/var Jj;function Az(){if(Jj)return fh;Jj=1;var e=Zc();function t(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var a=typeof Object.is=="function"?Object.is:t,o=e.useState,l=e.useEffect,i=e.useLayoutEffect,d=e.useDebugValue;function f(b,_){var k=_(),N=o({inst:{value:k,getSnapshot:_}}),y=N[0].inst,w=N[1];return i(function(){y.value=k,y.getSnapshot=_,m(y)&&w({inst:y})},[b,k,_]),l(function(){return m(y)&&w({inst:y}),b(function(){m(y)&&w({inst:y})})},[b]),d(k),k}function m(b){var _=b.getSnapshot;b=b.value;try{var k=_();return!a(b,k)}catch{return!0}}function h(b,_){return _()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,fh}var ek;function dC(){return ek||(ek=1,dh.exports=Az()),dh.exports}var wf=dC(),ph={exports:{}},mh={};/**
|
|
749
|
-
* @license React
|
|
750
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
751
|
-
*
|
|
752
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
753
|
-
*
|
|
754
|
-
* This source code is licensed under the MIT license found in the
|
|
755
|
-
* LICENSE file in the root directory of this source tree.
|
|
756
|
-
*/var tk;function Mz(){if(tk)return mh;tk=1;var e=Zc(),t=dC();function a(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var o=typeof Object.is=="function"?Object.is:a,l=t.useSyncExternalStore,i=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return mh.useSyncExternalStoreWithSelector=function(h,g,b,_,k){var N=i(null);if(N.current===null){var y={hasValue:!1,value:null};N.current=y}else y=N.current;N=f(function(){function E(T){if(!j){if(j=!0,S=T,T=_(T),k!==void 0&&y.hasValue){var O=y.value;if(k(O,T))return R=O}return R=T}if(O=R,o(S,T))return O;var M=_(T);return k!==void 0&&k(O,M)?(S=T,O):(S=T,R=M)}var j=!1,S,R,A=b===void 0?null:b;return[function(){return E(g())},A===null?void 0:function(){return E(A())}]},[g,b,_,k]);var w=l(h,N[0],N[1]);return d(function(){y.hasValue=!0,y.value=w},[w]),m(w),w},mh}var nk;function Oz(){return nk||(nk=1,ph.exports=Mz()),ph.exports}var zz=Oz();const Dz=Gb(19),Pz=Dz?Iz:Bz;function nt(e,t,a,o,l){return Pz(e,t,a,o,l)}function Lz(e,t,a,o,l){const i=x.useCallback(()=>t(e.getSnapshot(),a,o,l),[e,t,a,o,l]);return wf.useSyncExternalStore(e.subscribe,i,i)}g4({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let a=0;a<e.syncHooks.length;a+=1){const o=e.syncHooks[a],l=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,l)||(t=!0,o.value=l)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const a=new Set;for(const l of e.syncHooks)a.add(l.store);const o=[];for(const l of a)o.push(l.subscribe(t));return()=>{for(const l of o)l()}}),wf.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Iz(e,t,a,o,l){const i=m4();if(!i)return Lz(e,t,a,o,l);const d=i.syncIndex;i.syncIndex+=1;let f;return i.didInitialize?(f=i.syncHooks[d],(f.store!==e||f.selector!==t||!Object.is(f.a1,a)||!Object.is(f.a2,o)||!Object.is(f.a3,l))&&(f.store!==e&&(i.didChangeStore=!0),f.store=e,f.selector=t,f.a1=a,f.a2=o,f.a3=l,f.value=t(e.getSnapshot(),a,o,l))):(f={store:e,selector:t,a1:a,a2:o,a3:l,value:t(e.getSnapshot(),a,o,l)},i.syncHooks.push(f)),f.value}function Bz(e,t,a,o,l){return zz.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,a,o,l))}class fC{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const a=this.updateTick;for(const o of this.listeners){if(a!==this.updateTick)return;o(t)}}update(t){for(const a in t)if(!Object.is(this.state[a],t[a])){this.setState({...this.state,...t});return}}set(t,a){Object.is(this.state[t],a)||this.setState({...this.state,[t]:a})}notifyAll(){const t={...this.state};this.setState(t)}use(t,a,o,l){return nt(this,t,a,o,l)}}class gp extends fC{constructor(t,a={},o){super(t),this.context=a,this.selectors=o}useSyncedValue(t,a){x.useDebugValue(t);const o=this;De(()=>{o.state[t]!==a&&o.set(t,a)},[o,t,a])}useSyncedValueWithCleanup(t,a){const o=this;De(()=>(o.state[t]!==a&&o.set(t,a),()=>{o.set(t,void 0)}),[o,t,a])}useSyncedValues(t){const a=this,o=Object.values(t);De(()=>{a.update(t)},[a,...o])}useControlledProp(t,a){x.useDebugValue(t);const o=this,l=a!==void 0;De(()=>{l&&!Object.is(o.state[t],a)&&o.setState({...o.state,[t]:a})},[o,t,a,l])}select(t,a,o,l){const i=this.selectors[t];return i(this.state,a,o,l)}useState(t,a,o,l){return x.useDebugValue(t),nt(this,this.selectors[t],a,o,l)}useContextCallback(t,a){x.useDebugValue(t);const o=Ue(a??Mn);this.context[t]=o}useStateSetter(t){const a=x.useRef(void 0);return a.current===void 0&&(a.current=o=>{this.set(t,o)}),a.current}observe(t,a){let o;typeof t=="function"?o=t:o=this.selectors[t];let l=o(this.state);return a(l,l,this),this.subscribe(i=>{const d=o(i);if(!Object.is(l,d)){const f=l;l=d,a(d,f,this)}})}}const $z={open:Me(e=>e.open),transitionStatus:Me(e=>e.transitionStatus),domReferenceElement:Me(e=>e.domReferenceElement),referenceElement:Me(e=>e.positionReference??e.referenceElement),floatingElement:Me(e=>e.floatingElement),floatingId:Me(e=>e.floatingId)};class hp extends gp{constructor(t){const{syncOnly:a,nested:o,onOpenChange:l,triggerElements:i,...d}=t;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:l,dataRef:{current:{}},events:ZS(),nested:o,triggerElements:i},$z),this.syncOnly=a}syncOpenEvent=(t,a)=>{(!t||!this.state.open||a!=null&&N4(a))&&(this.context.dataRef.current.openEvent=t?a:void 0)};dispatchOpenChange=(t,a)=>{this.syncOpenEvent(t,a.event);const o={open:t,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",o)};setOpen=(t,a)=>{if(this.syncOnly){this.context.onOpenChange?.(t,a);return}this.dispatchOpenChange(t,a),this.context.onOpenChange?.(t,a)}}function pC(e){const{popupStore:t,treatPopupAsFloatingElement:a=!1,floatingRootContext:o,floatingId:l,nested:i,onOpenChange:d}=e,f=t.useState("open"),m=t.useState("activeTriggerElement"),h=t.useState(a?"popupElement":"positionerElement"),g=t.context.triggerElements,b=d,_=x.useRef(null);o===void 0&&_.current===null&&(_.current=new hp({open:f,transitionStatus:void 0,referenceElement:m,floatingElement:h,triggerElements:g,onOpenChange:b,floatingId:l,syncOnly:!0,nested:i}));const k=o??_.current;return t.useSyncedValue("floatingId",l),De(()=>{const N={open:f,floatingId:l,referenceElement:m,floatingElement:h};_t(m)&&(N.domReferenceElement=m),k.state.positionReference===k.state.referenceElement&&(N.positionReference=m),k.update(N)},[f,l,m,h,k]),k.context.onOpenChange=b,k.context.nested=i,k}function _i(e,t=!1,a=!1){const[o,l]=x.useState(e&&t?"idle":void 0),[i,d]=x.useState(e);return e&&!i&&(d(!0),l("starting")),!e&&i&&o!=="ending"&&!a&&l("ending"),!e&&!i&&o==="ending"&&l(void 0),De(()=>{if(!e&&i&&o!=="ending"&&a){const f=ma.request(()=>{l("ending")});return()=>{ma.cancel(f)}}},[e,i,o,a]),De(()=>{if(!e||t)return;const f=ma.request(()=>{l(void 0)});return()=>{ma.cancel(f)}},[t,e]),De(()=>{if(!e||!t)return;e&&i&&o!=="idle"&&l("starting");const f=ma.request(()=>{l("idle")});return()=>{ma.cancel(f)}},[t,e,i,o]),{mounted:i,setMounted:d,transitionStatus:o}}let Lo=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Uz={[Lo.startingStyle]:""},Hz={[Lo.endingStyle]:""},ur={transitionStatus(e){return e==="starting"?Uz:e==="ending"?Hz:null}};function mC(e,t=!1,a=!0){const o=si();return Ue((l,i=null)=>{o.cancel();const d=Ka(e);if(d==null)return;const f=d,m=()=>{Fs.flushSync(l)};if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){l();return}function h(){Promise.all(f.getAnimations().map(g=>g.finished)).then(()=>{i?.aborted||m()}).catch(()=>{if(a){i?.aborted||m();return}const g=f.getAnimations();!i?.aborted&&g.length>0&&g.some(b=>b.pending||b.playState!=="finished")&&h()})}if(t){const g=Lo.startingStyle;if(!f.hasAttribute(g)){o.request(h);return}const b=new MutationObserver(()=>{f.hasAttribute(g)||(b.disconnect(),h())});b.observe(f,{attributes:!0,attributeFilter:[g]}),i?.addEventListener("abort",()=>b.disconnect(),{once:!0});return}o.request(h)})}function ka(e){const{enabled:t=!0,open:a,ref:o,onComplete:l}=e,i=Ue(l),d=mC(o,a,!1);x.useEffect(()=>{if(!t)return;const f=new AbortController;return d(i,f.signal),()=>{f.abort()}},[t,a,i,d])}const xp={tabIndex:-1,[wx]:""};function qz(e){return t=>t==="touch"?e.current:!0}function gC(e,t,a=!1){const o=Do(),l=Jr()!=null,i=x.useRef(null);e===void 0&&i.current===null&&(i.current=t(o,l));const d=e??i.current;return pC({popupStore:d,treatPopupAsFloatingElement:a,floatingRootContext:d.state.floatingRootContext,floatingId:o,nested:l,onOpenChange:d.setOpen}),{store:d,internalStore:i.current}}function Vz(e,t){const a=x.useRef(null),o=x.useRef(null);return x.useCallback(l=>{if(e===void 0)return;let i=!1;if(a.current!==null){const d=a.current,f=o.current,m=t.context.triggerElements.getById(d);f&&m===f&&(t.context.triggerElements.delete(d),i=!0),a.current=null,o.current=null}if(l!==null&&(a.current=e,o.current=l,t.context.triggerElements.add(e,l),i=!0),i){const d=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==d&&t.set("triggerCount",d)}},[t,e])}function t_(e,t,a,o=!1){t?e.preventUnmountingOnClose=!1:o&&(e.preventUnmountingOnClose=!0);const l=a?.id??null;(l||t)&&(e.activeTriggerId=l,e.activeTriggerElement=a??null)}function hC(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fz(e,t,a,o={}){const l=a.reason,i=l===On,d=t&&l===Yl,f=!t&&(l===bi||l===dp),m=hC(a);if(e.context.onOpenChange?.(t,a),a.isCanceled)return;o.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,a);const h=()=>{const g={...o.extraState,open:t};d?g.instantType="focus":f?g.instantType="dismiss":i&&(g.instantType=void 0),t_(g,t,a.trigger,m()),e.update(g)};i?Fs.flushSync(h):h()}function xC(e,t,a,o){e_(()=>{t===void 0&&e.state.open===!1&&a&&(e.state={...e.state,open:!0,activeTriggerId:o,preventUnmountingOnClose:!1})})}function bC(e,t,a,o){const l=a.useState("isMountedByTrigger",e),i=Vz(e,a),d=Ue(f=>{if(i(f),!f)return;const m=a.select("open"),h=a.select("activeTriggerId");if(h===e){a.update({activeTriggerElement:f,...m?o:null});return}h==null&&m&&a.update({activeTriggerId:e,activeTriggerElement:f,...o})});return De(()=>{l&&a.update({activeTriggerElement:t.current,...o})},[l,a,t,...Object.values(o)]),{registerTrigger:d,isMountedByThisTrigger:l}}function n_(e,t={}){const{closeOnActiveTriggerUnmount:a=!1}=t,o=e.useState("open"),l=e.useState("triggerCount");De(()=>{if(!o){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const i=e.context.triggerElements.size,d={};e.state.triggerCount!==i&&(d.triggerCount=i);const f=e.select("activeTriggerId");let m=null;if(f){const h=e.context.triggerElements.getById(f);h?h!==e.state.activeTriggerElement&&(d.activeTriggerElement=h):m=f}if(!m&&!f&&i===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[g,b]=h.value;d.activeTriggerId=g,d.activeTriggerElement=b}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&e.update(d),m&&a&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){const h=st(va);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,l,a])}function s_(e,t,a){const{mounted:o,setMounted:l,transitionStatus:i}=_i(e),d=t.useState("preventUnmountingOnClose"),f=e?!1:d;t.useSyncedValues({mounted:o,transitionStatus:i,preventUnmountingOnClose:f});const m=Ue(()=>{l(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),t.context.onOpenChangeComplete?.(!1)});return ka({enabled:o&&!e&&!f,open:e,ref:t.context.popupRef,onComplete(){e||m()}}),{forceUnmount:m,transitionStatus:i}}function a_(e,t){e.useSyncedValues(t),De(()=>()=>{e.update({activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt})},[e])}function Gz(e,t){De(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),De(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class ou{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,a){const o=this.idMap.get(t);o!==a&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(a),this.idMap.set(t,a))}delete(t){const a=this.idMap.get(t);a&&(this.elementsSet.delete(a),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const a of this.elementsSet)if(t(a))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Yz(){return new hp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new ou,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function r_(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Yz(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt}}function _C(e,t,a=!1){return new hp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:a,onOpenChange:void 0})}const zc=Me(e=>e.triggerIdProp??e.activeTriggerId),o_=Me(e=>e.openProp??e.open),sk=Me(e=>(e.popupElement?.id??e.floatingId)||void 0);function vC(e,t){return t!==void 0&&o_(e)&&zc(e)===t}function Kz(e,t){return vC(e,t)?!0:t!==void 0&&o_(e)&&zc(e)==null&&e.triggerCount===1}const l_={open:o_,mounted:Me(e=>e.mounted),transitionStatus:Me(e=>e.transitionStatus),floatingRootContext:Me(e=>e.floatingRootContext),triggerCount:Me(e=>e.triggerCount),preventUnmountingOnClose:Me(e=>e.preventUnmountingOnClose),payload:Me(e=>e.payload),activeTriggerId:zc,activeTriggerElement:Me(e=>e.mounted?e.activeTriggerElement:null),popupId:sk,isTriggerActive:Me((e,t)=>t!==void 0&&zc(e)===t),isOpenedByTrigger:Me((e,t)=>vC(e,t)),isMountedByTrigger:Me((e,t)=>t!==void 0&&zc(e)===t&&e.mounted),triggerProps:Me((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Me((e,t)=>Kz(e,t)?sk(e):void 0),popupProps:Me(e=>e.popupProps),popupElement:Me(e=>e.popupElement),positionerElement:Me(e=>e.positionerElement)};function yC(e){const{open:t=!1,onOpenChange:a,elements:o={}}=e,l=Do(),i=Jr()!=null,d=ns(()=>new hp({open:t,transitionStatus:void 0,onOpenChange:a,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new ou,floatingId:l,syncOnly:!1,nested:i})).current;return De(()=>{const f={open:t,floatingId:l};o.reference!==void 0&&(f.referenceElement=o.reference,f.domReferenceElement=_t(o.reference)?o.reference:null),o.floating!==void 0&&(f.floatingElement=o.floating),d.update(f)},[t,l,o.reference,o.floating,d]),d.context.onOpenChange=a,d.context.nested=i,d}function Xz(e={}){const{nodeId:t,externalTree:a}=e,o=yC(e),l=e.rootContext||o,i=l.useState("referenceElement"),d=l.useState("floatingElement"),f=l.useState("domReferenceElement"),m=l.useState("open"),h=l.useState("floatingId"),[g,b]=x.useState(null),[_,k]=x.useState(void 0),[N,y]=x.useState(void 0),w=x.useRef(null),E=eo(a),j=x.useMemo(()=>({reference:i,floating:d,domReference:f}),[i,d,f]),S=wz({...e,elements:{...j,...g&&{reference:g}}}),R=_t(_)?_:null,A=N===void 0?l.state.floatingElement:N;l.useSyncedValue("referenceElement",_??null),l.useSyncedValue("domReferenceElement",_===void 0?f:R),l.useSyncedValue("floatingElement",A);const T=x.useCallback(D=>{const L=_t(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;b(L),S.refs.setReference(L)},[S.refs]),O=x.useCallback(D=>{(_t(D)||D===null)&&(w.current=D,k(D)),(_t(S.refs.reference.current)||S.refs.reference.current===null||D!==null&&!_t(D))&&S.refs.setReference(D)},[S.refs,k]),M=x.useCallback(D=>{y(D),S.refs.setFloating(D)},[S.refs]),B=x.useMemo(()=>({...S.refs,setReference:O,setFloating:M,setPositionReference:T,domReference:w}),[S.refs,O,M,T]),P=x.useMemo(()=>({...S.elements,domReference:f}),[S.elements,f]),$=x.useMemo(()=>({...S,dataRef:l.context.dataRef,open:m,onOpenChange:l.setOpen,events:l.context.events,floatingId:h,refs:B,elements:P,nodeId:t,rootStore:l}),[S,B,P,t,l,m,h]);return De(()=>{f&&(w.current=f)},[f]),De(()=>{l.context.dataRef.current.floatingContext=$;const D=E?.nodesRef.current.find(L=>L.id===t);D&&(D.context=$)}),x.useMemo(()=>({...S,context:$,refs:B,elements:P,rootStore:l}),[S,B,P,$,l])}const gh=Ab&&Wr;function jC(e,t={}){const{enabled:a=!0,delay:o}=t,l="rootStore"in e?e.rootStore:e,{events:i,dataRef:d}=l.context,f=x.useRef(!1),m=x.useRef(null),h=x.useRef(!0),g=En();x.useEffect(()=>{const _=l.select("domReferenceElement");if(!a)return;const k=Qt(_);function N(){const E=l.select("domReferenceElement");!l.select("open")&&Kt(E)&&E===Yn(xt(E))&&(f.current=!0)}function y(){h.current=!0}function w(){h.current=!1}return xa(bt(k,"blur",N),gh&&bt(k,"keydown",y,!0),gh&&bt(k,"pointerdown",w,!0))},[l,a]),x.useEffect(()=>{if(!a)return;function _(k){if(k.reason===bi||k.reason===dp){const N=l.select("domReferenceElement");_t(N)&&(m.current=N,f.current=!0)}}return i.on("openchange",_),()=>{i.off("openchange",_)}},[i,a,l]);const b=x.useMemo(()=>{function _(){f.current=!1,m.current=null}return{onMouseLeave(){_()},onFocus(k){const N=k.currentTarget;if(f.current){if(m.current===N)return;_()}const y=qn(k.nativeEvent);if(_t(y)){if(gh&&!k.relatedTarget){if(!h.current&&!cp(y))return}else if(!z4(y))return}const w=hf(k.relatedTarget,l.context.triggerElements),{nativeEvent:E,currentTarget:j}=k,S=typeof o=="function"?o():o;if(l.select("open")&&w||S===0||S===void 0){l.setOpen(!0,st(Yl,E,j));return}g.start(S,()=>{f.current||l.setOpen(!0,st(Yl,E,j))})},onBlur(k){_();const N=k.relatedTarget,y=k.nativeEvent,w=_t(N)&&N.hasAttribute(Gc("focus-guard"))&&N.getAttribute("data-type")==="outside";g.start(0,()=>{const E=l.select("domReferenceElement"),j=Yn(xt(E));!N&&j===E||We(d.current.floatingContext?.refs.floating.current,j)||We(E,j)||w||hf(N??j,l.context.triggerElements)||l.setOpen(!1,st(Yl,y))})}}},[d,o,l,g]);return x.useMemo(()=>a?{reference:b,trigger:b}:{},[a,b])}class i_{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ta,this.restTimeout=new ta,this.handleCloseOptions=void 0}static create(){return new i_}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Sf=new WeakMap;function Cf(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Sf.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Sf.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kC(e,t){const{scopeElement:a,referenceElement:o,floatingElement:l}=t,i=Sf.get(a);i&&i!==e&&Cf(i),Cf(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=a,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=l,Sf.set(a,e),a.style.pointerEvents="none",o.style.pointerEvents="auto",l.style.pointerEvents="auto"}function c_(e){const t=e.context.dataRef.current,a=ns(()=>t.hoverInteractionState??i_.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=a),Tb(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function wC(e,t={}){const{enabled:a=!0,closeDelay:o=0,nodeId:l}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),f=i.useState("floatingElement"),m=i.useState("domReferenceElement"),{dataRef:h}=i.context,g=eo(),b=Jr(),_=c_(i),k=En(),N=Ue(()=>yS(h.current.openEvent?.type,_.interactedInside)),y=Ue(()=>P4(h.current.openEvent?.type)),w=Ue(()=>{Cf(_)});De(()=>{d||(_.pointerType=void 0,_.restTimeoutPending=!1,_.interactedInside=!1,w())},[d,_,w]),x.useEffect(()=>w,[w]),De(()=>{if(a&&d&&_.handleCloseOptions?.blockPointerEvents&&y()&&_t(m)&&f){const E=m,j=f,S=xt(f),R=g?.nodesRef.current.find(M=>M.id===b)?.context?.elements.floating;R&&(R.style.pointerEvents="");const A=_.pointerEventsScopeElement!==j?_.pointerEventsScopeElement:null,T=R!==j?R:null,O=_.handleCloseOptions?.getScope?.()??A??T??E.closest("[data-rootownerid]")??S.body;return kC(_,{scopeElement:O,referenceElement:E,floatingElement:j}),()=>{w()}}},[a,d,m,f,_,y,g,b,w]),x.useEffect(()=>{if(!a)return;function E(){return!!(g&&b&&Yr(g.nodesRef.current,b).length>0)}function j(M){const B=ni(o,"close",_.pointerType),P=()=>{i.setOpen(!1,st(On,M)),g?.events.emit("floating.closed",M)};B?_.openChangeTimeout.start(B,P):(_.openChangeTimeout.clear(),P())}function S(M){const B=qn(M);if(!O4(B)){_.interactedInside=!1;return}_.interactedInside=B?.closest("[aria-haspopup]")!=null}function R(){_.openChangeTimeout.clear(),k.clear(),g?.events.off("floating.closed",T),w()}function A(M){if(E()&&g){g.events.on("floating.closed",T);return}if(hf(M.relatedTarget,i.context.triggerElements))return;const B=h.current.floatingContext?.nodeId??l,P=M.relatedTarget;if(!(g&&B&&_t(P)&&Yr(g.nodesRef.current,B,!1).some(D=>We(D.context?.elements.floating,P)))){if(_.handler){_.handler(M);return}w(),y()&&!N()&&j(M)}}function T(M){!g||!b||E()||k.start(0,()=>{g.events.off("floating.closed",T),i.setOpen(!1,st(On,M)),g.events.emit("floating.closed",M)})}const O=f;return xa(O&&bt(O,"mouseenter",R),O&&bt(O,"mouseleave",A),O&&bt(O,"pointerdown",S,!0),()=>{g?.events.off("floating.closed",T)})},[a,f,i,h,o,l,y,N,w,_,g,b,k])}const Qz={current:null};function SC(e,t={}){const{enabled:a=!0,delay:o=0,handleClose:l=null,mouseOnly:i=!1,restMs:d=0,move:f=!0,triggerElementRef:m=Qz,externalTree:h,isActiveTrigger:g=!0,getHandleCloseContext:b,isClosing:_,shouldOpen:k}=t,N="rootStore"in e?e.rootStore:e,{dataRef:y,events:w}=N.context,E=eo(h),j=c_(N),S=x.useRef(!1),R=pn(l),A=pn(o),T=pn(d),O=pn(a),M=pn(k),B=pn(_),P=Ue(()=>yS(y.current.openEvent?.type,j.interactedInside)),$=Ue(()=>M.current?.()!==!1),D=Ue((V,U,F)=>{const X=N.context.triggerElements;if(X.hasElement(U))return!V||!We(V,U);if(!_t(F))return!1;const G=F;return X.hasMatchingElement(Y=>We(Y,G))&&(!V||!We(V,G))}),L=Ue(()=>{if(!j.handler)return;xt(N.select("domReferenceElement")).removeEventListener("mousemove",j.handler),j.handler=void 0}),H=Ue(()=>{Cf(j)});return g&&(j.handleCloseOptions=R.current?.__options),x.useEffect(()=>L,[L]),x.useEffect(()=>{if(!a)return;function V(U){U.open?S.current=!1:(S.current=U.reason===On,L(),j.openChangeTimeout.clear(),j.restTimeout.clear(),j.blockMouseMove=!0,j.restTimeoutPending=!1)}return w.on("openchange",V),()=>{w.off("openchange",V)}},[a,w,j,L]),x.useEffect(()=>{if(!a)return;function V(G,Y=!0){const I=ni(A.current,"close",j.pointerType);I?j.openChangeTimeout.start(I,()=>{N.setOpen(!1,st(On,G)),E?.events.emit("floating.closed",G)}):Y&&(j.openChangeTimeout.clear(),N.setOpen(!1,st(On,G)),E?.events.emit("floating.closed",G))}const U=m.current??(g?N.select("domReferenceElement"):null);if(!_t(U))return;function F(G){if(j.openChangeTimeout.clear(),j.blockMouseMove=!1,i&&!Oo(j.pointerType))return;const Y=Cj(T.current),I=ni(A.current,"open",j.pointerType),Q=qn(G),J=G.currentTarget??null,K=N.select("domReferenceElement");let se=J;if(_t(Q)&&!N.context.triggerElements.hasElement(Q)){for(const Ce of N.context.triggerElements.elements())if(We(Ce,Q)){se=Ce;break}}_t(J)&&_t(K)&&!N.context.triggerElements.hasElement(J)&&We(J,K)&&(se=K);const te=se==null?!1:D(K,se,Q),le=N.select("open"),W=B.current?.()??N.select("transitionStatus")==="ending",ne=!le&&W&&S.current,ve=!te&&_t(se)&&_t(K)&&We(K,se)&&ne,oe=Y>0&&!I,fe=te&&(le||ne)||ve,we=!le||te;if(fe){$()&&N.setOpen(!0,st(On,G,se));return}oe||(I?j.openChangeTimeout.start(I,()=>{we&&$()&&N.setOpen(!0,st(On,G,se))}):we&&$()&&N.setOpen(!0,st(On,G,se)))}function X(G){if(P()){H();return}L();const Y=N.select("domReferenceElement"),I=xt(Y);j.restTimeout.clear(),j.restTimeoutPending=!1;const Q=y.current.floatingContext??b?.();if(hf(G.relatedTarget,N.context.triggerElements))return;if(R.current&&Q){N.select("open")||j.openChangeTimeout.clear();const K=m.current;j.handler=R.current({...Q,tree:E,x:G.clientX,y:G.clientY,onClose(){H(),L(),O.current&&!P()&&K===N.select("domReferenceElement")&&V(G,!0)}}),I.addEventListener("mousemove",j.handler),j.handler(G);return}(j.pointerType==="touch"?!We(N.select("floatingElement"),G.relatedTarget):!0)&&V(G)}return f?xa(bt(U,"mousemove",F,{once:!0}),bt(U,"mouseenter",F),bt(U,"mouseleave",X)):xa(bt(U,"mouseenter",F),bt(U,"mouseleave",X))},[L,H,y,A,N,a,R,j,g,D,P,i,f,T,m,E,O,b,B,$]),x.useMemo(()=>{if(!a)return;function V(U){j.pointerType=U.pointerType}return{onPointerDown:V,onPointerEnter:V,onMouseMove(U){const{nativeEvent:F}=U,X=U.currentTarget,G=N.select("domReferenceElement"),Y=N.select("open"),I=D(G,X,U.target);if(i&&!Oo(j.pointerType))return;if(Y&&I&&j.handleCloseOptions?.blockPointerEvents){const K=N.select("floatingElement");if(K){const se=j.handleCloseOptions?.getScope?.()??X.ownerDocument.body;kC(j,{scopeElement:se,referenceElement:X,floatingElement:K})}}const Q=Cj(T.current);if(Y&&!I||Q===0||!I&&j.restTimeoutPending&&U.movementX**2+U.movementY**2<2)return;j.restTimeout.clear();function J(){if(j.restTimeoutPending=!1,P())return;const K=N.select("open");!j.blockMouseMove&&(!K||I)&&$()&&N.setOpen(!0,st(On,F,X))}j.pointerType==="touch"?Fs.flushSync(()=>{J()}):I&&Y?J():(j.restTimeoutPending=!0,j.restTimeout.start(Q,J))}}},[a,j,P,D,i,N,T,$])}const Wz="Escape";function bp(e,t,a){switch(e){case"vertical":return t;case"horizontal":return a;default:return t||a}}function Md(e,t){return bp(t,e===vS||e===Lb,e===lp||e===ip)}function hh(e,t,a){return bp(t,e===Lb,a?e===lp:e===ip)||e==="Enter"||e===" "||e===""}function Zz(e,t,a){return bp(t,a?e===lp:e===ip,e===Lb)}function Jz(e,t,a,o){const l=a?e===ip:e===lp,i=e===vS;return t==="both"||t==="horizontal"&&o?e===Wz:bp(t,l,i)}function CC(e,t){const{listRef:a,activeIndex:o,onNavigate:l=()=>{},enabled:i=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:b=!1,focusItemOnOpen:_="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:N=!0,disabledIndices:y=void 0,orientation:w="vertical",parentOrientation:E,id:j,resetOnPointerLeave:S=!0,externalTree:R,grid:A}=t,T=A!=null,O="rootStore"in e?e.rootStore:e,M=O.useState("open"),B=O.useState("floatingElement"),P=O.useState("domReferenceElement"),$=O.context.dataRef,D=xf(B),L=Sx(P),H=pn(D),V=Jr(),U=eo(R),F=x.useRef(_),X=x.useRef(d??-1),G=x.useRef(null),Y=x.useRef(!0),I=Ue(me=>{l(X.current===-1?null:X.current,me)}),Q=x.useRef(!!B),J=x.useRef(M),K=x.useRef(!1),se=x.useRef(!1),te=x.useRef(null),le=pn(y),W=pn(M),ne=pn(d),ve=pn(S),oe=si(),fe=si(),we=Ue(()=>{function me(ze){b?U?.events.emit("virtualfocus",ze):te.current=af(ze,{sync:K.current,preventScroll:!0})}const Se=a.current[X.current],Ge=se.current;Se&&me(Se),(K.current?ze=>ze():ze=>oe.request(ze))(()=>{const ze=a.current[X.current]||Se;if(!ze)return;Se||me(ze),xe&&(Ge||!Y.current)&&ze.scrollIntoView?.({block:"nearest",inline:"nearest"})})});De(()=>{$.current.orientation=w},[$,w]),De(()=>{i&&(M&&B?(X.current=d??-1,F.current&&d!=null&&(se.current=!0,I())):Q.current&&(X.current=-1,I()))},[i,M,B,d,I]),De(()=>{if(i){if(!M){K.current=!1;return}if(B)if(o==null){if(K.current=!1,ne.current!=null)return;if(Q.current&&(X.current=-1,we()),(!J.current||!Q.current)&&F.current&&(G.current!=null||F.current===!0&&G.current==null)){let me=0;const Se=()=>{a.current[0]==null?(me<2&&(me?Ae=>fe.request(Ae):queueMicrotask)(Se),me+=1):(X.current=G.current==null||hh(G.current,w,g)||h?sf(a):Ex(a),G.current=null,I())};Se()}}else Oc(a.current,o)||(X.current=o,we(),se.current=!1)}},[i,M,B,o,ne,h,a,w,g,I,we,fe]),De(()=>{if(!i||B||!U||b||!Q.current)return;const me=U.nodesRef.current,Se=me.find(ze=>ze.id===V)?.context?.elements.floating,Ge=Yn(xt(P??Se??null)),Ae=me.some(ze=>ze.context&&We(ze.context.elements.floating,Ge));Se&&!Ae&&Y.current&&Se.focus({preventScroll:!0})},[i,B,P,U,V,b]),De(()=>{J.current=M,Q.current=!!B}),De(()=>{M||(G.current=null,F.current=_)},[M,_]);const Ce=o!=null,Le=Ue(me=>{if(!W.current)return;const Se=a.current.indexOf(me.currentTarget);Se!==-1&&(X.current!==Se||o!==Se)&&(X.current=Se,I(me))}),$e=Ue(()=>E??U?.nodesRef.current.find(me=>me.id===V)?.context?.dataRef?.current.orientation),Ee=Ue(()=>sf(a,le.current)),_e=Ue(me=>{if(Y.current=!1,K.current=!0,me.which===229||!W.current&&me.currentTarget===H.current)return;if(h&&Jz(me.key,w,g,T)){Md(me.key,$e())||fa(me),O.setOpen(!1,st(Cx,me.nativeEvent)),Kt(P)&&(b?U?.events.emit("virtualfocus",P):P.focus());return}const Se=X.current,Ge=sf(a,y),Ae=Ex(a,y);if(L||(me.key==="Home"&&(fa(me),X.current=Ge,I(me)),me.key==="End"&&(fa(me),X.current=Ae,I(me))),A!=null){const ze=A(me,X.current,a,w,m,g,y,Ge,Ae);if(ze!=null&&(X.current=ze,I(me)),w==="both")return}if(Md(me.key,w)){if(fa(me),M&&!b&&Yn(me.currentTarget.ownerDocument)===me.currentTarget){X.current=hh(me.key,w,g)?Ge:Ae,I(me);return}hh(me.key,w,g)?m?Se>=Ae?f&&Se!==a.current.length?X.current=-1:(K.current=!1,X.current=Ge):X.current=Qa(a.current,{startingIndex:Se,disabledIndices:y}):X.current=Math.min(Ae,Qa(a.current,{startingIndex:Se,disabledIndices:y})):m?Se<=Ge?f&&Se!==-1?X.current=a.current.length:(K.current=!1,X.current=Ae):X.current=Qa(a.current,{startingIndex:Se,decrement:!0,disabledIndices:y}):X.current=Math.max(Ge,Qa(a.current,{startingIndex:Se,decrement:!0,disabledIndices:y})),Oc(a.current,X.current)&&(X.current=-1),I(me)}}),xe=x.useMemo(()=>({onFocus(Se){K.current=!0,Le(Se)},onClick:({currentTarget:Se})=>Se.focus({preventScroll:!0}),onMouseMove(Se){K.current=!0,se.current=!1,k&&Le(Se)},onPointerLeave(Se){if(!W.current||!Y.current||Se.pointerType==="touch")return;K.current=!0;const Ge=Se.relatedTarget;if(!(!k||a.current.includes(Ge))&&ve.current&&(te.current?.(),te.current=null,X.current=-1,I(Se),!b)){const Ae=H.current,ze=Yn(xt(Ae));Ae&&We(Ae,ze)&&Ae.focus({preventScroll:!0})}}}),[Le,W,H,k,a,I,ve,b]),Re=x.useMemo(()=>b&&M&&Ce&&{"aria-activedescendant":`${j}-${o}`},[b,M,Ce,j,o]),Oe=x.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...L?{}:Re,onKeyDown(me){if(me.key==="Tab"&&me.shiftKey&&M&&!b){const Se=qn(me.nativeEvent);if(Se&&!We(H.current,Se))return;fa(me),O.setOpen(!1,st(zo,me.nativeEvent)),Kt(P)&&P.focus();return}_e(me)},onPointerMove(){Y.current=!0}}),[Re,_e,H,w,L,O,M,b,P]),Pe=x.useMemo(()=>{function me(Ae){O.setOpen(!0,st(Cx,Ae.nativeEvent,Ae.currentTarget))}function Se(Ae){_==="auto"&&Ob(Ae.nativeEvent)&&(F.current=!b)}function Ge(Ae){F.current=_,_==="auto"&&xS(Ae.nativeEvent)&&(F.current=!0)}return{onKeyDown(Ae){const ze=O.select("open");Y.current=!1;const tt=Ae.key.startsWith("Arrow"),ot=Zz(Ae.key,$e(),g),vt=Md(Ae.key,w),Mt=(h?ot:vt)||Ae.key==="Enter"||Ae.key.trim()==="";if(b&&ze)return _e(Ae);if(!(!ze&&!N&&tt)){if(Mt){const lt=Md(Ae.key,$e());G.current=h&<?null:Ae.key}if(h){ot&&(fa(Ae),ze?(X.current=Ee(),I(Ae)):me(Ae));return}vt&&(ne.current!=null&&(X.current=ne.current),fa(Ae),!ze&&N?me(Ae):_e(Ae),ze&&I(Ae))}},onFocus(Ae){O.select("open")&&!b&&(X.current=-1,I(Ae))},onPointerDown:Ge,onPointerEnter:Ge,onMouseDown:Se,onClick:Se}},[_e,_,Ee,h,I,O,N,w,$e,g,ne,b]),Be=x.useMemo(()=>({...Re,...Pe}),[Re,Pe]);return x.useMemo(()=>i?{reference:Be,floating:Oe,item:xe,trigger:Pe}:{},[i,Be,Oe,Pe,xe])}function NC(e,t){const{listRef:a,elementsRef:o,activeIndex:l,onMatch:i,disabledIndices:d,onTyping:f,enabled:m=!0,resetMs:h=750,selectedIndex:g=null}=t,b="rootStore"in e?e.rootStore:e,_=b.useState("open"),k=En(),N=x.useRef(""),y=x.useRef(g??l??-1),w=x.useRef(null),E=Ue(R=>{function A(H){const V=o?.current[H];return!V||fp(V)}function T(H){return A(H)?d==null||!vf(ar,H,d):!1}function O(H,V,U=0){if(H.length===0)return-1;const F=(U%H.length+H.length)%H.length,X=V.toLowerCase();for(let G=0;G<H.length;G+=1){const Y=(F+G)%H.length;if(!(!H[Y]?.toLowerCase().startsWith(X)||!T(Y)))return Y}return-1}const M=a.current;if(N.current.length>0&&R.key===" "&&(fa(R),f?.(!0)),N.current.length>0&&N.current[0]!==" "&&O(M,N.current)===-1&&R.key!==" "&&f?.(!1),M==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;_&&R.key!==" "&&(fa(R),f?.(!0));const B=N.current==="";B&&(y.current=g??l??-1),M.every((H,V)=>H&&T(V)?H[0]?.toLowerCase()!==H[1]?.toLowerCase():!0)&&N.current===R.key&&(N.current="",y.current=w.current),N.current+=R.key,k.start(h,()=>{N.current="",y.current=w.current,f?.(!1)});const D=((B?g??l??-1:y.current)??0)+1,L=O(M,N.current,D);L!==-1?(i?.(L),w.current=L):R.key!==" "&&(N.current="",f?.(!1))}),j=Ue(R=>{const A=R.relatedTarget,T=b.select("domReferenceElement"),O=b.select("floatingElement");We(T,A)||We(O,A)||(k.clear(),N.current="",y.current=w.current,f?.(!1))});De(()=>{!_&&g!==null||(k.clear(),w.current=null,N.current!==""&&(N.current=""))},[_,g,k]),De(()=>{_&&N.current===""&&(y.current=g??l??-1)},[_,g,l]);const S=x.useMemo(()=>({onKeyDown:E,onBlur:j}),[E,j]);return x.useMemo(()=>m?{reference:S,floating:S}:{},[m,S])}const ak=.1,e6=ak*ak,Vt=.5;function Od(e,t,a,o,l,i){return o>=t!=i>=t&&e<=(l-a)*(t-o)/(i-o)+a}function zd(e,t,a,o,l,i,d,f,m,h){let g=!1;return Od(e,t,a,o,l,i)&&(g=!g),Od(e,t,l,i,d,f)&&(g=!g),Od(e,t,d,f,m,h)&&(g=!g),Od(e,t,m,h,a,o)&&(g=!g),g}function t6(e,t,a){return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height}function Dd(e,t,a,o,l,i){const d=Math.min(a,l),f=Math.max(a,l),m=Math.min(o,i),h=Math.max(o,i);return e>=d&&e<=f&&t>=m&&t<=h}function EC(e={}){const{blockPointerEvents:t=!1}=e,a=new ta,o=({x:l,y:i,placement:d,elements:f,onClose:m,nodeId:h,tree:g})=>{const b=d?.split("-")[0];let _=!1,k=null,N=null,y=typeof performance<"u"?performance.now():0;function w(j,S){const R=performance.now(),A=R-y;if(k===null||N===null||A===0)return k=j,N=S,y=R,!1;const T=j-k,O=S-N,M=T*T+O*O,B=A*A*e6;return k=j,N=S,y=R,M<B}function E(){a.clear(),m()}return function(S){a.clear();const R=f.domReference,A=f.floating;if(!R||!A||b==null||l==null||i==null)return;const{clientX:T,clientY:O}=S,M=qn(S),B=S.type==="mouseleave",P=We(A,M),$=We(R,M);if(P&&(_=!0,!B))return;if($&&(_=!1,!B)){_=!0;return}if(B&&_t(S.relatedTarget)&&We(A,S.relatedTarget))return;function D(){return!!(g&&Yr(g.nodesRef.current,h).length>0)}function L(){D()||E()}if(D())return;const H=R.getBoundingClientRect(),V=A.getBoundingClientRect(),U=l>V.right-V.width/2,F=i>V.bottom-V.height/2,X=V.width>H.width,G=V.height>H.height,Y=(X?H:V).left,I=(X?H:V).right,Q=(G?H:V).top,J=(G?H:V).bottom;if(b==="top"&&i>=H.bottom-1||b==="bottom"&&i<=H.top+1||b==="left"&&l>=H.right-1||b==="right"&&l<=H.left+1){L();return}let K=!1;switch(b){case"top":K=Dd(T,O,Y,H.top+1,I,V.bottom-1);break;case"bottom":K=Dd(T,O,Y,V.top+1,I,H.bottom-1);break;case"left":K=Dd(T,O,V.right-1,J,H.left+1,Q);break;case"right":K=Dd(T,O,H.right-1,J,V.left+1,Q);break}if(K)return;if(_&&!t6(T,O,H)){L();return}if(!B&&w(T,O)){L();return}let se=!1;switch(b){case"top":{const te=X?Vt/2:Vt*4,le=X||U?l+te:l-te,W=X?l-te:U?l+te:l-te,ne=i+Vt+1,ve=U||X?V.bottom-Vt:V.top,oe=U?X?V.bottom-Vt:V.top:V.bottom-Vt;se=zd(T,O,le,ne,W,ne,V.left,ve,V.right,oe);break}case"bottom":{const te=X?Vt/2:Vt*4,le=X||U?l+te:l-te,W=X?l-te:U?l+te:l-te,ne=i-Vt,ve=U||X?V.top+Vt:V.bottom,oe=U?X?V.top+Vt:V.bottom:V.top+Vt;se=zd(T,O,le,ne,W,ne,V.left,ve,V.right,oe);break}case"left":{const te=G?Vt/2:Vt*4,le=G||F?i+te:i-te,W=G?i-te:F?i+te:i-te,ne=l+Vt+1,ve=F||G?V.right-Vt:V.left,oe=F?G?V.right-Vt:V.left:V.right-Vt;se=zd(T,O,ve,V.top,oe,V.bottom,ne,le,ne,W);break}case"right":{const te=G?Vt/2:Vt*4,le=G||F?i+te:i-te,W=G?i-te:F?i+te:i-te,ne=l-Vt,ve=F||G?V.left+Vt:V.right,oe=F?G?V.left+Vt:V.right:V.left+Vt;se=zd(T,O,ne,le,ne,W,ve,V.top,oe,V.bottom);break}}se?_||a.start(40,L):L()}};return o.__options={...e,blockPointerEvents:t},o}const n6={...l_,disabled:Me(e=>e.disabled),instantType:Me(e=>e.instantType),isInstantPhase:Me(e=>e.isInstantPhase),trackCursorAxis:Me(e=>e.trackCursorAxis),disableHoverablePopup:Me(e=>e.disableHoverablePopup),lastOpenChangeReason:Me(e=>e.openChangeReason),closeOnClick:Me(e=>e.closeOnClick),closeDelay:Me(e=>e.closeDelay),hasViewport:Me(e=>e.hasViewport)};class u_ extends gp{constructor(t,a,o=!1){const l=new ou,i={...s6(),...t};i.floatingRootContext=_C(l,a,o),super(i,{popupRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:l},n6)}setOpen=(t,a)=>{Fz(this,t,a,{extraState:{openChangeReason:a.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,st(bi,t))}static useStore(t,a){return gC(t,(l,i)=>new u_(a,l,i)).store}}function s6(){return{...r_(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const a6=Rb(function(t){const{disabled:a=!1,defaultOpen:o=!1,open:l,disableHoverablePopup:i=!1,trackCursorAxis:d="none",actionsRef:f,onOpenChange:m,onOpenChangeComplete:h,handle:g,triggerId:b,defaultTriggerId:_=null,children:k}=t,N=u_.useStore(g?.store,{open:o,openProp:l,activeTriggerId:_,triggerIdProp:b});xC(N,l,o,_),N.useControlledProp("openProp",l),N.useControlledProp("triggerIdProp",b),N.useContextCallback("onOpenChange",m),N.useContextCallback("onOpenChangeComplete",h);const y=N.useState("open"),w=!a&&y,E=N.useState("activeTriggerId"),j=N.useState("mounted"),S=N.useState("payload");N.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:i}),N.useSyncedValue("disabled",a),n_(N,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:A}=s_(w,N),T=N.useState("isInstantPhase"),O=N.useState("instantType"),M=N.useState("lastOpenChangeReason"),B=x.useRef(null);De(()=>{y&&a&&N.setOpen(!1,st(kS))},[y,a,N]),De(()=>{A==="ending"&&M===va||A!=="ending"&&T?(O!=="delay"&&(B.current=O),N.set("instantType","delay")):B.current!==null&&(N.set("instantType",B.current),B.current=null)},[A,T,M,O,N]),De(()=>{w&&E==null&&N.set("payload",void 0)},[N,E,w]);const P=x.useCallback(()=>{N.setOpen(!1,st(Ib))},[N]);x.useImperativeHandle(f,()=>({unmount:R,close:P}),[R,P]);const $=w||j||!a&&d!=="none";return n.jsxs(hS.Provider,{value:N,children:[$&&n.jsx(r6,{store:N,disabled:a,trackCursorAxis:d}),typeof k=="function"?k({payload:S}):k]})});function r6({store:e,disabled:t,trackCursorAxis:a}){const o=e.useState("floatingRootContext"),l=pp(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),i=UO(o,{enabled:!t&&a!=="none",axis:a==="none"?void 0:a}),d=x.useMemo(()=>Qn(i.reference,l.reference),[i.reference,l.reference]),f=x.useMemo(()=>Qn(i.trigger,l.trigger),[i.trigger,l.trigger]),m=x.useMemo(()=>Qn(xp,i.floating,l.floating),[i.floating,l.floating]);return a_(e,{activeTriggerProps:d,inactiveTriggerProps:f,popupProps:m}),null}let To=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Lo.startingStyle]="startingStyle",e[e.endingStyle=Lo.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Nf=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const o6={[Nf.popupOpen]:""},l6={[Nf.popupOpen]:"",[Nf.pressed]:""},i6={[To.open]:""},c6={[To.closed]:""},u6={[To.anchorHidden]:""},RC={open(e){return e?o6:null}},Mx={open(e){return e?l6:null}},Yo={open(e){return e?i6:c6},anchorHidden(e){return e?u6:null}};function ra(e){return Do(e,"base-ui")}const TC=x.createContext(void 0);function d6(){return x.useContext(TC)}let f6=(function(e){return e[e.popupOpen=Nf.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const p6=600,AC="data-base-ui-tooltip-trigger";function rk(e){if("composedPath"in e){const a=e.composedPath();for(let o=0;o<a.length;o+=1){const l=a[o];if(_t(l))return l}}const t=e.target;return _t(t)?t:null}function m6(e){let t=e;for(;t;){if(t.hasAttribute(AC))return t;const a=t.parentElement;if(a){t=a;continue}const o=t.getRootNode();t="host"in o&&_t(o.host)?o.host:null}return null}const g6=gS(function(t,a){const{render:o,className:l,style:i,handle:d,payload:f,disabled:m,delay:h,closeOnClick:g=!0,closeDelay:b,id:_,...k}=t,N=au(!0),y=d?.store??N;if(!y)throw new Error(cn(82));const w=ra(_),E=y.useState("isTriggerActive",w),j=y.useState("isOpenedByTrigger",w),S=y.useState("floatingRootContext"),R=x.useRef(null),A=h??p6,T=b??0,{registerTrigger:O,isMountedByThisTrigger:M}=bC(w,R,y,{payload:f,closeOnClick:g,closeDelay:T}),B=d6(),{delayRef:P,isInstantPhase:$,hasProvider:D}=U4(S,{open:j}),L=c_(S);y.useSyncedValue("isInstantPhase",$);const H=y.useState("disabled"),V=m??H,U=pn(V),F=y.useState("trackCursorAxis"),X=y.useState("disableHoverablePopup"),G=x.useRef(!1),Y=En(),I=x.useRef(void 0);function Q(){const fe=B?.delay,we=typeof P.current=="object"?P.current.open:void 0;let Ce=A;return D&&(we!==0?Ce=h??fe??A:Ce=0),Ce}function J(fe){const we=R.current;if(!we||!fe)return!1;const Ce=m6(fe);return Ce!==null&&Ce!==we&&We(we,Ce)}function K(fe){const we=J(fe);return G.current=we,we&&(L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1,Y.clear()),we}const se=SC(S,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!X&&F!=="both"?EC():null,restMs:Q,delay(){const fe=typeof P.current=="object"?P.current.close:void 0;let we=T;return b==null&&D&&(we=fe),{close:we}},triggerElementRef:R,isActiveTrigger:E,isClosing:()=>y.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),te=jC(S,{enabled:!V}).reference,le=fe=>{const we=G.current,Ce=rk(fe),Le=K(Ce),$e=R.current,Ee=$e&&Ce&&We($e,Ce);if(Le&&y.select("open")&&y.select("lastOpenChangeReason")===On){y.setOpen(!1,st(On,fe));return}if(we&&!Le&&Ee&&!U.current&&!y.select("open")&&$e&&Oo(I.current)){const _e=()=>{!G.current&&!U.current&&!y.select("open")&&y.setOpen(!0,st(On,fe,$e))},xe=Q();xe===0?(Y.clear(),_e()):Y.start(xe,_e)}},W=y.useState("triggerProps",M);return Et("button",t,{state:{open:j},ref:[a,O,R],props:[se,te,M||F!=="none"?W:void 0,{onMouseOver(fe){le(fe.nativeEvent)},onFocus(fe){J(rk(fe.nativeEvent))&&fe.preventBaseUIHandler()},onMouseLeave(){G.current=!1,Y.clear(),I.current=void 0},onPointerEnter(fe){I.current=fe.pointerType},onPointerDown(fe){I.current=fe.pointerType,y.set("closeOnClick",g),g&&!y.select("open")&&y.cancelPendingOpen(fe.nativeEvent)},onClick(fe){g&&!y.select("open")&&y.cancelPendingOpen(fe.nativeEvent)},id:w,[f6.triggerDisabled]:V?"":void 0,[AC]:V?void 0:""},k],stateAttributesMapping:RC})}),MC=x.createContext(void 0);function h6(){const e=x.useContext(MC);if(e===void 0)throw new Error(cn(70));return e}const x6=x.forwardRef(function(t,a){const{children:o,container:l,className:i,render:d,style:f,...m}=t,{portalNode:h,portalSubtree:g}=WS({container:l,ref:a,componentProps:t,elementProps:m});return!g&&!h?null:n.jsxs(x.Fragment,{children:[g,h&&Fs.createPortal(o,h)]})}),b6=x.forwardRef(function(t,a){const{keepMounted:o=!1,...l}=t;return au().useState("mounted")||o?n.jsx(MC.Provider,{value:o,children:n.jsx(x6,{ref:a,...l})}):null}),OC=x.createContext(void 0);function zC(){const e=x.useContext(OC);if(e===void 0)throw new Error(cn(71));return e}const _6=x.createContext(void 0);function _p(){return x.useContext(_6)?.direction??"ltr"}const v6=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:o,placement:l,rects:i,platform:d,elements:f,middlewareData:m}=t,{element:h,padding:g=0,offsetParent:b="real"}=or(e,t)||{};if(h==null)return{};const _=TS(g),k={x:a,y:o},N=qb(l),y=Hb(N),w=await d.getDimensions(h),E=N==="y",j=E?"top":"left",S=E?"bottom":"right",R=E?"clientHeight":"clientWidth",A=i.reference[y]+i.reference[N]-k[N]-i.floating[y],T=k[N]-i.reference[N],O=b==="real"?await d.getOffsetParent?.(h):f.floating;let M=f.floating[R]||i.floating[y];(!M||!await d.isElement?.(O))&&(M=f.floating[R]||i.floating[y]);const B=A/2-T/2,P=M/2-w[y]/2-1,$=Math.min(_[j],P),D=Math.min(_[S],P),L=$,H=M-w[y]-D,V=M/2-w[y]/2+B,U=RS(L,V,H),F=!m.arrow&&Zr(l)!=null&&V!==U&&i.reference[y]/2-(V<L?$:D)-w[y]/2<0,X=F?V<L?V-L:V-H:0;return{[N]:k[N]+X,data:{[N]:U,centerOffset:V-U-X,...F&&{alignmentOffset:X}},reset:F}}}),y6=(e,t)=>({...v6(e),options:[e,t]}),j6=Tz().fn,k6={name:"hide",async fn(e){const{width:t,height:a,x:o,y:l}=e.rects.reference,i=t===0&&a===0&&o===0&&l===0;return{data:{referenceHidden:(await j6(e)).data?.referenceHidden||i}}}},of={sideX:"left",sideY:"top"},DC={name:"adaptiveOrigin",async fn(e){const{x:t,y:a,rects:{floating:o},elements:{floating:l},platform:i,strategy:d,placement:f}=e,m=Qt(l),h=m.getComputedStyle(l);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:a,data:of};const b=await i.getOffsetParent?.(l);let _={width:0,height:0};if(d==="fixed"&&m?.visualViewport)_={width:m.visualViewport.width,height:m.visualViewport.height};else if(b===m){const j=xt(l);_={width:j.documentElement.clientWidth,height:j.documentElement.clientHeight}}else await i.isElement?.(b)&&(_=await i.getDimensions(b));const k=ws(f);let N=t,y=a;k==="left"&&(N=_.width-(t+o.width)),k==="top"&&(y=_.height-(a+o.height));const w=k==="left"?"right":of.sideX,E=k==="top"?"bottom":of.sideY;return{x:N,y,data:{sideX:w,sideY:E}}}};function PC(e,t,a){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?a?"inline-start":"inline-end":"right",bottom:"bottom",left:o?a?"inline-end":"inline-start":"left"}[t]}function ok(e,t,a){const{rects:o,placement:l}=e;return{side:PC(t,ws(l),a),align:Zr(l)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function d_(e){const{anchor:t,positionMethod:a="absolute",side:o="bottom",sideOffset:l=0,align:i="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:m=5,sticky:h=!1,arrowPadding:g=5,disableAnchorTracking:b=!1,inline:_,keepMounted:k=!1,floatingRootContext:N,mounted:y,collisionAvoidance:w,shiftCrossAxis:E=!1,nodeId:j,adaptiveOrigin:S,lazyFlip:R=!1,externalTree:A}=e,[T,O]=x.useState(null);!y&&T!==null&&O(null);const M=w.side||"flip",B=w.align||"flip",P=w.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,D=Ue($),L=$?D:t,H=pn(t),V=pn(y),F=_p()==="rtl",X=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[o],G=i==="center"?X:`${X}-${i}`;let Y=m;const I=1,Q=o==="bottom"?I:0,J=o==="top"?I:0,K=o==="right"?I:0,se=o==="left"?I:0;typeof Y=="number"?Y={top:Y+Q,right:Y+se,bottom:Y+J,left:Y+K}:Y&&(Y={top:(Y.top||0)+Q,right:(Y.right||0)+se,bottom:(Y.bottom||0)+J,left:(Y.left||0)+K});const te={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:Y},le=x.useRef(null),W=pn(l),ne=pn(d),ve=typeof l!="function"?l:0,oe=typeof d!="function"?d:0,fe=[];_&&fe.push(_),fe.push(Sz(Qe=>{const mt=ok(Qe,o,F),Ot=typeof W.current=="function"?W.current(mt):W.current,Jt=typeof ne.current=="function"?ne.current(mt):ne.current;return{mainAxis:Ot,crossAxis:Jt,alignmentAxis:Jt}},[ve,oe,F,o]));const we=B==="none"&&M!=="shift",Ce=!we&&(h||E||M==="shift"),Le=M==="none"?null:Ez({...te,padding:{top:Y.top+I,right:Y.right+I,bottom:Y.bottom+I,left:Y.left+I},mainAxis:!E&&M==="flip",crossAxis:B==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),$e=we?null:Cz(Qe=>{const mt=xt(Qe.elements.floating).documentElement;return{...te,rootBoundary:E?{x:0,y:0,width:mt.clientWidth,height:mt.clientHeight}:void 0,mainAxis:B!=="none",crossAxis:Ce,limiter:h||E?void 0:Nz(Ot=>{if(!le.current)return{};const{width:Jt,height:Wt}=le.current.getBoundingClientRect(),en=qs(ws(Ot.placement)),mn=en==="y"?Jt:Wt,rs=en==="y"?Y.left+Y.right:Y.top+Y.bottom;return{offset:mn/2+rs/2}})}},[te,h,E,Y,B]);M==="shift"||B==="shift"||i==="center"?fe.push($e,Le):fe.push(Le,$e),fe.push(Rz({...te,apply({elements:{floating:Qe},availableWidth:mt,availableHeight:Ot,rects:Jt}){if(!V.current)return;const Wt=Qe.style;Wt.setProperty("--available-width",`${mt}px`),Wt.setProperty("--available-height",`${Ot}px`);const en=Qt(Qe).devicePixelRatio||1,{x:mn,y:rs,width:hs,height:Es}=Jt.reference,gn=(Math.round((mn+hs)*en)-Math.round(mn*en))/en,Rs=(Math.round((rs+Es)*en)-Math.round(rs*en))/en;Wt.setProperty("--anchor-width",`${gn}px`),Wt.setProperty("--anchor-height",`${Rs}px`)}}),y6(Qe=>({element:le.current||xt(Qe.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(Qe){const{elements:mt,middlewareData:Ot,placement:Jt,rects:Wt,y:en}=Qe,mn=ws(Jt),rs=qs(mn),hs=le.current,Es=Ot.arrow?.x||0,gn=Ot.arrow?.y||0,Rs=hs?.clientWidth||0,Sa=hs?.clientHeight||0,Gs=Es+Rs/2,Ca=gn+Sa/2,dt=Math.abs(Ot.shift?.y||0),$t=Wt.reference.height/2,hn=typeof l=="function"?l(ok(Qe,o,F)):l,Rn=dt>hn,Sn={top:`${Gs}px calc(100% + ${hn}px)`,bottom:`${Gs}px ${-hn}px`,left:`calc(100% + ${hn}px) ${Ca}px`,right:`${-hn}px ${Ca}px`}[mn],Gt=`${Gs}px ${Wt.reference.y+$t-en}px`;return mt.floating.style.setProperty("--transform-origin",Ce&&rs==="y"&&Rn?Gt:Sn),{}}},k6,S),De(()=>{!y&&N&&N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,N]);const Ee=x.useMemo(()=>({elementResize:!b&&typeof ResizeObserver<"u",layoutShift:!b&&typeof IntersectionObserver<"u"}),[b]),{refs:_e,elements:xe,x:Re,y:Oe,middlewareData:Pe,update:Be,placement:me,context:Se,isPositioned:Ge,floatingStyles:Ae}=Xz({rootContext:N,open:k?y:void 0,placement:G,middleware:fe,strategy:a,whileElementsMounted:k?void 0:(...Qe)=>Wj(...Qe,Ee),nodeId:j,externalTree:A}),{sideX:ze,sideY:tt}=Pe.adaptiveOrigin||of,ot=Ge?a:"fixed",vt=x.useMemo(()=>{const Qe=S?{position:ot,[ze]:Re,[tt]:Oe}:{position:ot,...Ae};return Ge||(Qe.opacity=0),Qe},[S,ot,ze,Re,tt,Oe,Ae,Ge]),Mt=x.useRef(null);De(()=>{if(!y)return;const Qe=H.current,mt=typeof Qe=="function"?Qe():Qe,Jt=(lk(mt)?mt.current:mt)||null||null;Jt!==Mt.current&&(_e.setPositionReference(Jt),Mt.current=Jt)},[y,_e,L,H]),x.useEffect(()=>{if(!y)return;const Qe=H.current;typeof Qe!="function"&&lk(Qe)&&Qe.current!==Mt.current&&(_e.setPositionReference(Qe.current),Mt.current=Qe.current)},[y,_e,L,H]),x.useEffect(()=>{if(k&&y&&xe.reference&&xe.floating)return Wj(xe.reference,xe.floating,Be,Ee)},[k,y,xe,Be,Ee]);const lt=ws(me),Rt=PC(o,lt,F),je=Zr(me)||"center",Ie=!!Pe.hide?.referenceHidden;De(()=>{R&&y&&Ge&&O(lt)},[R,y,Ge,lt]);const Xe=x.useMemo(()=>({position:"absolute",top:Pe.arrow?.y,left:Pe.arrow?.x}),[Pe.arrow]),it=Pe.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:vt,arrowStyles:Xe,arrowRef:le,arrowUncentered:it,side:Rt,align:je,physicalSide:lt,anchorHidden:Ie,refs:_e,context:Se,isPositioned:Ge,update:Be}),[vt,Xe,le,it,Rt,je,lt,Ie,_e,Se,Ge,Be])}function lk(e){return e!=null&&"current"in e}function vp(e){return e==="starting"?MO:Xt}function f_(e,t,{styles:a,transitionStatus:o,props:l,refs:i,hidden:d,inert:f=!1}){const m={...a};return f&&(m.pointerEvents="none"),Et("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:d,style:m},vp(o),l],stateAttributesMapping:Yo})}const w6=x.forwardRef(function(t,a){const{render:o,className:l,anchor:i,positionMethod:d="absolute",side:f="top",align:m="center",sideOffset:h=0,alignOffset:g=0,collisionBoundary:b="clipping-ancestors",collisionPadding:_=5,arrowPadding:k=5,sticky:N=!1,disableAnchorTracking:y=!1,collisionAvoidance:w=KS,style:E,...j}=t,S=au(),R=h6(),A=S.useState("open"),T=S.useState("mounted"),O=S.useState("trackCursorAxis"),M=S.useState("disableHoverablePopup"),B=S.useState("floatingRootContext"),P=S.useState("instantType"),$=S.useState("transitionStatus"),D=S.useState("hasViewport"),L=d_({anchor:i,positionMethod:d,floatingRootContext:B,mounted:T,side:f,sideOffset:h,align:m,alignOffset:g,collisionBoundary:b,collisionPadding:_,sticky:N,arrowPadding:k,disableAnchorTracking:y,keepMounted:R,collisionAvoidance:w,adaptiveOrigin:D?DC:void 0}),H=x.useMemo(()=>({open:A,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:O!=="none"?"tracking-cursor":P}),[A,L.side,L.align,L.anchorHidden,O,P]),V=f_(t,H,{styles:L.positionerStyles,transitionStatus:$,props:j,refs:[a,S.useStateSetter("positionerElement")],hidden:!T,inert:!A||O==="both"||M});return n.jsx(OC.Provider,{value:L,children:V})}),S6={...Yo,...ur},C6=x.forwardRef(function(t,a){const{render:o,className:l,style:i,...d}=t,f=au(),{side:m,align:h}=zC(),g=f.useState("open"),b=f.useState("instantType"),_=f.useState("transitionStatus"),k=f.useState("popupProps"),N=f.useState("floatingRootContext"),y=f.useState("disabled"),w=f.useState("closeDelay");ka({open:g,ref:f.context.popupRef,onComplete(){g&&f.context.onOpenChangeComplete?.(!0)}}),wC(N,{enabled:!y,closeDelay:w});const E=f.useStateSetter("popupElement");return Et("div",t,{state:{open:g,side:m,align:h,instant:b,transitionStatus:_},ref:[a,f.context.popupRef,E],props:[k,vp(_),d],stateAttributesMapping:S6})}),N6=x.forwardRef(function(t,a){const{render:o,className:l,style:i,...d}=t,f=au(),{arrowRef:m,side:h,align:g,arrowUncentered:b,arrowStyles:_}=zC(),k=f.useState("open"),N=f.useState("instantType");return Et("div",t,{state:{open:k,side:h,align:g,uncentered:b,instant:N},ref:[a,m],props:[{style:_,"aria-hidden":!0},d],stateAttributesMapping:Yo})}),E6=function(t){const{delay:a,closeDelay:o,timeout:l=400}=t,i=x.useMemo(()=>({delay:a,closeDelay:o}),[a,o]),d=x.useMemo(()=>({open:a,close:o}),[a,o]);return n.jsx(TC.Provider,{value:i,children:n.jsx($4,{delay:d,timeoutMs:l,children:t.children})})};function yp(e){return Gb(19)?e:e?"true":void 0}function R6(e){const[t,a]=x.useState({current:e,previous:null});return e!==t.current&&a({current:e,previous:t.current}),t.previous}function Ct(...e){return mS(Hc(e))}function T6({delay:e=0,...t}){return n.jsx(E6,{"data-slot":"tooltip-provider",delay:e,...t})}function p_({...e}){return n.jsx(a6,{"data-slot":"tooltip",...e})}function m_({...e}){return n.jsx(g6,{"data-slot":"tooltip-trigger",...e})}function g_({className:e,side:t="top",sideOffset:a=4,align:o="center",alignOffset:l=0,children:i,...d}){return n.jsx(b6,{children:n.jsx(w6,{align:o,alignOffset:l,side:t,sideOffset:a,className:"isolate z-50",children:n.jsxs(C6,{"data-slot":"tooltip-content",className:Ct("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...d,children:[i,n.jsx(N6,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}function Pl({label:e,active:t,onClick:a,isAdd:o,isSettings:l,isDefault:i,icon:d,title:f,testId:m}){const h=e.trim()||"·",{initials:g,subLabel:b}=LC(h),_=o||l?"indigo":IC(h),k=b&&!o&&!l&&!i;return n.jsxs(p_,{children:[n.jsx(m_,{render:n.jsxs("button",{type:"button",onClick:a,"data-testid":m,className:"group relative flex w-full cursor-pointer flex-col items-center gap-1",children:[n.jsx("span",{className:ge("flex size-10 items-center justify-center rounded-xl text-sm font-bold transition-all",t&&"ring-2 ring-foreground ring-offset-2 ring-offset-card",o&&"border border-dashed border-muted-fg/50 bg-transparent text-muted-fg hover:bg-accent/60 hover:text-foreground",l&&"bg-muted text-muted-fg hover:bg-accent hover:text-foreground",i&&"overflow-hidden bg-muted",!o&&!l&&!i&&t&&z6(_),!o&&!l&&!i&&!t&&O6(_)),children:d??g}),k&&n.jsx("span",{className:"block max-w-[3.6rem] truncate text-[9px] leading-tight text-muted-fg group-hover:text-foreground",children:b})]})}),n.jsx(g_,{side:"right",children:f||e})]})}function LC(e){const t=e.trim().replace(/[_\-.]+/g," ").replace(/\s+/g," ");if(!t)return{initials:"·",subLabel:null};const a=t.split(" ");if(a.length>=2)return{initials:(a[0][0]+a[1][0]).toUpperCase(),subLabel:A6(t)};const o=a[0];return o.length<=4?{initials:o[0].toUpperCase(),subLabel:o}:{initials:o[0].toUpperCase(),subLabel:o.slice(0,4)+"…"}}function A6(e){return e.length>6?e.slice(0,5)+"…":e}function IC(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)|0;return vj[Math.abs(t)%vj.length]}const BC={sky:"bg-sky-500/15 text-sky-300 hover:bg-sky-500/25",violet:"bg-violet-500/15 text-violet-300 hover:bg-violet-500/25",emerald:"bg-emerald-500/15 text-emerald-300 hover:bg-emerald-500/25",amber:"bg-amber-500/15 text-amber-300 hover:bg-amber-500/25",rose:"bg-rose-500/15 text-rose-300 hover:bg-rose-500/25",indigo:"bg-indigo-500/15 text-indigo-300 hover:bg-indigo-500/25",teal:"bg-teal-500/15 text-teal-300 hover:bg-teal-500/25",fuchsia:"bg-fuchsia-500/15 text-fuchsia-300 hover:bg-fuchsia-500/25"},M6={sky:"bg-sky-500/30 text-sky-100",violet:"bg-violet-500/30 text-violet-100",emerald:"bg-emerald-500/30 text-emerald-100",amber:"bg-amber-500/30 text-amber-100",rose:"bg-rose-500/30 text-rose-100",indigo:"bg-indigo-500/30 text-indigo-100",teal:"bg-teal-500/30 text-teal-100",fuchsia:"bg-fuchsia-500/30 text-fuchsia-100"};function O6(e){return BC[e]}function z6(e){return M6[e]}function D6(e){const{initials:t}=LC(e);return{initials:t,idleClass:BC[IC(e)]}}function qe({content:e,side:t="top",children:a}){return e?n.jsxs(p_,{children:[n.jsx(m_,{render:a}),n.jsx(g_,{side:t,children:e})]}):a}const $C=x.createContext(void 0);function h_(e){const t=x.useContext($C);if(t===void 0&&!e)throw new Error(cn(33));return t}const UC=x.createContext(void 0);function to(e){const t=x.useContext(UC);if(t===void 0&&!e)throw new Error(cn(36));return t}const P6=x.createContext(void 0);function jp(e=!0){const t=x.useContext(P6);if(t===void 0&&!e)throw new Error(cn(25));return t}function oi({controlled:e,default:t,name:a,state:o="value"}){const{current:l}=x.useRef(e!==void 0),[i,d]=x.useState(t),f=l?e:i,m=x.useCallback(h=>{l||d(h)},[]);return[f,m]}const HC=x.createContext(void 0);function x_(e=!1){const t=x.useContext(HC);if(t===void 0&&!e)throw new Error(cn(16));return t}function L6(e){const{focusableWhenDisabled:t,disabled:a,composite:o=!1,tabIndex:l=0,isNativeButton:i}=e,d=o&&t!==!1,f=o&&t===!1;return{props:x.useMemo(()=>{const h={onKeyDown(g){a&&t&&g.key!=="Tab"&&g.preventDefault()}};return o||(h.tabIndex=l,!i&&a&&(h.tabIndex=t?l:-1)),(i&&(t||d)||!i&&a)&&(h["aria-disabled"]=a),i&&(!t||f)&&(h.disabled=a),h},[o,a,t,d,f,i,l])}}function no(e={}){const{disabled:t=!1,focusableWhenDisabled:a,tabIndex:o=0,native:l=!0,composite:i}=e,d=x.useRef(null),f=x_(!0),m=i??f!==void 0,{props:h}=L6({focusableWhenDisabled:a,disabled:t,composite:m,tabIndex:o,isNativeButton:l}),g=x.useCallback(()=>{const k=d.current;xh(k)&&m&&t&&h.disabled===void 0&&k.disabled&&(k.disabled=!1)},[t,h.disabled,m]);De(g,[g]);const b=x.useCallback((k={})=>{const{onClick:N,onMouseDown:y,onKeyUp:w,onKeyDown:E,onPointerDown:j,...S}=k;return Qn({onClick(R){if(t){R.preventDefault();return}N?.(R)},onMouseDown(R){t||y?.(R)},onKeyDown(R){if(t||(jf(R),E?.(R),R.baseUIHandlerPrevented))return;const A=R.target===R.currentTarget,T=R.currentTarget,O=xh(T),M=!l&&I6(T),B=A&&(l?O:!M),P=R.key==="Enter",$=R.key===" ",D=T.getAttribute("role"),L=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(A&&m&&$){if(R.defaultPrevented&&L)return;R.preventDefault(),M||l&&O?(T.click(),R.preventBaseUIHandler()):B&&(N?.(R),R.preventBaseUIHandler());return}B&&(!l&&($||P)&&R.preventDefault(),!l&&P&&N?.(R))},onKeyUp(R){if(!t){if(jf(R),w?.(R),R.target===R.currentTarget&&l&&m&&xh(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!l&&!m&&R.key===" "&&N?.(R)}},onPointerDown(R){if(t){R.preventDefault();return}j?.(R)}},l?{type:"button"}:{role:"button"},h,S)},[t,h,m,l]),_=Ue(k=>{d.current=k,g()});return{getButtonProps:b,buttonRef:_}}function xh(e){return Kt(e)&&e.tagName==="BUTTON"}function I6(e){return!!(e?.tagName==="A"&&e?.href)}function B6(e){const{closeOnClick:t,highlighted:a,id:o,nodeId:l,store:i,typingRef:d,itemRef:f,itemMetadata:m}=e,{events:h}=i.useState("floatingTreeRoot"),g=i.useState("open"),b=jp(!0),_=b!==void 0;return x.useMemo(()=>({id:o,role:"menuitem",tabIndex:g&&a?0:-1,onKeyDown(k){k.key===" "&&d?.current&&k.preventDefault()},onMouseMove(k){l&&h.emit("itemhover",{nodeId:l,target:k.currentTarget})},onClick(k){t&&h.emit("close",{domEvent:k,reason:Kl})},onMouseUp(k){if(b){const N=b.initialCursorPointRef.current;if(b.initialCursorPointRef.current=null,_&&N&&Math.abs(k.clientX-N.x)<=1&&Math.abs(k.clientY-N.y)<=1||_&&!Ab&&k.button===2)return}f.current&&i.context.allowMouseUpTriggerRef.current&&(!_||k.button===2)&&(!m||m.type==="regular-item")&&f.current.click()}}),[t,a,o,h,l,g,i,d,f,b,_,m])}const qC={type:"regular-item"};function VC(e){const{closeOnClick:t,disabled:a=!1,highlighted:o,id:l,store:i,typingRef:d=i.context.typingRef,nativeButton:f,itemMetadata:m,nodeId:h}=e,g=i.useState("disabled"),b=a||g,_=x.useRef(null),{getButtonProps:k,buttonRef:N}=no({disabled:b,focusableWhenDisabled:!0,native:f,composite:!0}),y=B6({closeOnClick:t,highlighted:o,id:l,nodeId:h,store:i,typingRef:d,itemRef:_,itemMetadata:m}),w=x.useCallback(j=>Qn(y,{onMouseEnter(){m.type==="submenu-trigger"&&m.setActive()}},j,k),[y,k,m]),E=rr(_,N);return x.useMemo(()=>({getItemProps:w,itemRef:E}),[w,E])}const FC=x.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function $6(){return x.useContext(FC)}let GC=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function lu(e={}){const{label:t,metadata:a,textRef:o,indexGuessBehavior:l,index:i}=e,{register:d,unregister:f,subscribeMapChange:m,elementsRef:h,labelsRef:g,nextIndexRef:b}=$6(),_=x.useRef(-1),[k,N]=x.useState(i??(l===GC.GuessFromOrder?()=>{if(_.current===-1){const E=b.current;b.current+=1,_.current=E}return _.current}:-1)),y=x.useRef(null),w=x.useCallback(E=>{if(y.current=E,k!==-1&&E!==null&&(h.current[k]=E,g)){const j=t!==void 0;g.current[k]=j?t:o?.current?.textContent??E.textContent}},[k,h,g,t,o]);return De(()=>{if(i!=null)return;const E=y.current;if(E)return d(E,a),()=>{f(E)}},[i,d,f,a]),De(()=>{if(i==null)return m(E=>{const j=y.current?E.get(y.current)?.index:null;j!=null&&N(j)})},[i,m,N]),{ref:w,index:k}}let ik=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const YC={checked(e){return e?{[ik.checked]:""}:{[ik.unchecked]:""}},...ur},U6=x.createContext(void 0),H6=x.forwardRef(function(t,a){const{render:o,className:l,id:i,label:d,nativeButton:f=!1,disabled:m=!1,closeOnClick:h=!0,style:g,...b}=t,_=lu({label:d}),k=h_(!0),N=ra(i),{store:y}=to(),w=y.useState("isActive",_.index),E=y.useState("itemProps"),{getItemProps:j,itemRef:S}=VC({closeOnClick:h,disabled:m,highlighted:w,id:N,store:y,nativeButton:f,nodeId:k?.context.nodeId,itemMetadata:qC});return Et("div",t,{state:{disabled:m,highlighted:w},props:[E,b,j],ref:[S,a,_.ref]})}),q6=x.createContext(void 0);function KC(e){return x.useContext(q6)}const Dc="ArrowUp",Pc="ArrowDown",Ef="ArrowLeft",Rf="ArrowRight",kp="Home",wp="End",XC=new Set([Ef,Rf]),V6=new Set([Ef,Rf,kp,wp]),QC=new Set([Dc,Pc]),F6=new Set([Dc,Pc,kp,wp]),WC=new Set([...XC,...QC]),Sp=new Set([...WC,kp,wp]),G6="Shift",Y6="Control",K6="Alt",X6="Meta",Q6=new Set([G6,Y6,K6,X6]);function W6(e){return Kt(e)&&e.tagName==="INPUT"}function ck(e){return!!(W6(e)&&e.selectionStart!=null||Kt(e)&&e.tagName==="TEXTAREA")}function uk(e,t,a,o){if(!e||!t||!t.scrollTo)return;let l=e.scrollLeft,i=e.scrollTop;const d=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(d&&o!=="vertical"){const m=dk(e,t,"left"),h=Pd(e),g=Pd(t);a==="ltr"&&(m+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-h.scrollPaddingRight?l=m+t.offsetWidth+g.scrollMarginRight-e.clientWidth+h.scrollPaddingRight:m-g.scrollMarginLeft<e.scrollLeft+h.scrollPaddingLeft&&(l=m-g.scrollMarginLeft-h.scrollPaddingLeft)),a==="rtl"&&(m-g.scrollMarginRight<e.scrollLeft+h.scrollPaddingLeft?l=m-g.scrollMarginLeft-h.scrollPaddingLeft:m+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-h.scrollPaddingRight&&(l=m+t.offsetWidth+g.scrollMarginRight-e.clientWidth+h.scrollPaddingRight))}if(f&&o!=="horizontal"){const m=dk(e,t,"top"),h=Pd(e),g=Pd(t);m-g.scrollMarginTop<e.scrollTop+h.scrollPaddingTop?i=m-g.scrollMarginTop-h.scrollPaddingTop:m+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-h.scrollPaddingBottom&&(i=m+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+h.scrollPaddingBottom)}e.scrollTo({left:l,top:i,behavior:"auto"})}function dk(e,t,a){const o=a==="left"?"offsetLeft":"offsetTop";let l=0;for(;t.offsetParent&&(l+=t[o],t.offsetParent!==e);)t=t.offsetParent;return l}function Pd(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Z6={...Yo,...ur},J6=x.forwardRef(function(t,a){const{render:o,className:l,style:i,finalFocus:d,...f}=t,{store:m}=to(),{side:h,align:g}=h_(),b=KC()!=null,_=m.useState("open"),k=m.useState("transitionStatus"),N=m.useState("popupProps"),y=m.useState("mounted"),w=m.useState("instantType"),E=m.useState("activeTriggerElement"),j=m.useState("parent"),S=m.useState("lastOpenChangeReason"),R=m.useState("rootId"),A=m.useState("floatingRootContext"),T=m.useState("floatingTreeRoot"),O=m.useState("closeDelay"),M=m.useState("activeTriggerElement"),B=m.useState("hoverEnabled"),P=m.useState("disabled"),$=m.useState("openMethod"),D=j.type==="context-menu";ka({open:_,ref:m.context.popupRef,onComplete(){_&&m.context.onOpenChangeComplete?.(!0)}}),x.useEffect(()=>{function F(X){m.setOpen(!1,st(X.reason,X.domEvent))}return T.events.on("close",F),()=>{T.events.off("close",F)}},[T.events,m]),wC(A,{enabled:B&&!P&&!D&&j.type!=="menubar",closeDelay:O});const L=x.useCallback(F=>{m.set("popupElement",F)},[m]),H={transitionStatus:k,side:h,align:g,open:_,nested:j.type==="menu",instant:w},V=Et("div",t,{state:H,ref:[a,m.context.popupRef,L],stateAttributesMapping:Z6,props:[N,{onKeyDown(F){b&&Sp.has(F.key)&&F.stopPropagation()}},vp(k),f,{"data-rootownerid":R}]});let U=j.type===void 0||D;return(E||j.type==="menubar"&&S!==up)&&(U=!0),n.jsx(Zb,{context:A,openInteractionType:$,modal:D,disabled:!y,returnFocus:d===void 0?U:d,initialFocus:j.type!=="menu",restoreFocus:!0,externalTree:j.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:j.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:j.type===void 0?m.context.beforeContentFocusGuardRef:void 0,children:V})}),ZC=x.createContext(void 0);function eD(){const e=x.useContext(ZC);if(e===void 0)throw new Error(cn(32));return e}const tD=x.forwardRef(function(t,a){const{keepMounted:o=!1,...l}=t,{store:i}=to();return i.useState("mounted")||o?n.jsx(ZC.Provider,{value:o,children:n.jsx(Xb,{ref:a,...l})}):null});function Cp(e){const{children:t,elementsRef:a,labelsRef:o,onMapChange:l}=e,i=Ue(l),d=x.useRef(0),f=ns(sD).current,m=ns(nD).current,[h,g]=x.useState(0),b=x.useRef(h),_=Ue((E,j)=>{m.set(E,j??null),b.current+=1,g(b.current)}),k=Ue(E=>{m.delete(E),b.current+=1,g(b.current)}),N=x.useMemo(()=>{const E=new Map;return Array.from(m.keys()).filter(S=>S.isConnected).sort(aD).forEach((S,R)=>{const A=m.get(S)??{};E.set(S,{...A,index:R})}),E},[m,h]);De(()=>{if(typeof MutationObserver!="function"||N.size===0)return;const E=new MutationObserver(j=>{const S=new Set,R=A=>S.has(A)?S.delete(A):S.add(A);j.forEach(A=>{A.removedNodes.forEach(R),A.addedNodes.forEach(R)}),S.size===0&&(b.current+=1,g(b.current))});return N.forEach((j,S)=>{S.parentElement&&E.observe(S.parentElement,{childList:!0})}),()=>{E.disconnect()}},[N]),De(()=>{b.current===h&&(a.current.length!==N.size&&(a.current.length=N.size),o&&o.current.length!==N.size&&(o.current.length=N.size),d.current=N.size),i(N)},[i,N,a,o,h]),De(()=>()=>{a.current=[]},[a]),De(()=>()=>{o&&(o.current=[])},[o]);const y=Ue(E=>(f.add(E),()=>{f.delete(E)}));De(()=>{f.forEach(E=>E(N))},[f,N]);const w=x.useMemo(()=>({register:_,unregister:k,subscribeMapChange:y,elementsRef:a,labelsRef:o,nextIndexRef:d}),[_,k,y,a,o,d]);return n.jsx(FC.Provider,{value:w,children:t})}function nD(){return new Map}function sD(){return new Set}function aD(e,t){const a=e.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_FOLLOWING||a&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:a&Node.DOCUMENT_POSITION_PRECEDING||a&Node.DOCUMENT_POSITION_CONTAINS?1:0}const b_=x.forwardRef(function(t,a){const{cutout:o,...l}=t;let i;if(o){const d=o.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${d.left}px ${d.top}px,${d.left}px ${d.bottom}px,${d.right}px ${d.bottom}px,${d.right}px ${d.top}px,${d.left}px ${d.top}px)`}return n.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});let fk={},pk={},mk="";function rD(e){if(typeof document>"u")return!1;const t=xt(e);return Qt(t).innerWidth-t.documentElement.clientWidth>0}function oD(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=xt(e),o=a.documentElement,l=a.body,i=Go(o)?o:l,d=i.style.overflowY,f=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",i.style.overflowY="scroll";const m=i.offsetWidth;i.style.overflowY="hidden";const h=i.offsetWidth;return i.style.overflowY=d,o.style.scrollbarGutter=f,m===h}function lD(e){const t=xt(e),a=t.documentElement,o=t.body,l=Go(a)?a:o,i={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,i)}}function iD(e){const t=xt(e),a=t.documentElement,o=t.body,l=Qt(a);let i=0,d=0,f=!1;const m=ma.create();if(Wr&&(l.visualViewport?.scale??1)!==1)return()=>{};function h(){const k=l.getComputedStyle(a),N=l.getComputedStyle(o),E=(k.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=a.scrollTop,d=a.scrollLeft,fk={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},mk=a.style.scrollBehavior,pk={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const j=a.scrollHeight>a.clientHeight,S=a.scrollWidth>a.clientWidth,R=k.overflowY==="scroll"||N.overflowY==="scroll",A=k.overflowX==="scroll"||N.overflowX==="scroll",T=Math.max(0,l.innerWidth-o.clientWidth),O=Math.max(0,l.innerHeight-o.clientHeight),M=parseFloat(N.marginTop)+parseFloat(N.marginBottom),B=parseFloat(N.marginLeft)+parseFloat(N.marginRight),P=Go(a)?a:o;if(f=oD(e),f){a.style.scrollbarGutter=E,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(j||R)&&(a.style.overflowY="scroll"),(S||A)&&(a.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:M||O?`calc(100dvh - ${M+O}px)`:"100dvh",width:B||T?`calc(100vw - ${B+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=i,o.scrollLeft=d,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function g(){Object.assign(a.style,fk),Object.assign(o.style,pk),f||(a.scrollTop=i,a.scrollLeft=d,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=mk)}function b(){g(),m.request(h)}h();const _=bt(l,"resize",b);return()=>{m.cancel(),g(),typeof l.removeEventListener=="function"&&_()}}class cD{lockCount=0;restore=null;timeoutLock=ta.create();timeoutUnlock=ta.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=xt(t).documentElement,l=Qt(o).getComputedStyle(o).overflowY;if(l==="hidden"||l==="clip"){this.restore=Mn;return}const i=sp||!rD(t);this.restore=i?lD(t):iD(t)}}const uD=new cD;function JC(e=!0,t=null){De(()=>{if(e)return uD.acquire(t)},[e,t])}const dD=20;function eN(e,t,a,o){const[l,i]=x.useState(!1);De(()=>{if(!e||!t||a==null){i(!1);return}const d=xt(a).documentElement.clientWidth,f=a.offsetWidth;i(d>0&&f>0&&f>=d-dD)},[e,t,a]),JC(e&&(!t||l),o)}const fD=x.forwardRef(function(t,a){const{anchor:o,positionMethod:l="absolute",className:i,render:d,side:f,align:m,sideOffset:h=0,alignOffset:g=0,collisionBoundary:b="clipping-ancestors",collisionPadding:_=5,arrowPadding:k=5,sticky:N=!1,disableAnchorTracking:y=!1,collisionAvoidance:w=YS,style:E,...j}=t,{store:S}=to(),R=eD(),A=jp(!0),T=S.useState("parent"),O=S.useState("floatingRootContext"),M=S.useState("floatingTreeRoot"),B=S.useState("mounted"),P=S.useState("open"),$=S.useState("modal"),D=S.useState("openMethod"),L=S.useState("activeTriggerElement"),H=S.useState("transitionStatus"),V=S.useState("positionerElement"),U=S.useState("instantType"),F=S.useState("hasViewport"),X=S.useState("lastOpenChangeReason"),G=S.useState("floatingNodeId"),Y=S.useState("floatingParentNodeId"),I=O.useState("domReferenceElement"),Q=x.useRef(null),J=mC(V,!1,!1);let K=o,se=h,te=g,le=m,W=w;T.type==="context-menu"&&(K=o??T.context?.anchor,le=le??"start",!f&&le!=="center"&&(te=t.alignOffset??2,se=t.sideOffset??-5));let ne=f,ve=le;T.type==="menu"?(ne=ne??"inline-end",ve=ve??"start",W=t.collisionAvoidance??KS):T.type==="menubar"&&(ne=ne??(T.context.orientation==="vertical"?"inline-end":"bottom"),ve=ve??"start");const oe=T.type==="context-menu",fe=d_({anchor:K,floatingRootContext:O,positionMethod:A?"fixed":l,mounted:B,side:ne,sideOffset:se,align:ve,alignOffset:te,arrowPadding:oe?0:k,collisionBoundary:b,collisionPadding:_,sticky:N,nodeId:G,keepMounted:R,disableAnchorTracking:y,collisionAvoidance:W,shiftCrossAxis:oe&&!("side"in W&&W.side==="flip"),externalTree:M,adaptiveOrigin:F?DC:void 0});x.useEffect(()=>{function Re(Oe){Oe.open&&(Oe.parentNodeId===G&&S.set("hoverEnabled",!1),Oe.nodeId!==G&&Oe.parentNodeId===S.select("floatingParentNodeId")&&S.setOpen(!1,st(wc)))}return M.events.on("menuopenchange",Re),()=>{M.events.off("menuopenchange",Re)}},[S,M.events,G]),x.useEffect(()=>{if(S.select("floatingParentNodeId")==null)return;function Re(Oe){if(Oe.open||Oe.nodeId!==S.select("floatingParentNodeId"))return;const Pe=Oe.reason??wc;S.setOpen(!1,st(Pe))}return M.events.on("menuopenchange",Re),()=>{M.events.off("menuopenchange",Re)}},[M.events,S]);const we=En();x.useEffect(()=>{P||we.clear()},[P,we]),x.useEffect(()=>{function Re(Oe){if(!(!P||Oe.nodeId!==S.select("floatingParentNodeId")))if(Oe.target&&L&&L!==Oe.target){const Pe=S.select("closeDelay");Pe>0?we.isStarted()||we.start(Pe,()=>{S.setOpen(!1,st(wc))}):S.setOpen(!1,st(wc))}else we.clear()}return M.events.on("itemhover",Re),()=>{M.events.off("itemhover",Re)}},[M.events,P,L,S,we]),x.useEffect(()=>{const Re={open:P,nodeId:G,parentNodeId:Y,reason:S.select("lastOpenChangeReason")};M.events.emit("menuopenchange",Re)},[M.events,P,S,G,Y]),De(()=>{const Re=I,Oe=Q.current;if(Re&&(Q.current=Re),Oe&&Re&&Re!==Oe){S.set("instantType",void 0);const Pe=new AbortController;return J(()=>{S.set("instantType","trigger-change")},Pe.signal),()=>{Pe.abort()}}},[I,J,S]);const Ce={open:P,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:T.type==="menu",instant:U},Le=T.type==="menubar"&&T.context.modal;eN(P&&(Le||$&&X!==On),D==="touch",V,L);const Ee=f_(t,Ce,{styles:fe.positionerStyles,transitionStatus:H,props:j,refs:[a,S.useStateSetter("positionerElement")],hidden:!B,inert:!P}),_e=B&&T.type!=="menu"&&(T.type!=="menubar"&&$&&X!==On||T.type==="menubar"&&T.context.modal);let xe=null;return T.type==="menubar"?xe=T.context.contentElement:T.type===void 0&&(xe=L),n.jsxs($C.Provider,{value:fe,children:[_e&&n.jsx(b_,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:yp(!P),cutout:xe}),n.jsx(PO,{id:G,children:n.jsx(Cp,{elementsRef:S.context.itemDomElements,labelsRef:S.context.itemLabels,children:Ee})})]})}),tN=x.createContext(void 0);function pD(){const e=x.useContext(tN);if(e===void 0)throw new Error(cn(34));return e}const mD=x.memo(x.forwardRef(function(t,a){const{render:o,className:l,value:i,defaultValue:d,onValueChange:f,disabled:m=!1,style:h,"aria-labelledby":g,...b}=t,[_,k]=x.useState(void 0),[N,y]=oi({controlled:i,default:d,name:"MenuRadioGroup"}),w=Ue((R,A)=>{f?.(R,A),!A.isCanceled&&y(R)}),j=Et("div",t,{state:{disabled:m},ref:a,props:{role:"group","aria-labelledby":g??_,"aria-disabled":m||void 0,...b}}),S=x.useMemo(()=>({value:N,setValue:w,disabled:m}),[N,w,m]);return n.jsx(U6.Provider,{value:k,children:n.jsx(tN.Provider,{value:S,children:j})})})),nN=x.createContext(void 0);function gD(){const e=x.useContext(nN);if(e===void 0)throw new Error(cn(35));return e}const hD=x.forwardRef(function(t,a){const{render:o,className:l,id:i,label:d,nativeButton:f=!1,disabled:m=!1,closeOnClick:h=!1,value:g,style:b,..._}=t,k=lu({label:d}),N=h_(!0),y=ra(i),{store:w}=to(),E=w.useState("isActive",k.index),j=w.useState("itemProps"),{value:S,setValue:R,disabled:A}=pD(),T=A||m,O=S===g,{getItemProps:M,itemRef:B}=VC({closeOnClick:h,disabled:T,highlighted:E,id:y,store:w,nativeButton:f,nodeId:N?.context.nodeId,itemMetadata:qC}),P=x.useMemo(()=>({disabled:T,highlighted:E,checked:O}),[T,E,O]);function $(L){const H=st(Kl,L.nativeEvent,void 0,{preventUnmountOnClose(){}});R(g,H)}const D=Et("div",t,{state:P,stateAttributesMapping:YC,props:[j,{role:"menuitemradio","aria-checked":O,onClick:$},_,M],ref:[B,a,k.ref]});return n.jsx(nN.Provider,{value:P,children:D})}),xD=x.forwardRef(function(t,a){const{render:o,className:l,style:i,keepMounted:d=!1,...f}=t,m=gD(),h=x.useRef(null),{transitionStatus:g,setMounted:b}=_i(m.checked);ka({open:m.checked,ref:h,onComplete(){m.checked||b(!1)}});const _={checked:m.checked,disabled:m.disabled,highlighted:m.highlighted,transitionStatus:g};return Et("span",t,{state:_,stateAttributesMapping:YC,ref:[a,h],props:{"aria-hidden":!0,...f},enabled:d||m.checked})}),bD=x.createContext(null);function sN(e){return x.useContext(bD)}function _D(e){const t=x.useRef(""),a=x.useCallback(l=>{l.defaultPrevented||(t.current=l.pointerType,e(l,l.pointerType))},[e]);return{onClick:x.useCallback(l=>{if(l.detail===0){e(l,"keyboard");return}"pointerType"in l?e(l,l.pointerType):e(l,t.current),t.current=""},[e]),onPointerDown:a}}function __(e,t){const a=x.useRef(e),o=Ue(t);De(()=>{a.current!==e&&o(a.current)},[e,o]),De(()=>{a.current=e},[e])}function vD(e,t){const a=Ue((i,d)=>{(typeof e=="function"?e():e)||t(d||(sp?"touch":""))}),{onClick:o,onPointerDown:l}=_D(a);return x.useMemo(()=>({onClick:o,onPointerDown:l}),[o,l])}function aN(e){const[t,a]=x.useState(null),o=vD(e,a);return __(e,l=>{l&&!e&&a(null)}),x.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const yD={...l_,disabled:Me(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Me(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Me(e=>e.openMethod),allowMouseEnter:Me(e=>e.allowMouseEnter),highlightItemOnHover:Me(e=>e.highlightItemOnHover),stickIfOpen:Me(e=>e.stickIfOpen),parent:Me(e=>e.parent),rootId:Me(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Me(e=>e.activeIndex),isActive:Me((e,t)=>e.activeIndex===t),hoverEnabled:Me(e=>e.hoverEnabled),instantType:Me(e=>e.instantType),lastOpenChangeReason:Me(e=>e.openChangeReason),floatingTreeRoot:Me(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Me(e=>e.floatingNodeId),floatingParentNodeId:Me(e=>e.floatingParentNodeId),itemProps:Me(e=>e.itemProps),closeDelay:Me(e=>e.closeDelay),hasViewport:Me(e=>e.hasViewport),keyboardEventRelay:Me(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class v_ extends gp{constructor(t){super({...jD(),...t},{positionerRef:x.createRef(),popupRef:x.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),onOpenChangeComplete:void 0,triggerElements:new ou},yD),this.unsubscribeParentListener=this.observe("parent",a=>{if(this.unsubscribeParentListener?.(),a.type==="menu"){let o=a.store.select("rootId"),l=a.store.select("floatingTreeRoot"),i=a.store.select("keyboardEventRelay");this.unsubscribeParentListener=a.store.subscribe(()=>{const d=a.store.select("rootId"),f=a.store.select("floatingTreeRoot"),m=a.store.select("keyboardEventRelay");o===d&&l===f&&i===m||(o=d,l=f,i=m,this.notifyAll())}),this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;return}a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:a})}static useStore(t,a){const o=ns(()=>new v_(a)).current;return t??o}unsubscribeParentListener=null}function jD(){return{...r_(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Qb,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Xt,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const kD=x.createContext(void 0);function wD(){return x.useContext(kD)}const SD=Rb(function(t){const{children:a,open:o,onOpenChange:l,onOpenChangeComplete:i,defaultOpen:d=!1,disabled:f=!1,modal:m,loopFocus:h=!0,orientation:g="vertical",actionsRef:b,closeParentOnEsc:_=!1,handle:k,triggerId:N,defaultTriggerId:y=null,highlightItemOnHover:w=!0}=t,E=jp(!0),j=to(!0),S=sN(!0),R=wD(),A=x.useMemo(()=>R&&j?{type:"menu",store:j.store}:S?{type:"menubar",context:S}:E&&!j?{type:"context-menu",context:E}:{type:void 0},[E,j,S,R]),T=v_.useStore(k?.store,{open:d,openProp:o,activeTriggerId:y,triggerIdProp:N,parent:A});xC(T,o,d,y),T.useControlledProp("openProp",o),T.useControlledProp("triggerIdProp",N),T.useContextCallback("onOpenChangeComplete",i);const O=Do(),M=Do(),B=T.useState("floatingTreeRoot"),P=tC(B),$=Jr(),D=T.useState("open"),L=T.useState("activeTriggerElement"),H=T.useState("positionerElement"),V=T.useState("hoverEnabled"),U=T.useState("disabled"),F=T.useState("lastOpenChangeReason"),X=T.useState("parent"),G=T.useState("activeIndex"),Y=T.useState("payload"),I=T.useState("floatingParentNodeId"),Q=x.useRef(null),J=x.useRef(X.type!=="context-menu"),K=En(),se=x.useRef(!0),te=En(),le=I!=null,{openMethod:W,triggerProps:ne}=aN(D);T.useSyncedValues({disabled:f,highlightItemOnHover:w,modal:X.type===void 0?m:void 0,openMethod:W,rootId:O}),n_(T);const{forceUnmount:ve}=s_(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0})});De(()=>{E&&!j?T.update({parent:{type:"context-menu",context:E},floatingNodeId:P,floatingParentNodeId:$}):j&&T.update({floatingNodeId:P,floatingParentNodeId:$})},[E,j,P,$,T]),x.useEffect(()=>{if(D||(Q.current=null),X.type==="context-menu"){if(!D){K.clear(),J.current=!1;return}K.start(500,()=>{J.current=!0})}},[K,D,X.type]),De(()=>{!D&&!V&&T.set("hoverEnabled",!0)},[D,V,T]);const oe=Ue((ze,tt)=>{const ot=tt.reason;if(D===ze&&tt.trigger===L&&F===ot)return;const vt=hC(tt);if(!ze&&tt.trigger==null&&(tt.trigger=L??void 0),l?.(ze,tt),tt.isCanceled)return;T.state.floatingRootContext.dispatchOpenChange(ze,tt);const Mt=tt.event;if(ze===!1&&Mt?.type==="click"&&Mt.pointerType==="touch"&&!se.current)return;ze&&ot===Yl?(se.current=!1,te.start(300,()=>{se.current=!0})):(se.current=!0,te.clear());const lt=(ot===bi||ot===Kl)&&Mt.detail===0&&Mt?.isTrusted,Rt=!ze&&(ot===dp||ot==null),je={open:ze,openChangeReason:ot};Q.current=tt.event??null,t_(je,ze,tt.trigger,vt()),T.update(je),X.type==="menubar"&&(ot===Yl||ot===zo||ot===On||ot===Cx||ot===wc)?T.set("instantType","group"):lt||Rt?T.set("instantType",lt?"click":"dismiss"):T.set("instantType",void 0)}),fe=pC({popupStore:T,floatingId:M,nested:$!=null,onOpenChange:oe}),we=fe.context.events;x.useEffect(()=>{const ze=({open:tt,eventDetails:ot})=>oe(tt,ot);return we.on("setOpen",ze),()=>{we?.off("setOpen",ze)}},[we,oe]);const Ce=x.useCallback(()=>{T.setOpen(!1,st(Ib))},[T]);x.useImperativeHandle(b,()=>({unmount:ve,close:Ce}),[ve,Ce]);let Le;X.type==="context-menu"&&(Le=X.context),x.useImperativeHandle(Le?.positionerRef,()=>H,[H]),x.useImperativeHandle(Le?.actionsRef,()=>({setOpen:oe}),[oe]);const $e=pp(fe,{enabled:!U,bubbles:{escapeKey:_&&X.type==="menu"},outsidePress(){return X.type!=="context-menu"||Q.current?.type==="contextmenu"?!0:J.current},externalTree:le?B:void 0}),Ee=_p(),_e=x.useCallback(ze=>{T.select("activeIndex")!==ze&&T.set("activeIndex",ze)},[T]),xe=CC(fe,{enabled:!U,listRef:T.context.itemDomElements,activeIndex:G,nested:X.type!==void 0,loopFocus:h,orientation:g,parentOrientation:X.type==="menubar"?X.context.orientation:void 0,rtl:Ee==="rtl",disabledIndices:ar,onNavigate:_e,openOnArrowKeyDown:X.type!=="context-menu",externalTree:le?B:void 0,focusItemOnHover:w}),Re=x.useCallback(ze=>{T.context.typingRef.current=ze},[T]),Oe=NC(fe,{enabled:!U,listRef:T.context.itemLabels,elementsRef:T.context.itemDomElements,activeIndex:G,resetMs:TO,onMatch:ze=>{D&&ze!==G&&T.set("activeIndex",ze)},onTyping:Re}),Pe=x.useMemo(()=>{const ze=Qn(Oe.reference,xe.reference,$e.reference,{onMouseMove(){T.set("allowMouseEnter",!0)}},ne);return ze["aria-haspopup"]="menu",ze["aria-expanded"]=D,ze},[T,Oe.reference,xe.reference,$e.reference,ne,D]),Be=x.useMemo(()=>{const ze=Qn(xe.trigger,$e.trigger,ne);return ze["aria-haspopup"]="menu",ze["aria-expanded"]=!1,ze},[xe.trigger,$e.trigger,ne]),me=x.useMemo(()=>Qn(xp,{id:M,role:"menu","aria-labelledby":L?.id,onMouseMove(){T.set("allowMouseEnter",!0),X.type==="menu"&&T.set("hoverEnabled",!1)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(ze){const tt=T.select("keyboardEventRelay");tt&&!ze.isPropagationStopped()&&tt(ze)}},Oe.floating,xe.floating,$e.floating),[L,M,X.type,T,Oe.floating,xe.floating,$e.floating]),Se=xe.item??Xt;a_(T,{floatingRootContext:fe,activeTriggerProps:Pe,inactiveTriggerProps:Be,popupProps:me,itemProps:Se});const Ge=x.useMemo(()=>({store:T,parent:A}),[T,A]),Ae=n.jsx(UC.Provider,{value:Ge,children:typeof a=="function"?a({payload:Y}):a});return X.type===void 0||X.type==="context-menu"?n.jsx(LO,{externalTree:B,children:Ae}):Ae});function rN(e){const t=e.getBoundingClientRect(),a=Qt(e);if(Mb)return t;const o=a.getComputedStyle(e,"::before"),l=a.getComputedStyle(e,"::after");if(!(o.content!=="none"||l.content!=="none"))return t;const d=parseFloat(o.width)||0,f=parseFloat(o.height)||0,m=parseFloat(l.width)||0,h=parseFloat(l.height)||0,g=Math.max(t.width,d,m),b=Math.max(t.height,f,h),_=g-t.width,k=b-t.height;return{left:t.left-_/2,right:t.right+_/2,top:t.top-k/2,bottom:t.bottom+k/2}}function oN(e={}){const{highlightItemOnHover:t,highlightedIndex:a,onHighlightedIndexChange:o}=x_(),{ref:l,index:i}=lu(e),d=a===i,f=x.useRef(null),m=rr(l,f);return{compositeProps:{tabIndex:d?0:-1,onFocus(){o(i)},onMouseMove(){const g=f.current;if(!t||!g)return;const b=g.hasAttribute("disabled")||g.ariaDisabled==="true";!d&&!b&&g.focus()}},compositeRef:m,index:i}}function CD(e){const{render:t,className:a,style:o,state:l=Xt,props:i=ar,refs:d=ar,metadata:f,stateAttributesMapping:m,tag:h="div",...g}=e,{compositeProps:b,compositeRef:_}=oN({metadata:f});return Et(h,e,{state:l,ref:[...d,_],props:[b,...i,g],stateAttributesMapping:m})}function lN(e){if(Kt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ja(e))return lN(sr(e))}function ND(e,t){const a=x.useRef(null);function o(i){Fs.flushSync(()=>{e.setOpen(!1,st(zo,i.nativeEvent,i.currentTarget))}),fO(a.current)?.focus()}function l(i){const d=e.select("positionerElement");if(d&&Xl(i,d))e.context.beforeContentFocusGuardRef.current?.focus();else{Fs.flushSync(()=>{e.setOpen(!1,st(zo,i.nativeEvent,i.currentTarget))});let f=dO(e.context.triggerFocusTargetRef.current||t.current);for(;f!==null&&We(d,f);){const m=f;if(f=Fb(f),f===m)break}f?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:o,handleFocusTargetFocus:l}}function ED(e){const{enabled:t=!0,mouseDownAction:a,open:o}=e,l=x.useRef(!1);return x.useMemo(()=>t?{onMouseDown:i=>{(a==="open"&&!o||a==="close"&&o)&&(l.current=!0,xt(i.currentTarget).addEventListener("click",()=>{l.current=!1},{once:!0}))},onClick:i=>{l.current&&(l.current=!1,i.preventBaseUIHandler())}}:Xt,[t,a,o])}const Ld=2,RD=gS(function(t,a){const{render:o,className:l,style:i,disabled:d=!1,nativeButton:f=!0,id:m,openOnHover:h,delay:g=100,closeDelay:b=0,handle:_,payload:k,...N}=t,y=to(!0),w=_?.store??y?.store;if(!w)throw new Error(cn(85));const E=ra(m),j=w.useState("isTriggerActive",E),S=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",E),A=w.useState("triggerPopupId",E),T=x.useRef(null),O=AD(),M=x_(!0),B=eo(),P=x.useMemo(()=>B??new Qb,[B]),$=tC(P),D=Jr(),{registerTrigger:L,isMountedByThisTrigger:H}=bC(E,T,w,{payload:k,closeDelay:b,parent:O,floatingTreeRoot:P,floatingNodeId:$,floatingParentNodeId:D,keyboardEventRelay:M?.relayKeyboardEvent}),V=O.type==="menubar",U=w.useState("disabled"),F=d||U||V&&O.context.disabled,{getButtonProps:X,buttonRef:G}=no({disabled:F,native:f});x.useEffect(()=>{!R&&O.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,R,O.type]);const Y=x.useRef(null),I=En(),Q=Ue(xe=>{if(!Y.current)return;I.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Re=xe.target;if(We(Y.current,Re)||We(w.select("positionerElement"),Re)||Re===Y.current||Re!=null&&lN(Re)===w.select("rootId"))return;const Oe=rN(Y.current);xe.clientX>=Oe.left-Ld&&xe.clientX<=Oe.right+Ld&&xe.clientY>=Oe.top-Ld&&xe.clientY<=Oe.bottom+Ld||P.events.emit("close",{domEvent:xe,reason:jS})});x.useEffect(()=>{R&&w.select("lastOpenChangeReason")===On&&xt(Y.current).addEventListener("mouseup",Q,{once:!0})},[R,Q,w]);const J=V&&O.context.hasSubmenuOpen,se=SC(S,{enabled:(h??J)&&!F&&O.type!=="context-menu"&&(!V||J&&!H),handleClose:EC({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:O.type===void 0?g:void 0,delay:{close:b},triggerElementRef:T,externalTree:P,isActiveTrigger:j,isClosing:()=>w.select("transitionStatus")==="ending"}),te=TD(R,w.select("lastOpenChangeReason")),le=nC(S,{enabled:!F&&O.type!=="context-menu",event:R&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?te:!1}),W=jC(S,{enabled:!F&&J}),ne=ED({open:R,enabled:V,mouseDownAction:"open"}),ve=x.useMemo(()=>Qn(W.reference,le.reference),[W.reference,le.reference]),oe=w.useState("triggerProps",H),{preFocusGuardRef:fe,handlePreFocusGuardFocus:we,handleFocusTargetFocus:Ce}=ND(w,T),Le={disabled:F,open:R},$e=[Y,a,G,L,T],Ee=[ve,se??Xt,oe,{"aria-haspopup":"menu","aria-controls":A,id:E,onMouseDown:xe=>{if(w.select("open"))return;I.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),xt(xe.currentTarget).addEventListener("mouseup",Q,{once:!0})}},V?{role:"menuitem"}:{},ne,N,X],_e=Et("button",t,{enabled:!V,stateAttributesMapping:Mx,state:Le,ref:$e,props:Ee});return V?n.jsx(CD,{tag:"button",render:o,className:l,style:i,state:Le,refs:$e,props:Ee,stateAttributesMapping:Mx}):R?n.jsxs(x.Fragment,{children:[n.jsx(ai,{ref:fe,onFocus:we},`${E}-pre-focus-guard`),n.jsx(x.Fragment,{children:_e},E),n.jsx(ai,{ref:w.context.triggerFocusTargetRef,onFocus:Ce},`${E}-post-focus-guard`)]}):n.jsx(x.Fragment,{children:_e},E)});function TD(e,t){const a=En(),[o,l]=x.useState(!1);return De(()=>{e&&t==="trigger-hover"?(l(!0),a.start(AO,()=>{l(!1)})):e||(a.clear(),l(!1))},[e,t,a]),o}function AD(){const e=jp(!0),t=to(!0),a=sN();return x.useMemo(()=>a?{type:"menubar",context:a}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,a])}function iN(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function y_({...e}){return n.jsx(SD,{"data-slot":"dropdown-menu",...e})}function j_({...e}){return n.jsx(RD,{"data-slot":"dropdown-menu-trigger",...e})}function k_({align:e="start",alignOffset:t=0,side:a="bottom",sideOffset:o=4,className:l,...i}){return n.jsx(tD,{children:n.jsx(fD,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:a,sideOffset:o,children:n.jsx(J6,{"data-slot":"dropdown-menu-content",className:Ct("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",l),...i})})})}function lf({className:e,inset:t,variant:a="default",...o}){return n.jsx(H6,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:Ct("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...o})}function MD({...e}){return n.jsx(mD,{"data-slot":"dropdown-menu-radio-group",...e})}function OD({className:e,children:t,inset:a,...o}){return n.jsxs(hD,{"data-slot":"dropdown-menu-radio-item","data-inset":a,className:Ct("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:n.jsx(xD,{children:n.jsx(Gr,{})})}),t]})}const zD={common:{loading:"Cargando…",saving:"Guardando…",cancel:"Cancelar",save:"Guardar",delete:"Borrar",edit:"Editar",create:"Crear",add:"Agregar",remove:"Quitar",reload:"Recargar",shutdown:"Apagar",enabled:"Habilitado",disabled:"Deshabilitado",enable:"Habilitar",disable:"Deshabilitar",open:"Abrir",close:"Cerrar",confirm:"Confirmar",optional:"(opcional)",none:"—",none_yet:"Todavía no hay nada.",error_generic:"Algo salió mal.",search:"Buscar",new:"Nuevo",restore:"Restaurar",show:"Mostrar",hide:"Ocultar",copy:"Copiar",run:"Ejecutar",refresh:"Refrescar",view_all:"Ver todo",saved:"Guardado.",deleted:"Eliminado.",pager_prev:"Anterior",pager_next:"Siguiente",pager_page:"Página {page} de {total}",pager_range:"{from}–{to} de {total}",pager_per_page:"Por página"},daemon:{connecting:"Conectando con el daemon…",unreachable:"No pude llegar al daemon en localhost:7430.",unreachable_hint:"Arrancá APX con `apx daemon start` y refrescá.",version:"Versión",uptime:"Uptime",status:"Status",running:"running",down:"down",reload_hint:"POST /admin/reload — relee ~/.apx/config.json sin reiniciar.",shutdown_confirm:"¿Apagar el daemon? Las próximas requests fallarán hasta levantarlo de nuevo.",shutdown_done:"Daemon detenido."},pairing:{title:"Vincular este equipo",subtitle:"Estás entrando desde fuera de esta máquina. Por seguridad, vinculá este navegador con un código de pairing.",steps_title:"Cómo obtener el código",step_1:"En la PC donde corre APX, abrí una terminal.",step_2:"Ejecutá `apx pair` (o escaneá el QR con APX Deck).",step_3:"Copiá el código que aparece debajo del QR y pegalo acá.",code_label:"Código de pairing",code_ph:"p. ej. 7f3a1c9e-…",label_label:"Nombre de este equipo",label_ph:"p. ej. Notebook del living",submit:"Vincular",linking:"Vinculando…",success:"Equipo vinculado ✓",err_required:"Pegá el código de pairing.",err_expired:"El código expiró. Volvé a correr `apx pair` y probá de nuevo.",err_unknown:"Código desconocido o ya usado. Generá uno nuevo con `apx pair`.",err_generic:"No se pudo vincular. Revisá el código e intentá otra vez.",revoke_hint:"Podés revocar este equipo cuando quieras desde Settings o con `apx pair revoke`."},nav:{apx_admin:"APX",settings:"Settings",project:"Proyecto",add_project:"Agregar proyecto",all_projects:"Todos los proyectos",more_projects:"{count} más",collapse_projects:"Ocultar proyectos",expand_projects:"Mostrar proyectos",modules:{voice:"Voces",desktop:"Escritorio",deck:"Deck",code:"Code",web:"Web"}},topbar:{breadcrumb_root:"APX",breadcrumb_settings:"APX › Settings",breadcrumb_project:"APX › Proyecto",breadcrumb_base:"Base",breadcrumb_projects:"Proyectos",light:"Cambiar a claro",dark:"Cambiar a oscuro",lang_toggle:"Idioma"},admin:{title:"APX",subtitle:"Panel general. Configuración global, canales y proyectos.",engines_title:"Engines",engines_subtitle:"Adaptadores LLM disponibles. Las API keys viven en ~/.apx/config.json.",telegram_title:"Telegram",telegram_subtitle:"Canales configurados. Cada uno puede estar pineado a un proyecto.",telegram_polling_on:"Polling activo",telegram_polling_off:"Deshabilitado",telegram_add_channel:"Canal",telegram_send_test:"Probar",telegram_send_test_title:"Enviar a",telegram_default_message:"Mensaje de prueba desde el panel de APX ✅",projects_title:"Proyectos registrados",projects_subtitle:"Click en un proyecto para abrir su panel.",unregister:"Desregistrar",unregister_confirm:"¿Quitar {label} de APX? La carpeta no se borra; sólo se desregistra.",reload_success:"Config recargada.",telegram_polling_started:"Polling iniciado.",telegram_polling_stopped:"Polling detenido.",telegram_channel_removed:"Canal eliminado.",agents_badge:"agents",engine_badge:"sí",engine_badge_no:"no",base_label:"Base"},add_project:{title:"Agregar proyecto",subtitle:"APX indexará .apc/, agents y AGENTS.md en esa carpeta.",path_label:"Ruta absoluta",path_hint:"Equivalente a apx project add /ruta/al/proyecto",path_placeholder:"/Volumes/SSDT7Shield/proyectos_varios/mi-proyecto",register:"Registrar",path_required:"Ruta requerida.",registered:"Proyecto #{id} registrado.",search_btn:"Buscar",picker_prompt:"Elegí la carpeta del proyecto",browser_unavailable:"Explorador no disponible hasta reiniciar daemon. Pegá ruta manual.",no_folders:"Sin carpetas."},settings:{title:"Settings",subtitle:"Preferencias del panel + diagnóstico del daemon local.",appearance:"Apariencia",light_mode:"Claro",dark_mode:"Oscuro",system_mode:"Sistema",language:"Idioma",daemon:"Daemon",daemon_sub:"Estado del proceso local que sirve esta web y orquesta los agentes.",engines:"Engines disponibles",engines_sub:"Adaptadores LLM compilados con el daemon.",token:"Token para esta sesión",token_sub:"Si esta web no logró auto-cargar el token, pegalo acá.",token_active:"(ya hay token activo)",token_paste:"Pegá el bearer del daemon",token_saved:"Token guardado.",devices:"Dispositivos pareados",devices_sub:"GET /pair/list. Revocar invalida ese bearer en el daemon.",devices_empty:"No hay clientes pareados todavía.",devices_revoke_confirm:"Revocar cliente {id}?",devices_revoke_success:"Cliente revocado.",devices_pair_btn:"Vincular dispositivo",devices_pair_title:"Vincular dispositivo",devices_pair_desc:"Escaneá el QR con la cámara del celu para entrar directo, o pegá el código en la otra PC.",devices_pair_scan:"Escaneá con la cámara del teléfono — te abre la web ya vinculada.",devices_pair_code:"O pegá este código en la pantalla de pairing:",devices_pair_url:"URL de acceso",devices_pair_link:"O copiá este link y abrilo en el otro dispositivo (entra solo):",devices_pair_copy:"Copiar",devices_pair_copied:"Link copiado al portapapeles.",devices_pair_copied_code:"Código copiado.",devices_pair_expires:"Expira en {s}s",devices_pair_expired:"El código expiró.",devices_pair_regen:"Generar otro",devices_pair_waiting:"Esperando que el dispositivo confirme…",devices_pair_done:"Dispositivo vinculado ✓",devices_pair_localhost_only:"Solo se pueden generar códigos desde la PC del daemon (localhost).",devices_last_seen:"visto:",devices_never:"nunca",devices_revoke:"Revocar",account_section:"Cuenta",agents_section:"Agentes & modelos",channels_section:"Canales & dispositivos",modules_section:"Módulos",advanced_section:"Avanzado",tabs:{identity:"Identidad",super_agent:"Super-agente",engines:"Engines & modelos",telegram:"Telegram",devices:"Dispositivos",advanced:"Avanzado"},identity:{title:"Identidad",subtitle:"Datos del usuario. Configuración del agente va en Super-agente.",agent_name:"Nombre del agente",owner_name:"Tu nombre",personality:"Personalidad",owner_context:"Contexto del dueño",owner_context_hint:"Quién sos, en qué trabajás, qué le interesa al agente saber de vos.",language:"Idioma preferido",timezone:"Timezone (IANA)",timezone_hint:"Detectado automáticamente — buscá para cambiar.",saved:"Identidad guardada."},super_agent:{title:"Super-agente",subtitle:"Personalidad, modelo, prompt y modos del super-agente.",personality:"Personalidad",model:"Modelo activo",model_hint:"Ej: anthropic:claude-sonnet-4.5, ollama:gemma2:9b",permission_mode:"Permission mode",system:"Prompt extra (system)",system_hint:"Texto que se prepende al system prompt base.",system_ph:"(Vacío = se usa el prompt base de core/agent/prompts/super-agent-base.md)",fallback_title:"Fallback chain",fallback_hint:"Si el modelo activo falla, prueba estos en orden.",fallback_add:"Agregar modelo a la cadena",saved:"Super-agente guardado.",enabled_label:"Super-agente habilitado",model_active:"Modelo activo (router)",model_configure:"Configurar en Modelos",behavior_subtitle:"Comportamiento del super-agente. El modelo y la cadena de fallback se configuran en el Router de modelos."},engines_keys:{title:"API keys de modelos",subtitle:"Cada engine guarda su key en ~/.apx/config.json. Los valores ya seteados muestran sufijo seguro.",ollama_url:"Ollama URL",ollama_hint:"Por defecto: http://127.0.0.1:11434",key_label:"API key",key_placeholder:"(no seteada)",clear:"Borrar key",saved:"Key guardada.",cleared:"Key borrada."},telegram_global:{title:"Telegram (default)",subtitle:"Canal default — los proyectos pueden overridear con su propio canal.",bot_token:"Bot token",chat_id:"Chat ID por defecto",poll_interval:"Poll interval (ms)",respond_with_engine:"Respond with engine",enabled:"Polling habilitado",saved:"Telegram guardado."},advanced:{title:"Avanzado",subtitle:"Editor raw del ~/.apx/config.json. Los secretos se ven *** set *** pero podés escribir uno nuevo.",write:"Aplicar cambios",written:"Config aplicada y daemon recargado.",reload_success:"Config recargada."}},project:{not_found:"Roby no encontró el proyecto {pid}: quizás se desregistró o el ID es incorrecto.",rebuild:"Rebuild context",rebuild_done:"Rebuild OK.",unregister_confirm:"¿Desregistrar {label}? La carpeta no se borra.",unregistered:"Desregistrado.",base_subtitle:"Espacio general · super-agente",danger:{title:"Zona peligrosa",subtitle:"Acciones que afectan el registro del proyecto en APX. No tocan archivos del repo.",rebuild_desc:"Re-escanea .apc/, MCPs y agents y regenera el contexto del super-agente para este proyecto.",unregister_desc:"Quita el proyecto del registry de APX. La carpeta del disco se mantiene intacta.",rebuild_confirm_title:"Rebuild context",rebuild_confirm_desc:"Regenerar contexto de {label}.",rebuild_long:"Vuelve a leer la config APC, lista MCPs y agents disponibles, y reconstruye el system prompt del super-agente. Es seguro de correr — no borra nada. Usalo después de tocar .apc/ a mano o si los cambios no se reflejan.",unregister_confirm_title:"Desregistrar proyecto",unregister_long:"El proyecto deja de aparecer en `apx`. Los archivos del disco (.apc/, código, todo) se mantienen. Podés volver a registrarlo con `apx project register <path>`."},nav:{overview:"Overview",chat:"Chat",config:"Config",telegram:"Telegram",agents:"Agents",routines:"Rutinas",tasks:"Tasks",mcps:"MCPs",artifacts:"Artifacts",vars:"Variables",logs:"Logs",memories:"Memorias",structure:"Estructura",docs:"Docs",files:"Archivos"},sections:{workspace:"Workspace",content:"Contenido",automation:"Automatización",knowledge:"Conversaciones",config:"Config"},overview:{tasks_open:"Tasks abiertas",routines:"Rutinas",routines_active:"Rutinas activas",agents:"Agents",mcps:"MCPs",artifacts:"Artifacts",chat:"Chat (super-agent)",chat_value:"abrir",roster:"Equipo",no_agents:"Todavía no hay agentes.",orchestrators:"Orquestadores",specialists:"Especialistas",recent_tasks:"Tasks recientes",no_activity:"No hay tasks abiertas.",brain_title:"Cerebro del equipo",brain_desc:"El mapa completo de agentes — los orquestadores en el núcleo y sus especialistas en racimo alrededor. Clic en un nodo para abrirlo.",brain_core:"Equipo"},artifacts:{title:"Artifacts",subtitle:"Scripts y archivos reutilizables guardados en el proyecto. Los crean los agentes; podés verlos, ejecutarlos, renombrarlos o eliminarlos."},chat:{title:"Chat con agente",subtitle:"Chat directo con el agente del proyecto.",live_title:"Chat con {agent}",superagent_title:"Chat con {persona}",superagent_subtitle:"Chat con {persona} — el super-agente APX. Puede usar tools (proyectos, tasks, mcps, agentes).",loaded_subtitle:"Conversación cargada con {slug}. Lo que mandes se agrega a este chat.",thread_subtitle:"Historial con {persona} en {channel}. Si respondés acá, la conversación sigue desde la web.",empty:"Mandá un mensaje para arrancar la conversación.",placeholder:"Escribí algo y enter para enviar (shift+enter = nueva línea)",send:"Enviar",stop:"Stop",new_session:"Nueva sesión",delete:"Borrar",delete_confirm_title:"Borrar chat",delete_confirm_desc:"Esta acción no se puede deshacer. Se elimina para siempre el historial de este chat.",deleted:"Chat borrado.",meta_created:"Creado {date} · {channel}",meta_new:"Chat nuevo · {channel}",copy:"copiar",copied:"Copiado.",stopped_marker:" [detenido]",create_agent:"Crear agente",create_agent_title:"Crear agente",create_agent_desc:"Necesario para iniciar chat en proyecto.",role_label:"rol",model_label:"modelo",model_hint:"ej. openai:gpt-5, groq:llama-3.3-70b-versatile",master_label:"Agente master",list:{title:"Chats",new:"Nuevo",search:"Buscar chats…",all_agents:"Todos los agentes",empty:"No hay conversaciones todavía. Arrancá una desde la derecha.",count:"{n} en total",pick_agent:"Elegí un agente"}},tasks:{title:"Tasks (TODOs)",subtitle:"Append-only JSONL en ~/.apx/projects/<id>/tasks/.",add:"agregar",add_label:"Nueva task",add_placeholder:"ej. revisar bug del scroll",empty:"No hay tasks {state}.",empty_open:"No hay tasks abiertas.",created:"Task creada.",create_error:"no pude crear la task",done:"✓ done",drop:"✗ drop",reopen:"↻ reopen",due:"vence",via:"via",aria_done:"marcar done",aria_drop:"descartar task",aria_reopen:"reabrir task"},global_tasks:{title:"Tasks (todos los proyectos)",subtitle:"Tareas agregadas de todos los proyectos registrados.",empty:"Sin tasks.",due:"vence",go_project:"Ir al proyecto"},routines:{title:"Heartbeats / Routines",subtitle:"Cron, every:Nm, once:ISO. Cada rutina dispara un agente o un shell.",empty:"Sin rutinas. Creá una arriba.",new:"nueva",new_btn:"Nueva",delete_confirm:"Borrar rutina {name}?",delete_confirm_body:"Esta acción no se puede deshacer.",saved:"Rutina guardada.",paused:"pausada",next_run:"próxima:",last_run:"última:",enabled_hint:"Activa · corre según el intervalo",disabled_hint:"Pausada · solo con el botón Run",enabled_label:"Habilitada",new_title:"Nueva rutina",edit_title:"Editar {name}",dialog_desc:"Se guarda en .apc/routines.json. La rutina corre mientras el daemon está activo.",name_field:"Nombre (name)",name_no_edit:"No se puede cambiar al editar.",kind_field:"Acción (kind)",schedule_field:"Intervalo (schedule)",schedule_hint:"Elegí un preset o escribilo a mano. Manual = solo corre con el botón Run.",vars_title:"Variables disponibles",what_happens:"Qué va a pasar",list_title:"Rutinas",detail_empty:"Elegí una rutina de la lista.",edit_btn:"Editar",edit_hint:"Abrir el editor: tipo, intervalo, prompt, pre/post y variables.",block_pre:"Pre-commands",block_post:"Post-commands",block_prompt:"Prompt",block_text:"Texto",block_command:"Comando",block_empty:"(vacío)",runs_title:"Ejecuciones",runs_empty:"Sin ejecuciones todavía.",runs_close:"Cerrar",runs_no_detail:"Sin más detalle.",runs_output:"Salida",status_ok:"ok",status_error:"error",status_skipped:"salteada",agent_field:"Agente (spec.agent)",agent_hint:"Quién ejecuta la rutina.",agent_loading:"cargando…",agent_pick:"— elegí un agente —",prompt_exec:"Prompt (spec.prompt)",prompt_exec_ph:"qué pendiente hay para hoy?",prompt_super:"Prompt (spec.prompt)",prompt_super_ph:"resumí el estado del proyecto",pre_field:"Pre-commands (pre_commands)",pre_hint:"Shell ANTES del prompt. Uno por línea.",post_field:"Post-commands (post_commands)",post_hint:"Shell DESPUÉS del prompt. Uno por línea.",tg_channel:"Canal (spec.channel)",tg_chat_id:"Chat ID (spec.chat_id)",tg_text:"Mensaje de Telegram (spec.text)",tg_text_hint:"Mensaje fijo a enviar. No usa modelo.",shell_field:"Comando (spec.command)",shell_hint:"Corre tal cual en el shell. Sin prompt ni pre/post.",hb_channel:"Canal (spec.channel)",hb_message:"Mensaje (spec.message)",name_required:"name requerido",save_error:"save falló",run_error:"run falló",toggle_error:"toggle falló",delete_error:"delete falló",run_success:"{name} disparada.",run_confirm:"¿Ejecutar la rutina {name} ahora?",run_confirm_body:"Corre la acción una vez, sin esperar al horario.",running:"Ejecutando…",delete_success:"borrada."},agents:{title:"Agents",subtitle:"Definidos en .apc/agents/<slug>.md.",subtitle_full:"Definidos en .apc/agents/<slug>.md. La memoria runtime vive en ~/.apx/projects/<id>/agents/<slug>/.",empty:"Sin agents. Agregá uno con <code>apx agent add</code> o el botón.",empty_text:"Sin agents. Agregá uno con `apx agent add` o el botón de arriba.",new:"Agente",created:"Agent {slug} creado.",slug_invalid:"slug debe matchear /^[a-z][a-z0-9_-]*$/",hierarchy:"Jerarquía",list_view:"Lista",import:"Importar",chat:"Chat",view:"Ver",orchestrator:"Orquestador",new_title:"Nuevo agent",new_desc:"POST /projects/:pid/agents — escribe .apc/agents/<slug>.md.",slug_label:"slug",slug_ph:"cody",role_label:"role (opcional)",role_ph:"code refactor",model_label:"model (opcional)",model_hint:"ej. ollama:gemma2:9b, openai:gpt-4o-mini",lang_label:"language (opcional)",desc_label:"description (opcional)",desc_ph:"Qué hace este agente…",skills_label:"skills (coma)",skills_ph:"skill-a, skill-b",tools_label:"tools (coma)",tools_ph:"tool-a, tool-b",parent_label:"reporta a (parent, opcional)",parent_hint:"Subagente de un orquestador.",none_parent:"— ninguno —",master_label:"Orquestador (master)",create_success:"Agent {slug} creado.",create_error:"create falló",import_title:"Importar del vault",import_desc:"Plantillas en ~/.apx/agents. Se registran en este proyecto (.apc/agents/<slug>.md).",import_empty:"Sin plantillas en el vault.",import_success:"Importado: {slug}",import_already:"ya está",import_btn:"Importar"},agent_detail:{not_found:"Agente no encontrado.",chat_btn:"Chat con {slug}",reports_to:"↳ reporta a",no_threads:"Sin threads.",no_activity:"Sin actividad registrada.",threads_recent:"Threads recientes",subagents:"Subagentes",subagents_desc:"Agentes que reportan a este orquestador.",config_title:"Configuración del agente",type_label:"Tipología (type)",area_label:"Área",area_hint:"ej. operaciones, marketing",area_ph:"operaciones",role_label:"Role",parent_label:"Reporta a (parent)",none_parent:"— ninguno —",model_label:"Modelo base",model_hint:"Vacío = usa el modelo del Router (default). Setealo solo para forzar un modelo a este agente.",model_ph:"(vacío = router default)",skills_label:"Skills (coma)",bio_label:"Bio / descripción",system_label:"System prompt",system_hint:"Define personalidad y comportamiento (cuerpo del AGENT.md).",master_label:"Orquestador (master)",delete_btn:"Borrar agente",save_btn:"Guardar cambios",delete_confirm:'Borrar el agente "{slug}"? Se elimina .apc/agents/{slug}.md y sus datos runtime locales.',update_success:"Agente actualizado.",delete_success:"Agente borrado.",tools_hint:"Qué tools puede usar el agente. Tocá para activar/desactivar; o editá la lista abajo.",tools_custom_ph:"lista (coma): echo, http_fetch",memory_title:"Memoria del agente",memory_empty:"(memoria vacía)",memory_saved:"Memoria guardada.",records_title:"Records",records_desc:"Log de actividad del agente (mensajes/acciones). Lo más nuevo primero.",sleep_title:"Sleep / Heartbeat",sleep_desc:"Estado de ejecución del agente, derivado de sus rutinas.",sleep_deep:"Deep sleep · sin heartbeat",sleep_deep_desc:"Este agente no tiene ninguna rutina que lo dispare. No se ejecuta de forma autónoma; solo responde cuando lo invocás (chat / tarea).",brain_title:"Brain",brain_desc:"Grafo de relaciones reales del agente: memoria, threads, tasks, heartbeats y jerarquía. (primera versión — lo refinamos)",brain_empty:"Aún no hay relaciones para graficar (sin memoria, threads, tasks ni rutinas).",msgs_count:"msgs"},mcps:{title:"MCP servers",subtitle:"3 scopes: Runtime > Shared > Global. Conflictos arriba si los hay.",empty:"Sin MCPs configurados.",new:"MCP",delete_confirm:"Borrar MCP {name} de scope {scope}?",conflicts:"⚠ Conflictos: {names}",conflict_detail:"{name} está definido en {winner} y {loser}. Se usa {winner}; {loser} queda ignorado.",new_title:"Nuevo MCP",edit_title:"Editar MCP",new_desc:"Se guarda según el scope elegido. Los valores con ${var.X} se resuelven al arrancar el MCP.",scope_label:"Scope",scope_runtime:"Runtime",scope_shared:"Shared",scope_global:"Global",source_runtime:"Runtime",source_apc:"APC / Shared",source_claude:"Claude",source_codex:"Codex",source_cursor:"Cursor",source_vscode:"VS Code",source_roo:"Roo",source_gemini:"Gemini",scope_runtime_desc:"Solo este proyecto · con secrets · no se commitea (~/.apx/projects/<id>/mcps.json)",scope_shared_desc:"Solo este proyecto · committeable · sin secrets (.apc/mcps.json)",scope_global_desc:"Todos los proyectos de esta máquina (~/.apx/mcps.json)",transport_stdio:"stdio",transport_http:"HTTP",transport_stdio_desc:"Proceso local — `command` + args",transport_http_desc:"Endpoint remoto — URL + headers",transport_label:"Transport",name_label:"Nombre",name_ph:"my-mcp",cmd_label:"Comando",cmd_ph:"npx",args_label:"Args",args_hint_tokens:"Una entrada por argumento. Usá el botón + para insertar variables.",env_label:"Env",env_hint_tokens:"Pares clave/valor. Los valores aceptan ${var.NOMBRE} (botón + a la derecha).",env_empty:"Sin variables de entorno.",url_label:"URL",url_ph:"https://example.com/v2/mcp",headers_label:"Headers",headers_hint:"Pares clave/valor — típicamente Authorization: Bearer ${var.TOKEN}.",headers_empty:"Sin headers.",enabled_label:"Habilitado",add_btn:"Agregar",save_btn:"Guardar",add_arg:"Agregar arg",edit_btn:"Editar",test_btn:"Probar",logs_btn:"Logs",testing:"Probando…",test_ok:"OK · {n} tools disponibles",tools_count:"{n} tools",logs_title:"Logs · {name}",logs_empty:"Sin logs todavía. Arrancá el MCP llamando un tool o probando.",logs_events:"Eventos recientes",logs_stderr:"stderr (últimos 4KB)",logs_panel_title:"Live logs",logs_panel_pick:"elegí un MCP",logs_panel_hint:"Click un MCP de la lista para ver lo que está pasando en vivo.",logs_panel_idle:"Sin actividad. Apretá Probar para arrancarlo.",name_required:"Nombre requerido",removed:"eliminado",added:"MCP agregado.",updated:"MCP actualizado."},vars:{title:"Variables",subtitle_project:"Reemplazan ${var.NOMBRE} al cargar MCPs y plantillas. Las del proyecto ganan sobre las globales. Se guardan fuera del repo (~/.apx/, chmod 0600).",subtitle_base:"Variables globales — disponibles para todos los proyectos. Se guardan en ~/.apx/vars.json (chmod 0600).",empty:"Sin variables todavía.",new:"Variable",new_title:"Nueva variable",edit_title:"Editar variable",new_desc:"Se referencia como ${var.NOMBRE} en cualquier campo que soporte interpolación.",reveal_all:"Mostrar valores",reveal:"Mostrar",hide:"Ocultar",filter_label:"Mostrar:",filter_all:"Todas",filter_project:"Sólo proyecto",filter_global:"Sólo globales",scope_label:"Scope",scope_project:"proyecto",scope_project_desc:"Sólo este proyecto. Pisa la global con mismo nombre.",scope_global:"global",scope_global_desc:"Disponible en todos los proyectos.",name_label:"Nombre",name_hint:"Mayúsculas, dígitos y _. P. ej.: MY_API_KEY, GITHUB_TOKEN.",value_label:"Valor",value_hint:"Se guarda en disco con permisos 0600. Nunca se commitea.",value_edit_ph:"(dejá vacío para no cambiarlo… aún no soportado, pegá el valor de nuevo)",add_btn:"Agregar",save_btn:"Guardar",edit_btn:"Editar",delete_btn:"Borrar",delete_confirm:"¿Borrar {name} ({scope})?",removed:"Variable eliminada.",added:"Variable agregada.",updated:"Variable actualizada.",name_required:"Nombre requerido.",value_required:"Valor requerido."},threads:{title:"Chats",subtitle:"Conversaciones por agent (vacío = ningún log persistido todavía).",no_agents:"No hay agents. Las conversaciones requieren un agent configurado.",pick:"Elegí un agent para ver sus conversaciones.",empty:"No hay conversaciones para {slug}.",conversation_title:"Conversación {id}",messages:"mensajes",via:"via"},config:{title:"Config rápida",subtitle:"Override del proyecto. Se escribe en {path}.",model:"super_agent.model",model_hint:"ej. anthropic:claude-sonnet-4.5, ollama:gemma2:9b",perm:"super_agent.permission_mode",route:"route_to_agent",route_hint:"Slug del agent que atiende por defecto en este proyecto.",use_global:"(usa global)",saved:"Guardado.",nothing:"Nada para guardar.",raw_title:"Config (JSON crudo)",raw_subtitle:"Pegá el objeto entero — equivale a PUT del archivo.",raw_save:"Reemplazar config",raw_done:"Config sobrescrita.",effective:"Effective config (read-only)",effective_sub:"Lo que ve realmente el daemon (global ⊕ override).",section_title:"Config proyecto",section_desc:"APC metadata y overrides separados. General APX vive en Settings > Config.",effective_read:"Lectura: global APX + override proyecto.",save_project:".apc/project.json guardado.",save_override:".apc/config.json guardado.",save_fields_success:"Overrides guardados.",save_meta_success:"Project metadata guardado.",no_data:"Sin datos.",tab_settings:"Settings",tab_project:"Project"},telegram:{title:"Canal de Telegram (override)",subtitle:"Si seteás un canal acá, los mensajes generados por este proyecto se mandan ahí en lugar del default.",use_default:"Usar el canal default",bot_token:"Bot token (override)",chat_id:"Chat ID (override)",saved:"Override guardado.",cleared:"Override eliminado — vuelve al default.",override_active:"override activo",channel_badge:"Canal {name}",no_override:"Sin override. Los mensajes de este proyecto van al canal default.",respond_engine:"Responder con engine",route_agent:"route_to_agent",route_hint:"Slug del agent que atiende (vacío = super-agent).",bot_hint_none:"Si vacío, hereda del default."},memories:{sidebar_title:"Memorias",general_group:"General",general_item:"Memoria del proyecto",project_title:"Memoria del proyecto",project_desc:"Hechos durables a nivel proyecto. .apc/memory.md — la leen los agentes y el super-agente.",project_ph:`# Memoria del proyecto
|
|
757
|
-
|
|
758
|
-
Hechos estables que cualquier agente debería saber…`,agents_title:"Memorias de agentes",agents_desc:"Memoria individual por agente. ~/.apx/projects/<id>/agents/<slug>/memory.md",no_agents:"Sin agentes en este proyecto.",saved:"Memoria guardada.",empty:"(memoria vacía)",chars:"chars · Markdown",save_btn:"Guardar"}},base:{title:"Base",subtitle:"Espacio general · super-agente",nav_general:"General",nav_activity:"Actividad",nav_system:"Sistema",workspaces_title:"Workspaces",workspaces_desc:"Todos los proyectos registrados en APX.",workspaces_new:"Nuevo proyecto",workspaces_empty:"Sin proyectos. Agregá uno con el botón de arriba.",sessions_title:"Sessions",sessions_desc:"Sesiones de todos los engines (apx · claude · codex), más nuevas primero.",sessions_desc_scoped:"Sesiones en la carpeta de este proyecto ({path}), todos los engines, más nuevas primero.",sessions_all:"Todos los engines",sessions_empty:"Sin sesiones.",sessions_error:"No pude leer las sesiones: {msg}",sessions_search_ph:"Buscar sesiones…",sessions_deep:"Profundo",sessions_deep_tip:"También busca dentro de los transcripts (más lento)",sessions_clear:"Limpiar filtros",sessions_refresh:"Refrescar lista",sessions_no_match:"Ninguna sesión coincide con «{q}».",sessions_act_cmd:"Copiar comando apx",sessions_act_ask:"Pedir a {name} que continúe",sessions_act_folder:"Abrir carpeta",sessions_act_path:"Copiar ruta",sessions_cmd_copied:"Comando copiado — pegalo en tu terminal",sessions_path_copied:"Ruta copiada",sessions_copy_failed:"No se pudo copiar",sessions_no_folder:"Esta sesión no tiene carpeta",sessions_no_path:"Esta sesión no tiene ruta",sessions_folder_failed:"No se pudo abrir la carpeta: {msg}",defaults_title:"Agent defaults",defaults_desc:"Plantillas globales del vault. Las bundled vienen con APX y siempre están; las que crees o edites quedan en ~/.apx/agents y se superponen. Importalas a un proyecto desde Agents › Importar.",defaults_show_removed:"Mostrar removidos",defaults_new:"Nuevo",defaults_empty:"Sin plantillas en el vault.",defaults_hide:"Ocultar",defaults_restore:"Restaurar",defaults_edit:"Editar",defaults_remove:"Ocultar",defaults_delete:"Borrar",defaults_tombstone_msg:'Ocultar el default "{slug}"? Es bundled — quedá tombstoneado y lo recuperás con Restaurar.',defaults_delete_msg:'Borrar el template "{slug}"?',defaults_hidden:"Ocultado.",defaults_deleted:"Borrado.",defaults_restored:"Restaurado.",defaults_new_title:"Nuevo template",defaults_new_desc:"POST /agents/vault — se guarda en ~/.apx/agents/<slug>.md",defaults_edit_title:'Editar "{slug}"',defaults_bundled_desc:"Es un default bundled. Al guardar se hace copy-on-write a ~/.apx/agents/<slug>.md (queda como override).",defaults_user_desc:"PATCH /agents/vault/:slug — edita el archivo en ~/.apx/agents.",defaults_master_label:"Agente master",defaults_slug_invalid:"slug inválido (debe matchear /^[a-z][a-z0-9_-]*$/)",defaults_created:'Template "{slug}" creado.',defaults_saved:'Template "{slug}" guardado.'},logs:{title:"Logs",desc_global:"Actividad del daemon (canales globales: telegram, direct…). ~/.apx/messages/<channel>/.",desc_project:"Actividad del proyecto. ~/.apx/projects/<id>/messages/.",filter_channel:"filtrar canal (ej. telegram)",filter_dir:"dirección",all_directions:"Todas las direcciones",in:"Entrada (in)",out:"Salida (out)",filter_type:"tipo",all_types:"Todos los tipos",search_text:"buscar en el texto…",count_of:"de",no_activity:"Sin actividad.",no_activity_ch:'Sin actividad en el canal "{ch}".',error:"No pude leer los mensajes: {msg}",show_more:"ver más",show_less:"ver menos",daemon_errors:"Errores del daemon (~/.apx/logs/errors.jsonl)",no_errors:"Sin errores registrados. 🎉"},telegram_contacts:{title:"Contactos de Telegram",desc:"Quién le escribe a los bots. El rol define qué herramientas puede usar; un invitado no tiene permisos hasta que le asignes un rol.",empty:"Todavía no hay contactos — se registran solos cuando alguien escribe a un bot.",owner_badge:"dueño",assign_role:"Asignar rol",owner_hint:"Es dueño de un canal — cambialo desde el canal",removed:"Contacto eliminado.",delete_confirm:"¿Borrar el contacto {name}?",last_seen:"visto:",tools_all:"tools: todas",tools_none:"tools: ninguna",tools_label:"tools:"},telegram_channels:{title:"Canales",desc:"Cada canal es un bot que el daemon polea. Acá podés añadir/quitar canales, cambiar el agente que contesta, el proyecto al que pertenece y su dueño.",new_btn:"Nuevo canal",empty:"Todavía no hay canales — agregá el primero.",removed:"Canal eliminado.",delete_confirm:"¿Borrar el canal {name}?",no_owner:"sin dueño (se reclama al primer DM)",owner_label:"dueño:"},telegram_channel_dialog:{new_title:"Nuevo canal de Telegram",edit_title:"Editar canal: {name}",name_label:"name (slug interno)",token_label:"bot_token",chat_id:"chat_id",project_label:"project",project_hint:"Slug o id del proyecto al que pinear este canal (opcional).",route_label:"route_to_agent",route_hint:"Agente que contesta; vacío = super-agent APX.",owner_label:"owner_user_id",owner_hint:"user_id de Telegram del dueño de este canal. Override del rol global a 'owner' acá. Si lo dejás vacío, el primer mensaje privado lo reclama.",owner_ph:"889721252",respond_label:"Responder con engine (no echo)",name_required:"name requerido",saved:"Canal guardado."},telegram_send_dialog:{title:"Enviar a {name}",default_msg:"Mensaje de prueba desde el panel de APX ✅"},telegram_roles:{title:"Roles",desc:"Cada rol define qué herramientas del super-agent puede usar quien lo tenga asignado. 'owner' siempre = todas; 'guest' siempre = ninguna (solo chat).",empty:"No hay roles definidos.",tools_all:"todas las herramientas",tools_none:"ninguna herramienta",builtin:"built-in",delete_confirm:'¿Borrar el rol "{name}"?',removed:"Rol eliminado.",saved:'Rol "{name}" guardado.',name_required:"Nombre requerido.",builtin_error:'"{name}" es un rol built-in.',new_title:"Nuevo rol o reemplazar uno custom",name_label:"Nombre",name_ph:"editor",tools_label:"Tools (separadas por coma)",tools_hint:"Vacío = ninguna. Ejemplos: call_agent, list_tasks, create_task.",tools_ph:"call_agent, list_tasks",full_access:"Acceso total (todas las tools)",save_btn:"Guardar rol",delete_btn:"Borrar"},superagent:{title:"{persona}",badge:"super-agent · APX",desc:"Conversación rápida con tu super-agente. Tiene acceso a tools (proyectos, tasks, mcps, agentes); para un hilo más largo y persistente, abrí Chats.",empty:"Mandale un mensaje a {persona} para arrancar.",thinking:"{persona} está pensando…",talk:"Hablar con {persona}",new_chat:"Nuevo chat",placeholder:"Escribí y enter para enviar (shift+enter = nueva línea)…"},not_found:{title:"404",message:"Roby se perdió: esta página no existe o se movió.",home:"Volver al inicio"},ask_panel:{answers_header:"Respuestas",other:"Otro",other_placeholder:"Escribí tu propia respuesta acá",text_placeholder:"Escribí tu respuesta…",back:"Atrás",skip:"Omitir",next:"Siguiente",submit:"Enviar",status_waiting:"Esperando respuesta…",status_received:"Respuestas recibidas"},code_module:{title:"Code",badge:"super-agent",desc:"Sesiones de código estilo OpenCode. Elegí un proyecto, abrí una sesión y pedile que lea, planifique, edite o ejecute.",no_projects:"No hay proyectos registrados. Registrá uno con `apx project add` para usar Code.",sessions:"Sesiones",new_session:"Nueva sesión",untitled:"Nueva sesión",no_sessions:"Todavía no hay sesiones — creá una para empezar a codear.",pick_project:"Elegí un proyecto para ver sus sesiones.",rename:"Renombrar",delete:"Eliminar",delete_confirm:"¿Eliminar esta sesión? Se borra la transcripción; tus archivos quedan intactos.",empty_chat:"Mandá una instrucción de código para arrancar.",placeholder:"Pedí un cambio… (enter envía, shift+enter = nueva línea)",mode_build:"Build",mode_plan:"Plan",mode_build_hint:"Build — edita archivos y ejecuta comandos",mode_plan_hint:"Plan — solo lectura, propone cambios sin tocar archivos",tab_context:"Contexto",tab_changes:"Cambios",tab_artifacts:"Artifacts",artifacts_none:"Todavía no hay artifacts. Pedile al agente que cree un script en `artifacts/<nombre>`.",artifacts_count:"{n} artifact(s)",artifacts_copy_path:"Copiar path",artifacts_run:"Run",artifacts_run_hint:"Para ejecutarlo desde la terminal:",artifacts_delete:"Eliminar",artifacts_delete_confirm:"¿Eliminar este artifact? El archivo se borra del disco.",ctx_model:"Modelo",ctx_tokens:"Tokens",ctx_input:"Entrada",ctx_output:"Salida",ctx_messages:"Mensajes",ctx_breakdown:"Desglose de contexto",ctx_none:"Sin uso todavía — mandá un turno para ver tokens.",seg_system:"Sistema",seg_user:"Usuario",seg_assistant:"Asistente",seg_tool:"Tools",seg_other:"Otro",changes_none:"Todavía no hay cambios en esta sesión.",changes_no_git:"Los cambios necesitan un repo git. Este proyecto no lo es.",changes_files:"{n} archivo(s) cambiados",stopped:"[detenido]",close:"Cerrar",reload:"Recargar",discard_changes:"Descartar cambios",save_shortcut_hint:"Guardar (Cmd/Ctrl+S)",artifacts_rename:"Renombrar",artifacts_view:"Ver contenido",artifacts_edit:"Editar contenido",artifacts_preview:"Previsualizar",artifacts_preview_hint:"Abrir una previsualización en vivo en una pestaña local",artifacts_share:"Compartir",artifacts_share_hint:"Crear una URL pública por túnel para compartir esta preview",artifacts_stop_preview:"Detener preview",artifacts_preview_local:"Preview local",artifacts_preview_public:"URL pública",artifacts_copy_url:"Copiar URL",artifacts_preview_started:"Preview activa en {url}",tree_collapse_all:"Colapsar todo",terminal_clear:"Limpiar",terminal_close:"Cerrar terminal"},desktop_screen:{status_title:"Estado",autostart_title:"Arranque automático",shortcut_title:"Atajo de teclado",appearance_title:"Apariencia",activation_title:"Activación + transcripción",last_conv_title:"Última conversación",open_config:"Configuración"},voice_screen:{providers_title:"Proveedores de voz (TTS)",test_title:"Probar voz",stt_title:"Transcripción (STT)",configure_provider:"Configurar {name}"},deck_screen:{widgets_title:"Widgets",context_title:"Contexto APX",reload_manifest:"Recargar manifest",widget_native:"Widget nativo APX",widget_external:"Widget externo",preview_badge:"Vista previa",preview_title:"Deck — Próximamente",preview_body:"El módulo Deck todavía está en desarrollo y no fue lanzado aún. Lo volveremos a activar cuando Deck salga en una versión estable. Por ahora todo acá es de solo lectura y no se guardará ningún cambio."},memory_panel:{embeddings_title:"Embeddings (RAG)",embeddings_desc:"Modelo que vectoriza el historial de todos los canales para la memoria relevante. Igual que TTS/STT: elegí un proveedor y un modelo. 'Automático' prueba local primero y cae a offline si no hay nada disponible.",provider_label:"Proveedor",provider_hint:"Ollama es local y gratis. Gemini/OpenAI usan la API key de su sección en Modelos (o la de abajo).",mode_label:"Modo de selección",mode_hint:"Cadena cae al siguiente si uno falla; Único usa exactamente el proveedor elegido.",available:"disponible",unavailable:"no disp.",test_btn:"Probar embedding",reindex_btn:"Reindexar memoria",test_ok:"Embedding OK con {embedder}",test_failed:"Test falló: {msg}",reindexed:"Reindexado: {indexed} chunks (limpiados {cleared}).",reindex_failed:"Reindex falló: {msg}",save_failed:"No se pudo guardar: {msg}",provider_auto:"Automático (cadena: Ollama → Gemini → OpenAI → offline)",provider_ollama:"Ollama — local, sin API key (nomic-embed-text)",provider_gemini:"Gemini — free tier con key (text-embedding-004)",provider_openai:"OpenAI — text-embedding-3-small (cloud)",provider_tf:"Offline (term-frequency, sin modelo — degradado)",mode_chain:"Cadena (fallback automático)",mode_single:"Único (usa solo el elegido)",ollama_title:"Ollama (local)",ollama_desc:"Sin API key. Corre nomic-embed-text en tu Ollama local o cloud.",model_label:"Modelo",base_url_label:"Base URL",ollama_base_url_hint:"Vacío usa engines.ollama.base_url (default http://localhost:11434).",openai_title:"OpenAI",openai_desc:"text-embedding-3-small (1536 dims) u otro modelo compatible.",api_key_label:"API key",openai_key_hint:"Vacío reusa engines.openai.api_key. Dejalo en blanco para mantener la guardada.",gemini_title:"Gemini",gemini_desc:"text-embedding-004 (768 dims). Free tier con API key de Google.",gemini_key_hint:"Vacío reusa engines.gemini.api_key.",compaction_title:"Compactación de historial",compaction_desc:"Cuando un chat supera el umbral de turnos, los más viejos se resumen con un LLM liviano (local) y se guardan como [RESUMEN COMPACTADO], manteniendo el contexto acotado. Corre fuera del hot-path: el turno actual usa el resumen que ya exista.",threshold_label:"Umbral de compactación",threshold_hint:"Compactar una vez que el chat supera estos turnos (por defecto 60).",keep_recent_label:"Turnos recientes a preservar",keep_recent_hint:"Turnos verbatim que NUNCA se compactan (por defecto 40). Debe ser menor al umbral.",compact_model_label:"Modelo de compactación",compact_model_hint:"LLM liviano para resumir. Ideal uno local (Ollama) para no gastar. Formato proveedor:modelo.",compact_fallback_label:"Modelo de fallback",compact_fallback_hint:"Se usa si el de compactación falla. Vacío cae al modelo del super-agente.",compact_fallback_ph:"(vacío → modelo del super-agente)"},router_panel:{title:"Router de modelos",description:"Un único router general (sin casos por tarea). Elegí un proveedor y un modelo; si el activo falla, prueba la cadena de fallback en orden.",badge_default:"default",no_providers:"Agregá un proveedor abajo para poder elegir modelos.",active_model_label:"Modelo activo (default)",active_model_hint:"Proveedor + modelo. Se guarda como proveedor:modelo.",fallback_title:"Cadena de fallback",fallback_desc:"Si el modelo activo falla, prueba estos en orden. Click en uno para editarlo.",fallback_empty:"Sin fallback configurado.",add_to_chain:"Agregar a la cadena",done:"listo",save:"Guardar router",saved:"Guardado",saved_toast:"Router guardado.",provider_ph:"— proveedor —",provider_not_found:"⚠ {name} (no encontrado)",provider_not_configured:'El proveedor "{name}" no está configurado.'},routing_panel:{title:"Ruteo por contenido",description:"Elegí un modelo distinto por mensaje según su contenido (imagen, tamaño, canal, keywords). Aparte de la cadena de fallback de arriba.",signal_on:"Ruteo por contenido: ON ({n} reglas)",signal_on_empty:"Ruteo por contenido: ON (todavía sin reglas)",signal_off:"Ruteo por contenido: OFF",how_it_works:"¿Cómo funciona?",enable_label:"Activar ruteo por contenido",rules_title:"Reglas de ruteo",rules_desc:"Se evalúan de arriba hacia abajo; gana la primera regla que cumpla todas sus condiciones.",rules_empty:"Todavía sin reglas. Agregá algunas en el editor.",edit_rules:"Editar reglas (JSON)",hide_editor:"Ocultar editor",editor_label:"Reglas (array JSON)",json_hint:"Array de { model, when }. Claves de when: has_image, min_prompt_chars, max_prompt_chars, min_context_chars, channels[], keywords[]. when vacío = matchea todos los mensajes.",json_error:"JSON inválido: {msg}",json_not_array:"Las reglas tienen que ser un array JSON.",insert_example:"Insertar un ejemplo",when_any:"cualquier mensaje",when_image:"tiene imagen",when_no_image:"sin imagen",when_min_prompt:"prompt ≥ {n} chars",when_max_prompt:"prompt ≤ {n} chars",when_min_context:"contexto ≥ {n} chars",when_channels:"canales: {list}",when_keywords:"keywords: {list}",helper:"El ruteo elige un modelo por mensaje (imagen, tamaño, canal, keywords). Se compone con el failover: un modelo ruteado que esté caído cae por la cadena. Un override de modelo explícito por request siempre gana.",save:"Guardar ruteo",saved:"Guardado",saved_toast:"Ruteo por contenido guardado.",confirm_title:"¿Aplicar los cambios de ruteo?",confirm_body:"Esto cambia qué modelo atiende cada mensaje. El failover sigue aplicando si un modelo ruteado está caído.",confirm_on:"El ruteo por contenido va a quedar ON con {n} reglas.",confirm_off:"El ruteo por contenido va a quedar OFF (cada mensaje usa el router default).",confirm_apply:"Aplicar",cancel:"Cancelar"},engines_panel:{title:"Proveedores",new_btn:"Nuevo proveedor",description:"Proveedores LLM (API). Cada provider usa un engine/adapter (openai, ollama, …) con su key y URL.",empty:"Sin providers. Agregá uno con el botón de arriba.",add_card:"Agregar provider",saved:"Provider guardado.",saved_json:"Provider guardado (JSON).",deleted:"Provider borrado.",delete_confirm:"¿Borrar provider {name}?"},providers_modal:{new_title:"Nuevo proveedor",edit_title:"Editar {name}",description:"Proveedor LLM. El motor (engine) define qué adapter usa (openai, ollama, …).",list_models_hint:"Listar los modelos reales del proveedor",toggle_active:"Activo · click para desactivar",toggle_inactive:"Inactivo · click para activar",delete:"Borrar",custom:"Custom",json_mode:"JSON",form_mode:"Volver al formulario",json_label:"Config del provider (JSON)",json_hint:"Se guarda como engines.{slug} en config.json",json_help:"Debe ser un objeto JSON válido con al menos engine. El slug se toma del formulario.",name_label:"Nombre",name_ph:"Mi provider",engine_label:"Motor (engine)",base_url_label:"URL base (base_url)",base_url_hint:"Se completa sola al elegir un proveedor.",base_url_ph:"https://api.openai.com/v1",api_key_label:"API key",api_key_hint_existing:"Dejá en blanco para mantener la actual.",api_key_hint_env:"Se guarda como secreto. Env sugerida: {env}",api_key_hint:"Se guarda como secreto.",api_key_set:"…{suffix} (ya seteada)",model_label:"Modelo por defecto",load_models:"Cargar modelos",max_tokens_label:"Máx. tokens (max_tokens)",temperature_label:"Temperatura: {value}",pricing_summary:"Análisis de tokens / pricing (opcional)",context_limit_label:"Límite de contexto (tokens)",price_input:"$ entrada / 1M",price_output:"$ salida / 1M",price_cache_read:"$ cache read / 1M",price_cache_write:"$ cache write / 1M",model_limits_label:"Límites de contexto por modelo (JSON)",active_label:"Activo (los agentes pueden usarlo)",err_slug_required:"Slug requerido.",err_slug_required_form:"Slug requerido (en el formulario).",err_slug_exists:'Ya existe un provider "{slug}".',err_model_limits_json:"Límites de contexto por modelo: JSON inválido.",err_json_invalid:"JSON inválido: revisá la sintaxis.",err_json_object:"El JSON debe ser un objeto con la config del provider.",err_engine_missing:'Falta "engine" (ej. "anthropic", "ollama").',err_save:"Error al guardar.",err_no_models:"Sin modelos. ¿Key/URL correctas?",err_list_models:"No se pudo listar modelos."},providers_card:{active:"Activo",off:"Off",model:"Modelo",base_url:"Base URL",api_key:"API key",key_set:"✓ seteada",temp:"Temp",price_io:"$ in/out (1M)"},chat_ui:{copy:"Copiar",stop:"Detener",send:"Enviar",pick_model:"Elegir modelo (o Auto)",insert_variable:"Insertar variable",ctx_files:"archivos",ctx_actors:"{n} agentes/modelos",ctx_turns:"{n} turnos"},sidebar_ui:{toggle:"Mostrar/ocultar sidebar"},models_ui:{invalid_hint:"Modelo/proveedor no disponible"},global_config:{title:"Config APX"},agent_detail_extra:{skills_title:"Skills & tools"},voice_ui:{api_key_label:"API key",api_key_set:"…{suffix} (ya seteada)",api_key_keep_hint:"Dejá en blanco para mantener la actual.",api_key_secret_hint:"Se guarda como secreto. Env: {env}",api_key_reuse_hint:"Si lo dejás vacío, reusa {engine}. Env: {env}",err_save:"Error al guardar.",model_label:"Modelo",voice_label:"Voz",format_label:"Formato",output_format_label:"Formato de salida",voice_id_label:"Voice ID",voice_id_hint:"Voice id de ElevenLabs (vacío = default).",gemini_model_hint:"El TTS de Gemini todavía está en preview.",base_url_label:"Base URL (opcional)",base_url_hint:"Endpoint compatible con OpenAI. Vacío = OpenAI. Apuntalo a un servidor local (ej. un daemon QVox / Qwen3-TTS) para usar ese en su lugar.",openai_model_hint:"tts-1 / tts-1-hd para OpenAI. Dejalo vacío para que un servidor custom elija.",openai_voice_hint:"Preset de OpenAI (alloy…) o preset de tu servidor custom (ej. custom). Vacío = default del servidor.",openai_style_hint:"Voz base / instruct, usada por endpoints custom (la persona que se mantiene en todo el audio). El tts-1 de OpenAI la ignora.",style_label:"Estilo (cómo debería hablar)",style_hint:"Instrucción en lenguaje natural. Vacío = sin estilo. Ej.: 'hablá en un tono alegre y pausado'.",style_ph:"hablá en un tono alegre y enérgico",temperature_label:"Temperatura (opcional)",temperature_hint:"Temperatura de sampleo para endpoints custom. Vacío = default del servidor.",emotions_short:"Emociones",emotions_label:"Tags de emoción inline",emotions_hint:"Cuando hable este motor, deja que el agente meta tags tipo [happy]/[whisper] en las respuestas de voz para darles color. Activalo solo si este motor entiende los tags (ej. un endpoint QVox/Qwen3-TTS) — si no, se quitan antes de sintetizar.",emotions_tags_label:"Tags permitidos",emotions_tags_hint:"Separados por coma. Vacío = el set por defecto.",piper_bin_label:"Binario (bin)",piper_bin_hint:"Ruta o nombre del CLI de piper (PATH).",piper_model_label:"Modelo (.onnx)",piper_model_hint:"Ruta absoluta al modelo de voz de piper.",piper_speaker_label:"Speaker (opcional)",piper_speaker_hint:"Speaker id para modelos multi-voz.",mock_desc:"El engine mock genera un WAV de prueba en silencio. No tiene parámetros: sirve como fallback garantizado cuando no hay ningún otro engine configurado.",selection_mode:"Modo de selección",mode_chain_desc:"Cadena con fallback: usa el primer engine disponible siguiendo el orden de abajo.",mode_single_desc:"Solo engine default: siempre usa el elegido; el resto queda configurado para otros usos.",mode_chain_btn:"Cadena (router)",mode_single_btn:"Solo engine default",move_up:"Subir",move_down:"Bajar",badge_local:"local",badge_available:"disponible",badge_unavailable:"configurado, no disponible",badge_not_configured:"sin configurar",badge_default:"default",badge_custom:"custom",set_as_default:"Usar como default",configure:"Configurar",remove:"Quitar",remove_confirm:"¿Quitar este proveedor custom?",add_provider:"Agregar proveedor",new_provider:"Nuevo proveedor",custom_note:"Endpoint custom compatible con OpenAI.",custom_desc:"Cualquier endpoint de voz compatible con OpenAI (ej. un servidor local QVox / Qwen3-TTS).",label_label:"Nombre",label_hint:"Nombre para mostrar de este proveedor.",base_url_req_label:"Base URL",base_url_req_hint:"Requerido. El endpoint compatible con OpenAI, ej. http://127.0.0.1:5111/v1",api_key_optional_hint:"Opcional — solo si tu servidor pide key.",advanced:"Avanzado",custom_model_hint:"Opcional. La mayoría de los servidores locales lo ignoran (ej. QVox).",custom_voice_hint:"Opcional. Un preset que entienda tu servidor (ej. custom). Vacío = default del servidor.",custom_optional_ph:"(opcional)",stt_engine_label:"Engine de transcripción",stt_engine_hint:"Local usa faster-whisper (requiere python3 + faster-whisper). OpenAI usa la key de engines.openai.",stt_model_label:"Modelo local (whisper)",stt_model_hint:"Más grande = más preciso y más lento.",stt_language_label:"Idioma",stt_language_hint:'Para español, elegir "Español" mejora la precisión.',stt_provider_auto:"Automático (local, después remoto)",stt_provider_local:"Local — faster-whisper (offline)",stt_provider_openai:"OpenAI — Whisper-1 (cloud)",stt_provider_custom:"Custom — server OpenAI-compatible",stt_openai_model_label:"Modelo OpenAI",stt_openai_model_hint:"Por defecto whisper-1.",stt_custom_baseurl_label:"URL base (OpenAI-compatible)",stt_custom_baseurl_hint:"Ej: http://localhost:8000/v1 (mlx-audio en Metal) o http://192.168.1.50:9000/v1 (Radeon/NVIDIA en la red).",stt_custom_model_label:"Modelo",stt_custom_model_hint:"Ej: mlx-community/whisper-large-v3-turbo o large-v3.",stt_custom_key_hint:"Opcional — la mayoría de los servers locales no requieren key.",stt_hw_label:"Hardware detectado",stt_hw_recommended:"Recomendado",stt_hw_limited:"aceleración GPU limitada, se usa CPU",stt_backend_label:"Aceleración / Motor",stt_backend_hint:"Auto elige según tu hardware. Metal corre en la GPU (mlx); CPU usa faster-whisper.",stt_backend_auto:"Automático (recomendado)",stt_model_needs_download:"Falta descargar (~{size}). Hay que bajar el modelo para usar este motor.",lang_auto:"Detección automática",lang_es:"Español",lang_en:"Inglés",lang_pt:"Portugués",lang_fr:"Francés",lang_it:"Italiano",lang_de:"Alemán",test_default_text:"Hola, soy APX. Esto es una prueba de voz.",test_default_engine:"Default ({name})",test_default_chain:"Default (cadena)",test_unavailable_suffix:" · no disponible",test_empty_error:"Escribí algo para decir.",test_synth_error:"No se pudo sintetizar.",test_engine_label:"Engine",test_engine_hint:"Override del default para probar.",test_style_label:"Estilo (solo Gemini)",test_style_hint:"Cómo debería hablar. Vacío = sin estilo.",test_text_label:"Texto a decir",test_text_ph:"Escribí lo que querés que diga…",say_this:"Decir esto",stop:"Detener",replay:"Repetir",engine_result:"Engine",providers_desc:"Engines de síntesis, en orden de fallback. El estado lo reporta el daemon en vivo. Agregá tus propios endpoints compatibles con OpenAI.",providers_load_error:"No pude cargar los proveedores: {msg}",test_desc:"Elegí con qué engine sintetizar y, si aplica, cómo debería hablar.",stt_desc:"Engine de speech-to-text que usan el deck, Telegram y la CLI al escuchar.",toast_default_engine:"Engine default: {id}.",toast_mode_chain:"Modo: cadena con fallback.",toast_mode_single:"Modo: solo engine default.",toast_config_saved:"Configuración de voz guardada.",toast_provider_removed:"Proveedor eliminado.",err_label_required:"Falta el nombre.",err_base_url_required:"Falta la base URL.",toast_transcription_updated:"Transcripción actualizada."},telegram_ui:{channel_dialog_desc:"POST /telegram/channels (upsert) — PATCH /telegram/channels/:name (parcial).",bot_token_hint:"Token de BotFather. Se guarda en ~/.apx/config.json.",bot_token_hint_short:"Token de BotFather.",secret_set_replace:"(seteado — escribí para reemplazar)",secret_already_set:"(ya seteado)",empty_keep:"— vacío = mantener",message_sent:"Mensaje enviado.",message_label:"Texto",send_chat_id:"chat_id: {id}",default_apx:"APX por defecto",yes:"sí",no:"no",user_id_fallback:"user_id {id}",role_assigned:"{name} → {role}"},agents_form:{emoji:"Emoji",area:"Área",role:"Rol",no_role:"— sin rol —",autonomy:"Autonomía",autonomy_hint:"Cuánto puede hacer el agente sin pedir confirmación.",auto_total:"Total",auto_automatico:"Auto",auto_permiso:"Permiso"},structure:{title:"Estructura",subtitle:"Áreas y roles de la empresa. Las áreas agrupan agentes; los roles definen su función.",info:"Las áreas son agrupaciones opcionales. Los roles definen la función de un agente y pueden pertenecer a un área.",empty:"Todavía no hay áreas ni roles. Creá el primero arriba.",new_area:"Nueva área",new_role:"Nuevo rol",edit_area:"Editar área",edit_role:"Editar rol",create_area:"Crear área",create_role:"Crear rol",name:"Nombre",slug:"Slug",goal:"Objetivo",goal_hint:"Para qué existe esta área (opcional).",area:"Área",description:"Descripción",no_area:"— sin área —",roles:"Roles",add_role:"rol",no_roles:"sin roles",general_roles:"Roles generales",delete_area:"Borrar área",delete_role:"Borrar rol",delete_area_desc:'¿Borrar el área "{name}"? Sus roles quedan sin área, no se eliminan.',delete_role_desc:'¿Borrar el rol "{name}"?'},files:{docs_label:"Docs",files_label:"Archivos",new_doc:"Nuevo documento",new_doc_hint:"Podés usar carpetas: cases/onboarding/spec.md",empty:"No hay archivos.",docs_empty:"Todavía no hay documentación. Creá el primer documento.",truncated:"Listado recortado (demasiados archivos).",select_prompt:"Elegí un archivo para verlo.",save:"Guardar",saved:"Guardado.",deleted:"Eliminado.",created:"Documento creado.",edit:"Editar",preview:"Preview",discard:"Descartar",no_preview:"No hay preview para este archivo.",too_large:"Archivo demasiado grande para mostrar.",path_label:"Ruta del archivo",path_example:"ej. cases/onboarding/spec.md",create:"Crear"},tasks:{state_open:"abiertas",state_done:"hechas",state_dropped:"descartadas",status_pending:"pendiente",status_running:"corriendo",status_in_review:"en revisión",status_blocked:"bloqueada",done_label:"hecha",dropped_label:"descartada",detail_title:"Detalle de task",field_title:"Título",field_prompt:"Prompt",field_status:"Estado",field_agent:"Agente",field_creator:"Creada por",field_source:"Origen",field_created:"Creada",field_updated:"Actualizada",field_done:"Completada",prompt_ph:"Descripción / prompt de la task…",toggle_prompt:"Prompt",view_thread:"Ver conversación",mark_done:"Completar"},agents_ui:{model_router_default:"modelo: default del router",slug_kebab_hint:"kebab-case, ej. reviewer, my-agent, content-writer",comma_separated:"separadas por coma",body_hint:"markdown — extiende el system prompt del agente",source_user:"user",source_override:"override",source_bundled:"bundled",tab_explorer:"Explorador",type_none:"— sin tipo —",type_orchestrator:"Orquestador",type_orchestrator_desc:"Coordina el equipo y delega.",type_specialist:"Especialista",type_specialist_desc:"Experto en el dominio; corre tareas.",type_assistant:"Asistente",type_assistant_desc:"Ayudante conversacional.",type_worker:"Worker",type_worker_desc:"Corre tareas autónomas.",type_monitor:"Monitor",type_monitor_desc:"Vigila el estado y reporta.",stat_threads:"Threads",stat_records:"Records",stat_tasks:"Tasks",stat_heartbeats:"Heartbeats",uncategorized:"Sin categoría",brain_zoom_in:"Acercar",brain_zoom_out:"Alejar",brain_fit:"Ajustar a la vista",brain_fullscreen:"Pantalla completa",brain_exit_fs:"Salir de pantalla completa",brain_pan_hint:"scroll para zoom · arrastrá el fondo para mover",brain_expand:"Expandir cerebros",brain_collapse:"Colapsar",brain_open:"Abrir",brain_part_of:"Parte de",brain_branches:"Ramas",config_def_desc:"definición (frontmatter + system prompt).",memory_durable_desc:"hechos durables que el agente recuerda.",running:"running",paused:"pausada",last_error:"última: error",field_tick:"Tick",field_next_tick:"Próximo tick",field_last_tick:"Último tick",field_last_run:"Última corrida",tools_label:"Tools",kind_agent:"agente",kind_memory:"memoria",kind_thread:"thread",kind_task:"task",kind_routine:"rutina",kind_hierarchy:"jerarquía",nodes_drag_hint:"{n} nodos · arrastrá para reordenar",kind_exec_agent:"Agente del proyecto",kind_exec_agent_desc:"Corre un agente del proyecto con un prompt. Vos elegís cuál.",kind_super_agent:"Super-agente",kind_super_agent_desc:"Llama al super-agente APX con un prompt.",kind_telegram:"Telegram",kind_telegram_desc:"Manda un mensaje fijo a un canal de Telegram. Sin modelo ni agente.",kind_shell:"Shell",kind_shell_desc:"Corre un comando shell. Sin prompt ni pre/post — el comando es la acción.",kind_heartbeat:"Heartbeat",kind_heartbeat_desc:"No hace nada salvo escribir una línea en los logs cada vez que corre. Sirve para confirmar que el scheduler está vivo. Si no sabés si lo necesitás, no lo uses.",unit_seconds:"segundos",unit_minutes:"minutos",unit_hours:"horas",unit_days:"días",every_n_unit:"cada {n} {unit}",every_v:"cada {v}",preset_every_10m:"cada 10 min",preset_hourly:"cada hora",preset_daily_9am:"diario 9am",preset_weekdays_9am:"días hábiles 9am",preset_manual:"Manual",var_pre_output_prompt:"Salida de texto de los pre-commands. Se reemplaza dentro del prompt/texto antes de enviarlo. Útil para inyectar datos frescos (clima, una API) en la instrucción.",var_llm_output:"Respuesta final del agente o super-agente. Disponible en los post-commands como variable de entorno. Ej: reenviarla por Telegram.",var_status:"Resultado de la acción: ok o error. Disponible en los post-commands para decidir qué hacer después.",var_skipped:"Vale 1 si la acción se salteó (por skip_prompt_on), 0 si corrió. Disponible en los post-commands.",var_pre_output:"Salida completa de los pre-commands, como variable de entorno en los post-commands (hasta 32k).",var_pre_output_file:"Ruta a un archivo temporal con la salida de los pre-commands. Para salidas grandes que no convienen como variable.",var_pre_exit:"Código de salida del último pre-command (0 = ok). Disponible en los post-commands.",var_routine:"Nombre de esta rutina. Disponible como variable de entorno en los comandos.",summary_runs_agent:'Corre el agente "{agent}"',summary_runs_agent_none:"Corre un agente (todavía no elegiste cuál)",summary_super_agent:"Llama al super-agente",summary_telegram:'Manda Telegram a "{channel}"',summary_runs_cmd:"Corre: {cmd}",summary_shell:"Corre un comando shell",summary_heartbeat:"Deja un heartbeat en los logs",action_agent_answers:'El agente "{agent}" responde el prompt',action_agent_pick_answers:"El agente (elegí uno) responde el prompt",action_super_answers:"El super-agente responde el prompt",action_telegram_channel:'Manda Telegram al canal "{channel}"',action_runs_shell:"Corre el comando shell",step_pre:"Pre",step_post:"Post",last_label:"última:",tg_chat_id_ph:"(usa el del canal)",tg_text_ph:"mensaje a enviar",hb_message_ph:"sigo vivo",arg_placeholder:"--flag o valor",remove_arg:"quitar arg",super_agent_label:"{persona} (super-agente)",super_agent_badge:"super-agente"},modules_ui:{desktop_pos_left:"Izquierda",desktop_pos_center:"Centro",desktop_pos_right:"Derecha",desktop_theme_system:"Sistema",desktop_theme_light:"Claro",desktop_theme_dark:"Oscuro",desktop_status_desc:"La ventana se abre desde la terminal o por arranque automático.",desktop_running:"Corriendo",desktop_stopped:"Detenida",desktop_refresh:"refrescar",desktop_start:"Iniciar",desktop_stop:"Detener",desktop_restart:"Reiniciar",desktop_restart_hint:"Recarga la ventana abierta para aplicar ya los cambios de config (tema, posición).",desktop_restart_done:"Reiniciando la ventana — aplicando la última config.",desktop_restart_none:"No hay ninguna ventana de desktop conectada.",desktop_start_done:"Ventana de desktop iniciada.",desktop_start_already:"La ventana de desktop ya estaba corriendo.",desktop_stop_done:"Ventana de desktop detenida.",desktop_stop_none:"No había ninguna ventana de desktop corriendo.",desktop_from_terminal:"Desde la terminal:",desktop_autostart_desc:"Abre la ventana al iniciar sesión. Equivale a `apx desktop install` (no requiere sudo).",desktop_platform:"plataforma: {platform}",desktop_shortcut_desc:"Atajo global que muestra/oculta la ventana y empieza a escuchar.",desktop_accelerator:"Acelerador",desktop_accelerator_hint:"Hacé clic en el campo y apretá tu combinación de teclas. Reiniciá la ventana para aplicar.",desktop_shortcut_record:"Hacé clic para definir un atajo",desktop_shortcut_recording:"Apretá tu combinación…",desktop_shortcut_change:"clic para cambiar",desktop_shortcut_esc:"Esc para cancelar",desktop_shortcut_saved:"Atajo guardado. Reiniciá la ventana (apx desktop stop && start) para aplicarlo.",desktop_autostart_on:"Arranque automático habilitado para el próximo inicio de sesión.",desktop_autostart_off:"Arranque automático deshabilitado.",desktop_appearance_desc:"Tema de la ventana y posición en la pantalla.",desktop_theme:"Tema",desktop_restart_apply:"Reiniciá la ventana para aplicar.",desktop_theme_set:"Tema: {value}.",desktop_position:"Posición",desktop_position_hint:'"izquierda" / "centro" / "derecha" del borde superior.',desktop_position_set:"Posición: {value}.",desktop_activation_desc:"El plugin del daemon procesa los mensajes. El STT se configura en Voces.",desktop_enabled_toast:"Escritorio habilitado.",desktop_disabled_toast:"Escritorio deshabilitado.",desktop_plugin_on:"Plugin habilitado (responde mensajes)",desktop_plugin_off:"Plugin deshabilitado",desktop_stt_engine:"Motor de speech-to-text:",desktop_stt_engine_suffix:"(whisper local, idioma, modelo).",desktop_last_conv_desc:"El último intercambio con el agente desde la ventana flotante.",desktop_no_messages:"Todavía no hay mensajes. Mandá algo a la ventana de escritorio para que aparezca acá.",desktop_you:"Vos",desktop_roby:"Roby",desktop_empty_msg:"(vacío)",deck_widget_enabled:"Widget {id} habilitado.",deck_widget_disabled:"Widget {id} deshabilitado.",deck_save_error:"Error al guardar",deck_loading_manifest:"Cargando manifest…",deck_manifest_error:"Error al cargar el manifest.",deck_widgets_summary:"{count} widgets · {enabled} externos habilitados",deck_loading_manifest_full:"Cargando el manifest del Deck…",deck_manifest_load_failed:"No se pudo cargar el manifest del Deck.",deck_retry:"Reintentar",deck_no_widgets:"No hay widgets en el manifest.",deck_context_desc:"Información que el Deck ve desde el daemon.",deck_active_project:"Proyecto activo:",deck_none:"ninguno",deck_registered_projects:"Proyectos registrados:",deck_active_plugins:"Plugins activos:",deck_daemon_active:"activo · {uptime}",deck_daemon_started:"iniciado",deck_safety_no_shell:"sin shell directo",deck_safety_no_arbitrary:"comandos arbitrarios bloqueados",deck_safety_confirm:"las acciones peligrosas requieren confirmación",code_copied:"Copiado.",code_saved:"Guardado.",code_file_empty:"(vacío)",code_file_error:"Error: {msg}",code_stream_error:"error",code_super_agent:"super-agent",code_super_agent_desc:"Agente principal con todas las tools",code_chat_tab:"Chat",code_panel_sessions:"Lista de sesiones",code_panel_tree:"Árbol de archivos",code_panel_terminal:"Terminal",code_panel_context:"Panel de contexto",code_ctx_auto:"auto",code_ctx_mode:"Modo",code_ctx_agent:"Agente",code_ctx_msgs_value:"{user} usuario · {assistant} asistente",code_ctx_tokens_total:"Tokens Total",code_ctx_created:"Creado",code_ctx_activity:"Actividad",code_project_fallback:"proyecto {id}",code_pick_project_ph:"Elegí un proyecto…",code_artifact_exit_ok:"exit 0 — {ms}ms",code_artifact_exit_fail:"exit {code}{timeout}",code_artifact_timeout_suffix:" (timeout)",code_artifact_view_short:"Ver",code_artifact_edit_short:"Editar",code_artifact_exit_badge:"exit {code}",code_artifact_timeout:"timeout",code_artifact_truncated:"truncado"},settings_ui:{bearer_label:"Bearer",global_config_desc:"Config general en ~/.apx/config.json. Editable por tabs; el JSON queda separado.",global_json_desc:"Los secretos redacted no se sobrescriben.",save_json:"Guardar JSON",expand_menu:"Expandir menú",collapse_menu:"Colapsar menú",documentation:"Documentación",kind_personal:"Personal",kind_company:"Empresa",kind_app:"App",kind_software:"Software",kind_default:"Default",kind_other:"Otro",base_menu_view:"Vista del menú Base (workspace general).",coming_soon:"Próximamente",inspector_title:"Skill Inspector (RAG por turno)",inspector_desc:"Función experimental. Cuando está activa, el agente NO recibe la lista completa de skills en su prompt; en cada mensaje un RAG local decide qué skill(s) cargar — el cuerpo completo si hay match fuerte, una sugerencia si es medio, nada si no aplica. Se reevalúa en cada turno: una skill que dejó de ser relevante desaparece del contexto.",enable_inspector:"Habilitar inspector",enable_inspector_hint:"Off = comportamiento clásico (lista de slugs + sugerencia pasiva). On = el RAG decide por turno.",on:"On",off:"Off",index_count:"Índice: {n} skills",not_indexed:"sin indexar",dim:"dim {dim}",updated_at:"actualizado {date}",reindex:"Reindexar",reindex_forced:"Reindexar (forzado)",embedder_source:"El embedder viene de Memoria (RAG). Local con Ollama, u offline si no hay proveedor configurado.",thresholds_title:"Umbrales y límites",thresholds_desc:"Ajustá qué tan agresivo es el inspector. Subir los umbrales = menos falsos positivos pero más riesgo de perderte una skill; bajarlos = al revés.",test_title:"Probar (dry-run)",test_desc:"Escribí un mensaje como lo haría un usuario y mirá qué skills cargaría/sugeriría el inspector — sin llamar al modelo. Fuerza el inspector aunque esté apagado arriba.",test_placeholder:"ej.: necesito crear un video promocional con voz en off",test_btn:"Probar",jit_empty_index:"JIT (índice vacío)",loaded_label:"Cargadas:",suggested_label:"Sugeridas:",could_not_save:"No se pudo guardar: {msg}",indexed_with:"Indexado con {embedder} (dim {dim}): +{added} ~{refreshed} -{removed}.",index_failed:"Falló el indexado: {msg}",dry_run_failed:"Falló el dry-run: {msg}",knob_load_threshold:"Umbral de carga",knob_load_threshold_hint:"Similaridad mínima para inyectar el CUERPO de la skill (alto = más estricto).",knob_hint_threshold:"Umbral de sugerencia",knob_hint_threshold_hint:"Similaridad mínima para solo SUGERIR la skill (así el agente la carga si quiere).",knob_margin:"Margen sobre la 2da",knob_margin_hint:"La primera tiene que superar a la segunda por este margen para cargar su cuerpo (evita empates flojos).",knob_max_loaded:"Máx. cuerpos cargados",knob_max_loaded_hint:"Cuántas skills se inyectan completas por turno.",knob_max_hints:"Máx. sugerencias",knob_max_hints_hint:"Cuántas skills extra se nombran como sugerencia.",knob_prompt_floor:"Largo mínimo del prompt",knob_prompt_floor_hint:"Los mensajes más cortos que esto se ignoran (evita 'ok', 'hola').",knob_body_char_cap:"Tope de chars del cuerpo",knob_body_char_cap_hint:"Recorta los cuerpos largos para que no inflen el contexto.",cfg_overrides_label:"Overrides",cfg_overrides_desc:".apc/config.json. Solo valores específicos del proyecto; vacío hereda del global/effective.",cfg_route_to_agent:"Route to agent",cfg_super_agent_model:"Modelo del super-agente",cfg_permission_mode:"Permission mode",cfg_extra_prompt:"Prompt extra",cfg_telegram_label:"Telegram",cfg_chat_id:"Chat ID",cfg_bot_token:"Bot token",cfg_respond_with_engine:"Responder con engine",cfg_engines_label:"Engines",cfg_ollama_url:"Ollama URL",cfg_anthropic_key:"Anthropic API key",cfg_openai_key:"OpenAI API key",cfg_groq_key:"Groq API key",cfg_openrouter_key:"OpenRouter API key",cfg_gemini_key:"Gemini API key",cfg_project_label:"Proyecto",cfg_project_desc:".apc/project.json. Metadata APC portable; sin secretos, sin runtime.",cfg_name:"Nombre",cfg_version:"Versión",cfg_apc_spec:"APC spec",cfg_apx_install:"Estado de instalación APX",cfg_apx_storage_id:"ID de storage APX"},skills_page:{title:"Skills",desc:"Activá o desactivá qué skills carga cada agente. Elegí el scope: el super-agent (global) o un proyecto puntual.",list_title:"Skills instaladas",list_desc:"Las privadas de APX están siempre activas y no se pueden tocar.",scope_label:"Scope",scope_super_agent:"Super-agent (global)",scope_hint:"El super-agent usa el scope global. Cada proyecto puede sobrescribir skills de forma independiente.",count_label:"{n} skills · {on} activas",empty:"No hay skills. Creá una abajo o instalá con la CLI.",source_builtin:"APX",source_global:"Global",source_project:"Proyecto",private_badge:"Privada",private_hint:"Skill interna de APX — siempre activa, no se puede desactivar ni borrar.",overridden_badge:"Override",inherited_hint:"Heredada del global",reset_to_global:"Volver al global",on:"activa",off:"inactiva",toggle_failed:"No se pudo cambiar el estado: {msg}",add_title:"Agregar skill",add_desc:"Crea una skill de usuario en ~/.apx/skills/<slug>/SKILL.md. Queda disponible para todos los scopes.",add_slug_label:"Slug",add_slug_ph:"mi-skill",add_desc_label:"Descripción",add_desc_ph:"Una línea que explique cuándo usarla",add_body_label:"Cuerpo (Markdown)",add_body_ph:`# Mi skill
|
|
759
|
-
|
|
760
|
-
Instrucciones para el agente…`,add_btn:"Crear skill",created_ok:'Skill "{slug}" creada.',create_failed:"No se pudo crear: {msg}",delete_btn:"Borrar",delete_confirm:'¿Borrar la skill "{slug}"? No se puede deshacer.',deleted_ok:'Skill "{slug}" borrada.',delete_failed:"No se pudo borrar: {msg}",inspector_section_title:"Skill Inspector (RAG por turno)",inspector_section_desc:"Config avanzada: RAG local que inyecta solo las skills que el mensaje necesita.",scope_ph:"— elegir scope —",select_a_skill:"Elegí una skill de la lista para ver su contenido.",added_by:"Agregado por",activator:"Activador",by_apx:"APX (built-in)",by_you:"Vos",activator_value:"Coincidencia semántica (RAG)",tab_preview:"Vista",tab_source:"Fuente",add_menu:"Agregar",add_online:"Crear con el editor",add_online_hint:"Escribí slug + descripción + contenido",add_zip:"Subir .zip",add_zip_hint:"Importar una skill empaquetada",add_repo:"Desde repo git",add_repo_hint:"Clonar desde una URL",create_dialog_title:"Crear skill",repo_dialog_title:"Importar desde repo git",repo_url_label:"URL del repo",repo_url_ph:"https://github.com/usuario/mi-skill.git",repo_url_hint:"El repo (o su subcarpeta) debe tener un SKILL.md.",import_btn:"Importar",imported_ok:'Skill "{slug}" importada.',import_failed:"No se pudo importar: {msg}",cancel:"Cancelar",manager_tab:"Skills",rag_tab:"Config (RAG)"},shared_ui:{skill_inspector_title:"Skill Inspector ({embedder}) eligió estas skills para este turno",tools_count:"{n} tools",tool_read_file:"Leer archivo",tool_write_file:"Escribir archivo",tool_edit_file:"Editar archivo",tool_list_files:"Listar archivos",tool_search_files:"Buscar en archivos",tool_search_messages:"Buscar mensajes",tool_tail_messages:"Últimos mensajes",tool_run_shell:"Correr shell",tool_send_telegram:"Enviar Telegram",tool_call_agent:"Llamar agente",tool_call_mcp:"Llamar MCP",tool_call_runtime:"Llamar runtime",tool_create_task:"Crear task",dedup:"dedup",args:"args",result:"result",auto:"Auto",auto_router:"Auto (decide el router)",model_filter_ph:"filtrar o escribir modelo…",loading_models:"cargando modelos…",use_value:"usar “{value}”",model_combobox_ph:"elegí o escribí un modelo…",search_variable_ph:"buscar variable…",no_matches:"sin coincidencias",create_variable:"Crear nueva variable…",kv_key_ph:"CLAVE",kv_value_ph:"valor",remove_row:"quitar fila",add_row:"Agregar fila",err_chat_failed:"Falló el chat.",err_stream_failed:"Falló el stream.",err_load_conversation:"No se pudo cargar la conversación.",err_stream:"Error de stream."},integrations:{title:"Integrations",description:"Plugins y tools disponibles para este proyecto",tab_plugins:"Plugins",tab_tools:"Tools",scope_label:"Ámbito:",scope_project:"Este proyecto",scope_global:"Global (default)",plugins_hint:"Plugins de canal y servicio instalables por proyecto. Se guardan en el ámbito seleccionado arriba.",more_soon:"Más plugins próximamente…",tools_hint:"Tools que los plugins conectados exponen a los agentes de este proyecto.",tools_empty:"No hay tools de integraciones. Conectá un plugin para habilitarlas.",tool_active:"activo",tool_inactive:"inactivo",status_active:"Activo",status_error:"Error",status_unconfigured:"No configurado",connected:"Conectado",connect:"Conectar",deactivate:"Desactivar",saving:"Guardando...",validating:"Validando...",verifying:"Verificando token...",confirm:"Confirmar",select_placeholder:"Seleccionar...",reveal:"Ver",hide:"Ocultar",credentials:"Credenciales {name}",coming_soon:"Próximamente",coming_soon_body:"Este plugin está declarado en el catálogo pero todavía no está conectable en APX. Se va a portar de forma nativa en una próxima iteración.",tools_for_agents:"Tools para agentes",tools_available_note:"Disponibles para los agentes que las tengan permitidas, o vía discover_tools.",err_connect:"Error al conectar",err_generic:"Ocurrió un error",action_done:"Listo",asana:{select_label:"Seleccioná el workspace a usar",connected:{user_name:"Conectado como",user_email:"Email",workspace_name:"Workspace"},fields:{personal_access_token:{label:"Personal Access Token",help_label:"¿Cómo obtener el token?",help_steps:`Abrí app.asana.com/0/my-apps en el navegador.
|
|
761
|
-
Bajá hasta la sección "Personal access tokens" (no tus apps OAuth).
|
|
762
|
-
Hacé clic en "+ New access token".
|
|
763
|
-
Dale un nombre y confirmá.
|
|
764
|
-
Copiá el token completo — empieza con "1/..." y tiene un ":" en el medio.
|
|
765
|
-
Pegalo en el campo de abajo.`}}},github:{connected:{user_login:"Conectado como",user_name:"Nombre"},fields:{token:{label:"Personal Access Token",help_label:"¿Cómo obtener el token?",help_steps:`Abrí github.com/settings/tokens.
|
|
766
|
-
Generá un token (classic o fine-grained) con scope "repo".
|
|
767
|
-
Copiá el token — empieza con ghp_ o github_pat_.
|
|
768
|
-
Pegalo en el campo de abajo.`}}},obsidian:{connected:{vault_path:"Vault",vault_name:"Nombre",note_count:"Notas"},fields:{vault_path:{label:"Ruta del Vault"},auto_mcp:{label:"Registrar MCP de Obsidian",hint:"Agrega un MCP 'obsidian' apuntando a este vault, en este scope."},memory_sync:{label:"Sincronizar memoria de APX",hint:"Habilita el respaldo de la memoria de APX en el vault; luego usá el botón de abajo."}},actions:{sync_memory:"Sincronizar memoria",sync_memory_done:"Sincronizados {count} archivo(s) · {changed} cambiados"}}}},DD={common:{loading:"Loading…",saving:"Saving…",cancel:"Cancel",save:"Save",delete:"Delete",edit:"Edit",create:"Create",add:"Add",remove:"Remove",reload:"Reload",shutdown:"Shut down",enabled:"Enabled",disabled:"Disabled",enable:"Enable",disable:"Disable",open:"Open",close:"Close",confirm:"Confirm",optional:"(optional)",none:"—",none_yet:"Nothing here yet.",error_generic:"Something went wrong.",search:"Search",new:"New",restore:"Restore",show:"Show",hide:"Hide",copy:"Copy",run:"Run",refresh:"Refresh",view_all:"View all",saved:"Saved.",deleted:"Deleted.",pager_prev:"Previous",pager_next:"Next",pager_page:"Page {page} of {total}",pager_range:"{from}–{to} of {total}",pager_per_page:"Per page"},daemon:{connecting:"Connecting to the daemon…",unreachable:"Could not reach the daemon at localhost:7430.",unreachable_hint:"Start APX with `apx daemon start` and refresh.",version:"Version",uptime:"Uptime",status:"Status",running:"running",down:"down",reload_hint:"POST /admin/reload — reloads ~/.apx/config.json without restarting.",shutdown_confirm:"Shut down the daemon? Upcoming requests will fail until it restarts.",shutdown_done:"Daemon stopped."},pairing:{title:"Pair this device",subtitle:"You are connecting from outside this machine. For security, pair this browser with a pairing code.",steps_title:"How to get the code",step_1:"On the PC where APX is running, open a terminal.",step_2:"Run `apx pair` (or scan the QR with APX Deck).",step_3:"Copy the code shown below the QR and paste it here.",code_label:"Pairing code",code_ph:"e.g. 7f3a1c9e-…",label_label:"Device name",label_ph:"e.g. Living room laptop",submit:"Pair",linking:"Pairing…",success:"Device paired ✓",err_required:"Paste the pairing code.",err_expired:"The code expired. Run `apx pair` again and try again.",err_unknown:"Unknown or already-used code. Generate a new one with `apx pair`.",err_generic:"Could not pair. Check the code and try again.",revoke_hint:"You can revoke this device at any time from Settings or with `apx pair revoke`."},nav:{apx_admin:"APX",settings:"Settings",project:"Project",add_project:"Add project",all_projects:"All projects",more_projects:"{count} more",collapse_projects:"Hide projects",expand_projects:"Show projects",modules:{voice:"Voices",desktop:"Desktop",deck:"Deck",code:"Code",web:"Web"}},topbar:{breadcrumb_root:"APX",breadcrumb_settings:"APX › Settings",breadcrumb_project:"APX › Project",breadcrumb_base:"Base",breadcrumb_projects:"Projects",light:"Switch to light",dark:"Switch to dark",lang_toggle:"Language"},admin:{title:"APX",subtitle:"Admin panel. Global config, channels and projects.",engines_title:"Engines",engines_subtitle:"Available LLM adapters. API keys live in ~/.apx/config.json.",telegram_title:"Telegram",telegram_subtitle:"Configured channels. Each one can be pinned to a project.",telegram_polling_on:"Polling active",telegram_polling_off:"Disabled",telegram_add_channel:"Channel",telegram_send_test:"Test",telegram_send_test_title:"Send to",telegram_default_message:"Test message from APX panel ✅",projects_title:"Registered projects",projects_subtitle:"Click a project to open its panel.",unregister:"Unregister",unregister_confirm:"Remove {label} from APX? The folder is not deleted; only unregistered.",reload_success:"Config reloaded.",telegram_polling_started:"Polling started.",telegram_polling_stopped:"Polling stopped.",telegram_channel_removed:"Channel deleted.",agents_badge:"agents",engine_badge:"yes",engine_badge_no:"no",base_label:"Base"},add_project:{title:"Add project",subtitle:"APX will index .apc/, agents and AGENTS.md in that folder.",path_label:"Absolute path",path_hint:"Equivalent to apx project add /path/to/project",path_placeholder:"/path/to/my-project",register:"Register",path_required:"Path required.",registered:"Project #{id} registered.",search_btn:"Browse",picker_prompt:"Pick the project folder",browser_unavailable:"Browser unavailable until daemon restarts. Paste path manually.",no_folders:"No folders."},settings:{title:"Settings",subtitle:"Panel preferences + local daemon diagnostics.",appearance:"Appearance",light_mode:"Light",dark_mode:"Dark",system_mode:"System",language:"Language",daemon:"Daemon",daemon_sub:"Status of the local process that serves this web and orchestrates agents.",engines:"Available engines",engines_sub:"LLM adapters compiled with the daemon.",token:"Session token",token_sub:"If this web could not auto-load the token, paste it here.",token_active:"(token already active)",token_paste:"Paste daemon bearer",token_saved:"Token saved.",devices:"Paired devices",devices_sub:"GET /pair/list. Revoking invalidates that bearer on the daemon.",devices_empty:"No paired clients yet.",devices_revoke_confirm:"Revoke client {id}?",devices_revoke_success:"Client revoked.",devices_pair_btn:"Pair device",devices_pair_title:"Pair device",devices_pair_desc:"Scan the QR with your phone camera to open the web already paired, or paste the code on another PC.",devices_pair_scan:"Scan with your phone camera — opens the web already paired.",devices_pair_code:"Or paste this code on the pairing screen:",devices_pair_url:"Access URL",devices_pair_link:"Or copy this link and open it on the other device (enters automatically):",devices_pair_copy:"Copy",devices_pair_copied:"Link copied to clipboard.",devices_pair_copied_code:"Code copied.",devices_pair_expires:"Expires in {s}s",devices_pair_expired:"The code expired.",devices_pair_regen:"Generate another",devices_pair_waiting:"Waiting for device to confirm…",devices_pair_done:"Device paired ✓",devices_pair_localhost_only:"Codes can only be generated from the daemon's PC (localhost).",devices_last_seen:"seen:",devices_never:"never",devices_revoke:"Revoke",account_section:"Account",agents_section:"Agents & models",channels_section:"Channels & devices",modules_section:"Modules",advanced_section:"Advanced",tabs:{identity:"Identity",super_agent:"Super-agent",engines:"Engines & models",telegram:"Telegram",devices:"Devices",advanced:"Advanced"},identity:{title:"Identity",subtitle:"User data. Agent configuration goes in Super-agent.",agent_name:"Agent name",owner_name:"Your name",personality:"Personality",owner_context:"Owner context",owner_context_hint:"Who you are, what you work on, what the agent should know about you.",language:"Preferred language",timezone:"Timezone (IANA)",timezone_hint:"Auto-detected — search to change.",saved:"Identity saved."},super_agent:{title:"Super-agent",subtitle:"Personality, model, prompt and modes of the super-agent.",personality:"Personality",model:"Active model",model_hint:"E.g.: anthropic:claude-sonnet-4.5, ollama:gemma2:9b",permission_mode:"Permission mode",system:"Extra prompt (system)",system_hint:"Text prepended to the base system prompt.",system_ph:"(Empty = the base prompt from core/agent/prompts/super-agent-base.md is used)",fallback_title:"Fallback chain",fallback_hint:"If the active model fails, these are tried in order.",fallback_add:"Add model to chain",saved:"Super-agent saved.",enabled_label:"Super-agent enabled",model_active:"Active model (router)",model_configure:"Configure in Models",behavior_subtitle:"Super-agent behavior. Model and fallback chain are configured in the Model Router."},engines_keys:{title:"Model API keys",subtitle:"Each engine stores its key in ~/.apx/config.json. Already-set values show a safe suffix.",ollama_url:"Ollama URL",ollama_hint:"Default: http://127.0.0.1:11434",key_label:"API key",key_placeholder:"(not set)",clear:"Clear key",saved:"Key saved.",cleared:"Key cleared."},telegram_global:{title:"Telegram (default)",subtitle:"Default channel — projects can override with their own channel.",bot_token:"Bot token",chat_id:"Default chat ID",poll_interval:"Poll interval (ms)",respond_with_engine:"Respond with engine",enabled:"Polling enabled",saved:"Telegram saved."},advanced:{title:"Advanced",subtitle:"Raw editor for ~/.apx/config.json. Secrets show as *** set *** but you can write a new one.",write:"Apply changes",written:"Config applied and daemon reloaded.",reload_success:"Config reloaded."}},project:{not_found:"Roby couldn't find project {pid}: it may have been unregistered, or the ID is wrong.",rebuild:"Rebuild context",rebuild_done:"Rebuild OK.",unregister_confirm:"Unregister {label}? The folder is not deleted.",unregistered:"Unregistered.",base_subtitle:"General workspace · super-agent",danger:{title:"Danger zone",subtitle:"Actions that affect APX's project registry. They do not touch repo files.",rebuild_desc:"Re-scans .apc/, MCPs and agents and regenerates the super-agent context for this project.",unregister_desc:"Removes the project from APX's registry. The folder on disk stays intact.",rebuild_confirm_title:"Rebuild context",rebuild_confirm_desc:"Regenerate context for {label}.",rebuild_long:"Re-reads APC config, lists available MCPs and agents, and rebuilds the super-agent system prompt. Safe to run — nothing is deleted. Use it after editing .apc/ by hand or if changes are not being picked up.",unregister_confirm_title:"Unregister project",unregister_long:"The project disappears from `apx`. Files on disk (.apc/, code, everything) stay. You can re-register it with `apx project register <path>`."},nav:{overview:"Overview",chat:"Chat",config:"Config",telegram:"Telegram",agents:"Agents",routines:"Routines",tasks:"Tasks",mcps:"MCPs",artifacts:"Artifacts",vars:"Variables",logs:"Logs",memories:"Memories",structure:"Structure",docs:"Docs",files:"Files"},sections:{workspace:"Workspace",content:"Content",automation:"Automation",knowledge:"Conversations",config:"Config"},overview:{tasks_open:"Open tasks",routines:"Routines",routines_active:"Active routines",agents:"Agents",mcps:"MCPs",artifacts:"Artifacts",chat:"Chat (super-agent)",chat_value:"open",roster:"Team",no_agents:"No agents yet.",orchestrators:"Orchestrators",specialists:"Specialists",recent_tasks:"Recent tasks",no_activity:"No open tasks.",brain_title:"Team brain",brain_desc:"The whole agent map — orchestrators at the core, their specialists clustered around them. Click a node to open it.",brain_core:"Team"},artifacts:{title:"Artifacts",subtitle:"Reusable scripts and files stored under the project. Agents create them; you can view, run, rename or delete them."},chat:{title:"Chat with agent",subtitle:"Direct conversations with project agents. The super-agent does not intervene.",live_title:"Chat with {agent}",superagent_title:"Chat with {persona}",superagent_subtitle:"Chat with {persona} — the APX super-agent. Can use tools (projects, tasks, mcps, agents).",loaded_subtitle:"Loaded conversation with {slug}. Sending will append to this thread.",thread_subtitle:"History with {persona} on {channel}. Replying here continues the conversation from the web.",empty:"Send a message to start the conversation.",placeholder:"Type something and press enter to send (shift+enter = new line)",send:"Send",stop:"Stop",new_session:"New session",delete:"Delete",delete_confirm_title:"Delete chat",delete_confirm_desc:"This can't be undone. This chat's history will be permanently deleted.",deleted:"Chat deleted.",meta_created:"Created {date} · {channel}",meta_new:"New chat · {channel}",copy:"copy",copied:"Copied.",stopped_marker:" [stopped]",create_agent:"Create agent",create_agent_title:"Create agent",create_agent_desc:"Required to start a chat in this project.",role_label:"role",model_label:"model",model_hint:"e.g. openai:gpt-5, groq:llama-3.3-70b-versatile",master_label:"Master agent",list:{title:"Chats",new:"New",search:"Search chats…",all_agents:"All agents",empty:"No conversations yet. Start one from the right.",count:"{n} total",pick_agent:"Pick an agent"}},tasks:{title:"Tasks (TODOs)",subtitle:"Append-only JSONL in ~/.apx/projects/<id>/tasks/.",add:"add",add_label:"New task",add_placeholder:"e.g. fix scroll bug",empty:"No {state} tasks.",empty_open:"No open tasks.",created:"Task created.",create_error:"could not create task",done:"✓ done",drop:"✗ drop",reopen:"↻ reopen",due:"due",via:"via",aria_done:"mark done",aria_drop:"discard task",aria_reopen:"reopen task"},global_tasks:{title:"Tasks (all projects)",subtitle:"Aggregated tasks from all registered projects.",empty:"No tasks.",due:"due",go_project:"Go to project"},routines:{title:"Heartbeats / Routines",subtitle:"Cron, every:Nm, once:ISO. Each routine fires an agent or a shell.",empty:"No routines. Create one above.",new:"new",new_btn:"New",delete_confirm:"Delete routine {name}?",delete_confirm_body:"This can't be undone.",saved:"Routine saved.",paused:"paused",next_run:"next:",last_run:"last:",enabled_hint:"Active · runs on schedule",disabled_hint:"Paused · only via Run button",enabled_label:"Enabled",new_title:"New routine",edit_title:"Edit {name}",dialog_desc:"Saved in .apc/routines.json. The routine runs while the daemon is active.",name_field:"Name",name_no_edit:"Cannot be changed when editing.",kind_field:"Action (kind)",schedule_field:"Interval (schedule)",schedule_hint:"Choose a preset or type manually. Manual = only runs via Run button.",vars_title:"Available variables",what_happens:"What will happen",list_title:"Routines",detail_empty:"Pick a routine from the list.",edit_btn:"Edit",edit_hint:"Open the editor: kind, schedule, prompt, pre/post and variables.",block_pre:"Pre-commands",block_post:"Post-commands",block_prompt:"Prompt",block_text:"Text",block_command:"Command",block_empty:"(empty)",runs_title:"Executions",runs_empty:"No executions yet.",runs_close:"Close",runs_no_detail:"No further detail.",runs_output:"Output",status_ok:"ok",status_error:"error",status_skipped:"skipped",agent_field:"Agent (spec.agent)",agent_hint:"Who executes the routine.",agent_loading:"loading…",agent_pick:"— pick an agent —",prompt_exec:"Prompt (spec.prompt)",prompt_exec_ph:"what is pending for today?",prompt_super:"Prompt (spec.prompt)",prompt_super_ph:"summarize the project status",pre_field:"Pre-commands (pre_commands)",pre_hint:"Shell BEFORE the prompt. One per line.",post_field:"Post-commands (post_commands)",post_hint:"Shell AFTER the prompt. One per line.",tg_channel:"Channel (spec.channel)",tg_chat_id:"Chat ID (spec.chat_id)",tg_text:"Telegram Message (spec.text)",tg_text_hint:"Fixed message to send. Does not use a model.",shell_field:"Command (spec.command)",shell_hint:"Runs as-is in the shell. No prompt, no pre/post.",hb_channel:"Channel (spec.channel)",hb_message:"Message (spec.message)",name_required:"name required",save_error:"save failed",run_error:"run failed",toggle_error:"toggle failed",delete_error:"delete failed",run_success:"{name} fired.",run_confirm:"Run routine {name} now?",run_confirm_body:"Runs the action once, regardless of the schedule.",running:"Running…",delete_success:"deleted."},agents:{title:"Agents",subtitle:"Defined in .apc/agents/<slug>.md.",subtitle_full:"Defined in .apc/agents/<slug>.md. Runtime memory lives under ~/.apx/projects/<id>/agents/<slug>/.",empty:"No agents. Add one with <code>apx agent add</code> or the button.",empty_text:"No agents. Add one with `apx agent add` or the button above.",new:"Agent",created:"Agent {slug} created.",slug_invalid:"slug must match /^[a-z][a-z0-9_-]*$/",hierarchy:"Hierarchy",list_view:"List",import:"Import",chat:"Chat",view:"View",orchestrator:"Orchestrator",new_title:"New agent",new_desc:"POST /projects/:pid/agents — writes .apc/agents/<slug>.md.",slug_label:"slug",slug_ph:"cody",role_label:"role (optional)",role_ph:"code refactor",model_label:"model (optional)",model_hint:"e.g. ollama:gemma2:9b, openai:gpt-4o-mini",lang_label:"language (optional)",desc_label:"description (optional)",desc_ph:"What does this agent do…",skills_label:"skills (comma)",skills_ph:"skill-a, skill-b",tools_label:"tools (comma)",tools_ph:"tool-a, tool-b",parent_label:"reports to (parent, optional)",parent_hint:"Sub-agent of an orchestrator.",none_parent:"— none —",master_label:"Orchestrator (master)",create_success:"Agent {slug} created.",create_error:"create failed",import_title:"Import from vault",import_desc:"Templates in ~/.apx/agents. Registered in this project (.apc/agents/<slug>.md).",import_empty:"No templates in the vault.",import_success:"Imported: {slug}",import_already:"already here",import_btn:"Import"},agent_detail:{not_found:"Agent not found.",chat_btn:"Chat with {slug}",reports_to:"↳ reports to",no_threads:"No threads.",no_activity:"No recorded activity.",threads_recent:"Recent threads",subagents:"Sub-agents",subagents_desc:"Agents that report to this orchestrator.",config_title:"Agent configuration",type_label:"Type",area_label:"Area",area_hint:"e.g. operations, marketing",area_ph:"operations",role_label:"Role",parent_label:"Reports to (parent)",none_parent:"— none —",model_label:"Base model",model_hint:"Empty = uses the Router model (default). Set only to force a model for this agent.",model_ph:"(empty = router default)",skills_label:"Skills (comma)",bio_label:"Bio / description",system_label:"System prompt",system_hint:"Defines personality and behavior (body of AGENT.md).",master_label:"Orchestrator (master)",delete_btn:"Delete agent",save_btn:"Save changes",delete_confirm:'Delete agent "{slug}"? Removes .apc/agents/{slug}.md and local runtime data.',update_success:"Agent updated.",delete_success:"Agent deleted.",tools_hint:"Which tools this agent can use. Tap to toggle; or edit the list below.",tools_custom_ph:"list (comma): echo, http_fetch",memory_title:"Agent memory",memory_empty:"(empty memory)",memory_saved:"Memory saved.",records_title:"Records",records_desc:"Agent activity log (messages/actions). Newest first.",sleep_title:"Sleep / Heartbeat",sleep_desc:"Agent execution status, derived from its routines.",sleep_deep:"Deep sleep · no heartbeat",sleep_deep_desc:"This agent has no routine that triggers it. It does not run autonomously; it only responds when invoked (chat / task).",brain_title:"Brain",brain_desc:"Real relationship graph of the agent: memory, threads, tasks, heartbeats and hierarchy. (first version — will be refined)",brain_empty:"No relationships to graph yet (no memory, threads, tasks or routines).",msgs_count:"msgs"},mcps:{title:"MCP servers",subtitle:"3 scopes: runtime > shared > global. Conflicts shown above if any.",empty:"No MCPs configured.",new:"MCP",delete_confirm:"Delete MCP {name} from scope {scope}?",conflicts:"⚠ Conflicts: {names}",conflict_detail:"{name} is defined in {winner} and {loser}. APX uses {winner}; {loser} is ignored.",new_title:"New MCP",new_desc:"POST /projects/:pid/mcps?scope=…",scope_label:"Scope",transport_label:"Transport",name_label:"Name",name_ph:"filesystem",cmd_label:"Command",cmd_ph:"npx",args_label:"Args",args_hint:"space-separated",args_ph:"-y @modelcontextprotocol/server-filesystem /tmp",env_label:"Env (JSON, optional)",url_label:"URL",url_ph:"https://example.com/mcp",enabled_label:"Enabled",add_btn:"Add",name_required:"name required",env_invalid:"env must be valid JSON",removed:"removed",added:"MCP added.",updated:"MCP updated.",edit_title:"Edit MCP",save_btn:"Save",add_arg:"Add arg",edit_btn:"Edit",test_btn:"Test",logs_btn:"Logs",testing:"Testing…",test_ok:"OK · {n} tools available",tools_count:"{n} tools",logs_title:"Logs · {name}",logs_empty:"No logs yet. Start the MCP by calling a tool or running Test.",logs_events:"Recent events",logs_stderr:"stderr (last 4KB)",logs_panel_title:"Live logs",logs_panel_pick:"pick an MCP",logs_panel_hint:"Click an MCP in the list to see what's happening live.",logs_panel_idle:"No activity. Hit Test to spin it up.",scope_runtime:"Runtime",scope_shared:"Shared",scope_global:"Global",source_runtime:"Runtime",source_apc:"APC / Shared",source_claude:"Claude",source_codex:"Codex",source_cursor:"Cursor",source_vscode:"VS Code",source_roo:"Roo",source_gemini:"Gemini",scope_runtime_desc:"This project only · with secrets · not committed (~/.apx/projects/<id>/mcps.json)",scope_shared_desc:"This project only · committeable · no secrets (.apc/mcps.json)",scope_global_desc:"All projects on this machine (~/.apx/mcps.json)",transport_stdio:"stdio",transport_http:"HTTP",transport_stdio_desc:"Local process — `command` + args",transport_http_desc:"Remote endpoint — URL + headers",args_hint_tokens:"One entry per arg. Use the + button to insert a variable.",env_hint_tokens:"Key/value pairs. Values accept ${var.NAME} (+ button on the right).",env_empty:"No env vars.",headers_label:"Headers",headers_hint:"Key/value pairs — typically Authorization: Bearer ${var.TOKEN}.",headers_empty:"No headers."},vars:{title:"Variables",subtitle_project:"Replace ${var.NAME} when loading MCPs and templates. Project vars beat globals. Stored outside the repo (~/.apx/, chmod 0600).",subtitle_base:"Global variables — available to every project. Stored in ~/.apx/vars.json (chmod 0600).",empty:"No variables yet.",new:"Variable",new_title:"New variable",edit_title:"Edit variable",new_desc:"Referenced as ${var.NAME} in any field that supports interpolation.",reveal_all:"Show values",reveal:"Show",hide:"Hide",filter_label:"Show:",filter_all:"All",filter_project:"Project only",filter_global:"Globals only",scope_label:"Scope",scope_project:"project",scope_project_desc:"This project only. Beats the global with the same name.",scope_global:"global",scope_global_desc:"Available to every project.",name_label:"Name",name_hint:"Uppercase, digits and _. E.g. MY_API_KEY, GITHUB_TOKEN.",value_label:"Value",value_hint:"Stored on disk with 0600 perms. Never committed.",value_edit_ph:"(leave empty to keep current… not yet supported, paste the value again)",add_btn:"Add",save_btn:"Save",edit_btn:"Edit",delete_btn:"Delete",delete_confirm:"Delete {name} ({scope})?",removed:"Variable removed.",added:"Variable added.",updated:"Variable updated.",name_required:"Name required.",value_required:"Value required."},threads:{title:"Chats",subtitle:"Conversations per agent (empty = no logs persisted yet).",no_agents:"No agents. Conversations require a configured agent.",pick:"Pick an agent to view its conversations.",empty:"No conversations for {slug}.",conversation_title:"Conversation {id}",messages:"messages",via:"via"},config:{title:"Quick config",subtitle:"Project override. Written to {path}.",model:"super_agent.model",model_hint:"e.g. anthropic:claude-sonnet-4.5, ollama:gemma2:9b",perm:"super_agent.permission_mode",route:"route_to_agent",route_hint:"Slug of the agent that handles this project by default.",use_global:"(uses global)",saved:"Saved.",nothing:"Nothing to save.",raw_title:"Config (raw JSON)",raw_subtitle:"Paste the entire object — equivalent to PUT the file.",raw_save:"Replace config",raw_done:"Config overwritten.",effective:"Effective config (read-only)",effective_sub:"What the daemon actually sees (global ⊕ override).",section_title:"Project config",section_desc:"APC metadata and overrides separated. General APX lives in Settings > Config.",effective_read:"Read: global APX + project override.",save_project:".apc/project.json saved.",save_override:".apc/config.json saved.",save_fields_success:"Overrides saved.",save_meta_success:"Project metadata saved.",no_data:"No data.",tab_settings:"Settings",tab_project:"Project"},telegram:{title:"Telegram channel (override)",subtitle:"If you set a channel here, messages from this project go there instead of the default.",use_default:"Use default channel",bot_token:"Bot token (override)",chat_id:"Chat ID (override)",saved:"Override saved.",cleared:"Override removed — falls back to default.",override_active:"override active",channel_badge:"Channel {name}",no_override:"No override. Messages from this project go to the default channel.",respond_engine:"Respond with engine",route_agent:"route_to_agent",route_hint:"Slug of the agent that handles messages (empty = super-agent).",bot_hint_none:"If empty, inherits from default."},memories:{sidebar_title:"Memories",general_group:"General",general_item:"Project memory",project_title:"Project memory",project_desc:"Durable facts at the project level. .apc/memory.md — read by agents and the super-agent.",project_ph:`# Project Memory
|
|
769
|
-
|
|
770
|
-
Stable facts that any agent should know…`,agents_title:"Agent memories",agents_desc:"Individual memory per agent. ~/.apx/projects/<id>/agents/<slug>/memory.md",no_agents:"No agents in this project.",saved:"Memory saved.",empty:"(empty memory)",chars:"chars · Markdown",save_btn:"Save"}},base:{title:"Base",subtitle:"General workspace · super-agent",nav_general:"General",nav_activity:"Activity",nav_system:"System",workspaces_title:"Workspaces",workspaces_desc:"All projects registered in APX.",workspaces_new:"New project",workspaces_empty:"No projects. Add one with the button above.",sessions_title:"Sessions",sessions_desc:"Sessions from all engines (apx · claude · codex), newest first.",sessions_desc_scoped:"Sessions in this project's folder ({path}), all engines, newest first.",sessions_all:"All engines",sessions_empty:"No sessions.",sessions_error:"Could not read sessions: {msg}",sessions_search_ph:"Search sessions…",sessions_deep:"Deep",sessions_deep_tip:"Also search inside transcripts (slower)",sessions_clear:"Clear filters",sessions_refresh:"Refresh list",sessions_no_match:"No sessions match “{q}”.",sessions_act_cmd:"Copy apx command",sessions_act_ask:"Ask {name} to continue",sessions_act_folder:"Open folder",sessions_act_path:"Copy path",sessions_cmd_copied:"Command copied — paste it in your terminal",sessions_path_copied:"Path copied",sessions_copy_failed:"Could not copy",sessions_no_folder:"This session has no folder",sessions_no_path:"This session has no path",sessions_folder_failed:"Could not open folder: {msg}",defaults_title:"Agent defaults",defaults_desc:"Global vault templates. Bundled ones come with APX and are always present; ones you create or edit go in ~/.apx/agents and override. Import them into a project from Agents › Import.",defaults_show_removed:"Show removed",defaults_new:"New",defaults_empty:"No templates in the vault.",defaults_hide:"Hide",defaults_restore:"Restore",defaults_edit:"Edit",defaults_remove:"Hide",defaults_delete:"Delete",defaults_tombstone_msg:`Hide the default "{slug}"? It's bundled — tombstoned and recoverable with Restore.`,defaults_delete_msg:'Delete the template "{slug}"?',defaults_hidden:"Hidden.",defaults_deleted:"Deleted.",defaults_restored:"Restored.",defaults_new_title:"New template",defaults_new_desc:"POST /agents/vault — saved to ~/.apx/agents/<slug>.md",defaults_edit_title:'Edit "{slug}"',defaults_bundled_desc:"This is a bundled default. Saving does a copy-on-write to ~/.apx/agents/<slug>.md (becomes an override).",defaults_user_desc:"PATCH /agents/vault/:slug — edits the file in ~/.apx/agents.",defaults_master_label:"Master agent",defaults_slug_invalid:"invalid slug (must match /^[a-z][a-z0-9_-]*$/)",defaults_created:'Template "{slug}" created.',defaults_saved:'Template "{slug}" saved.'},logs:{title:"Logs",desc_global:"Daemon activity (global channels: telegram, direct…). ~/.apx/messages/<channel>/.",desc_project:"Project activity. ~/.apx/projects/<id>/messages/.",filter_channel:"filter channel (e.g. telegram)",filter_dir:"direction",all_directions:"All directions",in:"Incoming (in)",out:"Outgoing (out)",filter_type:"type",all_types:"All types",search_text:"search text…",count_of:"of",no_activity:"No activity.",no_activity_ch:'No activity in channel "{ch}".',error:"Could not read messages: {msg}",show_more:"show more",show_less:"show less",daemon_errors:"Daemon errors (~/.apx/logs/errors.jsonl)",no_errors:"No errors recorded. 🎉"},telegram_contacts:{title:"Telegram contacts",desc:"Who writes to the bots. The role defines which tools they can use; a guest has no permissions until you assign a role.",empty:"No contacts yet — they register automatically when someone writes to a bot.",owner_badge:"owner",assign_role:"Assign role",owner_hint:"Channel owner — change it from the channel",removed:"Contact deleted.",delete_confirm:"Delete contact {name}?",last_seen:"seen:",tools_all:"tools: all",tools_none:"tools: none",tools_label:"tools:"},telegram_channels:{title:"Channels",desc:"Each channel is a bot the daemon polls. Here you can add/remove channels, change the answering agent, the project it belongs to and its owner.",new_btn:"New channel",empty:"No channels yet — add the first one.",removed:"Channel deleted.",delete_confirm:"Delete channel {name}?",no_owner:"no owner (claimed on first DM)",owner_label:"owner:"},telegram_channel_dialog:{new_title:"New Telegram channel",edit_title:"Edit channel: {name}",name_label:"name (internal slug)",token_label:"bot_token",chat_id:"chat_id",project_label:"project",project_hint:"Slug or id of the project to pin this channel to (optional).",route_label:"route_to_agent",route_hint:"Answering agent; empty = APX super-agent.",owner_label:"owner_user_id",owner_hint:"Telegram user_id of the channel owner. Overrides global role to 'owner' here. Leave empty — first private message claims it.",owner_ph:"889721252",respond_label:"Respond with engine (not echo)",name_required:"name required",saved:"Channel saved."},telegram_send_dialog:{title:"Send to {name}",default_msg:"Test message from APX panel ✅"},telegram_roles:{title:"Roles",desc:"Each role defines which super-agent tools the assigned user can invoke. 'owner' always = all; 'guest' always = none (chat only).",empty:"No roles defined.",tools_all:"all tools",tools_none:"no tools",builtin:"built-in",delete_confirm:'Delete role "{name}"?',removed:"Role deleted.",saved:'Role "{name}" saved.',name_required:"Name required.",builtin_error:'"{name}" is a built-in role.',new_title:"New role or replace a custom one",name_label:"Name",name_ph:"editor",tools_label:"Tools (comma-separated)",tools_hint:"Empty = none. Examples: call_agent, list_tasks, create_task.",tools_ph:"call_agent, list_tasks",full_access:"Full access (all tools)",save_btn:"Save role",delete_btn:"Delete"},superagent:{title:"{persona}",badge:"super-agent · APX",desc:"Quick chat with your super-agent. Has access to tools (projects, tasks, mcps, agents); for a longer persistent thread, open Chats.",empty:"Send {persona} a message to get started.",thinking:"{persona} is thinking…",talk:"Talk to {persona}",new_chat:"New chat",placeholder:"Type and press enter to send (shift+enter = new line)…"},not_found:{title:"404",message:"Roby got lost: this page doesn't exist or has moved.",home:"Back to home"},ask_panel:{answers_header:"Answers",other:"Other",other_placeholder:"Write your own answer here",text_placeholder:"Type your answer…",back:"Back",skip:"Skip",next:"Next",submit:"Send",status_waiting:"Waiting for your answer…",status_received:"Answers received"},code_module:{title:"Code",badge:"super-agent",desc:"OpenCode-style coding sessions. Pick a project, open a session, and ask it to read, plan, edit or run.",no_projects:"No registered projects. Register one with `apx project add` to use Code.",sessions:"Sessions",new_session:"New session",untitled:"New session",no_sessions:"No sessions yet — create one to start coding.",pick_project:"Pick a project to see its sessions.",rename:"Rename",delete:"Delete",delete_confirm:"Delete this session? The transcript is removed; your files are untouched.",empty_chat:"Send a coding instruction to get started.",placeholder:"Ask for a change… (enter sends, shift+enter = new line)",mode_build:"Build",mode_plan:"Plan",mode_build_hint:"Build — edits files and runs commands",mode_plan_hint:"Plan — read-only, proposes changes without touching files",tab_context:"Context",tab_changes:"Changes",tab_artifacts:"Artifacts",artifacts_none:"No artifacts yet. Ask the agent to create a script under `artifacts/<name>`.",artifacts_count:"{n} artifact(s)",artifacts_copy_path:"Copy path",artifacts_run:"Run",artifacts_run_hint:"Run it from your terminal:",artifacts_delete:"Delete",artifacts_delete_confirm:"Delete this artifact? The file will be removed from disk.",ctx_model:"Model",ctx_tokens:"Tokens",ctx_input:"Input",ctx_output:"Output",ctx_messages:"Messages",ctx_breakdown:"Context breakdown",ctx_none:"No usage yet — send a turn to see tokens.",seg_system:"System",seg_user:"User",seg_assistant:"Assistant",seg_tool:"Tools",seg_other:"Other",changes_none:"No changes in this session yet.",changes_no_git:"Changes need a git repository. This project isn't one.",changes_files:"{n} file(s) changed",stopped:"[stopped]",close:"Close",reload:"Reload",discard_changes:"Discard changes",save_shortcut_hint:"Save (Cmd/Ctrl+S)",artifacts_rename:"Rename",artifacts_view:"View contents",artifacts_edit:"Edit contents",artifacts_preview:"Preview",artifacts_preview_hint:"Open a live preview in a local browser tab",artifacts_share:"Share",artifacts_share_hint:"Create a public tunnel URL to share this preview",artifacts_stop_preview:"Stop preview",artifacts_preview_local:"Local preview",artifacts_preview_public:"Public URL",artifacts_copy_url:"Copy URL",artifacts_preview_started:"Preview running at {url}",tree_collapse_all:"Collapse all",terminal_clear:"Clear",terminal_close:"Close terminal"},desktop_screen:{status_title:"Status",autostart_title:"Auto-start",shortcut_title:"Keyboard shortcut",appearance_title:"Appearance",activation_title:"Activation + transcription",last_conv_title:"Last conversation",open_config:"Configuration"},voice_screen:{providers_title:"Voice providers (TTS)",test_title:"Test voice",stt_title:"Transcription (STT)",configure_provider:"Configure {name}"},deck_screen:{widgets_title:"Widgets",context_title:"APX context",reload_manifest:"Reload manifest",widget_native:"Native APX widget",widget_external:"External widget",preview_badge:"Preview",preview_title:"Deck — Coming soon",preview_body:"The Deck module is still in development and not released yet. We'll re-enable it once Deck ships in a stable release. For now everything here is read-only and no changes will be saved."},memory_panel:{embeddings_title:"Embeddings (RAG)",embeddings_desc:"Model that vectorizes the history of all channels for relevant memory. Just like TTS/STT: pick a provider and model. 'Automatic' tries local first and falls back to offline if nothing is available.",provider_label:"Provider",provider_hint:"Ollama is local and free. Gemini/OpenAI use the API key from their section in Models (or the one below).",mode_label:"Selection mode",mode_hint:"Chain falls back to the next if one fails; Single uses exactly the chosen provider.",available:"available",unavailable:"unavail.",test_btn:"Test embedding",reindex_btn:"Reindex memory",test_ok:"Embedding OK with {embedder}",test_failed:"Test failed: {msg}",reindexed:"Reindexed: {indexed} chunks (cleared {cleared}).",reindex_failed:"Reindex failed: {msg}",save_failed:"Could not save: {msg}",provider_auto:"Automatic (chain: Ollama → Gemini → OpenAI → offline)",provider_ollama:"Ollama — local, no API key (nomic-embed-text)",provider_gemini:"Gemini — free tier with key (text-embedding-004)",provider_openai:"OpenAI — text-embedding-3-small (cloud)",provider_tf:"Offline (term-frequency, no model — degraded)",mode_chain:"Chain (automatic fallback)",mode_single:"Single (uses only the chosen one)",ollama_title:"Ollama (local)",ollama_desc:"No API key. Runs nomic-embed-text on your local or cloud Ollama.",model_label:"Model",base_url_label:"Base URL",ollama_base_url_hint:"Empty uses engines.ollama.base_url (default http://localhost:11434).",openai_title:"OpenAI",openai_desc:"text-embedding-3-small (1536 dims) or another compatible model.",api_key_label:"API key",openai_key_hint:"Empty reuses engines.openai.api_key. Leave it blank to keep the saved one.",gemini_title:"Gemini",gemini_desc:"text-embedding-004 (768 dims). Free tier with a Google API key.",gemini_key_hint:"Empty reuses engines.gemini.api_key.",compaction_title:"History compaction",compaction_desc:"When a chat exceeds the turn threshold, the oldest turns are summarized with a lightweight (local) LLM and saved as [COMPACTED SUMMARY], keeping context bounded. Runs off the hot-path: the current turn uses whatever summary already exists.",threshold_label:"Compaction threshold",threshold_hint:"Compact once the chat exceeds these turns (default 60).",keep_recent_label:"Recent turns to preserve",keep_recent_hint:"Verbatim turns that are NEVER compacted (default 40). Must be lower than the threshold.",compact_model_label:"Compaction model",compact_model_hint:"Lightweight LLM for summarizing. Ideally a local one (Ollama) to avoid cost. Format provider:model.",compact_fallback_label:"Fallback model",compact_fallback_hint:"Used if the compaction one fails. Empty falls back to the super-agent model.",compact_fallback_ph:"(empty → super-agent model)"},router_panel:{title:"Model router",description:"A single general router (no per-task cases). Pick a provider and model; if the active one fails, it tries the fallback chain in order.",badge_default:"default",no_providers:"Add a provider below to be able to pick models.",active_model_label:"Active model (default)",active_model_hint:"Provider + model. Saved as provider:model.",fallback_title:"Fallback chain",fallback_desc:"If the active model fails, it tries these in order. Click one to edit it.",fallback_empty:"No fallback configured.",add_to_chain:"Add to the chain",done:"done",save:"Save router",saved:"Saved",saved_toast:"Router saved.",provider_ph:"— provider —",provider_not_found:"⚠ {name} (not found)",provider_not_configured:'The provider "{name}" is not configured.'},routing_panel:{title:"Content routing",description:"Prefer a different model per message based on its content (image, size, channel, keywords). Separate from the fallback chain above.",signal_on:"Content routing: ON ({n} rules)",signal_on_empty:"Content routing: ON (no rules yet)",signal_off:"Content routing: OFF",how_it_works:"How does it work?",enable_label:"Enable content routing",rules_title:"Routing rules",rules_desc:"Evaluated top to bottom; the first rule whose conditions all match wins.",rules_empty:"No rules yet. Add some in the editor.",edit_rules:"Edit rules (JSON)",hide_editor:"Hide editor",editor_label:"Rules (JSON array)",json_hint:"Array of { model, when }. when keys: has_image, min_prompt_chars, max_prompt_chars, min_context_chars, channels[], keywords[]. Empty when = matches every message.",json_error:"Invalid JSON: {msg}",json_not_array:"The rules must be a JSON array.",insert_example:"Insert an example",when_any:"any message",when_image:"has image",when_no_image:"no image",when_min_prompt:"prompt ≥ {n} chars",when_max_prompt:"prompt ≤ {n} chars",when_min_context:"context ≥ {n} chars",when_channels:"channels: {list}",when_keywords:"keywords: {list}",helper:"Routing picks a model per message (image, size, channel, keywords). It composes with failover: a routed model that is down falls back down the chain. An explicit per-request model override always wins.",save:"Save routing",saved:"Saved",saved_toast:"Content routing saved.",confirm_title:"Apply routing changes?",confirm_body:"This changes which model handles each message. Failover still applies if a routed model is down.",confirm_on:"Content routing will be ON with {n} rules.",confirm_off:"Content routing will be OFF (every message uses the default router).",confirm_apply:"Apply",cancel:"Cancel"},engines_panel:{title:"Providers",new_btn:"New provider",description:"LLM providers (API). Each provider uses an engine/adapter (openai, ollama, …) with its key and URL.",empty:"No providers. Add one with the button above.",add_card:"Add provider",saved:"Provider saved.",saved_json:"Provider saved (JSON).",deleted:"Provider deleted.",delete_confirm:"Delete provider {name}?"},providers_modal:{new_title:"New provider",edit_title:"Edit {name}",description:"LLM provider. The engine defines which adapter it uses (openai, ollama, …).",list_models_hint:"List the provider's actual models",toggle_active:"Active · click to deactivate",toggle_inactive:"Inactive · click to activate",delete:"Delete",custom:"Custom",json_mode:"JSON",form_mode:"Back to form",json_label:"Provider config (JSON)",json_hint:"Saved as engines.{slug} in config.json",json_help:"Must be a valid JSON object with at least engine. The slug is taken from the form.",name_label:"Name",name_ph:"My provider",engine_label:"Engine",base_url_label:"Base URL (base_url)",base_url_hint:"Auto-filled when you pick a provider.",base_url_ph:"https://api.openai.com/v1",api_key_label:"API key",api_key_hint_existing:"Leave blank to keep the current one.",api_key_hint_env:"Stored as a secret. Suggested env: {env}",api_key_hint:"Stored as a secret.",api_key_set:"…{suffix} (already set)",model_label:"Default model",load_models:"Load models",max_tokens_label:"Max tokens (max_tokens)",temperature_label:"Temperature: {value}",pricing_summary:"Token analysis / pricing (optional)",context_limit_label:"Context limit (tokens)",price_input:"$ input / 1M",price_output:"$ output / 1M",price_cache_read:"$ cache read / 1M",price_cache_write:"$ cache write / 1M",model_limits_label:"Per-model context limits (JSON)",active_label:"Active (agents can use it)",err_slug_required:"Slug required.",err_slug_required_form:"Slug required (in the form).",err_slug_exists:'A provider "{slug}" already exists.',err_model_limits_json:"Per-model context limits: invalid JSON.",err_json_invalid:"Invalid JSON: check the syntax.",err_json_object:"The JSON must be an object with the provider config.",err_engine_missing:'Missing "engine" (e.g. "anthropic", "ollama").',err_save:"Error saving.",err_no_models:"No models. Correct key/URL?",err_list_models:"Could not list models."},providers_card:{active:"Active",off:"Off",model:"Model",base_url:"Base URL",api_key:"API key",key_set:"✓ set",temp:"Temp",price_io:"$ in/out (1M)"},chat_ui:{copy:"Copy",stop:"Stop",send:"Send",pick_model:"Pick model (or Auto)",insert_variable:"Insert variable",ctx_files:"files",ctx_actors:"{n} agents/models",ctx_turns:"{n} turns"},sidebar_ui:{toggle:"Toggle sidebar"},models_ui:{invalid_hint:"Model/provider unavailable"},global_config:{title:"APX config"},agent_detail_extra:{skills_title:"Skills & tools"},voice_ui:{api_key_label:"API key",api_key_set:"…{suffix} (already set)",api_key_keep_hint:"Leave blank to keep the current one.",api_key_secret_hint:"Stored as a secret. Env: {env}",api_key_reuse_hint:"Reuses {engine} if left blank. Env: {env}",err_save:"Error while saving.",model_label:"Model",voice_label:"Voice",format_label:"Format",output_format_label:"Output format",voice_id_label:"Voice ID",voice_id_hint:"ElevenLabs voice id (empty = default).",gemini_model_hint:"Gemini TTS is still in preview.",base_url_label:"Base URL (optional)",base_url_hint:"OpenAI-compatible endpoint. Empty = OpenAI. Point it at a local server (e.g. a QVox / Qwen3-TTS daemon) to use that instead.",openai_model_hint:"tts-1 / tts-1-hd for OpenAI. Leave blank to let a custom server pick.",openai_voice_hint:"OpenAI preset (alloy…) or a custom server's preset (e.g. custom). Empty = server default.",openai_style_hint:"Base voice / instruct, used by custom endpoints (the persona kept across the audio). Ignored by stock OpenAI tts-1.",style_label:"Style (how it should speak)",style_hint:"Natural-language instruction. Empty = no style. E.g.: 'speak in a cheerful, unhurried tone'.",style_ph:"speak in a cheerful, energetic tone",temperature_label:"Temperature (optional)",temperature_hint:"Sampling temperature for custom endpoints. Empty = server default.",emotions_short:"Emotions",emotions_label:"Inline emotion tags",emotions_hint:"When this engine speaks, let the agent drop [happy]/[whisper]-style tags into voice replies to color the delivery. Only enable it if this engine understands the tags (e.g. a QVox/Qwen3-TTS endpoint) — otherwise they're stripped before synthesis.",emotions_tags_label:"Allowed tags",emotions_tags_hint:"Comma-separated. Empty = the default set.",piper_bin_label:"Binary (bin)",piper_bin_hint:"Path or name of the piper CLI (PATH).",piper_model_label:"Model (.onnx)",piper_model_hint:"Absolute path to the piper voice model.",piper_speaker_label:"Speaker (optional)",piper_speaker_hint:"Speaker id for multi-voice models.",mock_desc:"The mock engine generates a silent test WAV. It has no parameters: it serves as a guaranteed fallback when no other engine is configured.",selection_mode:"Selection mode",mode_chain_desc:"Chain with fallback: uses the first available engine following the order below.",mode_single_desc:"Default engine only: always uses the chosen one; the rest stay configured for other purposes.",mode_chain_btn:"Chain (router)",mode_single_btn:"Default engine only",move_up:"Move up",move_down:"Move down",badge_local:"local",badge_available:"available",badge_unavailable:"configured, unavailable",badge_not_configured:"not configured",badge_default:"default",badge_custom:"custom",set_as_default:"Set as default",configure:"Configure",remove:"Remove",remove_confirm:"Remove this custom provider?",add_provider:"Add provider",new_provider:"New provider",custom_note:"Custom OpenAI-compatible endpoint.",custom_desc:"Any OpenAI-compatible speech endpoint (e.g. a local QVox / Qwen3-TTS server).",label_label:"Name",label_hint:"Display name for this provider.",base_url_req_label:"Base URL",base_url_req_hint:"Required. The OpenAI-compatible endpoint, e.g. http://127.0.0.1:5111/v1",api_key_optional_hint:"Optional — only if your server requires a key.",advanced:"Advanced",custom_model_hint:"Optional. Most local servers ignore it (e.g. QVox).",custom_voice_hint:"Optional. A preset your server understands (e.g. custom). Empty = server default.",custom_optional_ph:"(optional)",stt_engine_label:"Transcription engine",stt_engine_hint:"Local uses faster-whisper (requires python3 + faster-whisper). OpenAI uses the engines.openai key.",stt_model_label:"Local model (whisper)",stt_model_hint:"Bigger = more accurate and slower.",stt_language_label:"Language",stt_language_hint:'For Spanish, setting "Spanish" improves accuracy.',stt_provider_auto:"Automatic (local, then remote)",stt_provider_local:"Local — faster-whisper (offline)",stt_provider_openai:"OpenAI — Whisper-1 (cloud)",stt_provider_custom:"Custom — OpenAI-compatible server",stt_openai_model_label:"OpenAI model",stt_openai_model_hint:"Defaults to whisper-1.",stt_custom_baseurl_label:"Base URL (OpenAI-compatible)",stt_custom_baseurl_hint:"e.g. http://localhost:8000/v1 (mlx-audio on Metal) or http://192.168.1.50:9000/v1 (Radeon/NVIDIA on the LAN).",stt_custom_model_label:"Model",stt_custom_model_hint:"e.g. mlx-community/whisper-large-v3-turbo or large-v3.",stt_custom_key_hint:"Optional — most local servers need no key.",stt_hw_label:"Detected hardware",stt_hw_recommended:"Recommended",stt_hw_limited:"limited GPU acceleration, using CPU",stt_backend_label:"Acceleration / Engine",stt_backend_hint:"Auto adapts to your hardware. Metal runs on the GPU (mlx); CPU uses faster-whisper.",stt_backend_auto:"Automatic (recommended)",stt_model_needs_download:"Not downloaded (~{size}). The model must be downloaded to use this engine.",lang_auto:"Auto-detect",lang_es:"Spanish",lang_en:"English",lang_pt:"Portuguese",lang_fr:"French",lang_it:"Italian",lang_de:"German",test_default_text:"Hi, I'm APX. This is a voice test.",test_default_engine:"Default ({name})",test_default_chain:"Default (chain)",test_unavailable_suffix:" · unavailable",test_empty_error:"Type something to say.",test_synth_error:"Could not synthesize.",test_engine_label:"Engine",test_engine_hint:"Override the default for testing.",test_style_label:"Style (Gemini only)",test_style_hint:"How it should speak. Empty = no style.",test_text_label:"Text to say",test_text_ph:"Type what you want it to say…",say_this:"Say this",stop:"Stop",replay:"Replay",engine_result:"Engine",providers_desc:"Synthesis engines, in fallback order. Status is reported live by the daemon. Add your own OpenAI-compatible endpoints.",providers_load_error:"Could not load providers: {msg}",test_desc:"Pick which engine to synthesize with and, if applicable, how it should speak.",stt_desc:"Speech-to-text engine used by the deck, Telegram, and the CLI when listening.",toast_default_engine:"Default engine: {id}.",toast_mode_chain:"Mode: chain with fallback.",toast_mode_single:"Mode: default engine only.",toast_config_saved:"Voice configuration saved.",toast_provider_removed:"Provider removed.",err_label_required:"A name is required.",err_base_url_required:"A base URL is required.",toast_transcription_updated:"Transcription updated."},telegram_ui:{channel_dialog_desc:"POST /telegram/channels (upsert) — PATCH /telegram/channels/:name (partial).",bot_token_hint:"BotFather token. Stored in ~/.apx/config.json.",bot_token_hint_short:"BotFather token.",secret_set_replace:"(set — type to replace)",secret_already_set:"(already set)",empty_keep:"— empty = keep",message_sent:"Message sent.",message_label:"Text",send_chat_id:"chat_id: {id}",default_apx:"default APX",yes:"yes",no:"no",user_id_fallback:"user_id {id}",role_assigned:"{name} → {role}"},agents_form:{emoji:"Emoji",area:"Area",role:"Role",no_role:"— no role —",autonomy:"Autonomy",autonomy_hint:"How much the agent can do without asking for confirmation.",auto_total:"Total",auto_automatico:"Auto",auto_permiso:"Permission"},structure:{title:"Structure",subtitle:"Company areas and roles. Areas group agents; roles define their function.",info:"Areas are optional groupings. Roles define an agent's function and may belong to an area.",empty:"No areas or roles yet. Create the first one above.",new_area:"New area",new_role:"New role",edit_area:"Edit area",edit_role:"Edit role",create_area:"Create area",create_role:"Create role",name:"Name",slug:"Slug",goal:"Goal",goal_hint:"What this area exists for (optional).",area:"Area",description:"Description",no_area:"— no area —",roles:"Roles",add_role:"role",no_roles:"no roles",general_roles:"General roles",delete_area:"Delete area",delete_role:"Delete role",delete_area_desc:'Delete area "{name}"? Its roles are detached, not deleted.',delete_role_desc:'Delete role "{name}"?'},files:{docs_label:"Docs",files_label:"Files",new_doc:"New document",new_doc_hint:"Folders allowed: cases/onboarding/spec.md",empty:"No files.",docs_empty:"No documentation yet. Create the first document.",truncated:"Listing truncated (too many files).",select_prompt:"Pick a file to view it.",save:"Save",saved:"Saved.",deleted:"Deleted.",created:"Document created.",edit:"Edit",preview:"Preview",discard:"Discard",no_preview:"No preview for this file.",too_large:"File too large to display.",path_label:"File path",path_example:"e.g. cases/onboarding/spec.md",create:"Create"},tasks:{state_open:"open",state_done:"done",state_dropped:"dropped",status_pending:"pending",status_running:"running",status_in_review:"in review",status_blocked:"blocked",done_label:"done",dropped_label:"dropped",detail_title:"Task detail",field_title:"Title",field_prompt:"Prompt",field_status:"Status",field_agent:"Agent",field_creator:"Created by",field_source:"Source",field_created:"Created",field_updated:"Updated",field_done:"Completed",prompt_ph:"Task description / prompt…",toggle_prompt:"Prompt",view_thread:"View thread",mark_done:"Complete"},agents_ui:{model_router_default:"model: router default",slug_kebab_hint:"kebab-case, e.g. reviewer, my-agent, content-writer",comma_separated:"comma-separated",body_hint:"markdown — extends the agent's system prompt",source_user:"user",source_override:"override",source_bundled:"bundled",tab_explorer:"Explorer",type_none:"— no type —",type_orchestrator:"Orchestrator",type_orchestrator_desc:"Coordinates the team and delegates.",type_specialist:"Specialist",type_specialist_desc:"Domain expert; runs tasks.",type_assistant:"Assistant",type_assistant_desc:"Conversational helper.",type_worker:"Worker",type_worker_desc:"Runs autonomous tasks.",type_monitor:"Monitor",type_monitor_desc:"Watches state and reports.",stat_threads:"Threads",stat_records:"Records",stat_tasks:"Tasks",stat_heartbeats:"Heartbeats",uncategorized:"Uncategorized",brain_zoom_in:"Zoom in",brain_zoom_out:"Zoom out",brain_fit:"Fit to view",brain_fullscreen:"Fullscreen",brain_exit_fs:"Exit fullscreen",brain_pan_hint:"scroll to zoom · drag background to pan",brain_expand:"Expand brains",brain_collapse:"Collapse",brain_open:"Open",brain_part_of:"Part of",brain_branches:"Branches",config_def_desc:"definition (frontmatter + system prompt).",memory_durable_desc:"durable facts the agent remembers.",running:"running",paused:"paused",last_error:"last: error",field_tick:"Tick",field_next_tick:"Next tick",field_last_tick:"Last tick",field_last_run:"Last run",tools_label:"Tools",kind_agent:"agent",kind_memory:"memory",kind_thread:"thread",kind_task:"task",kind_routine:"routine",kind_hierarchy:"hierarchy",nodes_drag_hint:"{n} nodes · drag to rearrange",kind_exec_agent:"Project agent",kind_exec_agent_desc:"Runs a project agent with a prompt. You pick which one.",kind_super_agent:"Super-agent",kind_super_agent_desc:"Calls the APX super-agent with a prompt.",kind_telegram:"Telegram",kind_telegram_desc:"Sends a fixed message to a Telegram channel. No model or agent.",kind_shell:"Shell",kind_shell_desc:"Runs a shell command. No prompt or pre/post — the command is the action.",kind_heartbeat:"Heartbeat",kind_heartbeat_desc:"Does nothing except write a line to the logs each time it runs. Useful to confirm the scheduler is alive. If you don't know whether you need it, don't use it.",unit_seconds:"seconds",unit_minutes:"minutes",unit_hours:"hours",unit_days:"days",every_n_unit:"every {n} {unit}",every_v:"every {v}",preset_every_10m:"every 10 min",preset_hourly:"hourly",preset_daily_9am:"daily 9am",preset_weekdays_9am:"weekdays 9am",preset_manual:"Manual",var_pre_output_prompt:"Text output of the pre-commands. Replaced inside the prompt/text before it is sent. Use it to inject fresh data (weather, an API) into the instruction.",var_llm_output:"Final answer from the agent or super-agent. Available in the post-commands as an env var — e.g. forward it via Telegram.",var_status:"Action result: ok or error. Available in the post-commands to branch on what happened.",var_skipped:"1 if the action was skipped (via skip_prompt_on), 0 if it ran. Available in the post-commands.",var_pre_output:"Full pre-commands output, as an env var in the post-commands (up to 32k).",var_pre_output_file:"Path to a temp file with the pre-commands output. For large outputs not suited to an env var.",var_pre_exit:"Exit code of the last pre-command (0 = ok). Available in the post-commands.",var_routine:"Name of this routine. Available as an env var in the commands.",summary_runs_agent:'Runs the agent "{agent}"',summary_runs_agent_none:"Runs an agent (none chosen yet)",summary_super_agent:"Calls the super-agent",summary_telegram:'Sends Telegram to "{channel}"',summary_runs_cmd:"Runs: {cmd}",summary_shell:"Runs a shell command",summary_heartbeat:"Leaves a heartbeat in the logs",action_agent_answers:'Agent "{agent}" answers the prompt',action_agent_pick_answers:"Agent (pick one) answers the prompt",action_super_answers:"The super-agent answers the prompt",action_telegram_channel:'Sends Telegram to channel "{channel}"',action_runs_shell:"Runs the shell command",step_pre:"Pre",step_post:"Post",last_label:"last:",tg_chat_id_ph:"(uses the channel's)",tg_text_ph:"message to send",hb_message_ph:"still alive",arg_placeholder:"--flag or value",remove_arg:"remove arg",super_agent_label:"{persona} (super-agent)",super_agent_badge:"super-agent"},modules_ui:{desktop_pos_left:"Left",desktop_pos_center:"Center",desktop_pos_right:"Right",desktop_theme_system:"System",desktop_theme_light:"Light",desktop_theme_dark:"Dark",desktop_status_desc:"The window launches from the terminal or via autostart.",desktop_running:"Running",desktop_stopped:"Stopped",desktop_refresh:"refresh",desktop_start:"Start",desktop_stop:"Stop",desktop_restart:"Restart",desktop_restart_hint:"Reload the open window so config changes (theme, position) apply now.",desktop_restart_done:"Restarting the window — applying the latest config.",desktop_restart_none:"No desktop window is connected.",desktop_start_done:"Desktop window launched.",desktop_start_already:"Desktop window is already running.",desktop_stop_done:"Desktop window stopped.",desktop_stop_none:"No desktop window was running.",desktop_from_terminal:"From terminal:",desktop_autostart_desc:"Launches the window at user login. Equivalent to `apx desktop install` (no sudo required).",desktop_platform:"platform: {platform}",desktop_shortcut_desc:"Global hotkey that shows/hides the window and starts listening.",desktop_accelerator:"Accelerator",desktop_accelerator_hint:"Click the field and press your key combo. Restart the window to apply.",desktop_shortcut_record:"Click to set a shortcut",desktop_shortcut_recording:"Press your combo…",desktop_shortcut_change:"click to change",desktop_shortcut_esc:"Esc to cancel",desktop_shortcut_saved:"Shortcut saved. Restart the window (apx desktop stop && start) to apply it.",desktop_autostart_on:"Autostart enabled for the next login.",desktop_autostart_off:"Autostart disabled.",desktop_appearance_desc:"Window theme and position on the screen.",desktop_theme:"Theme",desktop_restart_apply:"Restart the window to apply.",desktop_theme_set:"Theme: {value}.",desktop_position:"Position",desktop_position_hint:'"left" / "center" / "right" of the top edge.',desktop_position_set:"Position: {value}.",desktop_activation_desc:"The daemon plugin processes the messages. STT is configured in Voices.",desktop_enabled_toast:"Desktop enabled.",desktop_disabled_toast:"Desktop disabled.",desktop_plugin_on:"Plugin enabled (replies to messages)",desktop_plugin_off:"Plugin disabled",desktop_stt_engine:"Speech-to-text engine:",desktop_stt_engine_suffix:"(local whisper, language, model).",desktop_last_conv_desc:"The latest exchange with the agent from the floating window.",desktop_no_messages:"No messages yet. Send something to the desktop window for it to appear here.",desktop_you:"You",desktop_roby:"Roby",desktop_empty_msg:"(empty)",deck_widget_enabled:"Widget {id} enabled.",deck_widget_disabled:"Widget {id} disabled.",deck_save_error:"Error while saving",deck_loading_manifest:"Loading manifest…",deck_manifest_error:"Error loading the manifest.",deck_widgets_summary:"{count} widgets · {enabled} external enabled",deck_loading_manifest_full:"Loading the Deck manifest…",deck_manifest_load_failed:"Could not load the Deck manifest.",deck_retry:"Retry",deck_no_widgets:"No widgets in the manifest.",deck_context_desc:"Information the Deck sees from the daemon.",deck_active_project:"Active project:",deck_none:"none",deck_registered_projects:"Registered projects:",deck_active_plugins:"Active plugins:",deck_daemon_active:"active · {uptime}",deck_daemon_started:"started",deck_safety_no_shell:"no direct shell",deck_safety_no_arbitrary:"arbitrary commands blocked",deck_safety_confirm:"dangerous actions require confirmation",code_copied:"Copied.",code_saved:"Saved.",code_file_empty:"(empty)",code_file_error:"Error: {msg}",code_stream_error:"error",code_super_agent:"super-agent",code_super_agent_desc:"Main agent with all tools",code_chat_tab:"Chat",code_panel_sessions:"Session list",code_panel_tree:"File tree",code_panel_terminal:"Terminal",code_panel_context:"Context panel",code_ctx_auto:"auto",code_ctx_mode:"Mode",code_ctx_agent:"Agent",code_ctx_msgs_value:"{user} user · {assistant} assistant",code_ctx_tokens_total:"Total Tokens",code_ctx_created:"Created",code_ctx_activity:"Activity",code_project_fallback:"project {id}",code_pick_project_ph:"Pick a project…",code_artifact_exit_ok:"exit 0 — {ms}ms",code_artifact_exit_fail:"exit {code}{timeout}",code_artifact_timeout_suffix:" (timeout)",code_artifact_view_short:"View",code_artifact_edit_short:"Edit",code_artifact_exit_badge:"exit {code}",code_artifact_timeout:"timeout",code_artifact_truncated:"truncated"},settings_ui:{bearer_label:"Bearer",global_config_desc:"General config in ~/.apx/config.json. Editable by tabs; JSON stays separate.",global_json_desc:"Redacted secrets are not overwritten.",save_json:"Save JSON",expand_menu:"Expand menu",collapse_menu:"Collapse menu",documentation:"Documentation",kind_personal:"Personal",kind_company:"Company",kind_app:"App",kind_software:"Software",kind_default:"Default",kind_other:"Other",base_menu_view:"Base menu view (general workspace).",coming_soon:"Coming soon",inspector_title:"Skill Inspector (per-turn RAG)",inspector_desc:"Experimental feature. When active, the agent does NOT receive the full skill list in its prompt; on each message a local RAG decides which skill(s) to load — the full body on a strong match, a suggestion on a medium match, nothing if it doesn't apply. It is re-evaluated every turn: a skill that stopped being relevant disappears from the context.",enable_inspector:"Enable inspector",enable_inspector_hint:"Off = classic behavior (slug list + passive suggestion). On = the RAG decides per turn.",on:"On",off:"Off",index_count:"Index: {n} skills",not_indexed:"not indexed",dim:"dim {dim}",updated_at:"updated {date}",reindex:"Reindex",reindex_forced:"Reindex (forced)",embedder_source:"The embedder comes from Memory (RAG). Local with Ollama, or offline if no provider is set.",thresholds_title:"Thresholds and limits",thresholds_desc:"Tune how aggressive the inspector is. Raising the thresholds = fewer false positives but more risk of missing a skill; lowering them = the opposite.",test_title:"Test (dry-run)",test_desc:"Type a message the way a user would and see which skills the inspector would load/suggest — without calling the model. Forces the inspector on even if it's off above.",test_placeholder:"e.g.: I need to create a promo video with voiceover",test_btn:"Test",jit_empty_index:"JIT (empty index)",loaded_label:"Loaded:",suggested_label:"Suggested:",could_not_save:"Could not save: {msg}",indexed_with:"Indexed with {embedder} (dim {dim}): +{added} ~{refreshed} -{removed}.",index_failed:"Index failed: {msg}",dry_run_failed:"Dry-run failed: {msg}",knob_load_threshold:"Load threshold",knob_load_threshold_hint:"Minimum similarity to inject the skill's BODY (high = stricter).",knob_hint_threshold:"Hint threshold",knob_hint_threshold_hint:"Minimum similarity to only SUGGEST the skill (so the agent loads it if it wants).",knob_margin:"Margin over the 2nd",knob_margin_hint:"The top must beat the second by this margin to load its body (avoids weak ties).",knob_max_loaded:"Max. loaded bodies",knob_max_loaded_hint:"How many skills are injected in full per turn.",knob_max_hints:"Max. hints",knob_max_hints_hint:"How many extra skills are named as a suggestion.",knob_prompt_floor:"Minimum prompt length",knob_prompt_floor_hint:"Messages shorter than this are ignored (avoids 'ok', 'hi').",knob_body_char_cap:"Body char cap",knob_body_char_cap_hint:"Trims long skill bodies so they don't bloat the context.",cfg_overrides_label:"Overrides",cfg_overrides_desc:".apc/config.json. Only project-specific values; empty inherits global/effective.",cfg_route_to_agent:"Route to agent",cfg_super_agent_model:"Super-agent model",cfg_permission_mode:"Permission mode",cfg_extra_prompt:"Extra prompt",cfg_telegram_label:"Telegram",cfg_chat_id:"Chat ID",cfg_bot_token:"Bot token",cfg_respond_with_engine:"Respond with engine",cfg_engines_label:"Engines",cfg_ollama_url:"Ollama URL",cfg_anthropic_key:"Anthropic API key",cfg_openai_key:"OpenAI API key",cfg_groq_key:"Groq API key",cfg_openrouter_key:"OpenRouter API key",cfg_gemini_key:"Gemini API key",cfg_project_label:"Project",cfg_project_desc:".apc/project.json. Portable APC metadata; no secrets, no runtime.",cfg_name:"Name",cfg_version:"Version",cfg_apc_spec:"APC spec",cfg_apx_install:"APX install state",cfg_apx_storage_id:"APX storage id"},skills_page:{title:"Skills",desc:"Turn skills on or off per agent. Pick a scope: the super-agent (global) or a specific project.",list_title:"Installed skills",list_desc:"APX's private skills are always active and can't be changed.",scope_label:"Scope",scope_super_agent:"Super-agent (global)",scope_hint:"The super-agent uses the global scope. Each project can override skills independently.",count_label:"{n} skills · {on} on",empty:"No skills yet. Create one below or install via the CLI.",source_builtin:"APX",source_global:"Global",source_project:"Project",private_badge:"Private",private_hint:"Built-in APX skill — always active, can't be disabled or deleted.",overridden_badge:"Override",inherited_hint:"Inherited from global",reset_to_global:"Reset to global",on:"on",off:"off",toggle_failed:"Could not change state: {msg}",add_title:"Add a skill",add_desc:"Creates a user skill at ~/.apx/skills/<slug>/SKILL.md. Available across all scopes.",add_slug_label:"Slug",add_slug_ph:"my-skill",add_desc_label:"Description",add_desc_ph:"One line describing when to use it",add_body_label:"Body (Markdown)",add_body_ph:`# My skill
|
|
771
|
-
|
|
772
|
-
Instructions for the agent…`,add_btn:"Create skill",created_ok:'Skill "{slug}" created.',create_failed:"Could not create: {msg}",delete_btn:"Delete",delete_confirm:`Delete skill "{slug}"? This can't be undone.`,deleted_ok:'Skill "{slug}" deleted.',delete_failed:"Could not delete: {msg}",inspector_section_title:"Skill Inspector (per-turn RAG)",inspector_section_desc:"Advanced: local RAG that injects only the skills a message needs.",scope_ph:"— choose scope —",select_a_skill:"Pick a skill from the list to see its content.",added_by:"Added by",activator:"Activator",by_apx:"APX (built-in)",by_you:"You",activator_value:"Semantic match (RAG)",tab_preview:"Preview",tab_source:"Source",add_menu:"Add",add_online:"Create with editor",add_online_hint:"Write slug + description + content",add_zip:"Upload .zip",add_zip_hint:"Import a packaged skill",add_repo:"From git repo",add_repo_hint:"Clone from a URL",create_dialog_title:"Create skill",repo_dialog_title:"Import from git repo",repo_url_label:"Repo URL",repo_url_ph:"https://github.com/user/my-skill.git",repo_url_hint:"The repo (or its subfolder) must contain a SKILL.md.",import_btn:"Import",imported_ok:'Skill "{slug}" imported.',import_failed:"Could not import: {msg}",cancel:"Cancel",manager_tab:"Skills",rag_tab:"Config (RAG)"},shared_ui:{skill_inspector_title:"Skill Inspector ({embedder}) chose these skills for this turn",tools_count:"{n} tools",tool_read_file:"Read file",tool_write_file:"Write file",tool_edit_file:"Edit file",tool_list_files:"List files",tool_search_files:"Search in files",tool_search_messages:"Search messages",tool_tail_messages:"Latest messages",tool_run_shell:"Run shell",tool_send_telegram:"Send Telegram",tool_call_agent:"Call agent",tool_call_mcp:"Call MCP",tool_call_runtime:"Call runtime",tool_create_task:"Create task",dedup:"dedup",args:"args",result:"result",auto:"Auto",auto_router:"Auto (router decides)",model_filter_ph:"filter or type a model…",loading_models:"loading models…",use_value:"use “{value}”",model_combobox_ph:"pick or type a model…",search_variable_ph:"search variable…",no_matches:"no matches",create_variable:"Create new variable…",kv_key_ph:"KEY",kv_value_ph:"value",remove_row:"remove row",add_row:"Add row",err_chat_failed:"Chat failed.",err_stream_failed:"Stream failed.",err_load_conversation:"Could not load conversation.",err_stream:"Stream error."},integrations:{title:"Integrations",description:"Plugins and tools available for this project",tab_plugins:"Plugins",tab_tools:"Tools",scope_label:"Scope:",scope_project:"This project",scope_global:"Global (default)",plugins_hint:"Channel & service plugins installable per project. Saved in the scope selected above.",more_soon:"More plugins coming soon…",tools_hint:"Tools that connected plugins expose to this project's agents.",tools_empty:"No integration tools yet. Connect a plugin to enable them.",tool_active:"active",tool_inactive:"inactive",status_active:"Active",status_error:"Error",status_unconfigured:"Not configured",connected:"Connected",connect:"Connect",deactivate:"Deactivate",saving:"Saving...",validating:"Validating...",verifying:"Verifying token...",confirm:"Confirm",select_placeholder:"Select...",reveal:"Show",hide:"Hide",credentials:"{name} credentials",coming_soon:"Coming soon",coming_soon_body:"This plugin is declared in the catalog but isn't connectable in APX yet. It will be ported natively in a future iteration.",tools_for_agents:"Agent tools",tools_available_note:"Available to agents that allow them, or via discover_tools.",err_connect:"Failed to connect",err_generic:"Something went wrong",action_done:"Done",asana:{select_label:"Select the workspace to use",connected:{user_name:"Connected as",user_email:"Email",workspace_name:"Workspace"},fields:{personal_access_token:{label:"Personal Access Token",help_label:"How to get the token?",help_steps:`Open app.asana.com/0/my-apps in your browser.
|
|
773
|
-
Scroll to the "Personal access tokens" section (not your OAuth apps).
|
|
774
|
-
Click "+ New access token".
|
|
775
|
-
Give it a name and confirm.
|
|
776
|
-
Copy the full token — it starts with "1/..." and has a ":" in the middle.
|
|
777
|
-
Paste it in the field below.`}}},github:{connected:{user_login:"Connected as",user_name:"Name"},fields:{token:{label:"Personal Access Token",help_label:"How to get the token?",help_steps:`Open github.com/settings/tokens.
|
|
778
|
-
Generate a token (classic or fine-grained) with the "repo" scope.
|
|
779
|
-
Copy the token — it starts with ghp_ or github_pat_.
|
|
780
|
-
Paste it in the field below.`}}},obsidian:{connected:{vault_path:"Vault",vault_name:"Name",note_count:"Notes"},fields:{vault_path:{label:"Vault path"},auto_mcp:{label:"Auto-register Obsidian MCP",hint:"Adds an 'obsidian' MCP server pointing at this vault, in this scope."},memory_sync:{label:"Sync APX memory",hint:"Enable mirroring APX memory into the vault, then use the button below."}},actions:{sync_memory:"Sync memory now",sync_memory_done:"Synced {count} file(s) · {changed} changed"}}}},w_={es:zD,en:DD};function PD(){try{const e=localStorage.getItem(zn.language);if(e&&e in w_)return e}catch{}return"en"}let Np=PD();function cN(e){Np=e;try{localStorage.setItem(zn.language,e)}catch{}}const uN=[{value:"es",label:"Español"},{value:"en",label:"English"}];function S_(){return Np}function LD(e){const t=w_[Np],a=e.split(".");let o=t;for(const l of a)if(o&&typeof o=="object"&&l in o)o=o[l];else return;return typeof o=="string"?o:void 0}function ID(e,t){return t?e.replace(/\{(\w+)\}/g,(a,o)=>o in t?String(t[o]):`{${o}}`):e}function BD(e){const t=LD(e);if(t!==void 0)return t;if(Np!=="es"){const a=w_.es,o=e.split(".");let l=a;for(const i of o)if(l&&typeof l=="object"&&i in l)l=l[i];else return;return typeof l=="string"?l:void 0}}function u(e,t){const a=BD(e);return a===void 0?e:ID(a,t)}function C_(e){const[t,a]=x.useState(!1);x.useEffect(()=>{try{a(localStorage.getItem(e)==="true")}catch{}},[e]);const o=x.useCallback(()=>a(l=>{const i=!l;try{localStorage.setItem(e,String(i))}catch{}return i}),[e]);return{collapsed:t,toggle:o}}function $D({collapsed:e,onToggle:t}){return n.jsx(qe,{content:u(e?"settings_ui.expand_menu":"settings_ui.collapse_menu"),side:"bottom",children:n.jsx("button",{type:"button",onClick:t,"aria-label":u(e?"settings_ui.expand_menu":"settings_ui.collapse_menu"),className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-fg transition-colors hover:bg-accent hover:text-foreground",children:n.jsx(sS,{className:ge("size-4 transition-transform",e&&"rotate-180")})})})}function UD({sections:e,active:t,onChange:a,collapsed:o=!1}){return n.jsx("nav",{className:ge("hidden md:flex shrink-0 flex-col gap-1 py-3 transition-all",o?"w-12 items-center px-1":"w-44 px-2"),children:e.map((l,i)=>n.jsxs("div",{className:ge("w-full",i>0&&"mt-2"),children:[!o&&l.title&&n.jsx("p",{className:"mb-1 px-2 text-[9px] font-semibold uppercase tracking-wider text-muted-fg/70",children:l.title}),n.jsx("div",{className:"space-y-0.5",children:l.items.map(({key:d,label:f,icon:m,badge:h,mark:g})=>{const b=t===d,_=n.jsxs("button",{type:"button",onClick:()=>a(d),"data-testid":`tabnav-${d||"index"}`,className:ge("relative flex cursor-pointer items-center rounded-lg transition-colors",o?"size-9 justify-center":"w-full gap-2 px-2.5 py-1.5",b?"bg-accent text-accent-fg":"text-muted-fg hover:bg-accent/60 hover:text-foreground"),children:[n.jsx(m,{className:"size-4 shrink-0"}),o&&g&&n.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center rounded-full bg-card",children:g}),!o&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"flex-1 truncate text-left text-xs",children:f}),g&&n.jsx("span",{className:"flex shrink-0 items-center",children:g}),h!==void 0&&n.jsx("span",{className:"rounded-full bg-muted px-1.5 text-[9px] text-muted-fg",children:h})]})]});return o?n.jsx(qe,{content:f,side:"right",children:_},d):n.jsx(x.Fragment,{children:_},d)})})]},i))})}const dN=0,fN=1,pN=2,gk=3;var hk=Object.prototype.hasOwnProperty;function Ox(e,t){var a,o;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((o=e.length)===t.length)for(;o--&&Ox(e[o],t[o]););return o===-1}if(!a||typeof e=="object"){o=0;for(a in e)if(hk.call(e,a)&&++o&&!hk.call(t,a)||!(a in t)||!Ox(e[a],t[a]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const Xa=new WeakMap,Wa=()=>{},Hn=Wa(),zx=Object,St=e=>e===Hn,ga=e=>typeof e=="function",Kr=(e,t)=>({...e,...t}),mN=e=>ga(e.then),bh={},Id={},N_="undefined",iu=typeof window!=N_,Dx=typeof document!=N_,HD=iu&&"Deno"in window,qD=()=>iu&&typeof window.requestAnimationFrame!=N_,gN=(e,t)=>{const a=Xa.get(e);return[()=>!St(t)&&e.get(t)||bh,o=>{if(!St(t)){const l=e.get(t);t in Id||(Id[t]=l),a[5](t,Kr(l,o),l||bh)}},a[6],()=>!St(t)&&t in Id?Id[t]:!St(t)&&e.get(t)||bh]};let Px=!0;const VD=()=>Px,[Lx,Ix]=iu&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Wa,Wa],FD=()=>{const e=Dx&&document.visibilityState;return St(e)||e!=="hidden"},GD=e=>(Dx&&document.addEventListener("visibilitychange",e),Lx("focus",e),()=>{Dx&&document.removeEventListener("visibilitychange",e),Ix("focus",e)}),YD=e=>{const t=()=>{Px=!0,e()},a=()=>{Px=!1};return Lx("online",t),Lx("offline",a),()=>{Ix("online",t),Ix("offline",a)}},KD={isOnline:VD,isVisible:FD},XD={initFocus:GD,initReconnect:YD},xk=!Jc.useId,Wl=!iu||HD,QD=e=>qD()?window.requestAnimationFrame(e):setTimeout(e,1),_h=Wl?x.useEffect:x.useLayoutEffect,vh=typeof navigator<"u"&&navigator.connection,bk=!Wl&&vh&&(["slow-2g","2g"].includes(vh.effectiveType)||vh.saveData),Bd=new WeakMap,WD=e=>zx.prototype.toString.call(e),yh=(e,t)=>e===`[object ${t}]`;let ZD=0;const Bx=e=>{const t=typeof e,a=WD(e),o=yh(a,"Date"),l=yh(a,"RegExp"),i=yh(a,"Object");let d,f;if(zx(e)===e&&!o&&!l){if(d=Bd.get(e),d)return d;if(d=++ZD+"~",Bd.set(e,d),Array.isArray(e)){for(d="@",f=0;f<e.length;f++)d+=Bx(e[f])+",";Bd.set(e,d)}if(i){d="#";const m=zx.keys(e).sort();for(;!St(f=m.pop());)St(e[f])||(d+=f+":"+Bx(e[f])+",");Bd.set(e,d)}}else d=o?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return d},E_=e=>{if(ga(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Bx(e):"",[e,t]};let JD=0;const $x=()=>++JD;async function hN(...e){const[t,a,o,l]=e,i=Kr({populateCache:!0,throwOnError:!0},typeof l=="boolean"?{revalidate:l}:l||{});let d=i.populateCache;const f=i.rollbackOnError;let m=i.optimisticData;const h=_=>typeof f=="function"?f(_):f!==!1,g=i.throwOnError;if(ga(a)){const _=a,k=[],N=t.keys();for(const y of N)!/^\$(inf|sub)\$/.test(y)&&_(t.get(y)._k)&&k.push(y);return Promise.all(k.map(b))}return b(a);async function b(_){const[k]=E_(_);if(!k)return;const[N,y]=gN(t,k),[w,E,j,S]=Xa.get(t),R=()=>{const H=w[k];return(ga(i.revalidate)?i.revalidate(N().data,_):i.revalidate!==!1)&&(delete j[k],delete S[k],H&&H[0])?H[0](pN).then(()=>N().data):N().data};if(e.length<3)return R();let A=o,T,O=!1;const M=$x();E[k]=[M,0];const B=!St(m),P=N(),$=P.data,D=P._c,L=St(D)?$:D;if(B&&(m=ga(m)?m(L,$):m,y({data:m,_c:L})),ga(A))try{A=A(L)}catch(H){T=H,O=!0}if(A&&mN(A))if(A=await A.catch(H=>{T=H,O=!0}),M!==E[k][0]){if(O)throw T;return A}else O&&B&&h(T)&&(d=!0,y({data:L,_c:Hn}));if(d&&!O)if(ga(d)){const H=d(A,L);y({data:H,error:Hn,_c:Hn})}else y({data:A,error:Hn,_c:Hn});if(E[k][1]=$x(),Promise.resolve(R()).then(()=>{y({_c:Hn})}),O){if(g)throw T;return}return A}}const _k=(e,t)=>{for(const a in e)e[a][0]&&e[a][0](t)},eP=(e,t)=>{if(!Xa.has(e)){const a=Kr(XD,t),o=Object.create(null),l=hN.bind(Hn,e);let i=Wa;const d=Object.create(null),f=(g,b)=>{const _=d[g]||[];return d[g]=_,_.push(b),()=>{const k=_.indexOf(b);k>=0&&(_[k]=_[_.length-1],_.pop())}},m=(g,b,_)=>{e.set(g,b);const k=d[g];if(k)for(const N of k)N(b,_)},h=()=>{if(!Xa.has(e)&&(Xa.set(e,[o,Object.create(null),Object.create(null),Object.create(null),l,m,f]),!Wl)){const g=a.initFocus(setTimeout.bind(Hn,_k.bind(Hn,o,dN))),b=a.initReconnect(setTimeout.bind(Hn,_k.bind(Hn,o,fN)));i=()=>{g&&g(),b&&b(),Xa.delete(e)}}};return h(),[e,l,h,i]}return[e,Xa.get(e)[4]]},tP=(e,t,a,o,l)=>{const i=a.errorRetryCount,d=l.retryCount,f=~~((Math.random()+.5)*(1<<(d<8?d:8)))*a.errorRetryInterval;!St(i)&&d>i||setTimeout(o,f,l)},nP=Ox,[xN,Tf]=eP(new Map),sP=Kr({onLoadingSlow:Wa,onSuccess:Wa,onError:Wa,onErrorRetry:tP,onDiscarded:Wa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:bk?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:bk?5e3:3e3,compare:nP,isPaused:()=>!1,cache:xN,mutate:Tf,fallback:{}},KD),aP=(e,t)=>{const a=Kr(e,t);if(t){const{use:o,fallback:l}=e,{use:i,fallback:d}=t;o&&i&&(a.use=o.concat(i)),l&&d&&(a.fallback=Kr(l,d))}return a},rP=x.createContext({}),oP="$inf$",bN=iu&&window.__SWR_DEVTOOLS_USE__,lP=bN?window.__SWR_DEVTOOLS_USE__:[],iP=()=>{bN&&(window.__SWR_DEVTOOLS_REACT__=Jc)},cP=e=>ga(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_N=()=>{const e=x.useContext(rP);return x.useMemo(()=>Kr(sP,e),[e])},uP=e=>(t,a,o)=>e(t,a&&((...i)=>{const[d]=E_(t),[,,,f]=Xa.get(xN);if(d.startsWith(oP))return a(...i);const m=f[d];return St(m)?a(...i):(delete f[d],m)}),o),dP=lP.concat(uP),fP=e=>function(...a){const o=_N(),[l,i,d]=cP(a),f=aP(o,d);let m=e;const{use:h}=f,g=(h||[]).concat(dP);for(let b=g.length;b--;)m=g[b](m);return m(l,i||f.fetcher||null,f)},pP=(e,t,a)=>{const o=t[e]||(t[e]=[]);return o.push(a),()=>{const l=o.indexOf(a);l>=0&&(o[l]=o[o.length-1],o.pop())}};iP();const jh=Jc.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),kh={dedupe:!0},Af=Promise.resolve(Hn);Af.status="fulfilled";Af.value=Hn;const mP=()=>Wa,gP=(e,t,a)=>{const{cache:o,compare:l,suspense:i,fallbackData:d,revalidateOnMount:f,revalidateIfStale:m,refreshInterval:h,refreshWhenHidden:g,refreshWhenOffline:b,keepPreviousData:_,strictServerPrefetchWarning:k}=a,[N,y,w,E]=Xa.get(o),[j,S]=E_(e),R=x.useRef(!1),A=x.useRef(!1),T=x.useRef(j),O=x.useRef(t),M=x.useRef(a),B=()=>M.current,P=()=>B().isVisible()&&B().isOnline(),[$,D,L,H]=gN(o,j),V=x.useRef({}).current,U=St(d)?St(a.fallback)?Hn:a.fallback[j]:d,F=(Ee,_e)=>{for(const xe in V){const Re=xe;if(Re==="data"){if(!l(Ee[Re],_e[Re])&&(!St(Ee[Re])||!l(te,_e[Re])))return!1}else if(_e[Re]!==Ee[Re])return!1}return!0},X=!R.current,G=x.useMemo(()=>{const Ee=$(),_e=H(),xe=Be=>{const me=Kr(Be);return delete me._k,(()=>{if(!j||!t||B().isPaused())return!1;if(X&&!St(f))return f;const Ge=St(U)?me.data:U;return St(Ge)||m})()?{isValidating:!0,isLoading:!0,...me}:me},Re=xe(Ee),Oe=Ee===_e?Re:xe(_e);let Pe=Re;return[()=>{const Be=xe($());return F(Be,Pe)?(Pe.data=Be.data,Pe.isLoading=Be.isLoading,Pe.isValidating=Be.isValidating,Pe.error=Be.error,Pe):(Pe=Be,Be)},()=>Oe]},[o,j]),Y=wf.useSyncExternalStore(x.useCallback(Ee=>L(j,(_e,xe)=>{F(xe,_e)||Ee()}),[o,j]),G[0],G[1]),I=N[j]&&N[j].length>0,Q=Y.data,J=St(Q)?U&&mN(U)?jh(U):U:Q,K=Y.error,se=x.useRef(J),te=_?St(Q)?St(se.current)?J:se.current:Q:J,le=j&&St(J),W=x.useRef(null);!Wl&&wf.useSyncExternalStore(mP,()=>(W.current=!1,W),()=>(W.current=!0,W));const ne=W.current;k&&ne&&!i&&le&&console.warn(`Missing pre-initiated data for serialized key "${j}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const ve=!j||!t||B().isPaused()||I&&!St(K)?!1:X&&!St(f)?f:i?St(J)?!1:m:St(J)||m,oe=X&&ve,fe=St(Y.isValidating)?oe:Y.isValidating,we=St(Y.isLoading)?oe:Y.isLoading,Ce=x.useCallback(async Ee=>{const _e=O.current;if(!j||!_e||A.current||B().isPaused())return!1;let xe,Re,Oe=!0;const Pe=Ee||{},Be=!w[j]||!Pe.dedupe,me=()=>xk?!A.current&&j===T.current&&R.current:j===T.current,Se={isValidating:!1,isLoading:!1},Ge=()=>{D(Se)},Ae=()=>{const tt=w[j];tt&&tt[1]===Re&&delete w[j]},ze={isValidating:!0};St($().data)&&(ze.isLoading=!0);try{if(Be&&(D(ze),a.loadingTimeout&&St($().data)&&setTimeout(()=>{Oe&&me()&&B().onLoadingSlow(j,a)},a.loadingTimeout),w[j]=[_e(S),$x()]),[xe,Re]=w[j],xe=await xe,Be&&setTimeout(Ae,a.dedupingInterval),!w[j]||w[j][1]!==Re)return Be&&me()&&B().onDiscarded(j),!1;Se.error=Hn;const tt=y[j];if(!St(tt)&&(Re<=tt[0]||Re<=tt[1]||tt[1]===0))return Ge(),Be&&me()&&B().onDiscarded(j),!1;const ot=$().data;Se.data=l(ot,xe)?ot:xe,Be&&me()&&B().onSuccess(xe,j,a)}catch(tt){Ae();const ot=B(),{shouldRetryOnError:vt}=ot;ot.isPaused()||(Se.error=tt,Be&&me()&&(ot.onError(tt,j,ot),(vt===!0||ga(vt)&&vt(tt))&&(!B().revalidateOnFocus||!B().revalidateOnReconnect||P())&&ot.onErrorRetry(tt,j,ot,Mt=>{const lt=N[j];lt&<[0]&<[0](gk,Mt)},{retryCount:(Pe.retryCount||0)+1,dedupe:!0})))}return Oe=!1,Ge(),!0},[j,o]),Le=x.useCallback((...Ee)=>hN(o,T.current,...Ee),[]);if(_h(()=>{O.current=t,M.current=a,St(Q)||(se.current=Q)}),_h(()=>{if(!j)return;const Ee=Ce.bind(Hn,kh);let _e=0;B().revalidateOnFocus&&(_e=Date.now()+B().focusThrottleInterval);const Re=pP(j,N,(Oe,Pe={})=>{if(Oe==dN){const Be=Date.now();B().revalidateOnFocus&&Be>_e&&P()&&(_e=Be+B().focusThrottleInterval,Ee())}else if(Oe==fN)B().revalidateOnReconnect&&P()&&Ee();else{if(Oe==pN)return Ce();if(Oe==gk)return Ce(Pe)}});return A.current=!1,T.current=j,R.current=!0,D({_k:S}),ve&&(w[j]||(St(J)||Wl?Ee():QD(Ee))),()=>{A.current=!0,Re()}},[j]),_h(()=>{let Ee;function _e(){const Re=ga(h)?h($().data):h;Re&&Ee!==-1&&(Ee=setTimeout(xe,Re))}function xe(){!$().error&&(g||B().isVisible())&&(b||B().isOnline())?Ce(kh).then(_e):_e()}return _e(),()=>{Ee&&(clearTimeout(Ee),Ee=-1)}},[h,g,b,j]),x.useDebugValue(te),i){if(!xk&&Wl&&le)throw new Error("Fallback data is required when using Suspense in SSR.");le&&(O.current=t,M.current=a,A.current=!1);const Ee=E[j],_e=!St(Ee)&&le?Le(Ee):Af;if(jh(_e),!St(K)&&le)throw K;const xe=le?Ce(kh):Af;!St(te)&&le&&(xe.status="fulfilled",xe.value=!0),jh(xe)}return{mutate:Le,get data(){return V.data=!0,te},get error(){return V.error=!0,K},get isValidating(){return V.isValidating=!0,fe},get isLoading(){return V.isLoading=!0,we}}},He=fP(gP);let li=null;function Ro(e){li=e}function R_(){return li}class cu extends Error{status;body;constructor(t,a,o){super(a),this.status=t,this.body=o}}async function xc(e,t,a,o={}){const l={"content-type":"application/json",...li?{authorization:`Bearer ${li}`}:{},...o.headers||{}},i=await fetch(t,{...o,method:e,headers:l,body:a!==void 0?JSON.stringify(a):void 0});if(!i.ok){let d="",f=null;try{f=await i.json(),d=f?.error||JSON.stringify(f)}catch{d=await i.text()}throw new cu(i.status,`${e} ${t} → ${i.status}: ${d}`,f)}if(i.status!==204)return await i.json()}function Hl(e){const t=e;if(Array.isArray(e))return{items:e,total:e.length};if(t&&Array.isArray(t.data)){const a=t.data;return{items:a,total:typeof t.meta?.total=="number"?t.meta.total:a.length}}if(t&&Array.isArray(t.sessions)){const a=t.sessions;return{items:a,total:a.length}}return{items:[],total:0}}const re={get:e=>xc("GET",e),post:(e,t)=>xc("POST",e,t),put:(e,t)=>xc("PUT",e,t),patch:(e,t)=>xc("PATCH",e,t),del:e=>xc("DELETE",e)};async function vN(e,t,a,o){const l=await fetch(e,{method:"POST",signal:o,headers:{"content-type":"application/json",...li?{authorization:`Bearer ${li}`}:{}},body:JSON.stringify(t)});if(!l.ok||!l.body){const m=await l.text().catch(()=>"");throw new cu(l.status,`POST ${e} → ${l.status}: ${m||"stream failed"}`)}const i=l.body.getReader(),d=new TextDecoder("utf-8");let f="";for(;;){const{value:m,done:h}=await i.read();if(h)break;f+=d.decode(m,{stream:!0});let g=f.indexOf(`
|
|
781
|
-
`);for(;g>=0;){const b=f.slice(0,g).trim();if(f=f.slice(g+1),b)try{a(JSON.parse(b))}catch{}g=f.indexOf(`
|
|
782
|
-
`)}}if(f.trim())try{a(JSON.parse(f.trim()))}catch{}}const hP={get:()=>re.get("/health")},Zn={list:()=>re.get("/projects"),register:e=>re.post("/projects",{path:e}),remove:e=>re.del(`/projects/${encodeURIComponent(e)}`),rebuild:e=>re.post(`/projects/${encodeURIComponent(e)}/rebuild`),config:{show:e=>re.get(`/projects/${e}/config`),set:(e,t)=>re.patch(`/projects/${e}/config`,{set:t}),unset:(e,t)=>re.patch(`/projects/${e}/config`,{unset:t}),put:(e,t)=>re.put(`/projects/${e}/config`,t)},apcProject:{set:(e,t,a)=>re.patch(`/projects/${e}/apc-project`,{set:t,unset:a}),put:(e,t)=>re.put(`/projects/${e}/apc-project`,t)},memory:{get:e=>re.get(`/projects/${e}/memory`),put:(e,t)=>re.put(`/projects/${e}/memory`,{body:t})}},an={list:(e,t)=>re.get(`/projects/${e}/agents${t?.stats?"?stats=1":""}`),get:(e,t)=>re.get(`/projects/${e}/agents/${t}`),create:(e,t)=>re.post(`/projects/${e}/agents`,t),update:(e,t,a)=>re.patch(`/projects/${e}/agents/${encodeURIComponent(t)}`,a),remove:(e,t)=>re.del(`/projects/${e}/agents/${encodeURIComponent(t)}`),chat:(e,t,a)=>re.post(`/projects/${e}/agents/${encodeURIComponent(t)}/chat`,a),memory:{get:(e,t)=>re.get(`/projects/${e}/agents/${t}/memory`),put:(e,t,a)=>re.put(`/projects/${e}/agents/${t}/memory`,{body:a})},vault:e=>re.get(e?.includeRemoved?"/agents/vault?include_removed=1":"/agents/vault"),vaultCreate:(e,t={},a="")=>re.post("/agents/vault",{slug:e,fields:t,body:a}),vaultPatch:(e,t)=>re.patch(`/agents/vault/${encodeURIComponent(e)}`,t),vaultRemove:e=>re.del(`/agents/vault/${encodeURIComponent(e)}`),vaultRestore:e=>re.post(`/agents/vault/${encodeURIComponent(e)}/restore`),import:(e,t)=>re.post(`/projects/${e}/agents/import`,{slug:t})},Xr={list:(e,t)=>re.get(`/projects/${e}/agents/${t}/conversations`),get:(e,t,a)=>re.get(`/projects/${e}/agents/${t}/conversations/${a}`),threads:e=>re.get(`/projects/${e}/super-agent/threads`),thread:(e,t,a)=>re.get(`/projects/${e}/super-agent/threads/${t}/${a}`),remove:(e,t,a)=>re.del(`/projects/${e}/agents/${t}/conversations/${a}`),removeThread:(e,t,a)=>re.del(`/projects/${e}/super-agent/threads/${t}/${a}`),compact:(e,t,a)=>re.post(a?`/projects/${e}/agents/${t}/conversations/${a}/compact`:`/projects/${e}/agents/${t}/compact`,{})},Br={list:e=>re.get(`/projects/${e}/routines`),get:(e,t)=>re.get(`/projects/${e}/routines/${t}`),run:(e,t)=>re.post(`/projects/${e}/routines/${t}/run`),enable:(e,t)=>re.post(`/projects/${e}/routines/${t}/enable`),disable:(e,t)=>re.post(`/projects/${e}/routines/${t}/disable`),upsert:(e,t)=>re.post(`/projects/${e}/routines`,t),remove:(e,t)=>re.del(`/projects/${e}/routines/${encodeURIComponent(t)}`)},Xn={list:(e,t="open")=>re.get(`/projects/${e}/tasks?state=${t}`).then(a=>Hl(a).items),global:(e="open")=>re.get(`/tasks?state=${e}`).then(t=>Hl(t).items),listPage:(e,{state:t,limit:a,offset:o})=>re.get(`/projects/${e}/tasks?state=${t}&limit=${a}&offset=${o}`).then(l=>Hl(l)),globalPage:({state:e,limit:t,offset:a})=>re.get(`/tasks?state=${e}&limit=${t}&offset=${a}`).then(o=>Hl(o)),get:(e,t)=>re.get(`/projects/${e}/tasks/${t}`),add:(e,t)=>re.post(`/projects/${e}/tasks`,t),patch:(e,t,a)=>re.patch(`/projects/${e}/tasks/${t}`,{patch:a}),status:(e,t,a)=>re.post(`/projects/${e}/tasks/${t}/status`,{status:a}),done:(e,t)=>re.post(`/projects/${e}/tasks/${t}/done`),drop:(e,t)=>re.post(`/projects/${e}/tasks/${t}/drop`),reopen:(e,t)=>re.post(`/projects/${e}/tasks/${t}/reopen`),summary:e=>re.get(`/projects/${e}/tasks-summary`)},$r={list:e=>re.get(`/projects/${e}/mcps`),check:e=>re.get(`/projects/${e}/mcps/check`),add:(e,t,a)=>re.post(`/projects/${e}/mcps?scope=${t}`,a),remove:(e,t,a="shared")=>re.del(`/projects/${e}/mcps/${encodeURIComponent(t)}?scope=${a}`),test:(e,t)=>re.post(`/projects/${e}/mcps/${encodeURIComponent(t)}/test`,{}),logs:(e,t)=>re.get(`/projects/${e}/mcps/${encodeURIComponent(t)}/logs`)},jo=e=>`?scope=${e}`,Gn={catalog:e=>re.get(`/projects/${e}/integrations/catalog`),list:(e,t="project")=>re.get(`/projects/${e}/integrations${jo(t)}`),status:(e,t,a="project")=>re.get(`/projects/${e}/integrations/${t}${jo(a)}`),configure:(e,t,a,o)=>re.post(`/projects/${e}/integrations/${t}/configure${jo(a)}`,o),validate:(e,t,a="project")=>re.post(`/projects/${e}/integrations/${t}/validate${jo(a)}`,{}),deactivate:(e,t,a="project")=>re.post(`/projects/${e}/integrations/${t}/deactivate${jo(a)}`,{}),action:(e,t,a,o="project")=>re.post(`/projects/${e}/integrations/${t}/action/${a}${jo(o)}`,{}),remove:(e,t,a="project")=>re.del(`/projects/${e}/integrations/${t}${jo(a)}`),asanaConfigure:(e,t,a)=>Gn.configure(e,"asana",t,{personal_access_token:a.personalAccessToken,workspace_gid:a.workspaceGid}),asanaValidate:(e,t)=>Gn.validate(e,"asana",t),asanaWorkspaces:(e,t)=>Gn.action(e,"asana","workspaces",t)},Yc={list:(e,t={})=>re.get(`/projects/${e}/vars${t.reveal?"?reveal=1":""}`),get:(e,t,a={})=>re.get(`/projects/${e}/vars/${encodeURIComponent(t)}${a.reveal?"?reveal=1":""}`),upsert:(e,t)=>re.post(`/projects/${e}/vars`,t),remove:(e,t,a="project")=>re.del(`/projects/${e}/vars/${encodeURIComponent(t)}?scope=${a}`)},wh=e=>{const t=new URLSearchParams;for(const[o,l]of Object.entries(e))l!==void 0&&l!==""&&t.set(o,String(l));const a=t.toString();return a?`?${a}`:""},Mf={global:(e={})=>re.get(`/messages/global${wh(e)}`),project:(e,t={})=>re.get(`/projects/${e}/messages${wh(t)}`),search:(e,t,a=50)=>re.get(`/projects/${e}/messages/search${wh({q:t,limit:a})}`)},xP={global:e=>re.get(`/sessions${e?`?engine=${encodeURIComponent(e)}`:""}`).then(t=>({sessions:Hl(t).items})),page:({engine:e,q:t,deep:a,cwd:o,limit:l,offset:i})=>{const d=new URLSearchParams({limit:String(l),offset:String(i)});return e&&d.set("engine",e),t?.trim()&&d.set("q",t.trim()),a&&d.set("deep","1"),o?.trim()&&d.set("cwd",o.trim()),re.get(`/sessions?${d.toString()}`).then(f=>Hl(f))}},bP={list:()=>re.get("/tools")},Dn={channels:{list:()=>re.get("/telegram/channels"),upsert:e=>re.post("/telegram/channels",e),patch:(e,t)=>re.patch(`/telegram/channels/${e}`,t),remove:e=>re.del(`/telegram/channels/${encodeURIComponent(e)}`)},contacts:{list:()=>re.get("/telegram/contacts"),patch:(e,t)=>re.patch(`/telegram/contacts/${encodeURIComponent(String(e))}`,t),remove:e=>re.del(`/telegram/contacts/${encodeURIComponent(String(e))}`)},roles:{list:()=>re.get("/telegram/roles"),set:(e,t)=>re.put(`/telegram/roles/${encodeURIComponent(e)}`,{tools:t}),remove:e=>re.del(`/telegram/roles/${encodeURIComponent(e)}`)},status:()=>re.get("/telegram/status"),start:()=>re.post("/telegram/start"),stop:()=>re.post("/telegram/stop"),send:e=>re.post("/telegram/send",e)},Kc={list:()=>re.get("/engines"),presets:()=>re.get("/engines/presets"),models:e=>re.post("/engines/models",e)},_P=Object.freeze(Object.defineProperty({__proto__:null,Engines:Kc},Symbol.toStringTag,{value:"Module"})),ii={reload:()=>re.post("/admin/reload"),shutdown:()=>re.post("/admin/shutdown"),config:{get:()=>re.get("/admin/config"),patch:e=>re.patch("/admin/config",e)},superAgent:()=>re.get("/admin/super-agent"),logs:(e="errors",t=200)=>re.get(`/admin/logs?file=${e}&limit=${t}`)},ci={list:()=>re.get("/pair/list"),revoke:e=>re.del(`/pair/revoke/${encodeURIComponent(e)}`),init:()=>re.post("/pair/init",{}),status:e=>re.get(`/pair/status/${encodeURIComponent(e)}`),confirm:e=>re.post("/pair/confirm",e)},vk={get:()=>re.get("/identity"),patch:e=>re.patch("/identity",e)},yN={send:(e,t)=>re.post(`/projects/${e}/super-agent/chat`,t),stream:(e,t,a,o)=>vN(`/projects/${e}/super-agent/chat/stream`,t,a,o),summarize:e=>re.post("/super-agent/summarize",e)},Of={dirs:e=>re.get(`/admin/fs/dirs?path=${encodeURIComponent(e)}`),pickDir:e=>re.get(`/admin/fs/pick-dir${e?`?prompt=${encodeURIComponent(e)}`:""}`)},vP=["alloy","echo","fable","onyx","nova","shimmer"],yP=["Kore","Puck","Charon","Fenrir","Aoede"],jP=["eleven_multilingual_v2","eleven_turbo_v2_5","eleven_flash_v2_5"],kP=["tts-1","tts-1-hd"],wP=["happy","sad","excited","angry","calm","whisper","shout","laugh","cry","narrator","neutral"],SP=["tiny","base","small","medium","large-v2","large-v3","large-v3-turbo"],zf={piper:{name:"Piper",note:"Local, offline (CLI + .onnx model). No API key.",local:!0},elevenlabs:{name:"ElevenLabs",note:"Cloud, multilingual. Requires an API key."},openai:{name:"OpenAI",note:"Cloud (tts-1 / tts-1-hd) or any OpenAI-compatible endpoint (set a base URL for a local server, e.g. QVox)."},gemini:{name:"Gemini",note:"Cloud (preview). Uses your Gemini key."},mock:{name:"Mock",note:"Silent test engine. Always available as a fallback.",local:!0}};async function CP(e){const t=R_(),a=await fetch(`/voice/tts?path=${encodeURIComponent(e)}`,{headers:t?{authorization:`Bearer ${t}`}:{}});if(!a.ok){const l=await a.text().catch(()=>"");throw new Error(`No se pudo leer el audio (${a.status}): ${l.slice(0,160)}`)}const o=await a.blob();return URL.createObjectURL(o)}const Df={providers:()=>re.get("/tts/providers"),sttHardware:()=>re.get("/transcribe/hardware"),sttModels:e=>re.get(`/transcribe/models?backend=${e}`),say:e=>re.post("/tts/say",e),turn:e=>re.post("/voice/turn",e)},jN={manifest:()=>re.get("/deck/manifest"),setWidget:(e,t)=>re.patch(`/deck/widgets/${encodeURIComponent(e)}`,t),exec:e=>re.post("/deck/exec",e)},ko=e=>`/projects/${e}/code/sessions`,Ga={sessions:{list:e=>re.get(ko(e)).then(t=>t.sessions),get:(e,t)=>re.get(`${ko(e)}/${t}`),create:(e,t={})=>re.post(ko(e),t),update:(e,t,a)=>re.patch(`${ko(e)}/${t}`,a),remove:(e,t)=>re.del(`${ko(e)}/${t}`)},changes:(e,t)=>re.get(`${ko(e)}/${t}/changes`),stream:(e,t,a,o,l)=>vN(`${ko(e)}/${t}/chat/stream`,a,o,l)},Ws={list:e=>re.get(`/projects/${encodeURIComponent(e)}/artifacts`),read:(e,t)=>re.get(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`),run:(e,t,a=[])=>re.post(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}/run`,{args:a}),remove:(e,t)=>re.del(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`),write:(e,t,a)=>re.patch(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{content:a}),rename:(e,t,a)=>re.patch(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{newName:a}),preview:(e,t,a=!0)=>re.post(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}/preview`,{watch:a}),previews:e=>re.get(`/projects/${encodeURIComponent(e)}/previews`),stopPreview:e=>re.del(`/previews/${encodeURIComponent(e)}`),openTunnel:(e,t)=>re.post(`/previews/${encodeURIComponent(e)}/tunnel`,{provider:t}),closeTunnel:e=>re.del(`/previews/${encodeURIComponent(e)}/tunnel`)},Us={list:e=>{const t=new URLSearchParams;e&&(t.set("project_path",e),t.set("scope",e));const a=t.toString();return re.get(a?`/skills?${a}`:"/skills")},detail:(e,t)=>{const a=t?`?project_path=${encodeURIComponent(t)}`:"";return re.get(`/skills/${encodeURIComponent(e)}/detail${a}`)},setEnabled:e=>re.put("/skills/enabled",e),create:e=>re.post("/skills",e),importZip:e=>re.post("/skills/import/zip",e),importRepo:e=>re.post("/skills/import/repo",e),remove:(e,t)=>{const a=t?`?project_path=${encodeURIComponent(t)}`:"";return re.del(`/skills/${encodeURIComponent(e)}${a}`)},inspector:()=>re.get("/skills/inspector"),updateInspector:e=>re.put("/skills/inspector",e),index:(e={})=>re.post("/skills/index",e),inspect:(e,t)=>re.post("/skills/inspect",{prompt:e,project_path:t})},qr={get:e=>re.get(`/projects/${e}/organization`),createArea:(e,t)=>re.post(`/projects/${e}/organization/areas`,t),updateArea:(e,t,a)=>re.patch(`/projects/${e}/organization/areas/${encodeURIComponent(t)}`,a),removeArea:(e,t)=>re.del(`/projects/${e}/organization/areas/${encodeURIComponent(t)}`),createRole:(e,t)=>re.post(`/projects/${e}/organization/roles`,t),updateRole:(e,t,a)=>re.patch(`/projects/${e}/organization/roles/${encodeURIComponent(t)}`,a),removeRole:(e,t)=>re.del(`/projects/${e}/organization/roles/${encodeURIComponent(t)}`)},Cc={tree:(e,t="project")=>re.get(`/projects/${e}/fs/tree?scope=${t}`),read:(e,t,a="project")=>re.get(`/projects/${e}/fs/file?scope=${a}&path=${encodeURIComponent(t)}`),write:(e,t,a,o="project")=>re.put(`/projects/${e}/fs/file`,{scope:o,path:t,content:a}),mkdir:(e,t,a="project")=>re.post(`/projects/${e}/fs/dir`,{scope:a,path:t}),remove:(e,t,a="project")=>re.del(`/projects/${e}/fs/entry?scope=${a}&path=${encodeURIComponent(t)}`)};function uu(){const{data:e,error:t,isLoading:a,mutate:o}=He("/projects",()=>Zn.list(),{refreshInterval:tp.projects});return{projects:(e||[]).slice().sort((i,d)=>{const f=Number(i.id),m=Number(d.id);return f===0&&m!==0?-1:m===0&&f!==0?1:f-m}),error:t,isLoading:a,mutate:o}}function du(e){const{projects:t,isLoading:a,mutate:o}=uu();return{project:t.find(i=>String(i.id)===e)??null,isLoading:a,mutate:o}}function T_(){const{data:e,error:t,isLoading:a,mutate:o}=He("/identity",()=>vk.get());return{identity:e||{},error:t,isLoading:a,mutate:o,save:async i=>{const d=await vk.patch(i);return await o(d,{revalidate:!1}),d}}}function Ep(){const{identity:e}=T_();return e?.agent_name?.trim()||"APX"}function NP(){return[{id:"desktop",label:u("nav.modules.desktop"),href:"/m/desktop",icon:yb},{id:"code",label:u("nav.modules.code"),href:"/m/code",icon:_a}]}function EP(e,t,a){const[o,l]=x.useState(t);return x.useLayoutEffect(()=>{const i=e.current;if(!i||!a)return;const d=()=>{const m=getComputedStyle(i),h=(parseFloat(m.paddingTop)||0)+(parseFloat(m.paddingBottom)||0),g=i.clientHeight-h;if(g<=0)return;const b=parseFloat(m.rowGap)||12,k=(i.querySelector("[data-rail-probe]")?.offsetHeight??56)+b,y=Math.max(0,Math.floor((g+b)/k))-1;l(y>=t?t:Math.max(0,y-1))};d();const f=new ResizeObserver(d);return f.observe(i),()=>f.disconnect()},[e,t,a]),a?Math.min(o,t):t}function yk({projects:e,label:t,sublabel:a,icon:o,tooltip:l,header:i,active:d,testId:f,onSelect:m,isActive:h}){return n.jsxs(y_,{children:[n.jsxs(j_,{"data-testid":f,title:l,"aria-label":l,className:"group flex w-full cursor-pointer flex-col items-center gap-1",children:[n.jsx("span",{className:ge("flex size-10 items-center justify-center rounded-xl text-xs font-bold transition-all","bg-muted/40 text-muted-fg hover:bg-accent hover:text-foreground",d&&"ring-2 ring-foreground ring-offset-2 ring-offset-card"),children:o??t}),a&&n.jsx("span",{className:"block max-w-[3.6rem] truncate text-[9px] leading-tight text-muted-fg group-hover:text-foreground",children:a})]}),n.jsxs(k_,{side:"right",align:"start",sideOffset:8,className:"max-h-[70vh] w-64",children:[n.jsx("div",{className:"px-1.5 py-1 text-xs font-medium text-muted-foreground",children:i}),e.map(g=>{const b=g.name||g.path.split("/").pop()||String(g.id),_=`/p/${g.id}`,{initials:k,idleClass:N}=D6(b);return n.jsxs(lf,{"data-testid":`project-menu-item-${g.id}`,onClick:()=>m(_),className:ge(h(_)&&"bg-accent/60 text-foreground"),children:[n.jsx("span",{className:ge("flex size-6 shrink-0 items-center justify-center rounded-md text-[10px] font-bold",N),children:k}),n.jsx("span",{className:"truncate",children:b})]},g.id)})]})]})}function RP({onSelect:e,onOpenRoby:t,onOpenAddProject:a}){const{projects:o,isLoading:l}=uu(),i=ss(),d=NP(),f=Ep(),m=x.useRef(null),{collapsed:h,toggle:g}=C_(zn.sidebarCollapsed+".projects"),b=j=>i.pathname===j||i.pathname.startsWith(`${j}/`),_=o.find(j=>String(j.id)==="0"),k=o.filter(j=>String(j.id)!=="0").sort((j,S)=>Number(S.id)-Number(j.id)),N=EP(m,k.length,!h&&k.length>0),y=k.slice(0,N),w=k.slice(N),E=w.some(j=>b(`/p/${j.id}`));return n.jsxs("aside",{className:"flex h-full w-20 flex-col items-center gap-3 overflow-hidden bg-transparent py-3",children:[n.jsx(qe,{content:u("nav.apx_admin"),side:"right",children:n.jsx("button",{type:"button",onClick:()=>e("/"),"data-testid":"nav-home",className:"mb-2 cursor-pointer",children:n.jsx(PM,{size:36})})}),l&&n.jsx("div",{className:"size-10 animate-pulse rounded-xl bg-muted"}),_&&n.jsx(Pl,{label:u("base.title"),testId:"project-avatar-0",title:u("base.subtitle"),active:b("/p/0"),isDefault:!0,icon:n.jsx("img",{src:"/modules/superagent.png",alt:u("base.title"),className:"size-7 object-contain",draggable:!1}),onClick:()=>e("/p/0")}),d.map(j=>n.jsx(Pl,{label:j.label,testId:`module-avatar-${j.id}`,title:j.label,active:b(j.href),icon:n.jsx(j.icon,{size:18}),onClick:()=>e(j.href)},j.id)),n.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center gap-3",children:[k.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"my-0.5 h-px w-8 rounded-full bg-border"}),n.jsx(qe,{content:u(h?"nav.expand_projects":"nav.collapse_projects"),side:"right",children:n.jsx("button",{type:"button",onClick:g,"data-testid":"nav-toggle-projects","aria-label":u(h?"nav.expand_projects":"nav.collapse_projects"),"aria-expanded":!h,className:"flex h-5 w-8 cursor-pointer items-center justify-center rounded-md text-muted-fg transition-colors hover:bg-accent hover:text-foreground",children:n.jsx(ms,{className:ge("size-3.5 transition-transform",h&&"-rotate-90")})})})]}),n.jsxs("div",{ref:m,className:"flex min-h-0 w-full flex-1 flex-col items-center gap-3 overflow-hidden py-1.5",children:[k.length>0&&h&&n.jsx(yk,{projects:k,icon:n.jsx(ZA,{size:18}),sublabel:String(k.length),tooltip:u("nav.all_projects"),header:u("nav.all_projects"),active:k.some(j=>b(`/p/${j.id}`)),testId:"nav-projects-folder",onSelect:e,isActive:b}),k.length>0&&!h&&n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-rail-probe":!0,"aria-hidden":!0,className:"invisible absolute w-full",children:n.jsx(Pl,{label:"Ag",active:!1,onClick:()=>{}})}),y.map(j=>{const S=j.name||j.path.split("/").pop()||String(j.id),R=`/p/${j.id}`;return n.jsx("div",{"data-rail-item":!0,className:"w-full",children:n.jsx(Pl,{label:S,testId:`project-avatar-${j.id}`,title:`${S} — ${j.path}`,active:b(R),onClick:()=>e(R)})},j.id)}),w.length>0&&n.jsx(yk,{projects:w,label:`+${w.length}`,tooltip:u("nav.more_projects",{count:w.length}),header:u("nav.more_projects",{count:w.length}),active:E,testId:"nav-projects-overflow",onSelect:e,isActive:b})]}),n.jsx(Pl,{label:u("nav.add_project"),isAdd:!0,testId:"nav-add-project",icon:n.jsx(Pt,{size:18}),active:!1,onClick:()=>a?a():e("/?action=add-project"),title:u("nav.add_project")})]})]}),n.jsx(Pl,{label:u("nav.settings"),isSettings:!0,testId:"nav-settings",icon:n.jsx(ep,{size:16}),active:i.pathname==="/settings"||i.pathname.startsWith("/settings/"),onClick:()=>e("/settings"),title:u("nav.settings")}),n.jsx(qe,{content:u("settings_ui.documentation"),side:"right",children:n.jsx("a",{href:"https://agentprojectcontext.github.io/apx/docs/",target:"_blank",rel:"noopener noreferrer","data-testid":"nav-docs","aria-label":u("settings_ui.documentation"),className:"flex size-10 items-center justify-center rounded-xl border border-border/60 bg-muted/30 text-muted-fg transition-colors hover:bg-accent hover:text-foreground",children:n.jsx(EA,{size:18})})}),n.jsx(qe,{content:u("superagent.talk",{persona:f}),side:"right",children:n.jsx("button",{type:"button",onClick:t,"data-testid":"nav-roby","aria-label":u("superagent.talk",{persona:f}),className:"flex size-10 items-center justify-center rounded-xl border border-border/60 bg-muted/30 text-muted-fg transition-colors hover:bg-accent hover:text-foreground",children:n.jsx(rn,{size:18})})})]})}function kN(e){switch(e){case"personal":return u("settings_ui.kind_personal");case"company":return u("settings_ui.kind_company");case"app":return u("settings_ui.kind_app");case"software":return u("settings_ui.kind_software");case"default":return u("settings_ui.kind_default");case"other":return u("settings_ui.kind_other");default:return u("nav.project")}}function Ye({title:e,description:t,action:a,className:o,children:l,fullHeight:i}){return n.jsxs("section",{className:ge("rounded-xl border border-border bg-card p-5",i&&"flex h-full min-h-0 flex-col",o),children:[n.jsxs("header",{className:ge("mb-4 flex items-start justify-between gap-4",i&&"shrink-0"),children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e}),t&&n.jsx("p",{className:"mt-0.5 text-sm text-muted-fg",children:t})]}),a]}),n.jsx("div",{className:ge(i&&"flex min-h-0 flex-1 flex-col"),children:l})]})}function jk({children:e}){return n.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-muted-fg",children:e})}function fu({ok:e}){return n.jsx("span",{className:ge("inline-block size-2 rounded-full",e===null?"bg-muted-fg":e?"bg-emerald-500":"bg-red-500")})}const TP=x.forwardRef(function(t,a){const{render:o,className:l,disabled:i=!1,focusableWhenDisabled:d=!1,nativeButton:f=!0,style:m,...h}=t,{getButtonProps:g,buttonRef:b}=no({disabled:i,focusableWhenDisabled:d,native:f});return Et("button",t,{state:{disabled:i},ref:[a,b],props:[h,g]})}),kk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wk=Hc,A_=(e,t)=>a=>{var o;if(t?.variants==null)return wk(e,a?.class,a?.className);const{variants:l,defaultVariants:i}=t,d=Object.keys(l).map(h=>{const g=a?.[h],b=i?.[h];if(g===null)return null;const _=kk(g)||kk(b);return l[h][_]}),f=a&&Object.entries(a).reduce((h,g)=>{let[b,_]=g;return _===void 0||(h[b]=_),h},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:b,className:_,...k}=g;return Object.entries(k).every(N=>{let[y,w]=N;return Array.isArray(w)?w.includes({...i,...f}[y]):{...i,...f}[y]===w})?[...h,b,_]:h},[]);return wk(e,d,m,a?.class,a?.className)},AP=A_("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function lr({className:e,variant:t="default",size:a="default",...o}){return n.jsx(TP,{"data-slot":"button",className:Ct(AP({variant:t,size:a,className:e})),...o})}let Sk=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const MP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Nc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},OP={disabled:!1,...Nc},M_={valid(e){return e===null?null:e?{[Sk.valid]:""}:{[Sk.invalid]:""}}},zP={invalid:void 0,name:void 0,validityData:{state:MP,errors:[],error:"",value:"",initialValue:null},setValidityData:Mn,disabled:void 0,touched:Nc.touched,setTouched:Mn,dirty:Nc.dirty,setDirty:Mn,filled:Nc.filled,setFilled:Mn,focused:Nc.focused,setFocused:Mn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:OP,markedDirtyRef:{current:!1},registerFieldControl:Mn,validation:{getValidationProps:(e,t=Xt)=>t,inputRef:{current:null},registerInput:Mn,commit:async()=>{},change:Mn}},DP=x.createContext(zP);function pu(e=!0){const t=x.useContext(DP);if(t.setValidityData===Mn&&!e)throw new Error(cn(28));return t}const PP=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Mn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function O_(){return x.useContext(PP)}const LP=x.createContext({controlId:void 0,registerControlId:Mn,labelId:void 0,setLabelId:Mn,messageIds:[],setMessageIds:Mn,getDescriptionProps:e=>e});function Rp(){return x.useContext(LP)}function IP(e,t,a,o=!0,l){const[i,d]=x.useState(),f=ra(l?`${l}-label`:void 0),m=e??t??i;return De(()=>{const h=e||t||!o?void 0:BP(a.current,f);i!==h&&d(h)}),m}function BP(e,t){const a=$P(e);if(a)return!a.id&&t&&(a.id=t),a.id||void 0}function $P(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const a=e.id;if(a){const l=e.nextElementSibling;if(l&&l.htmlFor===a)return l}const o=e.labels;return o&&o[0]}function Tp(e={}){const{id:t,implicit:a=!1,controlRef:o}=e,{controlId:l,registerControlId:i}=Rp(),d=ra(t),f=a?l:void 0,m=ns(()=>Symbol("labelable-control")),h=x.useRef(!1),g=x.useRef(t!=null),b=Ue(()=>{!h.current||i===Mn||(h.current=!1,i(m.current,void 0))});return De(()=>{if(i===Mn)return;let _;if(a){const k=o?.current;_t(k)&&k.closest("label")!=null?_=t??null:_=f??d}else if(t!=null)g.current=!0,_=t;else if(g.current)_=d;else{b();return}if(_===void 0){b();return}h.current=!0,i(m.current,_)},[t,o,f,i,a,d,m,b]),x.useEffect(()=>b,[b]),l??d}function z_(e,t,a,o,l=!0,i){const{registerFieldControl:d}=pu(),f=x.useRef(null);f.current||(f.current=Symbol()),De(()=>{const m=f.current;return!m||!l?void 0:(d(m,{controlRef:e,getValue:o,id:t,name:i,value:a}),()=>{d(m,void 0)})},[e,l,o,t,i,d,a])}const UP=x.forwardRef(function(t,a){const{render:o,className:l,id:i,name:d,value:f,disabled:m=!1,onValueChange:h,defaultValue:g,autoFocus:b=!1,style:_,...k}=t,{state:N,name:y,disabled:w,setTouched:E,setDirty:j,validityData:S,setFocused:R,setFilled:A,validationMode:T,validation:O}=pu(),{clearErrors:M}=O_(),B=w||m,P=y??d,$={...N,disabled:B},{labelId:D}=Rp(),L=Tp({id:i});De(()=>{const Y=f!=null;O.inputRef.current?.value||Y&&f!==""?A(!0):Y&&f===""&&A(!1)},[O.inputRef,A,f]);const H=x.useRef(null);De(()=>{b&&H.current===Yn(xt(H.current))&&R(!0)},[b,R]);const[V]=oi({controlled:f,default:g,name:"FieldControl",state:"value"}),U=f!==void 0,F=U?V:void 0,X=Ue(()=>O.inputRef.current?.value);return z_(O.inputRef,L,F,X,!B,d),Et("input",t,{ref:[a,H],state:$,props:[{id:L,disabled:B,name:P,ref:O.inputRef,"aria-labelledby":D,autoFocus:b,...U?{value:F}:{defaultValue:g},onChange(Y){const I=Y.currentTarget.value;h?.(I,st(va,Y.nativeEvent)),j(I!==S.initialValue),A(I!==""),Y.nativeEvent.defaultPrevented||(M(P),O.change(I))},onFocus(){R(!0)},onBlur(Y){E(!0),R(!1),T==="onBlur"&&O.commit(Y.currentTarget.value)},onKeyDown(Y){Y.currentTarget.tagName==="INPUT"&&Y.key==="Enter"&&(E(!0),O.commit(Y.currentTarget.value))}},k,Y=>O.getValidationProps(B,Y)],stateAttributesMapping:M_})}),HP=x.forwardRef(function(t,a){return n.jsx(UP,{ref:a,...t})});function qP({className:e,type:t,...a}){return n.jsx(HP,{type:t,"data-slot":"input",className:Ct("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...a})}function VP({className:e,...t}){return n.jsx("textarea",{"data-slot":"textarea",className:Ct("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}function FP(e){return Et(e.defaultTagName??"div",e,e)}const GP=A_("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function YP({className:e,variant:t="default",render:a,...o}){return FP({defaultTagName:"span",props:Qn({className:Ct(GP({variant:t}),e)},o),render:a,state:{slot:"badge",variant:t}})}const wN=x.createContext(void 0);function KP(){const e=x.useContext(wN);if(e===void 0)throw new Error(cn(63));return e}let Ck=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const SN={...M_,checked(e){return e?{[Ck.checked]:""}:{[Ck.unchecked]:""}}},XP=x.forwardRef(function(t,a){const{checked:o,className:l,defaultChecked:i,"aria-labelledby":d,form:f,id:m,inputRef:h,name:g,nativeButton:b=!1,onCheckedChange:_,readOnly:k=!1,required:N=!1,disabled:y=!1,render:w,uncheckedValue:E,value:j,style:S,...R}=t,{clearErrors:A}=O_(),{state:T,setTouched:O,setDirty:M,validityData:B,setFilled:P,setFocused:$,validationMode:D,disabled:L,name:H,validation:V}=pu(),{labelId:U}=Rp(),F=L||y,X=H??g,G=x.useRef(null),Y=rr(G,h,V.inputRef),I=x.useRef(null),Q=ra(),J=Tp({id:m,implicit:!1,controlRef:I}),K=b?void 0:J,[se,te]=oi({controlled:o,default:!!i,name:"Switch",state:"checked"});z_(I,Q,se,void 0,!F,g),De(()=>{G.current&&P(G.current.checked)},[G,P]),__(se,()=>{A(X),M(se!==B.initialValue),P(se),V.change(se)});const{getButtonProps:le,buttonRef:W}=no({disabled:F,native:b}),ne=IP(d,U,G,!b,K),ve={id:b?J:Q,role:"switch","aria-checked":se,"aria-readonly":k||void 0,"aria-required":N||void 0,"aria-labelledby":ne,onFocus(){F||$(!0)},onBlur(){const Ce=G.current;!Ce||F||(O(!0),$(!1),D==="onBlur"&&V.commit(Ce.checked))},onClick(Ce){if(k||F)return;Ce.preventDefault();const Le=G.current;Le&&Le.dispatchEvent(new(Qt(Le)).PointerEvent("click",{bubbles:!0,shiftKey:Ce.shiftKey,ctrlKey:Ce.ctrlKey,altKey:Ce.altKey,metaKey:Ce.metaKey}))}},oe=Qn({checked:se,disabled:F,form:f,id:K,name:X,required:N,style:X?ES:$b,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:Y,onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;if(k){Ce.preventDefault();return}const Le=Ce.currentTarget.checked,$e=st(va,Ce.nativeEvent);_?.(Le,$e),!$e.isCanceled&&te(Le)},onFocus(){I.current?.focus()}},Ce=>V.getValidationProps(F,Ce),j!==void 0?{value:j}:Xt),fe=x.useMemo(()=>({...T,checked:se,disabled:F,readOnly:k,required:N}),[T,se,F,k,N]),we=Et("span",t,{state:fe,ref:[a,I,W],props:[ve,R,le,Ce=>V.getValidationProps(F,Ce)],stateAttributesMapping:SN});return n.jsxs(wN.Provider,{value:fe,children:[we,!se&&X&&E!==void 0&&n.jsx("input",{type:"hidden",form:f,name:X,value:E,disabled:F}),n.jsx("input",{...oe,suppressHydrationWarning:!0})]})}),QP=x.forwardRef(function(t,a){const{render:o,className:l,style:i,...d}=t,f=KP();return Et("span",t,{state:f,ref:a,stateAttributesMapping:SN,props:d})});function WP({className:e,size:t="default",...a}){return n.jsx(XP,{"data-slot":"switch","data-size":t,className:Ct("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...a,children:n.jsx(QP,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function ZP({className:e,...t}){return n.jsx(Js,{role:"status","aria-label":"Loading",className:Ct("size-4 animate-spin",e),...t})}const CN=x.createContext(!1),NN=x.createContext(void 0);function Ko(e){const t=x.useContext(NN);if(e===!1&&t===void 0)throw new Error(cn(27));return t}const JP={...Yo,...ur},EN=x.forwardRef(function(t,a){const{render:o,className:l,style:i,forceRender:d=!1,...f}=t,{store:m}=Ko(),h=m.useState("open"),g=m.useState("nested"),b=m.useState("mounted"),_=m.useState("transitionStatus");return Et("div",t,{state:{open:h,transitionStatus:_},ref:[m.context.backdropRef,a],stateAttributesMapping:JP,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:d||!g})}),Ap=x.forwardRef(function(t,a){const{render:o,className:l,style:i,disabled:d=!1,nativeButton:f=!0,...m}=t,{store:h}=Ko(),g=h.useState("open"),{getButtonProps:b,buttonRef:_}=no({disabled:d,native:f}),k={disabled:d};function N(y){g&&h.setOpen(!1,st(L4,y.nativeEvent))}return Et("button",t,{state:k,ref:[a,_],props:[{onClick:N},m,b]})}),RN=x.forwardRef(function(t,a){const{render:o,className:l,style:i,id:d,...f}=t,{store:m}=Ko(),h=ra(d);return m.useSyncedValueWithCleanup("descriptionElementId",h),Et("p",t,{ref:a,props:[{id:h},f]})});let eL=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),tL=(function(e){return e[e.open=To.open]="open",e[e.closed=To.closed]="closed",e[e.startingStyle=To.startingStyle]="startingStyle",e[e.endingStyle=To.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const TN=x.createContext(void 0);function nL(){const e=x.useContext(TN);if(e===void 0)throw new Error(cn(26));return e}const sL={...Yo,...ur,nestedDialogOpen(e){return e?{[tL.nestedDialogOpen]:""}:null}},AN=x.forwardRef(function(t,a){const{render:o,className:l,style:i,finalFocus:d,initialFocus:f,...m}=t,{store:h}=Ko(),g=h.useState("descriptionElementId"),b=h.useState("disablePointerDismissal"),_=h.useState("floatingRootContext"),k=h.useState("popupProps"),N=h.useState("modal"),y=h.useState("mounted"),w=h.useState("nested"),E=h.useState("nestedOpenDialogCount"),j=h.useState("open"),S=h.useState("openMethod"),R=h.useState("titleElementId"),A=h.useState("transitionStatus"),T=h.useState("role"),O=_.useState("floatingId"),M=m.id??O;nL(),ka({open:j,ref:h.context.popupRef,onComplete(){j&&h.context.onOpenChangeComplete?.(!0)}});const B=f===void 0?qz(h.context.popupRef):f,P=E>0,$=h.useStateSetter("popupElement"),L=Et("div",t,{state:{open:j,nested:w,transitionStatus:A,nestedDialogOpen:P},props:[k,{id:M,"aria-labelledby":R??void 0,"aria-describedby":g??void 0,role:T,...xp,hidden:!y,onKeyDown(H){Sp.has(H.key)&&H.stopPropagation()},style:{[eL.nestedDialogs]:E}},m],ref:[a,h.context.popupRef,$],stateAttributesMapping:sL});return n.jsx(Zb,{context:_,openInteractionType:S,disabled:!y,closeOnFocusOut:!b,initialFocus:B,returnFocus:d,modal:N!==!1,restoreFocus:"popup",children:L})}),MN=x.forwardRef(function(t,a){const{keepMounted:o=!1,...l}=t,{store:i}=Ko(),d=i.useState("mounted"),f=i.useState("modal"),m=i.useState("open");return d||o?n.jsx(TN.Provider,{value:o,children:n.jsxs(Xb,{ref:a,...l,children:[d&&f===!0&&n.jsx(b_,{ref:i.context.internalBackdropRef,inert:yp(!m)}),t.children]})}):null});function aL(e){const{store:t,actionsRef:a}=e,o=t.useState("open");Gz(t,o),n_(t);const{forceUnmount:l}=s_(o,t),i=x.useCallback(()=>{t.setOpen(!1,st(Ib))},[t]);x.useImperativeHandle(a,()=>({unmount:l,close:i}),[l,i])}function rL({store:e,parentContext:t,isDrawer:a}){const o=e.useState("open"),l=e.useState("disablePointerDismissal"),i=e.useState("modal"),d=e.useState("popupElement"),f=e.useState("floatingRootContext"),[m,h]=x.useState(0),[g,b]=x.useState(0),_=m===0,k=pp(f,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(E){if(!e.context.outsidePressEnabledRef.current||"button"in E&&E.button!==0||"touches"in E&&E.touches.length!==1)return!1;const j=qn(E);return _&&!l?i&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===j||e.context.backdropRef.current===j||We(j,d)&&!j?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:_});JC(o&&i===!0,d),e.useContextCallback("onNestedDialogOpen",(E,j)=>{h(E),b(j)}),e.useContextCallback("onNestedDialogClose",()=>{h(0),b(0)}),x.useEffect(()=>(t?.onNestedDialogOpen&&o&&t.onNestedDialogOpen(m+1,g+(a?1:0)),t?.onNestedDialogClose&&!o&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&o&&t.onNestedDialogClose()}),[a,o,m,g,t]);const N=k.reference??Xt,y=k.trigger??Xt,w=k.floating??Xt;return a_(e,{activeTriggerProps:N,inactiveTriggerProps:y,popupProps:w,nestedOpenDialogCount:m,nestedOpenDrawerCount:g}),null}const oL={...l_,modal:Me(e=>e.modal),nested:Me(e=>e.nested),nestedOpenDialogCount:Me(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Me(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Me(e=>e.disablePointerDismissal),openMethod:Me(e=>e.openMethod),descriptionElementId:Me(e=>e.descriptionElementId),titleElementId:Me(e=>e.titleElementId),viewportElement:Me(e=>e.viewportElement),role:Me(e=>e.role)};class D_ extends gp{constructor(t,a,o=!1){const l=new ou,i=lL(t);i.floatingRootContext=_C(l,a,o),super(i,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:l,onOpenChange:void 0,onOpenChangeComplete:void 0},oL)}setOpen=(t,a)=>{if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,a),a.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,a);const o={open:t};t_(o,t,a.trigger),this.update(o)};static useStore(t,a){return gC(t,(l,i)=>new D_(a,l,i),!0).store}}function lL(e={}){return{...r_(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function iL(e,t="dialog"){const{children:a,open:o,defaultOpen:l=!1,onOpenChange:i,onOpenChangeComplete:d,disablePointerDismissal:f=!1,modal:m=!0,actionsRef:h,handle:g,triggerId:b,defaultTriggerId:_=null}=e,k=t==="drawer",N=t==="alert-dialog",y=N?!0:m,w=N||f,E=N?"alertdialog":"dialog",j=Ko(!0),R={modal:y,disablePointerDismissal:w,nested:!!j,role:E},A=D_.useStore(g?.store,{open:l,openProp:o,activeTriggerId:_,triggerIdProp:b,...R});e_(()=>{const $=o===void 0&&A.state.open===!1&&l===!0?{open:!0,activeTriggerId:_}:null;N?A.update($?{...R,...$}:R):$&&A.update($)}),A.useControlledProp("openProp",o),A.useControlledProp("triggerIdProp",b),A.useSyncedValues(R),A.useContextCallback("onOpenChange",i),A.useContextCallback("onOpenChangeComplete",d);const T=A.useState("open"),O=A.useState("mounted"),M=A.useState("payload");aL({store:A,actionsRef:h});const B=T||O,P=x.useMemo(()=>({store:A}),[A]);return n.jsx(CN.Provider,{value:!1,children:n.jsxs(NN.Provider,{value:P,children:[B&&n.jsx(rL,{store:A,parentContext:j?.store.context,isDrawer:k}),typeof a=="function"?a({payload:M}):a]})})}function ON(e){const t=x.useContext(CN)?"drawer":"dialog";return iL(e,t)}const zN=x.forwardRef(function(t,a){const{render:o,className:l,style:i,id:d,...f}=t,{store:m}=Ko(),h=ra(d);return m.useSyncedValueWithCleanup("titleElementId",h),Et("h2",t,{ref:a,props:[{id:h},f]})});function Ux({...e}){return n.jsx(ON,{"data-slot":"dialog",...e})}function cL({...e}){return n.jsx(MN,{"data-slot":"dialog-portal",...e})}function uL({...e}){return n.jsx(Ap,{"data-slot":"dialog-close",...e})}function dL({className:e,...t}){return n.jsx(EN,{"data-slot":"dialog-overlay",className:Ct("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Hx({className:e,children:t,showCloseButton:a=!0,...o}){return n.jsxs(cL,{children:[n.jsx(dL,{}),n.jsxs(AN,{"data-slot":"dialog-content",className:Ct("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[t,a&&n.jsxs(Ap,{"data-slot":"dialog-close",render:n.jsx(lr,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[n.jsx(gs,{}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qx({className:e,...t}){return n.jsx("div",{"data-slot":"dialog-header",className:Ct("flex flex-col gap-2",e),...t})}function Nk({className:e,showCloseButton:t=!1,children:a,...o}){return n.jsxs("div",{"data-slot":"dialog-footer",className:Ct("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...o,children:[a,t&&n.jsx(Ap,{render:n.jsx(lr,{variant:"outline"}),children:"Close"})]})}function Vx({className:e,...t}){return n.jsx(zN,{"data-slot":"dialog-title",className:Ct("font-heading text-base leading-none font-medium",e),...t})}function fL({className:e,...t}){return n.jsx(RN,{"data-slot":"dialog-description",className:Ct("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const pL={primary:"default",secondary:"outline",ghost:"ghost",destructive:"destructive"},mL={sm:"sm",md:"default"};function ie({variant:e="secondary",size:t="md",loading:a,className:o,children:l,disabled:i,type:d="button",...f}){return n.jsxs(lr,{type:d,variant:pL[e],size:mL[t],disabled:i||a,className:o,...f,children:[a?n.jsx(_n,{size:14}):null,l]})}function Te(e){return n.jsx(qP,{...e})}function un(e){return n.jsx(VP,{...e})}function gL(e){return n.jsx("select",{...e,className:ge("h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",e.className)})}function ce({label:e,hint:t,badge:a,children:o}){return n.jsxs("div",{className:"block space-y-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[e,a&&n.jsx("span",{className:"rounded bg-muted px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground",children:a})]}),o,t&&n.jsx("span",{className:"block text-[11px] text-muted-foreground/70",children:t})]})}function Bt({checked:e,onChange:t,label:a,disabled:o}){return n.jsxs("label",{className:ge("inline-flex items-center gap-2",o&&"opacity-50"),children:[n.jsx(WP,{checked:e,onCheckedChange:t,disabled:o}),a&&n.jsx("span",{className:"text-sm",children:a})]})}function Ve({children:e,tone:t="muted",className:a}){const o=t==="danger"?"destructive":t==="muted"?"secondary":"outline",l={muted:"",danger:"",success:"text-emerald-400 border-emerald-500/30",warning:"text-amber-400 border-amber-500/30",info:"text-sky-400 border-sky-500/30"};return n.jsx(YP,{variant:o,className:ge("rounded-md",l[t],a),children:e})}function Zt({open:e,onClose:t,title:a,description:o,children:l,footer:i,size:d="md"}){const f={sm:"sm:max-w-md",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"};return n.jsx(Ux,{open:e,onOpenChange:m=>{m||t()},children:n.jsxs(Hx,{className:ge("flex max-h-[88vh] w-full flex-col gap-0 p-0",f[d]),children:[(a||o)&&n.jsxs(qx,{className:"shrink-0 border-b border-border px-5 py-4 pr-12",children:[a&&n.jsx(Vx,{children:a}),o&&n.jsx(fL,{children:o})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:l}),i&&n.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border px-5 py-4",children:i})]})})}function _n({size:e=14}){return n.jsx(ZP,{style:{width:e,height:e}})}function pt({children:e}){return n.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/20 px-4 py-6 text-center text-sm text-muted-foreground",children:e})}function rt({label:e="Cargando…"}){return n.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[n.jsx(_n,{})," ",e]})}const DN=x.createContext(null);let hL=1;function xL({children:e}){const[t,a]=x.useState([]),o=x.useCallback((i,d)=>{const f=hL++;a(m=>[...m,{id:f,kind:i,message:d}]),setTimeout(()=>{a(m=>m.filter(h=>h.id!==f))},4500)},[]),l=x.useMemo(()=>({show:o,success:i=>o("success",i),error:i=>o("error",i),info:i=>o("info",i)}),[o]);return x.useEffect(()=>(window.__apxToast=l,()=>{delete window.__apxToast}),[l]),n.jsxs(DN.Provider,{value:l,children:[e,n.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[100] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:t.map(i=>n.jsx("div",{className:ge("pointer-events-auto overflow-hidden rounded-lg border bg-card px-3 py-2 text-sm shadow-lg",i.kind==="success"&&"border-emerald-500/40",i.kind==="error"&&"border-destructive/60",i.kind==="info"&&"border-border"),children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("span",{className:ge("mt-1 size-2 shrink-0 rounded-full",i.kind==="success"&&"bg-emerald-500",i.kind==="error"&&"bg-destructive",i.kind==="info"&&"bg-sky-500")}),n.jsx("span",{className:"flex-1 break-words",children:i.message})]})},i.id))})]})}function Ze(){const e=x.useContext(DN);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function PN(){const{data:e,error:t,isLoading:a}=He("/health",()=>hP.get(),{refreshInterval:tp.health});return{health:e,error:t,isLoading:a,isUp:!t&&!!e}}function bL(){const{data:e,error:t,isLoading:a,mutate:o}=He("/engines",()=>Kc.list());return{engines:e?.engines||[],error:t,isLoading:a,mutate:o}}function _L(){const{data:e,error:t,isLoading:a,mutate:o}=He("/telegram/status",()=>Dn.status(),{refreshInterval:tp.telegramStatus});return{status:e,error:t,isLoading:a,mutate:o}}function P_(){const{data:e,error:t,isLoading:a,mutate:o}=He("/telegram/channels",()=>Dn.channels.list());return{channels:e?.channels||[],error:t,isLoading:a,mutate:o}}function L_(){const{data:e,error:t,isLoading:a,mutate:o}=He("/telegram/contacts",()=>Dn.contacts.list());return{contacts:e?.contacts||[],roles:e?.roles||{},channelOwners:e?.channel_owners||[],error:t,isLoading:a,mutate:o}}function ps(e){return typeof e=="string"&&e.startsWith("*** set ***")}function Vr(e,t="(no seteada)"){return ps(e)?e:t}function Io(e){if(typeof e!="string")return null;const t=e.match(/\(\.\.\.([^)]+)\)/);return t?t[1]:null}function LN({channel:e,onClose:t,onSaved:a}){const o=Ze(),[l,i]=x.useState(!1),[d,f]=x.useState({name:""});x.useEffect(()=>{f(e?{...e,bot_token:""}:{name:""})},[e?.name]);const m=async()=>{if(!d.name?.trim()){o.error(u("telegram_channel_dialog.name_required"));return}i(!0);try{e&&e.name!==""&&e?.name===d.name?await Dn.channels.patch(e.name,d):await Dn.channels.upsert(d),o.success(u("telegram_channel_dialog.saved")),a()}catch(h){o.error(h.message)}finally{i(!1)}};return n.jsx(Zt,{open:!!e,onClose:t,title:e?.name?u("telegram_channel_dialog.edit_title",{name:e.name}):u("telegram_channel_dialog.new_title"),description:u("telegram_ui.channel_dialog_desc"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:l,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:m,loading:l,children:u("common.save")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("telegram_channel_dialog.name_label"),children:n.jsx(Te,{value:d.name,onChange:h=>f({...d,name:h.target.value}),disabled:!!e?.name})}),n.jsx(ce,{label:u("telegram_channel_dialog.token_label"),hint:e?.bot_token?Vr(e.bot_token):u("telegram_ui.bot_token_hint"),children:n.jsx(Te,{type:"password",value:d.bot_token||"",onChange:h=>f({...d,bot_token:h.target.value}),placeholder:e?.bot_token?Vr(e.bot_token):""})}),n.jsx(ce,{label:u("telegram_channel_dialog.chat_id"),children:n.jsx(Te,{value:d.chat_id||"",onChange:h=>f({...d,chat_id:h.target.value})})}),n.jsx(ce,{label:u("telegram_channel_dialog.project_label"),hint:u("telegram_channel_dialog.project_hint"),children:n.jsx(Te,{value:d.project||"",onChange:h=>f({...d,project:h.target.value})})}),n.jsx(ce,{label:u("telegram_channel_dialog.route_label"),hint:u("telegram_channel_dialog.route_hint"),children:n.jsx(Te,{value:d.route_to_agent||"",onChange:h=>f({...d,route_to_agent:h.target.value})})}),n.jsx(ce,{label:u("telegram_channel_dialog.owner_label"),hint:u("telegram_channel_dialog.owner_hint"),children:n.jsx(Te,{value:d.owner_user_id!=null?String(d.owner_user_id):"",onChange:h=>{const g=h.target.value.trim();f({...d,owner_user_id:g===""?void 0:/^\d+$/.test(g)?Number(g):g})},placeholder:"889721252"})}),n.jsx(Bt,{checked:!!d.respond_with_engine,onChange:h=>f({...d,respond_with_engine:h}),label:u("telegram_channel_dialog.respond_label")})]})})}function IN({channel:e,onClose:t}){const a=Ze(),[o,l]=x.useState(u("admin.telegram_default_message")),[i,d]=x.useState(!1),f=async()=>{if(!(!o.trim()||!e)){d(!0);try{await Dn.send({text:o,channel:e.name}),a.success(u("telegram_ui.message_sent")),t()}catch(m){a.error(m.message)}finally{d(!1)}}};return n.jsx(Zt,{open:!!e,onClose:t,title:e?u("telegram_send_dialog.title",{name:e.name}):"",description:e?u("telegram_ui.send_chat_id",{id:e.chat_id||"—"}):"",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:i,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:f,loading:i,children:u("chat_ui.send")})]}),children:n.jsx(ce,{label:u("telegram_ui.message_label"),children:n.jsx(un,{rows:4,value:o,onChange:m=>l(m.target.value)})})})}function BN({bare:e=!1}){const t=Ze(),{contacts:a,roles:o,channelOwners:l,isLoading:i,mutate:d}=L_(),f=new Set(l.filter(_=>_.owner_user_id!=null).map(_=>String(_.owner_user_id))),m=Array.from(new Set(["owner","guest",...Object.keys(o)])),h=async(_,k)=>{try{await Dn.contacts.patch(_.user_id,{role:k}),t.success(u("telegram_ui.role_assigned",{name:_.name||_.user_id,role:k})),d()}catch(N){t.error(N.message)}},g=async _=>{if(confirm(u("telegram_contacts.delete_confirm",{name:_.name||String(_.user_id)})))try{await Dn.contacts.remove(_.user_id),t.success(u("telegram_contacts.removed")),d()}catch(k){t.error(k.message)}},b=n.jsxs(n.Fragment,{children:[i&&n.jsx(rt,{}),!i&&a.length===0&&n.jsx(pt,{children:u("telegram_contacts.empty")}),a.length>0&&n.jsx("ul",{className:"space-y-2 text-sm",children:a.map(_=>{const k=f.has(String(_.user_id)),N=k?"owner":_.role||"guest";return n.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"font-medium",children:_.name||"—"}),_.username&&n.jsxs("span",{className:"ml-2 text-xs text-muted-fg",children:["@",_.username]}),k&&n.jsx(Ve,{tone:"success",children:u("telegram_contacts.owner_badge")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qe,{content:u(k?"telegram_contacts.owner_hint":"telegram_contacts.assign_role"),children:n.jsx(gL,{value:N,disabled:k,onChange:y=>h(_,y.target.value),children:m.map(y=>n.jsx("option",{value:y,children:y},y))})}),n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>g(_),children:u("common.delete")})]})]}),n.jsxs("div",{className:"mt-1 grid grid-cols-3 gap-2 text-xs text-muted-fg",children:[n.jsxs("span",{children:["user_id: ",String(_.user_id)]}),n.jsxs("span",{children:[u("telegram_contacts.last_seen")," ",_.last_seen?_.last_seen.slice(0,10):"—"]}),n.jsx("span",{children:vL(o[N])})]})]},String(_.user_id))})})]});return e?b:n.jsx(Ye,{title:u("telegram_contacts.title"),description:u("telegram_contacts.desc"),children:b})}function vL(e){return!e||e.tools===void 0?"":e.tools==="*"?u("telegram_contacts.tools_all"):Array.isArray(e.tools)?e.tools.length?`${u("telegram_contacts.tools_label")} ${e.tools.join(", ")}`:u("telegram_contacts.tools_none"):""}function yL(){const e=Pn(),[t,a]=Vo(),o=Ze(),{health:l,isUp:i}=PN(),{projects:d,isLoading:f,mutate:m}=uu(),{engines:h,isLoading:g}=bL(),{status:b,mutate:_}=_L(),{channels:k,isLoading:N,mutate:y}=P_(),[w,E]=x.useState(null),[j,S]=x.useState(null),R=async()=>{try{await ii.reload(),o.success(u("admin.reload_success"))}catch(M){o.error(M.message)}},A=async()=>{try{b?.enabled?(await Dn.stop(),o.info(u("admin.telegram_polling_stopped"))):(await Dn.start(),o.success(u("admin.telegram_polling_started"))),_()}catch(M){o.error(M.message)}},T=async M=>{if(confirm(u("telegram_channels.delete_confirm",{name:M})))try{await Dn.channels.remove(M),o.success(u("admin.telegram_channel_removed")),y()}catch(B){o.error(B.message)}},O=async(M,B)=>{if(confirm(u("admin.unregister_confirm",{label:B})))try{await Zn.remove(M),o.success(u("project.unregistered")),m()}catch(P){o.error(P.message)}};return n.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 p-6","data-testid":"screen-admin",children:[n.jsxs("header",{className:"flex items-end justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:u("admin.title")}),n.jsx("p",{className:"text-sm text-muted-fg",children:u("admin.subtitle")})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(qe,{content:u("daemon.reload_hint"),children:n.jsxs(ie,{size:"sm",onClick:R,children:[u("common.reload")," config"]})}),n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>{const M=new URLSearchParams(t);M.set("action","add-project"),a(M)},children:[n.jsx(Pt,{size:14})," ",u("nav.project")]})]})]}),n.jsx(Ye,{title:u("daemon.version"),children:n.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[n.jsx(Sh,{label:u("daemon.version"),value:l?.version||"—"}),n.jsx(Sh,{label:u("daemon.uptime"),value:l?`${l.uptime_s}s`:"—"}),n.jsx(Sh,{label:u("daemon.status"),value:u(i?"daemon.running":"daemon.down"),ok:i})]})}),n.jsxs(Ye,{title:u("admin.engines_title"),description:u("admin.engines_subtitle"),children:[g&&n.jsx(rt,{}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(M=>n.jsx(Ve,{tone:"info",children:M},M))})]}),n.jsxs(Ye,{title:u("admin.telegram_title"),description:u("admin.telegram_subtitle"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Bt,{checked:!!b?.enabled,onChange:A,label:b?.enabled?u("admin.telegram_polling_on"):u("admin.telegram_polling_off")}),n.jsxs(ie,{size:"sm",onClick:()=>E({name:""}),children:[n.jsx(Pt,{size:14})," ",u("admin.telegram_add_channel")]})]}),children:[N&&n.jsx(rt,{}),k.length===0&&n.jsx(pt,{children:u("common.none_yet")}),n.jsx("ul",{className:"space-y-2 text-sm",children:k.map(M=>n.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-medium",children:M.name}),n.jsxs("div",{className:"flex items-center gap-2",children:[M.project&&n.jsxs(Ve,{tone:"success",children:["project = ",M.project]}),n.jsxs(ie,{size:"sm",variant:"ghost",onClick:()=>S(M),children:[n.jsx(ja,{size:13})," ",u("admin.telegram_send_test")]}),n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>E(M),children:u("common.edit")}),n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>T(M.name),children:u("common.delete")})]})]}),n.jsxs("div",{className:"mt-1 grid grid-cols-3 gap-2 text-xs text-muted-fg",children:[n.jsxs("span",{children:["chat_id: ",M.chat_id||"—"]}),n.jsxs("span",{children:["route_to_agent: ",M.route_to_agent||"default APX"]}),n.jsxs("span",{children:["engine: ",M.respond_with_engine?u("admin.engine_badge"):u("admin.engine_badge_no")]})]})]},M.name))})]}),n.jsx(BN,{}),n.jsxs(Ye,{title:u("admin.projects_title"),description:u("admin.projects_subtitle"),children:[f&&n.jsx(rt,{}),n.jsx("ul",{className:"divide-y divide-border",children:d.map(M=>n.jsxs("li",{className:"flex items-center gap-3 py-2",children:[n.jsxs("span",{className:"w-10 font-mono text-xs text-muted-fg",children:["#",M.id]}),n.jsxs("button",{type:"button",className:"flex-1 text-left hover:underline",onClick:()=>e(`/p/${M.id}`),children:[n.jsx("span",{className:"font-medium",children:M.name||M.path.split("/").pop()}),n.jsx("span",{className:"ml-2 text-xs text-muted-fg",children:M.path})]}),n.jsxs(Ve,{children:[M.agents??0," ",u("admin.agents_badge")]}),Number(M.id)!==0&&n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>O(String(M.id),M.name||M.path),children:u("admin.unregister")})]},M.id))})]}),n.jsx(LN,{channel:w,onClose:()=>E(null),onSaved:()=>{E(null),y()}}),n.jsx(IN,{channel:j,onClose:()=>S(null)})]})}function Sh({label:e,value:t,ok:a}){return n.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),n.jsxs("div",{className:"mt-1 flex items-center gap-2 text-base font-medium",children:[a!==void 0&&n.jsx(fu,{ok:a}),n.jsx("span",{children:t})]})]})}const $N=x.createContext(null),UN=x.createContext(null),HN=x.createContext(""),qN=x.createContext(null),VN=x.createContext(null),FN=x.createContext(null);function jL({children:e}){const[t,a]=x.useState(null),[o,l]=x.useState(""),[i,d]=x.useState(null);return n.jsx(UN.Provider,{value:a,children:n.jsx($N.Provider,{value:t,children:n.jsx(qN.Provider,{value:l,children:n.jsx(HN.Provider,{value:o,children:n.jsx(FN.Provider,{value:d,children:n.jsx(VN.Provider,{value:i,children:e})})})})})})}function kL(){return x.useContext($N)}function wL(e,t){const a=x.useContext(UN);x.useEffect(()=>(a?.({collapsed:e,toggle:t}),()=>a?.(null)),[e,t,a])}function SL(){return x.useContext(HN)}function CL(e){const t=x.useContext(qN);x.useEffect(()=>(t?.(e),()=>t?.("")),[e,t])}function NL(){return x.useContext(VN)}function EL(e){const t=x.useContext(FN);x.useEffect(()=>(t?.(e),()=>t?.(null)),[e,t])}function GN({sections:e,active:t,onChange:a,collapsed:o,onToggleCollapse:l,actions:i,contentClassName:d,testId:f,children:m}){return wL(o,l),n.jsxs("div",{className:"flex h-full",children:[n.jsx(UD,{sections:e,active:t,onChange:a,collapsed:o}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[i?n.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2 px-6 pt-3",children:i}):null,n.jsx("div",{className:ge("flex-1 min-h-0 overflow-y-auto",d),"data-testid":f,children:m})]})]})}function RL({className:e}){return n.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M18.833 9.637a4.167 4.167 0 1 1 0 8.333 4.167 4.167 0 0 1 0-8.333zm-13.666 0a4.167 4.167 0 1 1 0 8.333 4.167 4.167 0 0 1 0-8.333zM12 2a4.167 4.167 0 1 1 0 8.333A4.167 4.167 0 0 1 12 2z"})})}function YN({className:e}){return n.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M19.355 18.538a68.967 68.959 0 0 0 1.858-2.954.81.81 0 0 0-.062-.9c-.516-.685-1.504-2.075-2.042-3.362-.553-1.321-.636-3.375-.64-4.377a1.707 1.707 0 0 0-.358-1.05l-3.198-4.064a3.744 3.744 0 0 1-.076.543c-.106.503-.307 1.004-.536 1.5-.134.29-.29.6-.446.914l-.31.626c-.516 1.068-.997 2.227-1.132 3.59-.124 1.26.046 2.73.815 4.481.128.011.257.025.386.044a6.363 6.363 0 0 1 3.326 1.505c.916.79 1.744 1.922 2.415 3.5zM8.199 22.569c.073.012.146.02.22.02.78.024 2.095.092 3.16.29.87.16 2.593.64 4.01 1.055 1.083.316 2.198-.548 2.355-1.664.114-.814.33-1.735.725-2.58l-.01.005c-.67-1.87-1.522-3.078-2.416-3.849a5.295 5.295 0 0 0-2.778-1.257c-1.54-.216-2.952.19-3.84.45.532 2.218.368 4.829-1.425 7.531zM5.533 9.938c-.023.1-.056.197-.098.29L2.82 16.059a1.602 1.602 0 0 0 .313 1.772l4.116 4.24c2.103-3.101 1.796-6.02.836-8.3-.728-1.73-1.832-3.081-2.55-3.831zM9.32 14.01c.615-.183 1.606-.465 2.745-.534-.683-1.725-.848-3.233-.716-4.577.154-1.552.7-2.847 1.235-3.95.113-.235.223-.454.328-.664.149-.297.288-.577.419-.86.217-.47.379-.885.46-1.27.08-.38.08-.72-.014-1.043-.095-.325-.297-.675-.68-1.06a1.6 1.6 0 0 0-1.475.36l-4.95 4.452a1.602 1.602 0 0 0-.513.952l-.427 2.83c.672.59 2.328 2.316 3.335 4.711.09.21.175.43.253.653z"})})}function TL({className:e}){return n.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})})}const Ek={happy:{eyes:["◕","◕"],mouth:"‿"},wave:{eyes:["◕","◕"],mouth:"▽",top:"·"},confused:{eyes:["◑","◐"],mouth:"o",top:"?"},sad:{eyes:["╥","╥"],mouth:"◠"},excited:{eyes:["★","★"],mouth:"▽",top:"✦"},sleeping:{eyes:["−","−"],mouth:"‿",top:"z z"}};function KN({mood:e="happy",className:t}){const a=Ek[e]??Ek.happy,[o,l]=a.eyes,i="text-emerald-700 dark:text-emerald-600/70";return n.jsxs("div",{"aria-hidden":!0,className:Ct("select-none whitespace-pre font-mono leading-none text-emerald-400",t),children:[a.top&&n.jsx("div",{children:n.jsx("span",{className:i,children:` ${a.top}`})}),n.jsx("div",{children:" ▄███████▄"}),n.jsxs("div",{children:[" █ ",n.jsx("span",{className:i,children:"██"})," ",n.jsx("span",{className:i,children:"██"})," █"]}),n.jsx("div",{children:` █ ${o} ${l} █`}),n.jsx("div",{children:` █ ${a.mouth} █`}),n.jsx("div",{children:" ▀███████▀"})]})}function XN({mood:e="confused",title:t,titleClassName:a,message:o,action:l,className:i,testId:d}){return n.jsx("div",{className:Ct("grid h-full place-items-center p-8",i),"data-testid":d,children:n.jsxs("div",{className:"flex flex-col items-center text-center",children:[n.jsx(KN,{mood:e,className:"mb-6 text-sm"}),t!=null&&n.jsx("div",{className:Ct("font-mono font-semibold leading-none tracking-tight text-foreground",a),children:t}),o!=null&&n.jsx("p",{className:"mt-4 max-w-sm text-sm text-muted-fg",children:o}),l&&n.jsx("div",{className:"mt-6",children:l})]})})}const I_={pending:{labelKey:"tasks.status_pending",color:"text-amber-500",dot:"bg-amber-400",Icon:PA},running:{labelKey:"tasks.status_running",color:"text-sky-500",dot:"bg-sky-400",Icon:Js,spin:!0},in_review:{labelKey:"tasks.status_in_review",color:"text-violet-500",dot:"bg-violet-400",Icon:V2},blocked:{labelKey:"tasks.status_blocked",color:"text-slate-400",dot:"bg-slate-400",Icon:LA}},QN=["pending","running","in_review","blocked"];function Pf(e){return e.state==="done"?"done":e.state==="dropped"?"dropped":e.status??"pending"}function B_(e){return u(I_[e].labelKey)}function Lf({status:e,className:t}){if(e==="done")return n.jsx(mb,{className:ge("size-4 text-emerald-500",t)});if(e==="dropped")return n.jsx(q2,{className:ge("size-4 text-muted-foreground",t)});const a=I_[e];return n.jsx(a.Icon,{className:ge("size-4",a.color,a.spin&&"animate-spin",t)})}function $_({status:e}){const t=e==="done"?u("tasks.done_label"):e==="dropped"?u("tasks.dropped_label"):B_(e),a=e==="done"?"text-emerald-500 border-emerald-500/30":e==="dropped"?"text-muted-foreground border-border":`${I_[e].color} border-current/30`;return n.jsxs("span",{className:ge("inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-medium capitalize",a),children:[n.jsx(Lf,{status:e,className:"size-3"}),t]})}function AL(e,t){var a,o=1;e==null&&(e=0),t==null&&(t=0);function l(){var i,d=a.length,f,m=0,h=0;for(i=0;i<d;++i)f=a[i],m+=f.x,h+=f.y;for(m=(m/d-e)*o,h=(h/d-t)*o,i=0;i<d;++i)f=a[i],f.x-=m,f.y-=h}return l.initialize=function(i){a=i},l.x=function(i){return arguments.length?(e=+i,l):e},l.y=function(i){return arguments.length?(t=+i,l):t},l.strength=function(i){return arguments.length?(o=+i,l):o},l}function ML(e){const t=+this._x.call(null,e),a=+this._y.call(null,e);return WN(this.cover(t,a),t,a,e)}function WN(e,t,a,o){if(isNaN(t)||isNaN(a))return e;var l,i=e._root,d={data:o},f=e._x0,m=e._y0,h=e._x1,g=e._y1,b,_,k,N,y,w,E,j;if(!i)return e._root=d,e;for(;i.length;)if((y=t>=(b=(f+h)/2))?f=b:h=b,(w=a>=(_=(m+g)/2))?m=_:g=_,l=i,!(i=i[E=w<<1|y]))return l[E]=d,e;if(k=+e._x.call(null,i.data),N=+e._y.call(null,i.data),t===k&&a===N)return d.next=i,l?l[E]=d:e._root=d,e;do l=l?l[E]=new Array(4):e._root=new Array(4),(y=t>=(b=(f+h)/2))?f=b:h=b,(w=a>=(_=(m+g)/2))?m=_:g=_;while((E=w<<1|y)===(j=(N>=_)<<1|k>=b));return l[j]=i,l[E]=d,e}function OL(e){var t,a,o=e.length,l,i,d=new Array(o),f=new Array(o),m=1/0,h=1/0,g=-1/0,b=-1/0;for(a=0;a<o;++a)isNaN(l=+this._x.call(null,t=e[a]))||isNaN(i=+this._y.call(null,t))||(d[a]=l,f[a]=i,l<m&&(m=l),l>g&&(g=l),i<h&&(h=i),i>b&&(b=i));if(m>g||h>b)return this;for(this.cover(m,h).cover(g,b),a=0;a<o;++a)WN(this,d[a],f[a],e[a]);return this}function zL(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var a=this._x0,o=this._y0,l=this._x1,i=this._y1;if(isNaN(a))l=(a=Math.floor(e))+1,i=(o=Math.floor(t))+1;else{for(var d=l-a||1,f=this._root,m,h;a>e||e>=l||o>t||t>=i;)switch(h=(t<o)<<1|e<a,m=new Array(4),m[h]=f,f=m,d*=2,h){case 0:l=a+d,i=o+d;break;case 1:a=l-d,i=o+d;break;case 2:l=a+d,o=i-d;break;case 3:a=l-d,o=i-d;break}this._root&&this._root.length&&(this._root=f)}return this._x0=a,this._y0=o,this._x1=l,this._y1=i,this}function DL(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function PL(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Jn(e,t,a,o,l){this.node=e,this.x0=t,this.y0=a,this.x1=o,this.y1=l}function LL(e,t,a){var o,l=this._x0,i=this._y0,d,f,m,h,g=this._x1,b=this._y1,_=[],k=this._root,N,y;for(k&&_.push(new Jn(k,l,i,g,b)),a==null?a=1/0:(l=e-a,i=t-a,g=e+a,b=t+a,a*=a);N=_.pop();)if(!(!(k=N.node)||(d=N.x0)>g||(f=N.y0)>b||(m=N.x1)<l||(h=N.y1)<i))if(k.length){var w=(d+m)/2,E=(f+h)/2;_.push(new Jn(k[3],w,E,m,h),new Jn(k[2],d,E,w,h),new Jn(k[1],w,f,m,E),new Jn(k[0],d,f,w,E)),(y=(t>=E)<<1|e>=w)&&(N=_[_.length-1],_[_.length-1]=_[_.length-1-y],_[_.length-1-y]=N)}else{var j=e-+this._x.call(null,k.data),S=t-+this._y.call(null,k.data),R=j*j+S*S;if(R<a){var A=Math.sqrt(a=R);l=e-A,i=t-A,g=e+A,b=t+A,o=k.data}}return o}function IL(e){if(isNaN(g=+this._x.call(null,e))||isNaN(b=+this._y.call(null,e)))return this;var t,a=this._root,o,l,i,d=this._x0,f=this._y0,m=this._x1,h=this._y1,g,b,_,k,N,y,w,E;if(!a)return this;if(a.length)for(;;){if((N=g>=(_=(d+m)/2))?d=_:m=_,(y=b>=(k=(f+h)/2))?f=k:h=k,t=a,!(a=a[w=y<<1|N]))return this;if(!a.length)break;(t[w+1&3]||t[w+2&3]||t[w+3&3])&&(o=t,E=w)}for(;a.data!==e;)if(l=a,!(a=a.next))return this;return(i=a.next)&&delete a.next,l?(i?l.next=i:delete l.next,this):t?(i?t[w]=i:delete t[w],(a=t[0]||t[1]||t[2]||t[3])&&a===(t[3]||t[2]||t[1]||t[0])&&!a.length&&(o?o[E]=a:this._root=a),this):(this._root=i,this)}function BL(e){for(var t=0,a=e.length;t<a;++t)this.remove(e[t]);return this}function $L(){return this._root}function UL(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function HL(e){var t=[],a,o=this._root,l,i,d,f,m;for(o&&t.push(new Jn(o,this._x0,this._y0,this._x1,this._y1));a=t.pop();)if(!e(o=a.node,i=a.x0,d=a.y0,f=a.x1,m=a.y1)&&o.length){var h=(i+f)/2,g=(d+m)/2;(l=o[3])&&t.push(new Jn(l,h,g,f,m)),(l=o[2])&&t.push(new Jn(l,i,g,h,m)),(l=o[1])&&t.push(new Jn(l,h,d,f,g)),(l=o[0])&&t.push(new Jn(l,i,d,h,g))}return this}function qL(e){var t=[],a=[],o;for(this._root&&t.push(new Jn(this._root,this._x0,this._y0,this._x1,this._y1));o=t.pop();){var l=o.node;if(l.length){var i,d=o.x0,f=o.y0,m=o.x1,h=o.y1,g=(d+m)/2,b=(f+h)/2;(i=l[0])&&t.push(new Jn(i,d,f,g,b)),(i=l[1])&&t.push(new Jn(i,g,f,m,b)),(i=l[2])&&t.push(new Jn(i,d,b,g,h)),(i=l[3])&&t.push(new Jn(i,g,b,m,h))}a.push(o)}for(;o=a.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}function VL(e){return e[0]}function FL(e){return arguments.length?(this._x=e,this):this._x}function GL(e){return e[1]}function YL(e){return arguments.length?(this._y=e,this):this._y}function U_(e,t,a){var o=new H_(t??VL,a??GL,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function H_(e,t,a,o,l,i){this._x=e,this._y=t,this._x0=a,this._y0=o,this._x1=l,this._y1=i,this._root=void 0}function Rk(e){for(var t={data:e.data},a=t;e=e.next;)a=a.next={data:e.data};return t}var as=U_.prototype=H_.prototype;as.copy=function(){var e=new H_(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,a,o;if(!t)return e;if(!t.length)return e._root=Rk(t),e;for(a=[{source:t,target:e._root=new Array(4)}];t=a.pop();)for(var l=0;l<4;++l)(o=t.source[l])&&(o.length?a.push({source:o,target:t.target[l]=new Array(4)}):t.target[l]=Rk(o));return e};as.add=ML;as.addAll=OL;as.cover=zL;as.data=DL;as.extent=PL;as.find=LL;as.remove=IL;as.removeAll=BL;as.root=$L;as.size=UL;as.visit=HL;as.visitAfter=qL;as.x=FL;as.y=YL;function es(e){return function(){return e}}function Hr(e){return(e()-.5)*1e-6}function KL(e){return e.x+e.vx}function XL(e){return e.y+e.vy}function QL(e){var t,a,o,l=1,i=1;typeof e!="function"&&(e=es(e==null?1:+e));function d(){for(var h,g=t.length,b,_,k,N,y,w,E=0;E<i;++E)for(b=U_(t,KL,XL).visitAfter(f),h=0;h<g;++h)_=t[h],y=a[_.index],w=y*y,k=_.x+_.vx,N=_.y+_.vy,b.visit(j);function j(S,R,A,T,O){var M=S.data,B=S.r,P=y+B;if(M){if(M.index>_.index){var $=k-M.x-M.vx,D=N-M.y-M.vy,L=$*$+D*D;L<P*P&&($===0&&($=Hr(o),L+=$*$),D===0&&(D=Hr(o),L+=D*D),L=(P-(L=Math.sqrt(L)))/L*l,_.vx+=($*=L)*(P=(B*=B)/(w+B)),_.vy+=(D*=L)*P,M.vx-=$*(P=1-P),M.vy-=D*P)}return}return R>k+P||T<k-P||A>N+P||O<N-P}}function f(h){if(h.data)return h.r=a[h.data.index];for(var g=h.r=0;g<4;++g)h[g]&&h[g].r>h.r&&(h.r=h[g].r)}function m(){if(t){var h,g=t.length,b;for(a=new Array(g),h=0;h<g;++h)b=t[h],a[b.index]=+e(b,h,t)}}return d.initialize=function(h,g){t=h,o=g,m()},d.iterations=function(h){return arguments.length?(i=+h,d):i},d.strength=function(h){return arguments.length?(l=+h,d):l},d.radius=function(h){return arguments.length?(e=typeof h=="function"?h:es(+h),m(),d):e},d}function WL(e){return e.index}function Tk(e,t){var a=e.get(t);if(!a)throw new Error("node not found: "+t);return a}function ZL(e){var t=WL,a=b,o,l=es(30),i,d,f,m,h,g=1;e==null&&(e=[]);function b(w){return 1/Math.min(f[w.source.index],f[w.target.index])}function _(w){for(var E=0,j=e.length;E<g;++E)for(var S=0,R,A,T,O,M,B,P;S<j;++S)R=e[S],A=R.source,T=R.target,O=T.x+T.vx-A.x-A.vx||Hr(h),M=T.y+T.vy-A.y-A.vy||Hr(h),B=Math.sqrt(O*O+M*M),B=(B-i[S])/B*w*o[S],O*=B,M*=B,T.vx-=O*(P=m[S]),T.vy-=M*P,A.vx+=O*(P=1-P),A.vy+=M*P}function k(){if(d){var w,E=d.length,j=e.length,S=new Map(d.map((A,T)=>[t(A,T,d),A])),R;for(w=0,f=new Array(E);w<j;++w)R=e[w],R.index=w,typeof R.source!="object"&&(R.source=Tk(S,R.source)),typeof R.target!="object"&&(R.target=Tk(S,R.target)),f[R.source.index]=(f[R.source.index]||0)+1,f[R.target.index]=(f[R.target.index]||0)+1;for(w=0,m=new Array(j);w<j;++w)R=e[w],m[w]=f[R.source.index]/(f[R.source.index]+f[R.target.index]);o=new Array(j),N(),i=new Array(j),y()}}function N(){if(d)for(var w=0,E=e.length;w<E;++w)o[w]=+a(e[w],w,e)}function y(){if(d)for(var w=0,E=e.length;w<E;++w)i[w]=+l(e[w],w,e)}return _.initialize=function(w,E){d=w,h=E,k()},_.links=function(w){return arguments.length?(e=w,k(),_):e},_.id=function(w){return arguments.length?(t=w,_):t},_.iterations=function(w){return arguments.length?(g=+w,_):g},_.strength=function(w){return arguments.length?(a=typeof w=="function"?w:es(+w),N(),_):a},_.distance=function(w){return arguments.length?(l=typeof w=="function"?w:es(+w),y(),_):l},_}var JL={value:()=>{}};function ZN(){for(var e=0,t=arguments.length,a={},o;e<t;++e){if(!(o=arguments[e]+"")||o in a||/[\s.]/.test(o))throw new Error("illegal type: "+o);a[o]=[]}return new cf(a)}function cf(e){this._=e}function e8(e,t){return e.trim().split(/^|\s+/).map(function(a){var o="",l=a.indexOf(".");if(l>=0&&(o=a.slice(l+1),a=a.slice(0,l)),a&&!t.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:o}})}cf.prototype=ZN.prototype={constructor:cf,on:function(e,t){var a=this._,o=e8(e+"",a),l,i=-1,d=o.length;if(arguments.length<2){for(;++i<d;)if((l=(e=o[i]).type)&&(l=t8(a[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<d;)if(l=(e=o[i]).type)a[l]=Ak(a[l],e.name,t);else if(t==null)for(l in a)a[l]=Ak(a[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var a in t)e[a]=t[a].slice();return new cf(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var a=new Array(l),o=0,l,i;o<l;++o)a[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,l=i.length;o<l;++o)i[o].value.apply(t,a)},apply:function(e,t,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],l=0,i=o.length;l<i;++l)o[l].value.apply(t,a)}};function t8(e,t){for(var a=0,o=e.length,l;a<o;++a)if((l=e[a]).name===t)return l.value}function Ak(e,t,a){for(var o=0,l=e.length;o<l;++o)if(e[o].name===t){e[o]=JL,e=e.slice(0,o).concat(e.slice(o+1));break}return a!=null&&e.push({name:t,value:a}),e}var ui=0,Ec=0,bc=0,JN=1e3,If,Rc,Bf=0,Bo=0,Mp=0,Xc=typeof performance=="object"&&performance.now?performance:Date,eE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tE(){return Bo||(eE(n8),Bo=Xc.now()+Mp)}function n8(){Bo=0}function Fx(){this._call=this._time=this._next=null}Fx.prototype=nE.prototype={constructor:Fx,restart:function(e,t,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?tE():+a)+(t==null?0:+t),!this._next&&Rc!==this&&(Rc?Rc._next=this:If=this,Rc=this),this._call=e,this._time=a,Gx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gx())}};function nE(e,t,a){var o=new Fx;return o.restart(e,t,a),o}function s8(){tE(),++ui;for(var e=If,t;e;)(t=Bo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ui}function Mk(){Bo=(Bf=Xc.now())+Mp,ui=Ec=0;try{s8()}finally{ui=0,r8(),Bo=0}}function a8(){var e=Xc.now(),t=e-Bf;t>JN&&(Mp-=t,Bf=e)}function r8(){for(var e,t=If,a,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(a=t._next,t._next=null,t=e?e._next=a:If=a);Rc=e,Gx(o)}function Gx(e){if(!ui){Ec&&(Ec=clearTimeout(Ec));var t=e-Bo;t>24?(e<1/0&&(Ec=setTimeout(Mk,e-Xc.now()-Mp)),bc&&(bc=clearInterval(bc))):(bc||(Bf=Xc.now(),bc=setInterval(a8,JN)),ui=1,eE(Mk))}}const o8=1664525,l8=1013904223,Ok=4294967296;function i8(){let e=1;return()=>(e=(o8*e+l8)%Ok)/Ok}function c8(e){return e.x}function u8(e){return e.y}var d8=10,f8=Math.PI*(3-Math.sqrt(5));function p8(e){var t,a=1,o=.001,l=1-Math.pow(o,1/300),i=0,d=.6,f=new Map,m=nE(b),h=ZN("tick","end"),g=i8();e==null&&(e=[]);function b(){_(),h.call("tick",t),a<o&&(m.stop(),h.call("end",t))}function _(y){var w,E=e.length,j;y===void 0&&(y=1);for(var S=0;S<y;++S)for(a+=(i-a)*l,f.forEach(function(R){R(a)}),w=0;w<E;++w)j=e[w],j.fx==null?j.x+=j.vx*=d:(j.x=j.fx,j.vx=0),j.fy==null?j.y+=j.vy*=d:(j.y=j.fy,j.vy=0);return t}function k(){for(var y=0,w=e.length,E;y<w;++y){if(E=e[y],E.index=y,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var j=d8*Math.sqrt(.5+y),S=y*f8;E.x=j*Math.cos(S),E.y=j*Math.sin(S)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function N(y){return y.initialize&&y.initialize(e,g),y}return k(),t={tick:_,restart:function(){return m.restart(b),t},stop:function(){return m.stop(),t},nodes:function(y){return arguments.length?(e=y,k(),f.forEach(N),t):e},alpha:function(y){return arguments.length?(a=+y,t):a},alphaMin:function(y){return arguments.length?(o=+y,t):o},alphaDecay:function(y){return arguments.length?(l=+y,t):+l},alphaTarget:function(y){return arguments.length?(i=+y,t):i},velocityDecay:function(y){return arguments.length?(d=1-y,t):1-d},randomSource:function(y){return arguments.length?(g=y,f.forEach(N),t):g},force:function(y,w){return arguments.length>1?(w==null?f.delete(y):f.set(y,N(w)),t):f.get(y)},find:function(y,w,E){var j=0,S=e.length,R,A,T,O,M;for(E==null?E=1/0:E*=E,j=0;j<S;++j)O=e[j],R=y-O.x,A=w-O.y,T=R*R+A*A,T<E&&(M=O,E=T);return M},on:function(y,w){return arguments.length>1?(h.on(y,w),t):h.on(y)}}}function m8(){var e,t,a,o,l=es(-30),i,d=1,f=1/0,m=.81;function h(k){var N,y=e.length,w=U_(e,c8,u8).visitAfter(b);for(o=k,N=0;N<y;++N)t=e[N],w.visit(_)}function g(){if(e){var k,N=e.length,y;for(i=new Array(N),k=0;k<N;++k)y=e[k],i[y.index]=+l(y,k,e)}}function b(k){var N=0,y,w,E=0,j,S,R;if(k.length){for(j=S=R=0;R<4;++R)(y=k[R])&&(w=Math.abs(y.value))&&(N+=y.value,E+=w,j+=w*y.x,S+=w*y.y);k.x=j/E,k.y=S/E}else{y=k,y.x=y.data.x,y.y=y.data.y;do N+=i[y.data.index];while(y=y.next)}k.value=N}function _(k,N,y,w){if(!k.value)return!0;var E=k.x-t.x,j=k.y-t.y,S=w-N,R=E*E+j*j;if(S*S/m<R)return R<f&&(E===0&&(E=Hr(a),R+=E*E),j===0&&(j=Hr(a),R+=j*j),R<d&&(R=Math.sqrt(d*R)),t.vx+=E*k.value*o/R,t.vy+=j*k.value*o/R),!0;if(k.length||R>=f)return;(k.data!==t||k.next)&&(E===0&&(E=Hr(a),R+=E*E),j===0&&(j=Hr(a),R+=j*j),R<d&&(R=Math.sqrt(d*R)));do k.data!==t&&(S=i[k.data.index]*o/R,t.vx+=E*S,t.vy+=j*S);while(k=k.next)}return h.initialize=function(k,N){e=k,a=N,g()},h.strength=function(k){return arguments.length?(l=typeof k=="function"?k:es(+k),g(),h):l},h.distanceMin=function(k){return arguments.length?(d=k*k,h):Math.sqrt(d)},h.distanceMax=function(k){return arguments.length?(f=k*k,h):Math.sqrt(f)},h.theta=function(k){return arguments.length?(m=k*k,h):Math.sqrt(m)},h}function g8(e){var t=es(.1),a,o,l;typeof e!="function"&&(e=es(e==null?0:+e));function i(f){for(var m=0,h=a.length,g;m<h;++m)g=a[m],g.vx+=(l[m]-g.x)*o[m]*f}function d(){if(a){var f,m=a.length;for(o=new Array(m),l=new Array(m),f=0;f<m;++f)o[f]=isNaN(l[f]=+e(a[f],f,a))?0:+t(a[f],f,a)}}return i.initialize=function(f){a=f,d()},i.strength=function(f){return arguments.length?(t=typeof f=="function"?f:es(+f),d(),i):t},i.x=function(f){return arguments.length?(e=typeof f=="function"?f:es(+f),d(),i):e},i}function h8(e){var t=es(.1),a,o,l;typeof e!="function"&&(e=es(e==null?0:+e));function i(f){for(var m=0,h=a.length,g;m<h;++m)g=a[m],g.vy+=(l[m]-g.y)*o[m]*f}function d(){if(a){var f,m=a.length;for(o=new Array(m),l=new Array(m),f=0;f<m;++f)o[f]=isNaN(l[f]=+e(a[f],f,a))?0:+t(a[f],f,a)}}return i.initialize=function(f){a=f,d()},i.strength=function(f){return arguments.length?(t=typeof f=="function"?f:es(+f),d(),i):t},i.y=function(f){return arguments.length?(e=typeof f=="function"?f:es(+f),d(),i):e},i}const $s={agent:"#a78bfa",memory:"#38bdf8",thread:"#34d399",task:"#fbbf24",routine:"#f472b6",agentlink:"#c084fc",hub:"#94a3b8"};function zk(e){return{agent:u("agents_ui.kind_agent"),memory:u("agents_ui.kind_memory"),thread:u("agents_ui.kind_thread"),task:u("agents_ui.kind_task"),routine:u("agents_ui.kind_routine"),agentlink:u("agents_ui.kind_hierarchy")}[e]??e}const Dk={core:24,hub:12,leaf:6},Lr=e=>e.role??"leaf",Pk=(e,t,a)=>Math.max(t,Math.min(a,e)),Lk=e=>{const t=new Map;for(const a of e)t.set(a.id,a);return[...t.values()]},x8=(e,t=26)=>e.length>t?`${e.slice(0,t)}…`:e;function sE({nodes:e,edges:t,height:a=520,onNodeClick:o,toolbar:l}){const d=Math.round(1e3*a/760),f=x.useRef(null),m=x.useRef(null),h=x.useRef(null),g=x.useRef([]),b=x.useRef([]),_=x.useRef(null),k=x.useRef(null),N=x.useRef(null),y=x.useRef(!1),w=x.useRef({tx:0,ty:0,k:1}),E=x.useRef(()=>{}),[,j]=x.useState(0),[S,R]=x.useState(null),[A,T]=x.useState(!1),O=1e3/2,M=d/2,B=()=>j(W=>W+1),P=e.length>44;x.useEffect(()=>{const W=Math.min(1e3,d)*.3,ne=e.filter(_e=>Lr(_e)==="hub"),ve=new Map;ne.forEach((_e,xe)=>ve.set(_e.id,xe/Math.max(1,ne.length)*Math.PI*2-Math.PI/2));const oe=e.map((_e,xe)=>{const Re=Lr(_e);if(Re==="core")return{..._e,x:O,y:M,fx:O,fy:M};const Oe=ve.get(_e.id)??xe/Math.max(1,e.length)*Math.PI*2,Pe=Re==="hub"?W:W*1.7;return{..._e,x:O+Math.cos(Oe)*Pe,y:M+Math.sin(Oe)*Pe}}),fe=new Map(oe.map(_e=>[_e.id,_e])),we=t.map(_e=>({source:fe.get(_e.source),target:fe.get(_e.target)})).filter(_e=>!!_e.source&&!!_e.target);g.current=oe,b.current=we,B();const Ce=_e=>{const xe=Lr(_e.source),Re=Lr(_e.target);return xe==="core"||Re==="core"?170:xe==="hub"&&Re==="hub"?130:58},Le=_e=>{const xe=Lr(_e);return xe==="core"?-700:xe==="hub"?-360:-90},$e=p8(oe).force("link",ZL(we).distance(Ce).strength(.5)).force("charge",m8().strength(Le)).force("center",AL(O,M).strength(.03)).force("x",g8(O).strength(.02)).force("y",h8(M).strength(.02)).force("collide",QL(_e=>Dk[Lr(_e)]+8)).alphaDecay(.025).on("tick",B);h.current=$e;const Ee=setTimeout(()=>E.current(),1400);return()=>{clearTimeout(Ee),$e.stop()}},[e,t,a]);const $=(W,ne)=>{const ve=m.current.getBoundingClientRect();return{x:(W-ve.left)/ve.width*1e3,y:(ne-ve.top)/ve.height*d}},D=(W,ne,ve)=>{const oe=w.current,fe=Pk(oe.k*ve,.25,8);w.current={k:fe,tx:W-(W-oe.tx)*(fe/oe.k),ty:ne-(ne-oe.ty)*(fe/oe.k)},B()};E.current=()=>{const W=g.current.filter(xe=>xe.x!=null&&xe.y!=null);if(!W.length)return;let ne=1/0,ve=1/0,oe=-1/0,fe=-1/0;for(const xe of W)ne=Math.min(ne,xe.x),ve=Math.min(ve,xe.y),oe=Math.max(oe,xe.x),fe=Math.max(fe,xe.y);const we=60,Ce=Math.max(1,oe-ne),Le=Math.max(1,fe-ve),$e=Pk(Math.min((1e3-we*2)/Ce,(d-we*2)/Le),.25,2.5),Ee=(ne+oe)/2,_e=(ve+fe)/2;w.current={k:$e,tx:1e3/2-Ee*$e,ty:d/2-_e*$e},B()},x.useEffect(()=>{const W=m.current;if(!W)return;const ne=ve=>{ve.preventDefault();const oe=$(ve.clientX,ve.clientY);D(oe.x,oe.y,ve.deltaY>0?.9:1.1)};return W.addEventListener("wheel",ne,{passive:!1}),()=>W.removeEventListener("wheel",ne)},[]),x.useEffect(()=>{if(!A)return;const W=ne=>{ne.key==="Escape"&&T(!1)};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[A]);const L=(W,ne)=>{const ve=$(W,ne),oe=w.current;return{x:(ve.x-oe.tx)/oe.k,y:(ve.y-oe.ty)/oe.k}},H=W=>ne=>{Lr(W)!=="core"&&(ne.stopPropagation(),_.current=W,N.current={x:ne.clientX,y:ne.clientY},y.current=!1,ne.target.setPointerCapture?.(ne.pointerId),h.current?.alphaTarget(.3).restart())},V=W=>{k.current={x:W.clientX,y:W.clientY},W.currentTarget.setPointerCapture?.(W.pointerId)},U=W=>{if(_.current){const ne=N.current;ne&&!y.current&&Math.hypot(W.clientX-ne.x,W.clientY-ne.y)>4&&(y.current=!0);const ve=L(W.clientX,W.clientY);_.current.fx=ve.x,_.current.fy=ve.y;return}if(k.current){const ne=m.current.getBoundingClientRect();w.current.tx+=(W.clientX-k.current.x)/ne.width*1e3,w.current.ty+=(W.clientY-k.current.y)/ne.height*d,k.current={x:W.clientX,y:W.clientY},B()}},F=()=>{const W=_.current;W&&(W.fx=null,W.fy=null),_.current=null,k.current=null,h.current?.alphaTarget(0)},X=W=>()=>{y.current||J(W)},G=g.current,Y=b.current,I=w.current,Q=[...new Set(e.map(W=>W.kind))].filter(W=>W!=="agent"&&W!=="hub"),J=W=>{R(W),o?.(W)},K=S?Lk(Y.filter(W=>W.target.id===S.id).map(W=>W.source)):[],se=S?Lk(Y.filter(W=>W.source.id===S.id).map(W=>W.target)):[],te=S?.detail&&S.detail.trim()!==S.label.trim()?S.detail:null,le=({onClick:W,title:ne,children:ve})=>n.jsx("button",{type:"button",title:ne,onClick:W,className:"grid size-7 place-items-center rounded-md border border-border bg-card/80 text-muted-fg backdrop-blur hover:text-foreground",children:ve});return n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{ref:f,className:A?"fixed inset-0 z-[60] flex flex-col gap-3 bg-background p-4":"relative",children:[n.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden rounded-xl border border-border bg-gradient-to-b from-background to-muted/20",children:[n.jsxs("div",{className:"absolute right-2 top-2 z-10 flex items-center gap-1.5",children:[l,n.jsx(le,{onClick:()=>D(O,M,1.2),title:u("agents_ui.brain_zoom_in"),children:n.jsx(Pt,{size:14})}),n.jsx(le,{onClick:()=>D(O,M,.83),title:u("agents_ui.brain_zoom_out"),children:n.jsx(fM,{size:14})}),n.jsx(le,{onClick:()=>E.current(),title:u("agents_ui.brain_fit"),children:n.jsx(JA,{size:14})}),n.jsx(le,{onClick:()=>T(W=>!W),title:u(A?"agents_ui.brain_exit_fs":"agents_ui.brain_fullscreen"),children:A?n.jsx(dM,{size:14}):n.jsx(uM,{size:14})})]}),n.jsxs("svg",{ref:m,viewBox:`0 0 1000 ${d}`,preserveAspectRatio:"xMidYMid meet",style:A?{height:"100%",width:"100%"}:{height:a},className:"w-full touch-none select-none",onPointerMove:U,onPointerUp:F,onPointerLeave:F,children:[n.jsxs("defs",{children:[n.jsxs("filter",{id:"brain-glow",x:"-80%",y:"-80%",width:"260%",height:"260%",children:[n.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),n.jsxs("feMerge",{children:[n.jsx("feMergeNode",{in:"blur"}),n.jsx("feMergeNode",{in:"SourceGraphic"})]})]}),n.jsxs("radialGradient",{id:"brain-core",cx:"50%",cy:"50%",r:"50%",children:[n.jsx("stop",{offset:"0%",stopColor:$s.agent,stopOpacity:"0.9"}),n.jsx("stop",{offset:"55%",stopColor:$s.agent,stopOpacity:"0.35"}),n.jsx("stop",{offset:"100%",stopColor:$s.agent,stopOpacity:"0"})]}),n.jsxs("radialGradient",{id:"brain-bg",cx:"50%",cy:"50%",r:"60%",children:[n.jsx("stop",{offset:"0%",stopColor:$s.agent,stopOpacity:"0.10"}),n.jsx("stop",{offset:"100%",stopColor:$s.agent,stopOpacity:"0"})]})]}),n.jsx("rect",{x:0,y:0,width:1e3,height:d,fill:"url(#brain-bg)",onPointerDown:V,className:"cursor-grab active:cursor-grabbing"}),n.jsxs("g",{transform:`translate(${I.tx},${I.ty}) scale(${I.k})`,children:[Y.map((W,ne)=>{const ve=$s[W.target.kind==="hub"?W.source.kind:W.target.kind],oe=1.4+ne%5*.35;return n.jsxs("g",{children:[n.jsx("line",{x1:W.source.x,y1:W.source.y,x2:W.target.x,y2:W.target.y,stroke:ve,strokeOpacity:.16,strokeWidth:1.4}),n.jsx("line",{x1:W.target.x,y1:W.target.y,x2:W.source.x,y2:W.source.y,stroke:ve,strokeOpacity:.5,strokeWidth:2,strokeLinecap:"round",strokeDasharray:"1 14",children:n.jsx("animate",{attributeName:"stroke-dashoffset",values:"15;0",dur:`${oe}s`,repeatCount:"indefinite"})})]},ne)}),G.map((W,ne)=>{const ve=Lr(W),oe=$s[W.kind];if(ve==="core"){const _e=W.emoji&&W.emoji.trim()||W.label.slice(0,2).toUpperCase();return n.jsxs("g",{transform:`translate(${W.x},${W.y})`,children:[n.jsxs("circle",{r:54,fill:"url(#brain-core)",children:[n.jsx("animate",{attributeName:"r",values:"50;58;50",dur:"4s",repeatCount:"indefinite"}),n.jsx("animate",{attributeName:"opacity",values:"0.85;1;0.85",dur:"4s",repeatCount:"indefinite"})]}),n.jsxs("circle",{r:26,fill:"none",stroke:$s.agent,strokeWidth:1.5,opacity:.5,children:[n.jsx("animate",{attributeName:"r",values:"26;48",dur:"3.2s",repeatCount:"indefinite"}),n.jsx("animate",{attributeName:"opacity",values:"0.5;0",dur:"3.2s",repeatCount:"indefinite"})]}),n.jsx("circle",{r:24,fill:$s.agent,filter:"url(#brain-glow)"}),n.jsx("circle",{r:24,fill:"none",stroke:"#ffffff",strokeOpacity:.35,strokeWidth:1}),n.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fontSize:_e.length<=2?20:11,fontWeight:700,fill:"#1a1030",children:_e.length>8?_e.slice(0,8):_e})]},W.id)}const fe=S?.id===W.id,we=Dk[ve]+(fe?3:0),Ce=2.4+ne%6*.4,Le=`${ne%6*.3}s`,$e=ve==="hub",Ee=$e||fe||!P;return n.jsxs("g",{transform:`translate(${W.x},${W.y})`,className:"cursor-grab active:cursor-grabbing",onPointerDown:H(W),onClick:X(W),children:[n.jsxs("circle",{r:we,fill:oe,filter:"url(#brain-glow)",opacity:.3,children:[n.jsx("animate",{attributeName:"r",values:`${we};${we+6};${we}`,dur:`${Ce}s`,begin:Le,repeatCount:"indefinite"}),n.jsx("animate",{attributeName:"opacity",values:"0.32;0.08;0.32",dur:`${Ce}s`,begin:Le,repeatCount:"indefinite"})]}),n.jsx("circle",{r:we,fill:oe,fillOpacity:fe?1:.95,stroke:fe?"#fff":"#ffffff",strokeOpacity:fe?1:.25,strokeWidth:fe?2:1}),W.emoji&&$e&&n.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fontSize:11,style:{pointerEvents:"none"},children:W.emoji}),Ee&&n.jsx("text",{x:we+4,y:4,fontSize:$e?11:10,className:$e?"fill-foreground font-medium":"fill-foreground/80",style:{pointerEvents:"none"},children:W.label.length>22?`${W.label.slice(0,22)}…`:W.label})]},W.id)})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-[11px] text-muted-fg",children:[Q.map(W=>n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx("span",{className:"size-2 rounded-full",style:{background:$s[W]}})," ",zk(W)]},W)),n.jsxs("span",{className:"ml-auto",children:[u("agents_ui.brain_pan_hint")," · ",u("agents_ui.nodes_drag_hint",{n:String(e.length)})]})]})]}),S&&n.jsxs("div",{className:"space-y-2.5 rounded-lg border border-border bg-card p-3 text-xs",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"size-2.5 rounded-full",style:{background:$s[S.kind]}}),S.emoji&&n.jsx("span",{className:"text-sm leading-none",children:S.emoji}),n.jsx("span",{className:"text-[13px] font-semibold",children:S.label}),n.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-fg",children:zk(S.kind)}),S.relation&&n.jsxs("span",{className:"text-muted-fg",children:["· ",S.relation]}),n.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[S.slug&&o&&n.jsx("button",{type:"button",onClick:()=>o(S),className:"text-primary hover:underline",children:u("agents_ui.brain_open")}),n.jsx("button",{type:"button",onClick:()=>R(null),className:"text-muted-fg hover:text-foreground",children:"✕"})]})]}),te&&n.jsx("p",{className:"whitespace-pre-wrap text-muted-fg",children:te}),K.length>0&&n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-fg/70",children:u("agents_ui.brain_part_of")}),K.map(W=>n.jsx(Ik,{node:W,onClick:()=>R(W)},W.id))]}),se.length>0&&n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsxs("span",{className:"text-[10px] uppercase tracking-wide text-muted-fg/70",children:[u("agents_ui.brain_branches")," · ",se.length]}),se.map(W=>n.jsx(Ik,{node:W,onClick:()=>R(W)},W.id))]})]})]})}function Ik({node:e,onClick:t}){return n.jsxs("button",{type:"button",onClick:t,className:"inline-flex max-w-[220px] items-center gap-1 rounded-md border border-border bg-muted/40 px-1.5 py-0.5 text-[11px] hover:border-muted-fg/50 hover:bg-muted",children:[n.jsx("span",{className:"size-1.5 shrink-0 rounded-full",style:{background:$s[e.kind]}}),e.emoji&&n.jsx("span",{className:"leading-none",children:e.emoji}),n.jsx("span",{className:"truncate",children:x8(e.label,28)})]})}function Bk({pid:e}){const t=Pn(),a=He(`/projects/${e}/tasks?state=open`,()=>Xn.list(e),{refreshInterval:2e4}),o=He(`/projects/${e}/tasks-summary`,()=>Xn.summary(e),{refreshInterval:2e4}),l=He(`/projects/${e}/routines`,()=>Br.list(e)),i=He(`/projects/${e}/agents`,()=>an.list(e)),d=He(`/projects/${e}/mcps`,()=>$r.list(e)),f=He(`/projects/${e}/artifacts`,()=>Ws.list(e)),m=i.data??[],h=m.filter(y=>y.is_master||y.type==="orchestrator"),g=m.filter(y=>!(y.is_master||y.type==="orchestrator")),b=b8(m),_=b.some(y=>y.area),k=(l.data??[]).filter(y=>y.enabled).length,N=[...a.data??[]].sort((y,w)=>(w.created_at||"").localeCompare(y.created_at||"")).slice(0,6);return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[n.jsx(wo,{title:u("project.overview.agents"),value:m.length,href:`/p/${e}/agents`,icon:rn}),n.jsx(wo,{title:u("project.overview.tasks_open"),value:o.data?.open??a.data?.length??"…",href:`/p/${e}/tasks`,icon:hi}),n.jsx(wo,{title:u("project.overview.routines_active"),value:k,href:`/p/${e}/routines`,icon:Mo}),n.jsx(wo,{title:u("project.overview.artifacts"),value:f.data?.length??"…",href:`/p/${e}/artifacts`,icon:xb})]}),o.data&&n.jsx("div",{className:"flex flex-wrap gap-2",children:QN.map(y=>n.jsxs(mf,{to:`/p/${e}/tasks`,className:"flex items-center gap-1.5 rounded-lg border border-border bg-card px-3 py-1.5 text-xs hover:bg-accent/40",children:[n.jsx(Lf,{status:y,className:"size-3.5"}),n.jsx("span",{className:"capitalize text-muted-foreground",children:B_(y)}),n.jsx("span",{className:"font-semibold",children:o.data.status?.[y]??0})]},y))}),n.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[n.jsx(Ye,{title:u("project.overview.roster"),className:"!p-4",children:m.length===0?n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.overview.no_agents")}):_?n.jsx("div",{className:"space-y-3",children:b.map(y=>n.jsx(Ch,{label:y.area||u("agents_ui.uncategorized"),icon:fb,agents:y.agents,pid:e,navigate:t},y.area??"__none"))}):n.jsxs("div",{className:"space-y-3",children:[h.length>0&&n.jsx(Ch,{label:u("project.overview.orchestrators"),icon:ba,agents:h,pid:e,navigate:t}),g.length>0&&n.jsx(Ch,{label:u("project.overview.specialists"),icon:rn,agents:g,pid:e,navigate:t})]})}),n.jsx(Ye,{title:u("project.overview.recent_tasks"),className:"!p-4",action:n.jsx(mf,{to:`/p/${e}/tasks`,className:"text-xs text-sky-500 hover:text-sky-400",children:u("common.view_all")}),children:N.length===0?n.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-fg",children:[n.jsx(Kf,{className:"size-4"}),u("project.overview.no_activity")]}):n.jsx("ul",{className:"space-y-1.5",children:N.map(y=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>t(`/p/${e}/tasks?task=${y.id}`),className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left hover:bg-accent/40",children:[n.jsx(Lf,{status:Pf(y),className:"size-3.5 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:y.title}),n.jsx($_,{status:Pf(y)})]})},y.id))})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:[n.jsx(wo,{title:u("project.overview.chat"),value:u("project.overview.chat_value"),href:`/p/${e}/chat`,icon:Wf}),n.jsx(wo,{title:u("project.overview.mcps"),value:d.data?.length??"…",href:`/p/${e}/mcps`,icon:Zf}),n.jsx(wo,{title:u("project.overview.routines"),value:l.data?.length??"…",href:`/p/${e}/routines`,icon:Mo})]}),m.length>0&&n.jsx(Ye,{title:u("project.overview.brain_title"),description:u("project.overview.brain_desc"),className:"!p-4",children:n.jsx(v8,{pid:e,agents:m,routines:l.data??[],navigate:t})})]})}function b8(e){const t=new Map;for(const a of e){const o=a.area||null;t.has(o)||t.set(o,[]),t.get(o).push(a)}return[...t.entries()].sort(([a],[o])=>a===null?1:o===null?-1:a.localeCompare(o)).map(([a,o])=>({area:a,agents:o}))}function _8(e){return e.split(`
|
|
783
|
-
`).map(t=>t.replace(/^[-*#>\s]+/,"").trim()).filter(t=>t.length>2&&!t.startsWith("```")).slice(0,5)}function v8({pid:e,agents:t,routines:a,navigate:o}){const[l,i]=x.useState(!1),d=He(l?`/team-brain/${e}/${t.map(b=>b.slug).join(",")}`:null,async()=>{const b=await Xn.list(e,"all"),_=await Promise.all(t.map(async k=>{const[N,y]=await Promise.all([an.get(e,k.slug).catch(()=>null),Xr.list(e,k.slug).catch(()=>[])]);return[k.slug,{memory:N?.memory||"",threads:(y||[]).slice(0,4).map(w=>({title:w.title||w.filename,id:w.id}))}]}));return{tasks:b,perAgent:Object.fromEntries(_)}}),f=l&&!!d.data,{nodes:m,edges:h}=x.useMemo(()=>{const b=[],_=[],k="__root";b.push({id:k,label:u("project.overview.brain_core"),kind:"agent",role:"core",emoji:"🧠"});const N=new Set(t.map(w=>w.slug)),y=w=>t.some(E=>E.parent===w);for(const w of t){const E=!!w.is_master||w.type==="orchestrator";b.push({id:w.slug,label:w.slug,slug:w.slug,kind:E?"agent":"agentlink",role:f||E||y(w.slug)?"hub":"leaf",emoji:w.emoji||void 0,relation:w.role||u(E?"project.agents.orchestrator":"project.overview.specialists"),detail:w.description||void 0})}for(const w of t){const E=w.parent&&N.has(w.parent)?w.parent:k;_.push({source:E,target:w.slug})}if(f&&d.data){const{tasks:w,perAgent:E}=d.data,j=(S,R,A,T,O)=>{b.push({id:S,label:R,kind:A,detail:O}),_.push({source:T,target:S})};for(const S of t){const R=E[S.slug];_8(R?.memory||"").forEach((A,T)=>j(`${S.slug}:m${T}`,A,"memory",S.slug,A)),(R?.threads||[]).forEach((A,T)=>j(`${S.slug}:th${T}`,A.title,"thread",S.slug)),w.filter(A=>A.agent===S.slug).slice(0,4).forEach((A,T)=>j(`${S.slug}:ts${T}`,A.title,"task",S.slug,A.body||void 0)),a.filter(A=>A.spec?.agent===S.slug).slice(0,2).forEach((A,T)=>j(`${S.slug}:rt${T}`,A.name,"routine",S.slug,`schedule: ${A.schedule}`))}}return{nodes:b,edges:_}},[t,a,f,d.data]),g=n.jsxs("button",{type:"button",onClick:()=>i(b=>!b),className:ge("inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] font-medium backdrop-blur transition-colors",l?"border-primary/40 bg-primary/15 text-foreground":"border-border bg-card/80 text-muted-fg hover:text-foreground"),children:[n.jsx(Uc,{className:ge("size-3.5",d.isLoading&&"animate-pulse")}),u(l?"agents_ui.brain_collapse":"agents_ui.brain_expand")]});return n.jsx(sE,{nodes:m,edges:h,height:620,toolbar:g,onNodeClick:b=>{b.slug&&o(`/p/${e}/agents/${b.slug}`)}})}function Ch({label:e,icon:t,agents:a,pid:o,navigate:l}){return n.jsxs("div",{children:[n.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[n.jsx(t,{className:"size-3.5"}),e," (",a.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(i=>n.jsxs("button",{type:"button",onClick:()=>l(`/p/${o}/agents/${i.slug}`),className:ge("inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-2 py-1 text-xs hover:border-muted-fg/50"),children:[n.jsx("span",{className:"text-sm leading-none",children:i.emoji||"🤖"}),n.jsx("span",{className:"truncate",children:i.slug}),i.role&&n.jsxs("span",{className:"truncate text-[10px] text-muted-fg",children:["· ",i.role]})]},i.slug))})]})}function wo({title:e,value:t,href:a,icon:o}){return n.jsxs(mf,{to:a,className:"flex items-center gap-3 rounded-xl border border-border bg-card p-4 hover:bg-accent/40",children:[n.jsx("span",{className:"grid size-10 place-items-center rounded-lg bg-muted text-muted-fg",children:n.jsx(o,{size:20})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),n.jsx("div",{className:"text-2xl font-semibold",children:t})]})]})}function y8(){const e=Pn(),{projects:t,isLoading:a}=uu();return n.jsxs(Ye,{title:u("base.workspaces_title"),description:u("base.workspaces_desc"),action:n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>e("/p/0/workspaces?action=add-project"),children:[n.jsx(Pt,{size:14})," ",u("base.workspaces_new")]}),children:[a&&n.jsx(rt,{}),!a&&t.length===0&&n.jsx(pt,{children:u("base.workspaces_empty")}),n.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(o=>{const l=String(o.id)==="0",i=l?u("base.title"):o.name||o.path.split("/").pop()||String(o.id);return n.jsxs("button",{type:"button",onClick:()=>e(`/p/${o.id}`),className:"flex cursor-pointer flex-col gap-2 rounded-xl border border-border bg-card p-4 text-left transition-colors hover:border-muted-fg/50",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(K2,{className:"size-4 text-muted-fg"}),n.jsx("span",{className:"truncate text-sm font-semibold",children:i}),n.jsx(Ve,{tone:l?"success":"info",children:l?u("base.title"):kN(o.kind)})]}),n.jsx("p",{className:"truncate font-mono text-[10px] text-muted-fg",children:o.path})]},o.id)})})]})}const aE=x.createContext(null),rE=x.createContext(null);function wa(){const e=x.useContext(aE);if(e===null)throw new Error(cn(60));return e}function oE(){const e=x.useContext(rE);if(e===null)throw new Error(cn(61));return e}const j8=(e,t)=>Object.is(e,t);function $o(e,t,a){return e==null||t==null?Object.is(e,t):a(e,t)}function k8(e,t,a){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:$o(t,o,a))}function Lc(e,t,a){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:$o(o,t,a))}function w8(e,t,a){return e.filter(o=>!$o(t,o,a))}function Yx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function lE(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function S8(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(lE(t)){for(const a of t)for(const o of a.items)if(o&&o.value==null&&o.label!=null)return!0;return!1}for(const a of t)if(a&&a.value==null&&a.label!=null)return!0;return!1}function iE(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Yx(e)}function No(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Yx(e.value):Yx(e)}function cE(e,t,a){function o(){return iE(e,a)}if(a&&e!=null)return a(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const l=t,i=lE(l)?l.flatMap(d=>d.items):l;if(e==null||typeof e!="object"){const d=i.find(f=>f.value===e);return d&&d.label!=null?d.label:o()}if("value"in e){const d=i.find(f=>f&&f.value===e.value);if(d&&d.label!=null)return d.label}}return o()}function C8(e,t,a){return e.reduce((o,l,i)=>(i>0&&o.push(", "),o.push(n.jsx(x.Fragment,{children:cE(l,t,a)},i)),o),[])}const et={id:Me(e=>e.id),labelId:Me(e=>e.labelId),modal:Me(e=>e.modal),multiple:Me(e=>e.multiple),items:Me(e=>e.items),itemToStringLabel:Me(e=>e.itemToStringLabel),itemToStringValue:Me(e=>e.itemToStringValue),isItemEqualToValue:Me(e=>e.isItemEqualToValue),value:Me(e=>e.value),hasSelectedValue:Me(e=>{const{value:t,multiple:a,itemToStringValue:o}=e;return t==null?!1:a&&Array.isArray(t)?t.length>0:No(t,o)!==""}),hasNullItemLabel:Me((e,t)=>t?S8(e.items):!1),open:Me(e=>e.open),mounted:Me(e=>e.mounted),forceMount:Me(e=>e.forceMount),transitionStatus:Me(e=>e.transitionStatus),openMethod:Me(e=>e.openMethod),activeIndex:Me(e=>e.activeIndex),selectedIndex:Me(e=>e.selectedIndex),isActive:Me((e,t)=>e.activeIndex===t),isSelected:Me((e,t)=>{const a=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(l=>$o(t,l,a)):$o(t,o,a)}),isSelectedByFocus:Me((e,t)=>e.selectedIndex===t),popupProps:Me(e=>e.popupProps),triggerProps:Me(e=>e.triggerProps),triggerElement:Me(e=>e.triggerElement),positionerElement:Me(e=>e.positionerElement),listElement:Me(e=>e.listElement),popupSide:Me(e=>e.popupSide),scrollUpArrowVisible:Me(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Me(e=>e.scrollDownArrowVisible),hasScrollArrows:Me(e=>e.hasScrollArrows)};function N8(e,t,a=(o,l)=>o===l){return e.length===t.length&&e.every((o,l)=>a(o,t[l]))}function Tc(e,t=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,a))}const Zs=1;function q_(e,t){return Math.max(0,e-t)}function $f(e,t){if(t<=0)return 0;const a=Tc(e,0,t),o=a,l=t-a,i=o<=Zs,d=l<=Zs;return i&&d?o<=l?0:t:i?0:d?t:a}function E8(e){const{id:t,value:a,defaultValue:o=null,onValueChange:l,open:i,defaultOpen:d=!1,onOpenChange:f,name:m,form:h,autoComplete:g,disabled:b=!1,readOnly:_=!1,required:k=!1,modal:N=!0,actionsRef:y,inputRef:w,onOpenChangeComplete:E,items:j,multiple:S=!1,itemToStringLabel:R,itemToStringValue:A,isItemEqualToValue:T=j8,highlightItemOnHover:O=!0,children:M}=e,{clearErrors:B}=O_(),{setDirty:P,setTouched:$,setFocused:D,validityData:L,setFilled:H,name:V,disabled:U,validation:F,validationMode:X}=pu(),G=Tp({id:t}),Y=U||b,I=V??m,[Q,J]=oi({controlled:a,default:S?o??ar:o,name:"Select",state:"value"}),[K,se]=oi({controlled:i,default:d,name:"Select",state:"open"}),te=x.useRef([]),le=x.useRef([]),W=x.useRef(null),ne=x.useRef(null),ve=x.useRef(0),oe=x.useRef(null),fe=x.useRef([]),we=x.useRef(!1),Ce=x.useRef(null),Le=x.useRef(null),$e=x.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=x.useRef(!1),{mounted:_e,setMounted:xe,transitionStatus:Re}=_i(K),{openMethod:Oe,triggerProps:Pe}=aN(K),Be=ns(()=>new fC({id:G,labelId:void 0,modal:N,multiple:S,itemToStringLabel:R,itemToStringValue:A,isItemEqualToValue:T,value:Q,open:K,mounted:_e,transitionStatus:Re,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,me=nt(Be,et.activeIndex),Se=nt(Be,et.selectedIndex),Ge=nt(Be,et.triggerElement),Ae=nt(Be,et.positionerElement),ze=R6(Oe),tt=Oe??ze??null,ot=x.useMemo(()=>S?"":No(Q,A),[S,Q,A]),vt=x.useMemo(()=>S&&Array.isArray(Q)?Q.map(dt=>No(dt,A)):No(Q,A),[S,Q,A]),Mt=pn(Be.state.triggerElement),lt=Ue(()=>vt);z_(Mt,G,Q,lt,!Y,m);const Rt=x.useRef(Q),je=S?Array.isArray(Q)&&Q.length>0:Q!=null&&No(Q,A)!=="";De(()=>{Q!==Rt.current&&Be.set("forceMount",!0)},[Be,Q]),De(()=>{H(je)},[je,H]),De(function(){const $t=fe.current;let hn;if(S){const Rn=Array.isArray(Q)?Q:[];if(Rn.length===0)hn=null;else{const Sn=Rn[Rn.length-1],Gt=Lc($t,Sn,T);hn=Gt===-1?null:Gt}}else{const Rn=Lc($t,Q,T);hn=Rn===-1?null:Rn}hn===null&&(Le.current=null),!K&&Be.set("selectedIndex",hn)},[je,S,K,Q,fe,T,Be,Le]);function Ie(dt){const $t=L.initialValue;return Array.isArray(dt)&&Array.isArray($t)?!N8(dt,$t,(hn,Rn)=>$o(hn,Rn,T)):dt!==$t}__(Q,()=>{B(I),P(Ie(Q)),F.change(Q)});const Xe=Ue((dt,$t)=>{f?.(dt,$t),!$t.isCanceled&&(se(dt),!dt&&($t.reason===zo||$t.reason===up)&&($(!0),D(!1),X==="onBlur"&&F.commit(Q)))}),it=Ue(()=>{xe(!1),Be.update({activeIndex:null,openMethod:null}),E?.(!1)});ka({enabled:!y,open:K,ref:W,onComplete(){K||it()}}),x.useImperativeHandle(y,()=>({unmount:it}),[it]);const Qe=Ue((dt,$t)=>{l?.(dt,$t),!$t.isCanceled&&J(dt)}),mt=Ue(()=>{const dt=Be.state.listElement||W.current;if(!dt)return;const $t=q_(dt.scrollHeight,dt.clientHeight),hn=$f(dt.scrollTop,$t),Rn=hn>0,Sn=hn<$t;Be.state.scrollUpArrowVisible!==Rn&&Be.set("scrollUpArrowVisible",Rn),Be.state.scrollDownArrowVisible!==Sn&&Be.set("scrollDownArrowVisible",Sn)}),Ot=yC({open:K,onOpenChange:Xe,elements:{reference:Ge,floating:Ae}}),Jt=nC(Ot,{enabled:!_&&!Y,event:"mousedown"}),Wt=pp(Ot),en=CC(Ot,{enabled:!_&&!Y,listRef:te,activeIndex:me,selectedIndex:Se,disabledIndices:ar,onNavigate(dt){dt===null&&!K||Be.set("activeIndex",dt)},focusItemOnHover:O}),mn=NC(Ot,{enabled:!_&&!Y&&(K||!S),listRef:le,activeIndex:me,selectedIndex:Se,disabledIndices:dt=>iN(te.current[dt]),onMatch(dt){K?Be.set("activeIndex",dt):Qe(fe.current[dt],st("none"))},onTyping(dt){we.current=dt}}),rs=x.useMemo(()=>{const dt=Qn(mn.reference,en.reference,Wt.reference,Jt.reference,Pe);return G&&(dt.id=G),dt},[Jt.reference,mn.reference,en.reference,Wt.reference,Pe,G]),hs=x.useMemo(()=>Qn(xp,mn.floating,en.floating,Wt.floating),[mn.floating,en.floating,Wt.floating]),Es=en.item??Xt;e_(()=>{Be.update({popupProps:hs,triggerProps:rs})}),De(()=>{Be.update({id:G,modal:N,multiple:S,value:Q,open:K,mounted:_e,transitionStatus:Re,popupProps:hs,triggerProps:rs,items:j,itemToStringLabel:R,itemToStringValue:A,isItemEqualToValue:T,openMethod:tt})},[Be,G,N,S,Q,K,_e,Re,hs,rs,j,R,A,T,tt]);const gn=x.useMemo(()=>({store:Be,name:I,required:k,disabled:Y,readOnly:_,multiple:S,highlightItemOnHover:O,setValue:Qe,setOpen:Xe,listRef:te,popupRef:W,scrollHandlerRef:ne,handleScrollArrowVisibility:mt,scrollArrowsMountedCountRef:ve,itemProps:Es,valueRef:oe,valuesRef:fe,labelsRef:le,typingRef:we,selectionRef:$e,firstItemTextRef:Ce,selectedItemTextRef:Le,validation:F,onOpenChangeComplete:E,alignItemWithTriggerActiveRef:Ee,initialValueRef:Rt}),[Be,I,k,Y,_,S,O,Qe,Xe,Es,F,E,mt]),Rs=rr(w,F.inputRef),Sa=S&&Array.isArray(Q)&&Q.length>0,Gs=S?void 0:I,Ca=x.useMemo(()=>!S||!Array.isArray(Q)||!I?null:Q.map(dt=>{const $t=No(dt,A);return n.jsx("input",{type:"hidden",form:h,name:I,value:$t,disabled:Y},$t)}),[S,Q,h,I,A,Y]);return n.jsx(aE.Provider,{value:gn,children:n.jsxs(rE.Provider,{value:Ot,children:[M,n.jsx("input",{...F.getValidationProps(Y,{onFocus(){Be.state.triggerElement?.focus({focusVisible:!0})},onChange(dt){if(dt.nativeEvent.defaultPrevented||Y||_)return;const $t=dt.currentTarget.value,hn=st(va,dt.nativeEvent);function Rn(){if(S)return;const Sn=$t.toLowerCase();let Gt=fe.current.findIndex(oa=>No(oa,A).toLowerCase()===Sn||iE(oa,R).toLowerCase()===Sn);Gt===-1&&(Gt=fe.current.findIndex((oa,vi)=>{const mu=le.current[vi];return mu!=null&&mu.toLowerCase()===Sn}));const Ln=Gt===-1?void 0:fe.current[Gt];Ln!=null&&Qe(Ln,hn)}Be.set("forceMount",!0),queueMicrotask(Rn)}}),id:G&&Gs==null?`${G}-hidden-input`:void 0,form:h,name:Gs,autoComplete:g,value:ot,disabled:Y,required:k&&!Sa,readOnly:_,ref:Rs,style:I?ES:$b,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ca]})})}function R8(e,t){return e??t}const $d=2,T8=400,A8={...Mx,...M_,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},M8=x.forwardRef(function(t,a){const{render:o,className:l,id:i,disabled:d=!1,nativeButton:f=!0,style:m,...h}=t,{setTouched:g,setFocused:b,validationMode:_,state:k,disabled:N}=pu(),{labelId:y}=Rp(),{store:w,setOpen:E,selectionRef:j,validation:S,readOnly:R,required:A,alignItemWithTriggerActiveRef:T,disabled:O}=wa(),M=N||O||d,B=nt(w,et.open),P=nt(w,et.mounted),$=nt(w,et.value),D=nt(w,et.triggerProps),L=nt(w,et.positionerElement),H=nt(w,et.listElement),V=nt(w,et.popupSide),U=nt(w,et.id),F=nt(w,et.labelId),X=nt(w,et.hasSelectedValue),G=P&&L?V:null,Y=i??U,I=R8(y,F);Tp({id:Y});const Q=pn(L),J=x.useRef(null),{getButtonProps:K,buttonRef:se}=no({disabled:M,native:f}),te=Ue(we=>{w.set("triggerElement",we)}),le=En(),W=En(),ne=En();x.useEffect(()=>{if(B)return ne.start(T8,()=>{j.current.allowUnselectedMouseUp=!0,j.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};j.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},W.clear()},[B,j,W,ne]);const ve=Qn(D,{id:Y,role:"combobox","aria-expanded":B?"true":"false","aria-haspopup":"listbox","aria-controls":B?H?.id??xf(L)?.id:void 0,"aria-labelledby":I,"aria-readonly":R||void 0,"aria-required":A||void 0,tabIndex:M?-1:0,onFocus(we){b(!0),B&&T.current&&E(!1,st(va,we.nativeEvent)),le.start(0,()=>{w.set("forceMount",!0)})},onBlur(we){We(L,we.relatedTarget)||(g(!0),b(!1),_==="onBlur"&&S.commit($))},onMouseDown(we){if(B)return;const Ce=xt(we.currentTarget);function Le($e){if(!J.current)return;const Ee=$e.target;if(We(J.current,Ee)||We(Q.current,Ee))return;const _e=rN(J.current);$e.clientX>=_e.left-$d&&$e.clientX<=_e.right+$d&&$e.clientY>=_e.top-$d&&$e.clientY<=_e.bottom+$d||E(!1,st(jS,$e))}W.start(0,()=>{Ce.addEventListener("mouseup",Le,{once:!0})})}},h,K),oe=S.getValidationProps(M,ve);oe.role="combobox";const fe={...k,open:B,disabled:M,value:$,readOnly:R,popupSide:G,placeholder:!X};return Et("button",t,{ref:[a,J,se,te],state:fe,stateAttributesMapping:A8,props:oe})}),O8={value:()=>null},z8=x.forwardRef(function(t,a){const{className:o,render:l,children:i,placeholder:d,style:f,...m}=t,{store:h,valueRef:g}=wa(),b=nt(h,et.value),_=nt(h,et.items),k=nt(h,et.itemToStringLabel),N=nt(h,et.hasSelectedValue),y=!N&&d!=null&&i==null,w=nt(h,et.hasNullItemLabel,y),E={value:b,placeholder:!N};let j=null;return typeof i=="function"?j=i(b):i!=null?j=i:!N&&d!=null&&!w?j=d:Array.isArray(b)?j=C8(b,_,k):j=cE(b,_,k),Et("span",t,{state:E,ref:[a,g],props:[{children:j},m],stateAttributesMapping:O8})}),D8=x.forwardRef(function(t,a){const{render:o,className:l,style:i,...d}=t,{store:f}=wa(),h={open:nt(f,et.open)};return Et("span",t,{state:h,ref:a,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:RC})}),P8=x.createContext(void 0),L8=x.forwardRef(function(t,a){const{store:o}=wa(),l=nt(o,et.mounted),i=nt(o,et.forceMount);return l||i?n.jsx(P8.Provider,{value:!0,children:n.jsx(Xb,{ref:a,...t})}):null}),uE=x.createContext(void 0);function V_(){const e=x.useContext(uE);if(!e)throw new Error(cn(59));return e}function Uf(e,t){e&&Object.assign(e.style,t)}const dE={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},I8={position:"fixed"},B8=x.forwardRef(function(t,a){const{anchor:o,positionMethod:l="absolute",className:i,render:d,side:f="bottom",align:m="center",sideOffset:h=0,alignOffset:g=0,collisionBoundary:b="clipping-ancestors",collisionPadding:_,arrowPadding:k=5,sticky:N=!1,disableAnchorTracking:y,alignItemWithTrigger:w=!0,collisionAvoidance:E=YS,style:j,...S}=t,{store:R,listRef:A,labelsRef:T,alignItemWithTriggerActiveRef:O,selectedItemTextRef:M,valuesRef:B,initialValueRef:P,popupRef:$,setValue:D}=wa(),L=oE(),H=nt(R,et.open),V=nt(R,et.mounted),U=nt(R,et.modal),F=nt(R,et.value),X=nt(R,et.openMethod),G=nt(R,et.positionerElement),Y=nt(R,et.triggerElement),I=nt(R,et.isItemEqualToValue),Q=nt(R,et.transitionStatus),J=x.useRef(null),K=x.useRef(null),[se,te]=x.useState(w),le=V&&se&&X!=="touch";!V&&se!==w&&te(w),De(()=>{V||(et.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),et.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,V]),x.useImperativeHandle(O,()=>le),eN((le||U)&&H,X==="touch",G,Y);const W=d_({anchor:o,floatingRootContext:L,positionMethod:l,mounted:V,side:f,sideOffset:h,align:m,alignOffset:g,arrowPadding:k,collisionBoundary:b,collisionPadding:_,sticky:N,disableAnchorTracking:y??le,collisionAvoidance:E,keepMounted:!0}),ne=le?"none":W.side,ve=le?I8:W.positionerStyles,oe={open:H,side:ne,align:W.align,anchorHidden:W.anchorHidden};De(()=>{R.set("popupSide",W.side)},[R,W.side]);const fe=Ue(Ee=>{R.set("positionerElement",Ee)}),we=f_(t,oe,{styles:ve,transitionStatus:Q,props:S,refs:[a,fe],hidden:!V,inert:!H}),Ce=x.useRef(0),Le=Ue(Ee=>{if(Ee.size===0&&Ce.current===0||B.current.length===0)return;const _e=Ce.current;if(Ce.current=Ee.size,Ee.size===_e)return;const xe=st(va);if(_e!==0&&!R.state.multiple&&F!==null&&Lc(B.current,F,I)===-1){const Oe=P.current,Be=Oe!=null&&Lc(B.current,Oe,I)!==-1?Oe:null;D(Be,xe),Be===null&&(R.set("selectedIndex",null),M.current=null)}if(_e!==0&&R.state.multiple&&Array.isArray(F)){const Re=Pe=>Lc(B.current,Pe,I)!==-1,Oe=F.filter(Pe=>Re(Pe));(Oe.length!==F.length||Oe.some(Pe=>!k8(F,Pe,I)))&&(D(Oe,xe),Oe.length===0&&(R.set("selectedIndex",null),M.current=null))}if(H&&le){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Re={height:""};Uf(G,Re),Uf($.current,Re)}}),$e=x.useMemo(()=>({...W,side:ne,alignItemWithTriggerActive:le,setControlledAlignItemWithTrigger:te,scrollUpArrowRef:J,scrollDownArrowRef:K}),[W,ne,le,te]);return n.jsx(Cp,{elementsRef:A,labelsRef:T,onMapChange:Le,children:n.jsxs(uE.Provider,{value:$e,children:[V&&U&&n.jsx(b_,{inert:yp(!H),cutout:Y}),we]})})}),Ud="base-ui-disable-scrollbar",Kx={className:Ud,getElement(e){return n.jsx("style",{nonce:e,href:Ud,precedence:"base-ui:low",children:`.${Ud}{scrollbar-width:none}.${Ud}::-webkit-scrollbar{display:none}`})}},$8=x.createContext(void 0),U8={disableStyleElements:!1};function H8(){return x.useContext($8)??U8}const q8={...Yo,...ur},V8=x.forwardRef(function(t,a){const{render:o,className:l,style:i,finalFocus:d,...f}=t,{store:m,popupRef:h,onOpenChangeComplete:g,setOpen:b,valueRef:_,firstItemTextRef:k,selectedItemTextRef:N,multiple:y,handleScrollArrowVisibility:w,scrollHandlerRef:E,listRef:j,highlightItemOnHover:S}=wa(),{side:R,align:A,alignItemWithTriggerActive:T,isPositioned:O,setControlledAlignItemWithTrigger:M}=V_(),B=KC()!=null,P=oE(),$=_p(),{nonce:D,disableStyleElements:L}=H8(),H=nt(m,et.id),V=nt(m,et.open),U=nt(m,et.openMethod),F=nt(m,et.mounted),X=nt(m,et.popupProps),G=nt(m,et.transitionStatus),Y=nt(m,et.triggerElement),I=nt(m,et.positionerElement),Q=nt(m,et.listElement),J=x.useRef(!1),K=x.useRef(!1),se=x.useRef({}),te=si(),le=Ue(oe=>{if(!I||!h.current||!K.current)return;if(J.current||!T){w();return}const fe=I.style.top==="0px",we=I.style.bottom==="0px";if(!fe&&!we){w();return}const Ce=Uk(I),Le=Ac(I.getBoundingClientRect().height,"y",Ce),$e=xt(I),Ee=Qt(I),_e=Ee.getComputedStyle(I),xe=parseFloat(_e.marginTop),Re=parseFloat(_e.marginBottom),Oe=$k(Ee.getComputedStyle(h.current)),Pe=Math.min($e.documentElement.clientHeight-xe-Re,Oe),Be=oe.scrollTop,me=Hd(oe);let Se=0,Ge=null,Ae=!1,ze=!1;const tt=lt=>{I.style.height=`${lt}px`},ot=(lt,Rt)=>{const je=Tc(lt,0,Pe-Le);je>0&&tt(Le+je),oe.scrollTop=Rt,Pe-(Le+je)<=Zs&&(J.current=!0),w()},vt=fe?me-Be:Be,Mt=Math.min(Le+vt,Pe);if(Se=Mt,vt<=Zs){ot(vt,fe?me:0);return}if(Pe-Mt>Zs)fe?ze=!0:Ge=0;else if(Ae=!0,we&&Be<me){const lt=Le+vt-Pe;Ge=Be-(vt-lt)}if(Se=Math.ceil(Se),Se!==0&&tt(Se),ze||Ge!=null){const lt=Hd(oe),Rt=ze?lt:Tc(Ge,0,lt);Math.abs(oe.scrollTop-Rt)>Zs&&(oe.scrollTop=Rt)}(Ae||Se>=Pe-Zs)&&(J.current=!0),w()});x.useImperativeHandle(E,()=>le,[le]),ka({open:V,ref:h,onComplete(){V&&g?.(!0)}});const W={open:V,transitionStatus:G,side:R,align:A};De(()=>{!I||!h.current||Object.keys(se.current).length||(se.current={top:I.style.top||"0",left:I.style.left||"0",right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[h,I]),De(()=>{V||T||(K.current=!1,J.current=!1,Uf(I,se.current))},[V,T,I,h]),De(()=>{const oe=h.current;if(!V||!Y||!I||!oe||T&&!O||m.state.transitionStatus==="ending")return;if(!T){K.current=!0,te.request(w),oe.style.removeProperty("--transform-origin");return}const fe=F8(oe);oe.style.removeProperty("--transform-origin");try{let we=N.current;we?.isConnected||(we=!et.hasSelectedValue(m.state)&&k.current?.isConnected?k.current:null);const Ce=_.current,Le=Qt(I),$e=Le.getComputedStyle(I),Ee=Le.getComputedStyle(oe),_e=xt(Y),xe=Uk(Y),Re=qd(Y.getBoundingClientRect(),xe),Oe=qd(I.getBoundingClientRect(),xe),Pe=Re.height,Be=Q||oe,me=Be.scrollHeight,Se=parseFloat(Ee.borderBottomWidth),Ge=parseFloat($e.marginTop)||10,Ae=parseFloat($e.marginBottom)||10,ze=parseFloat($e.minHeight)||100,tt=$k(Ee),ot=5,vt=5,Mt=20,lt=_e.documentElement.clientHeight-Ge-Ae,Rt=_e.documentElement.clientWidth,je=lt-Re.bottom+Pe;let Ie,Xe=$==="rtl"?Re.right-Oe.width:Re.left,it=0;if(we&&Ce){const gn=qd(Ce.getBoundingClientRect(),xe);Ie=qd(we.getBoundingClientRect(),xe),Xe=Oe.left+($==="rtl"?gn.right-Ie.right:gn.left-Ie.left);const Rs=gn.top-Re.top+gn.height/2;it=Ie.top-Oe.top+Ie.height/2-Rs}const Qe=je+it+Ae+Se;let mt=Math.min(lt,Qe);const Ot=lt-Ge-Ae,Jt=Qe-mt,Wt=Rt-vt;I.style.left=`${Tc(Xe,ot,Wt-Oe.width)}px`,I.style.height=`${mt}px`,I.style.maxHeight="none",I.style.marginTop=`${Ge}px`,I.style.marginBottom=`${Ae}px`,oe.style.height="100%";const en=Hd(Be),mn=Jt>=en-Zs;mn&&(mt=Math.min(lt,Oe.height)-(Jt-en));const rs=Re.top<Mt||Re.bottom>lt-Mt||Math.ceil(mt)+Zs<Math.min(me,ze),hs=(Le.visualViewport?.scale??1)!==1&&Wr;if(rs||hs){K.current=!0,Uf(I,se.current),M(!1);return}const Es=Math.max(ze,mt);if(mn){const gn=Math.max(0,lt-Qe);I.style.top=Oe.height>=Ot?"0":`${gn}px`,I.style.height=`${mt}px`,Be.scrollTop=Hd(Be)}else I.style.bottom="0",Be.scrollTop=Jt;if(Ie){const gn=Oe.top,Rs=Oe.height,Sa=Ie.top+Ie.height/2,Gs=Rs>0?(Sa-gn)/Rs*100:50,Ca=Tc(Gs,0,100);oe.style.setProperty("--transform-origin",`50% ${Ca}%`)}(Es===lt||mt>=tt)&&(J.current=!0),w(),S&&m.state.selectedIndex===null&&m.state.activeIndex===null&&j.current[0]!=null&&m.set("activeIndex",0),K.current=!0}finally{fe()}},[m,V,I,Y,_,k,N,h,w,T,M,te,Q,j,S,$,O]),x.useEffect(()=>{if(!T||!I||!V)return;const oe=Qt(I);function fe(we){b(!1,st(I4,we))}return bt(oe,"resize",fe)},[b,T,I,V]);const ne={...Q?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":y||void 0,id:`${H}-list`},onKeyDown(oe){B&&Sp.has(oe.key)&&oe.stopPropagation()},onScroll(oe){Q||le(oe.currentTarget)},...T&&{style:Q?{height:"100%"}:dE}},ve=Et("div",t,{ref:[a,h],state:W,stateAttributesMapping:q8,props:[X,ne,vp(G),{className:!Q&&T?Kx.className:void 0},f]});return n.jsxs(x.Fragment,{children:[!L&&Kx.getElement(D),n.jsx(Zb,{context:P,modal:!1,disabled:!F,openInteractionType:U,returnFocus:d,restoreFocus:!0,children:ve})]})});function $k(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Hd(e){return q_(e.scrollHeight,e.clientHeight)}function Uk(e){return iC.getScale(e)}function Ac(e,t,a){return e/a[t]}function qd(e,t){return Fc({x:Ac(e.x,"x",t),y:Ac(e.y,"y",t),width:Ac(e.width,"x",t),height:Ac(e.height,"y",t)})}const Hk=[["transform","none"],["scale","1"],["translate","0 0"]];function F8(e){const{style:t}=e,a={};for(const[o,l]of Hk)a[o]=t.getPropertyValue(o),t.setProperty(o,l,"important");return()=>{for(const[o]of Hk){const l=a[o];l?t.setProperty(o,l):t.removeProperty(o)}}}const G8=x.forwardRef(function(t,a){const{render:o,className:l,style:i,...d}=t,{store:f,scrollHandlerRef:m}=wa(),{alignItemWithTriggerActive:h}=V_(),g=nt(f,et.hasScrollArrows),b=nt(f,et.openMethod),_=nt(f,et.multiple),N={id:`${nt(f,et.id)}-list`,role:"listbox","aria-multiselectable":_||void 0,onScroll(w){m.current?.(w.currentTarget)},...h&&{style:dE},className:g&&b!=="touch"?Kx.className:void 0},y=Ue(w=>{f.set("listElement",w)});return Et("div",t,{ref:[a,y],props:[N,d]})}),fE=x.createContext(void 0);function F_(){const e=x.useContext(fE);if(!e)throw new Error(cn(57));return e}const Y8=x.memo(x.forwardRef(function(t,a){const{render:o,className:l,style:i,value:d=null,label:f,disabled:m=!1,nativeButton:h=!1,...g}=t,b=x.useRef(null),_=lu({label:f,textRef:b,indexGuessBehavior:GC.GuessFromOrder}),{store:k,itemProps:N,setOpen:y,setValue:w,selectionRef:E,typingRef:j,valuesRef:S,multiple:R,selectedItemTextRef:A,disabled:T,readOnly:O}=wa(),M=nt(k,et.isActive,_.index),B=nt(k,et.open),P=nt(k,et.isSelected,d),$=nt(k,et.isSelectedByFocus,_.index),D=nt(k,et.isItemEqualToValue),L=_.index,H=L!==-1,V=x.useRef(null);De(()=>{if(!H)return;const le=S.current;return le[L]=d,()=>{delete le[L]}},[H,L,d,S]),De(()=>{if(!H)return;const le=k.state.value;let W=le;R&&Array.isArray(le)&&(W=le.length>0?le[le.length-1]:void 0),W!==void 0&&$o(d,W,D)&&(k.set("selectedIndex",L),b.current&&(A.current=b.current))},[H,L,R,D,k,d,A]);const U=x.useRef(null),F=x.useRef("mouse"),X=x.useRef(!1),{getButtonProps:G,buttonRef:Y}=no({disabled:m,focusableWhenDisabled:!0,native:h,composite:!0}),I={disabled:m,selected:P,highlighted:M};function Q(le){if(T||O)return;const W=k.state.value;if(R){const ne=Array.isArray(W)?W:[],ve=P?w8(ne,d,D):[...ne,d];w(ve,st(Kl,le))}else w(d,st(Kl,le)),y(!1,st(Kl,le))}function J(){E.current.dragY=0}const K={role:"option","aria-selected":P,tabIndex:B&&M?0:-1,onKeyDown(le){U.current=le.key,k.set("activeIndex",L),le.key===" "&&j.current&&le.preventDefault()},onClick(le){const W=le.type==="click"&&F.current!=="touch",ne=le.nativeEvent.pointerType,ve=W&&Ob(le.nativeEvent)&&(ne!==void 0||M),oe=W&&!ve&&!X.current;X.current=!1,!(le.type==="keydown"&&U.current===null)&&(m||le.type==="keydown"&&U.current===" "&&j.current||oe||(U.current=null,Q(le.nativeEvent)))},onPointerEnter(le){F.current=le.pointerType},onPointerMove(le){if(le.pointerType==="mouse"&&le.buttons===1){const W=E.current;W.dragY+=le.movementY,W.dragY**2>=64&&(W.allowUnselectedMouseUp=!0)}},onPointerDown(le){F.current=le.pointerType,X.current=!0,J()},onMouseUp(){if(J(),m||F.current==="touch"||X.current)return;const le=!E.current.allowSelectedMouseUp&&P,W=!E.current.allowUnselectedMouseUp&&!P;le||W||(X.current=!0,V.current?.click(),X.current=!1)}},se=Et("div",t,{ref:[Y,a,_.ref,V],state:I,props:[N,K,g,G]}),te=x.useMemo(()=>({selected:P,index:L,textRef:b,selectedByFocus:$,hasRegistered:H}),[P,L,b,$,H]);return n.jsx(fE.Provider,{value:te,children:se})})),K8=x.forwardRef(function(t,a){const o=t.keepMounted??!1,{selected:l}=F_();return o||l?n.jsx(X8,{...t,ref:a}):null}),X8=x.memo(x.forwardRef((e,t)=>{const{render:a,className:o,style:l,keepMounted:i,...d}=e,{selected:f}=F_(),m=x.useRef(null),{transitionStatus:h,setMounted:g}=_i(f),_=Et("span",e,{ref:[t,m],state:{selected:f,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},d],stateAttributesMapping:ur});return ka({open:f,ref:m,onComplete(){f||g(!1)}}),_})),Q8=x.memo(x.forwardRef(function(t,a){const{index:o,textRef:l,selectedByFocus:i,hasRegistered:d}=F_(),{firstItemTextRef:f,selectedItemTextRef:m}=wa(),{render:h,className:g,style:b,..._}=t,k=x.useCallback(y=>{y&&(d&&o===0&&(f.current=y),d&&i&&(m.current=y))},[f,m,o,i,d]);return Et("div",t,{ref:[k,a,l],props:_})})),pE=x.forwardRef(function(t,a){const{render:o,className:l,style:i,direction:d,keepMounted:f=!1,...m}=t,h=d==="up",{store:g,popupRef:b,listRef:_,handleScrollArrowVisibility:k,scrollArrowsMountedCountRef:N}=wa(),{side:y,scrollDownArrowRef:w,scrollUpArrowRef:E}=V_(),j=h?et.scrollUpArrowVisible:et.scrollDownArrowVisible,S=nt(g,j),R=nt(g,et.openMethod),A=S&&R!=="touch",T=En(),O=h?E:w,{mounted:M,transitionStatus:B,setMounted:P}=_i(A);De(()=>(N.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{N.current=Math.max(0,N.current-1),N.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,N]),ka({open:A,ref:O,onComplete(){A||P(!1)}});const L=Et("div",t,{ref:[a,O],state:{direction:d,visible:A,side:y,transitionStatus:B},props:[{"aria-hidden":!0,children:h?"▲":"▼",style:{position:"absolute"},onMouseMove(V){if(V.movementX===0&&V.movementY===0||T.isStarted())return;g.set("activeIndex",null);function U(){const F=g.state.listElement??b.current;if(!F)return;g.set("activeIndex",null),k();const X=q_(F.scrollHeight,F.clientHeight),G=$f(F.scrollTop,X),Y=G===(h?0:X),I=_.current;if(G!==F.scrollTop&&(F.scrollTop=G),I.length===0&&g.set(h?"scrollUpArrowVisible":"scrollDownArrowVisible",!Y),Y){T.clear();return}if(I.length>0){const Q=O.current?.offsetHeight||0;F.scrollTop=W8(I,h,G,F.clientHeight,Q,X)}T.start(40,U)}T.start(40,U)},onMouseLeave(){T.clear()}},m],stateAttributesMapping:ur});return M||f?L:null});function W8(e,t,a,o,l,i){if(t){let g=0;const b=a+l-Zs;for(let N=0;N<e.length;N+=1){const y=e[N];if(y&&y.offsetTop>=b){g=N;break}}const _=Math.max(0,g-1),k=e[_];return _<g&&k?$f(k.offsetTop-l,i):0}let d=e.length-1;const f=a+o-l+Zs;for(let g=0;g<e.length;g+=1){const b=e[g];if(b&&b.offsetTop+b.offsetHeight>f){d=Math.max(0,g-1);break}}const m=Math.min(e.length-1,d+1),h=e[m];return m>d&&h?$f(h.offsetTop+h.offsetHeight-o+l,i):i}const Z8=x.forwardRef(function(t,a){return n.jsx(pE,{...t,ref:a,direction:"down"})}),J8=x.forwardRef(function(t,a){return n.jsx(pE,{...t,ref:a,direction:"up"})}),eI=E8;function tI({className:e,...t}){return n.jsx(z8,{"data-slot":"select-value",className:Ct("flex flex-1 text-left",e),...t})}function nI({className:e,size:t="default",children:a,...o}){return n.jsxs(M8,{"data-slot":"select-trigger","data-size":t,className:Ct("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[a,n.jsx(D8,{render:n.jsx(ms,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function sI({className:e,children:t,side:a="bottom",sideOffset:o=4,align:l="center",alignOffset:i=0,alignItemWithTrigger:d=!0,...f}){return n.jsx(L8,{children:n.jsx(B8,{side:a,sideOffset:o,align:l,alignOffset:i,alignItemWithTrigger:d,className:"isolate z-50",children:n.jsxs(V8,{"data-slot":"select-content","data-align-trigger":d,className:Ct("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...f,children:[n.jsx(rI,{}),n.jsx(G8,{children:t}),n.jsx(oI,{})]})})})}function aI({className:e,children:t,...a}){return n.jsxs(Y8,{"data-slot":"select-item",className:Ct("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pr-8 pl-2.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[n.jsx(Q8,{className:"flex min-w-0 flex-1 gap-2 overflow-hidden whitespace-nowrap",children:t}),n.jsx(K8,{render:n.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:n.jsx(Gr,{className:"pointer-events-none"})})]})}function rI({className:e,...t}){return n.jsx(J8,{"data-slot":"select-scroll-up-button",className:Ct("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:n.jsx(pb,{})})}function oI({className:e,...t}){return n.jsx(Z8,{"data-slot":"select-scroll-down-button",className:Ct("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:n.jsx(ms,{})})}function ut({value:e,onChange:t,options:a,placeholder:o="— elegir —",disabled:l,className:i,showIcon:d=!1}){return n.jsxs(eI,{value:e,onValueChange:f=>t(f??""),disabled:l,children:[n.jsx(nI,{className:ge("h-9 w-full",i),children:n.jsx(tI,{placeholder:o,children:f=>{const m=a.find(g=>g.value===f),h=d?m?.icon:void 0;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h&&n.jsx(h,{className:"size-3.5 shrink-0"}),n.jsx("span",{className:"truncate",children:m?.label??f})]})}})}),n.jsx(sI,{side:"bottom",sideOffset:6,align:"start",alignItemWithTrigger:!1,className:"w-[var(--anchor-width)] p-1.5",children:a.map(f=>{const m=f.icon;return n.jsx(aI,{value:f.value,disabled:f.disabled,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[m?n.jsx(m,{className:"size-4 shrink-0 text-muted-fg"}):null,f.description?n.jsxs("span",{className:"flex min-w-0 flex-col leading-tight",children:[n.jsx("span",{className:"truncate font-medium",children:f.label}),n.jsx("span",{className:"truncate text-[11px] text-muted-fg",children:f.description})]}):n.jsx("span",{className:"truncate",children:f.label})]})},f.value)})})]})}const qk=320;function lI(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function iI(e){return e.agent_slug||e.actor_id||e.author||e.actor_kind||"—"}function cI(e){const t=e.meta?.model;return typeof t=="string"&&t?t:null}function uI(e){const t=e.meta?.usage;if(!t||typeof t!="object")return null;const a=(t.input_tokens||0)+(t.output_tokens||0);return a>0?a:null}function dI({m:e}){const[t,a]=x.useState(!1),o=(e.body?.length||0)>qk,l=!o||t?e.body:`${e.body.slice(0,qk)}…`,i=cI(e),d=uI(e);return n.jsxs("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx("span",{className:"mt-0.5 shrink-0",children:e.direction==="in"?n.jsx($2,{size:14,className:"text-blue-400"}):n.jsx(H2,{size:14,className:"text-emerald-400"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[n.jsx("span",{className:"font-mono",children:lI(e.ts)}),n.jsx(Ve,{tone:"info",children:e.channel}),e.type&&n.jsx(Ve,{children:e.type}),n.jsx("span",{className:"font-medium text-foreground",children:iI(e)}),i&&n.jsx("span",{className:"font-mono text-[11px] text-sky-400/90",children:i}),d!==null&&n.jsxs("span",{className:"font-mono text-[11px]",children:[d," tok"]})]}),e.body&&n.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-xs",children:l}),o&&n.jsx("button",{type:"button",onClick:()=>a(f=>!f),className:"mt-1 text-[11px] font-medium text-sky-400 hover:underline",children:u(t?"logs.show_less":"logs.show_more")})]})]})}function fI(){const[e,t]=x.useState(!1),a=He(e?"/admin/logs?errors":null,()=>ii.logs("errors",200)),o=a.data?.entries||[];return n.jsxs("details",{className:"mb-3 rounded-lg border border-border bg-muted/20",onToggle:l=>t(l.target.open),children:[n.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-xs font-medium text-muted-fg",children:[u("logs.daemon_errors"),o.length?` · ${o.length}`:""]}),n.jsxs("div",{className:"border-t border-border p-3",children:[a.isLoading&&n.jsx(rt,{}),e&&!a.isLoading&&o.length===0&&n.jsx("p",{className:"text-xs text-muted-fg",children:u("logs.no_errors")}),n.jsx("ul",{className:"space-y-1",children:o.map((l,i)=>n.jsxs("li",{className:"rounded-md bg-card px-2 py-1 text-[11px]",children:[n.jsxs("div",{className:"flex items-center gap-2 text-muted-fg",children:[typeof l.ts=="string"&&n.jsx("span",{className:"font-mono",children:new Date(l.ts).toLocaleString()}),typeof l.level=="string"&&n.jsx("span",{className:"text-destructive",children:l.level})]}),n.jsx("p",{className:"whitespace-pre-wrap break-words font-mono",children:String(l.msg??l.message??l.error??l.raw??JSON.stringify(l)).slice(0,500)})]},i))})]})]})}function pI({pid:e}){const t=!e||String(e)==="0",[a,o]=x.useState(""),[l,i]=x.useState(""),[d,f]=x.useState(""),[m,h]=x.useState(""),g=a.trim()||void 0,b=t?`/messages/global?channel=${g??""}`:`/projects/${e}/messages?channel=${g??""}`,_=He(b,()=>t?Mf.global({channel:g,limit:300}):Mf.project(e,{channel:g,limit:300})),k=x.useMemo(()=>[..._.data||[]].sort((w,E)=>(E.ts||"").localeCompare(w.ts||"")),[_.data]),N=x.useMemo(()=>Array.from(new Set(k.map(w=>w.type).filter(Boolean))),[k]),y=x.useMemo(()=>k.filter(w=>!(l&&w.direction!==l||d&&w.type!==d||m&&!(w.body||"").toLowerCase().includes(m.toLowerCase()))),[k,l,d,m]);return n.jsxs(Ye,{title:u("logs.title"),description:u(t?"logs.desc_global":"logs.desc_project"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Te,{placeholder:u("logs.filter_channel"),value:a,onChange:w=>o(w.target.value),className:"w-44"}),n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>_.mutate(),children:n.jsx(Ss,{size:13})})]}),children:[t&&n.jsx(fI,{}),n.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[n.jsx("div",{className:"w-36",children:n.jsx(ut,{value:l,onChange:i,placeholder:u("logs.filter_dir"),options:[{value:"",label:u("logs.all_directions")},{value:"in",label:u("logs.in")},{value:"out",label:u("logs.out")}]})}),n.jsx("div",{className:"w-40",children:n.jsx(ut,{value:d,onChange:f,placeholder:u("logs.filter_type"),options:[{value:"",label:u("logs.all_types")},...N.map(w=>({value:w,label:w}))]})}),n.jsx(Te,{placeholder:u("logs.search_text"),value:m,onChange:w=>h(w.target.value),className:"w-56"}),n.jsxs("span",{className:"text-[11px] text-muted-fg",children:[y.length," ",u("logs.count_of")," ",k.length]})]}),_.isLoading&&n.jsx(rt,{}),_.error&&n.jsx(pt,{children:u("logs.error",{msg:_.error.message})}),!_.isLoading&&!_.error&&y.length===0&&n.jsx(pt,{children:g?u("logs.no_activity_ch",{ch:g}):u("logs.no_activity")}),n.jsx("ul",{className:"space-y-1 text-sm",children:y.map((w,E)=>n.jsx(dI,{m:w},`${w.ts}-${E}`))})]})}function mE({value:e,onChange:t,options:a,placeholder:o=u("shared_ui.model_combobox_ph"),invalid:l,invalidHint:i,className:d}){const[f,m]=x.useState(!1),[h,g]=x.useState(e),b=x.useRef(null),_=x.useRef(null),[k,N]=x.useState(null);x.useEffect(()=>{g(e)},[e]),x.useLayoutEffect(()=>{if(!f)return;const S=()=>{const R=b.current;if(!R)return;const A=R.getBoundingClientRect();N({top:A.bottom+4,left:A.left,width:A.width})};return S(),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[f]),x.useEffect(()=>{if(!f)return;const S=R=>{const A=R.target;b.current?.contains(A)||_.current?.contains(A)||m(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const y=h.trim().toLowerCase(),E=y&&!(h===e)?a.filter(S=>S.toLowerCase().includes(y)):a,j=S=>{t(S),g(S),m(!1)};return n.jsxs("div",{ref:b,className:ge("relative",d),children:[n.jsxs("div",{className:ge("flex items-center gap-1 rounded-lg border bg-background px-2.5 transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring",l?"border-amber-500/60":"border-border"),children:[l&&n.jsx(qe,{content:i||u("models_ui.invalid_hint"),children:n.jsx("span",{children:n.jsx(rS,{className:"size-3.5 shrink-0 text-amber-400"})})}),n.jsx("input",{value:h,placeholder:o,onChange:S=>{g(S.target.value),t(S.target.value),m(!0)},onFocus:()=>m(!0),className:"w-full bg-transparent py-1.5 text-sm outline-none placeholder:text-muted-fg/60"}),n.jsx("button",{type:"button",tabIndex:-1,onClick:()=>m(S=>!S),className:"shrink-0 text-muted-fg hover:text-foreground",children:n.jsx(ms,{className:"size-4"})})]}),f&&E.length>0&&k&&Fs.createPortal(n.jsx("ul",{ref:_,style:{position:"fixed",top:k.top,left:k.left,width:k.width},className:"z-[1000] max-h-56 overflow-y-auto rounded-lg border border-border bg-popover p-1 shadow-md ring-1 ring-foreground/10",children:E.map(S=>n.jsx("li",{children:n.jsx("button",{type:"button",onMouseDown:R=>{R.preventDefault(),j(S)},className:ge("flex w-full items-center rounded-md px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-fg",S===e&&"bg-accent/50"),children:n.jsx("span",{className:"truncate font-mono text-xs",children:S})})},S))}),document.body)]})}function dr(){const{data:e,error:t,isLoading:a,mutate:o}=He("/admin/config",()=>ii.config.get()),l=async(i,d)=>{const f=await ii.config.patch({set:i,unset:d});return await o({config:f.config},{revalidate:!1}),f.config};return{config:e?.config||{},error:t,isLoading:a,mutate:o,patch:l}}function gE(){const{data:e,error:t,isLoading:a,mutate:o}=He("/admin/super-agent",()=>ii.superAgent());return{superAgent:e,error:t,isLoading:a,mutate:o}}const mI="modulepreload",gI=function(e){return"/"+e},Vk={},hI=function(t,a,o){let l=Promise.resolve();if(a&&a.length>0){let d=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");l=d(a.map(h=>{if(h=gI(h),h in Vk)return;Vk[h]=!0;const g=h.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const _=document.createElement("link");if(_.rel=g?"stylesheet":mI,g||(_.as="script"),_.crossOrigin="",_.href=h,m&&_.setAttribute("nonce",m),document.head.appendChild(_),g)return new Promise((k,N)=>{_.addEventListener("load",k),_.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return l.then(d=>{for(const f of d||[])f.status==="rejected"&&i(f.reason);return t().catch(i)})},xI={anthropic:"from-orange-600 to-amber-600",openai:"from-emerald-600 to-teal-600",gemini:"from-blue-600 to-indigo-600",groq:"from-cyan-600 to-teal-600",openrouter:"from-violet-600 to-indigo-600",ollama:"from-amber-600 to-orange-600",azure:"from-blue-600 to-cyan-600",mock:"from-slate-600 to-gray-600",custom:"from-slate-600 to-gray-600"},bI={anthropic:"bg-orange-500/20 text-orange-300 border border-orange-500/40",openai:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/40",gemini:"bg-blue-500/20 text-blue-300 border border-blue-500/40",groq:"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40",openrouter:"bg-violet-500/20 text-violet-300 border border-violet-500/40",ollama:"bg-amber-500/20 text-amber-300 border border-amber-500/40",azure:"bg-blue-500/20 text-blue-300 border border-blue-500/40",mock:"bg-slate-500/20 text-slate-300 border border-slate-500/40",custom:"bg-slate-500/20 text-slate-300 border border-slate-500/40"},Ic=[{value:"anthropic",label:"Anthropic"},{value:"openai",label:"OpenAI-compatible"},{value:"gemini",label:"Gemini"},{value:"groq",label:"Groq"},{value:"openrouter",label:"OpenRouter"},{value:"ollama",label:"Ollama"},{value:"azure",label:"Azure OpenAI"},{value:"mock",label:"Mock (test)"},{value:"custom",label:"Custom"}];function Nh(e,t){return t&&t in e?e[t]:e.custom}const Hf={anthropic:sa,openai:rn,gemini:eM,groq:hi,openrouter:su,ollama:aS,azure:BA,mock:xx,custom:aa},Za={anthropic:{base_url:"",default_model:"claude-sonnet-5",api_key_env:"ANTHROPIC_API_KEY",known_models:["claude-opus-4-8","claude-sonnet-5","claude-haiku-4-5","claude-fable-5"]},openai:{base_url:"https://api.openai.com/v1",default_model:"gpt-5.4-mini",api_key_env:"OPENAI_API_KEY",known_models:["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-5.1","gpt-4.1-mini"]},gemini:{base_url:"https://generativelanguage.googleapis.com/v1beta/openai",default_model:"gemini-2.5-flash",api_key_env:"GEMINI_API_KEY",known_models:["gemini-3.5-flash","gemini-3.1-pro-preview","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite"]},groq:{base_url:"https://api.groq.com/openai/v1",default_model:"openai/gpt-oss-20b",api_key_env:"GROQ_API_KEY",known_models:["openai/gpt-oss-120b","openai/gpt-oss-20b","qwen/qwen3.6-27b","groq/compound","groq/compound-mini","whisper-large-v3-turbo"]},openrouter:{base_url:"https://openrouter.ai/api/v1",default_model:"openrouter/auto",api_key_env:"OPENROUTER_API_KEY",known_models:["openrouter/auto","openrouter/free","anthropic/claude-sonnet-5","openai/gpt-5.4-mini","google/gemini-2.5-flash"]},ollama:{base_url:"http://127.0.0.1:11434",default_model:"gemma2:9b",api_key_env:"",known_models:[]},azure:{base_url:"",default_model:"",api_key_env:"AZURE_OPENAI_API_KEY",known_models:[]},mock:{base_url:"",default_model:"mock",api_key_env:"",known_models:["mock"]},custom:{base_url:"",default_model:"",api_key_env:"",known_models:[]}};let Fk=!1;async function _I(){if(!Fk)try{const{Engines:e}=await hI(async()=>{const{Engines:a}=await Promise.resolve().then(()=>_P);return{Engines:a}},[]),{presets:t}=await e.presets();for(const[a,o]of Object.entries(t||{}))a in Za&&o&&Object.assign(Za[a],o);Fk=!0}catch{}}function hE(e){const t=e.indexOf(":");return t<0?{provider:e,model:""}:{provider:e.slice(0,t),model:e.slice(t+1)}}function Eh({value:e,onChange:t,providers:a}){const{provider:o,model:l}=hE(e),i=a.find(g=>g.slug===o),d=!!o&&!i,f=x.useMemo(()=>{const g=i?Za[i.engine]?.known_models||[]:[];return Array.from(new Set([...i?.default_model?[i.default_model]:[],...g]))},[i]),m=g=>{const b=a.find(k=>k.slug===g),_=b?.default_model||Za[b?.engine]?.default_model||"";t(_?`${g}:${_}`:`${g}:`)},h=g=>t(`${o}:${g}`);return n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsx(ut,{value:o,onChange:m,placeholder:d?u("router_panel.provider_not_found",{name:o}):u("router_panel.provider_ph"),options:a.map(g=>({value:g.slug,label:g.slug,icon:Hf[g.engine]}))}),n.jsx(mE,{value:l,onChange:h,options:f,invalid:d,invalidHint:u("router_panel.provider_not_configured",{name:o})})]})}function vI(){const e=Ze(),{superAgent:t,isLoading:a,mutate:o}=gE(),{config:l,patch:i}=dr(),[d,f]=x.useState(""),[m,h]=x.useState([]),[g,b]=x.useState(""),[_,k]=x.useState(null),[N,y]=x.useState(!1),[w,E]=x.useState({model:"",fallback:[]});x.useEffect(()=>{if(!t)return;const P=t.model_fallback?.models||[],$=Array.isArray(P)?P:[];f(t.model||""),h($),E({model:t.model||"",fallback:$})},[t]);const j=x.useMemo(()=>{const P=l.engines||{};return Object.entries(P).map(([$,D])=>({slug:$,engine:D?.engine||$,default_model:D?.default_model||Za[D?.engine||$]?.default_model}))},[l.engines]),S=P=>{const{provider:$}=hE(P);return j.some(D=>D.slug===$)};if(a||!t)return n.jsx(rt,{});const R=d!==w.model||JSON.stringify(m)!==JSON.stringify(w.fallback),A=async()=>{y(!0);try{await i({"super_agent.model":d,"super_agent.model_fallback.enabled":m.length>0,"super_agent.model_fallback.models":m}),e.success(u("router_panel.saved_toast")),E({model:d,fallback:m}),o()}catch(P){e.error(P.message)}finally{y(!1)}},T=()=>{const P=g.trim().replace(/:$/,"");!P||!P.includes(":")||m.includes(P)||(h([...m,P]),b(""))},O=(P,$)=>{const D=[...m];D[P]=$,h(D)},M=P=>{h(m.filter(($,D)=>D!==P)),_===P&&k(null)},B=(P,$)=>{const D=P+$;if(D<0||D>=m.length)return;const L=[...m];[L[P],L[D]]=[L[D],L[P]],h(L)};return n.jsx(Ye,{title:u("router_panel.title"),description:u("router_panel.description"),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-muted/20 p-3",children:[n.jsxs(Ve,{tone:"success",children:[n.jsx(su,{size:11})," ",u("router_panel.badge_default")]}),n.jsx("span",{className:`font-mono text-xs ${!S(d)&&d?"text-amber-400":""}`,children:d||"—"}),m.map(P=>n.jsxs("span",{className:"flex items-center gap-2 text-muted-fg",children:[n.jsx(U2,{size:12}),n.jsx("span",{className:`font-mono text-xs ${S(P)?"":"text-amber-400"}`,children:P})]},P))]}),j.length===0?n.jsx("p",{className:"text-xs text-muted-fg",children:u("router_panel.no_providers")}):n.jsx(ce,{label:u("router_panel.active_model_label"),hint:u("router_panel.active_model_hint"),children:n.jsx(Eh,{value:d,onChange:f,providers:j})}),n.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3",children:[n.jsxs("div",{className:"mb-2",children:[n.jsx("div",{className:"text-sm font-medium",children:u("router_panel.fallback_title")}),n.jsx("div",{className:"text-xs text-muted-fg",children:u("router_panel.fallback_desc")})]}),n.jsxs("ul",{className:"mb-3 space-y-1",children:[m.map((P,$)=>{const D=!S(P),L=_===$;return n.jsx("li",{className:"rounded-md bg-card px-2 py-1.5 text-xs",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"w-6 text-muted-fg",children:["#",$+1]}),L?n.jsx("div",{className:"flex-1",children:n.jsx(Eh,{value:P,onChange:H=>O($,H),providers:j})}):n.jsxs("button",{type:"button",onClick:()=>k($),className:"flex flex-1 items-center gap-1.5 text-left",children:[D&&n.jsx(rS,{size:12,className:"text-amber-400"}),n.jsx("span",{className:`font-mono ${D?"text-amber-400":""}`,children:P})]}),L?n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>k(null),children:u("router_panel.done")}):n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>k($),children:n.jsx(ya,{size:12})}),n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>B($,-1),disabled:$===0,children:"↑"}),n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>B($,1),disabled:$===m.length-1,children:"↓"}),n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>M($),children:n.jsx(vn,{size:12})})]})},`${$}-${P}`)}),m.length===0&&n.jsx("li",{className:"text-xs text-muted-fg",children:u("router_panel.fallback_empty")})]}),j.length>0&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"text-xs text-muted-fg",children:u("router_panel.add_to_chain")}),n.jsx(Eh,{value:g,onChange:b,providers:j}),n.jsxs(ie,{size:"sm",variant:"secondary",onClick:T,disabled:!g.includes(":")||g.endsWith(":"),children:[n.jsx(Pt,{size:13})," ",u("router_panel.add_to_chain")]})]})]}),n.jsx(ie,{variant:"primary",loading:N,disabled:!R,onClick:A,children:u(R?"router_panel.save":"router_panel.saved")})]})})}const yI=[{model:"openai:gpt-4o",when:{has_image:!0}},{model:"anthropic:claude-3-5-haiku",when:{max_prompt_chars:400}}];function jI({when:e}){const t=[];return!e||Object.keys(e).length===0?t.push({icon:n.jsx(Qr,{size:11}),label:u("routing_panel.when_any")}):(e.has_image===!0&&t.push({icon:n.jsx(bx,{size:11}),label:u("routing_panel.when_image")}),e.has_image===!1&&t.push({icon:n.jsx(bx,{size:11}),label:u("routing_panel.when_no_image")}),Number.isFinite(e.min_prompt_chars)&&t.push({icon:n.jsx(eh,{size:11}),label:u("routing_panel.when_min_prompt",{n:String(e.min_prompt_chars)})}),Number.isFinite(e.max_prompt_chars)&&t.push({icon:n.jsx(eh,{size:11}),label:u("routing_panel.when_max_prompt",{n:String(e.max_prompt_chars)})}),Number.isFinite(e.min_context_chars)&&t.push({icon:n.jsx(eh,{size:11}),label:u("routing_panel.when_min_context",{n:String(e.min_context_chars)})}),Array.isArray(e.channels)&&e.channels.length>0&&t.push({icon:n.jsx(vM,{size:11}),label:u("routing_panel.when_channels",{list:e.channels.join(", ")})}),Array.isArray(e.keywords)&&e.keywords.length>0&&t.push({icon:n.jsx(sM,{size:11}),label:u("routing_panel.when_keywords",{list:e.keywords.join(", ")})})),n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:t.map((a,o)=>n.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-fg",children:[a.icon," ",a.label]},o))})}function kI(){const e=Ze(),{config:t,isLoading:a,patch:o}=dr(),[l,i]=x.useState(!1),[d,f]=x.useState("[]"),[m,h]=x.useState(!1),[g,b]=x.useState(!1),[_,k]=x.useState(!1),[N,y]=x.useState({enabled:!1,rulesText:"[]"});x.useEffect(()=>{const M=t.super_agent?.routing||{},B=Array.isArray(M.rules)?M.rules:[],P=JSON.stringify(B,null,2);i(M.enabled===!0),f(P),y({enabled:M.enabled===!0,rulesText:P})},[t.super_agent?.routing]);const w=x.useMemo(()=>{try{const M=JSON.parse(d);return Array.isArray(M)?{rules:M,error:null}:{rules:[],error:u("routing_panel.json_not_array")}}catch(M){return{rules:[],error:u("routing_panel.json_error",{msg:M.message})}}},[d]);if(a)return n.jsx(rt,{});const E=w.rules,j=E.length,S=w.error?d:JSON.stringify(E),R=(()=>{try{return JSON.stringify(JSON.parse(N.rulesText))}catch{return N.rulesText}})(),A=l!==N.enabled||S!==R,T=async()=>{if(!w.error){b(!0);try{await o({"super_agent.routing":{enabled:l,rules:E}}),e.success(u("routing_panel.saved_toast"));const M=JSON.stringify(E,null,2);f(M),y({enabled:l,rulesText:M})}catch(M){e.error(M.message)}finally{b(!1),k(!1)}}},O=l&&j>0;return n.jsxs("div",{"data-testid":"routing-panel",children:[n.jsx(Ye,{title:u("routing_panel.title"),description:u("routing_panel.description"),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-muted/20 p-3",children:[n.jsx("span",{"data-testid":"routing-signal",children:O?n.jsxs(Ve,{tone:"success",children:[n.jsx(Jg,{size:11})," ",u("routing_panel.signal_on",{n:String(j)})]}):l?n.jsxs(Ve,{tone:"warning",children:[n.jsx(Jg,{size:11})," ",u("routing_panel.signal_on_empty")]}):n.jsxs(Ve,{tone:"muted",children:[n.jsx(Jg,{size:11})," ",u("routing_panel.signal_off")]})}),n.jsx(qe,{content:u("routing_panel.helper"),children:n.jsx("span",{className:"text-xs text-muted-fg underline decoration-dotted underline-offset-2",children:u("routing_panel.how_it_works")})})]}),n.jsx(Bt,{checked:l,onChange:i,label:u("routing_panel.enable_label")}),n.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3",children:[n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-medium",children:u("routing_panel.rules_title")}),n.jsx("div",{className:"text-xs text-muted-fg",children:u("routing_panel.rules_desc")})]}),n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>h(M=>!M),children:u(m?"routing_panel.hide_editor":"routing_panel.edit_rules")})]}),n.jsxs("ul",{className:"space-y-1.5",children:[E.map((M,B)=>n.jsxs("li",{className:"rounded-md bg-card px-2.5 py-2 text-xs",children:[n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsxs("span",{className:"w-6 text-muted-fg",children:["#",B+1]}),n.jsx("span",{className:"font-mono text-[12px]",children:M.model||"—"})]}),n.jsx("div",{className:"pl-8",children:n.jsx(jI,{when:M.when})})]},B)),j===0&&!w.error&&n.jsx("li",{className:"text-xs text-muted-fg",children:u("routing_panel.rules_empty")})]})]}),m&&n.jsxs(ce,{label:u("routing_panel.editor_label"),hint:u("routing_panel.json_hint"),children:[n.jsx(un,{rows:10,className:"font-mono text-xs",value:d,onChange:M=>f(M.target.value),spellCheck:!1}),w.error?n.jsx("span",{className:"mt-1 block text-[11px] text-red-400",children:w.error}):n.jsx("button",{type:"button",className:"mt-1 text-[11px] text-muted-fg underline decoration-dotted underline-offset-2",onClick:()=>f(JSON.stringify(yI,null,2)),children:u("routing_panel.insert_example")})]}),n.jsx("p",{className:"text-[11px] leading-relaxed text-muted-fg",children:u("routing_panel.helper")}),n.jsx(ie,{variant:"primary",loading:g,disabled:!A||!!w.error,onClick:()=>k(!0),children:u(A?"routing_panel.save":"routing_panel.saved")})]})}),n.jsx(Zt,{open:_,onClose:()=>k(!1),title:u("routing_panel.confirm_title"),description:u("routing_panel.confirm_body"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>k(!1),children:u("routing_panel.cancel")}),n.jsx(ie,{variant:"primary",loading:g,onClick:T,children:u("routing_panel.confirm_apply")})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:l?u("routing_panel.confirm_on",{n:String(j)}):u("routing_panel.confirm_off")})})]})}function wI({provider:e,onEdit:t,onDelete:a,onToggle:o}){const l=Nh(xI,e.engine),i=Nh(bI,e.engine),d=Nh(Hf,e.engine),f=Ic.find(b=>b.value===e.engine)?.label||e.engine,m=typeof e.api_key=="string"&&e.api_key.length>0,h=Io(e.api_key),g=e.is_active!==!1;return n.jsxs("div",{className:"group flex h-full cursor-pointer flex-col gap-3 rounded-xl border border-border bg-card p-4 transition-colors hover:border-muted-fg/50",onClick:t,children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:ge("flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br",l),children:n.jsx(d,{className:"size-5 text-white"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("h3",{className:"truncate text-sm font-semibold",children:e.name||e.slug}),n.jsx("p",{className:"truncate font-mono text-[10px] text-muted-fg",children:e.slug}),n.jsxs("span",{className:ge("mt-1 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",i),children:[n.jsx(d,{className:"size-3"})," ",f]})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(qe,{content:u(g?"providers_modal.toggle_active":"providers_modal.toggle_inactive"),children:n.jsxs("button",{type:"button",onClick:b=>{b.stopPropagation(),o()},className:ge("flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-medium transition-colors",g?"border-emerald-500/40 text-emerald-400 hover:bg-emerald-500/10":"border-border text-muted-fg hover:text-foreground"),children:[n.jsx("span",{className:ge("size-1.5 rounded-full",g?"bg-emerald-400":"bg-muted-fg/40")}),u(g?"providers_card.active":"providers_card.off")]})}),n.jsx(qe,{content:u("providers_modal.delete"),children:n.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),a()},className:"rounded-md p-1 text-muted-fg hover:bg-destructive/10 hover:text-destructive",children:n.jsx(vn,{className:"size-3.5"})})})]})]}),n.jsxs("div",{className:"mt-auto space-y-1 text-xs",children:[n.jsx(_c,{label:u("providers_card.model"),value:e.default_model||"—",mono:!0}),e.base_url&&n.jsx(_c,{label:u("providers_card.base_url"),value:e.base_url,mono:!0,truncate:!0}),n.jsx(_c,{label:u("providers_card.api_key"),value:m?h?`…${h}`:u("providers_card.key_set"):"—",mono:!!h}),e.default_temperature!==void 0&&n.jsx(_c,{label:u("providers_card.temp"),value:e.default_temperature.toFixed(1)}),e.pricing?.input_per_million!==void 0&&n.jsx(_c,{label:u("providers_card.price_io"),value:`${e.pricing.input_per_million??0} / ${e.pricing.output_per_million??0}`})]})]})}function _c({label:e,value:t,mono:a,truncate:o}){return n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"text-muted-fg",children:e}),n.jsx("span",{className:ge("text-foreground",a&&"font-mono",o&&"max-w-[180px] truncate"),children:t})]})}const Gk={name:"",slug:"",engine:"anthropic",base_url:"",api_key_value:"",default_model:"",default_temperature:.7,default_max_tokens:4096,is_active:!0,context_limit_tokens:2e5,model_context_limits_json:"",p_input:"",p_output:"",p_cache_read:"",p_cache_write:""},SI=["anthropic","openai","gemini","groq","openrouter","ollama","custom"];function vc(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Vd(e){if(e==null)return"";const t=Number(e);return Number.isFinite(t)?String(t):""}function CI(e){return{name:e.name||e.slug,slug:e.slug,engine:e.engine||"custom",base_url:e.base_url||"",api_key_value:"",default_model:e.default_model||"",default_temperature:e.default_temperature??.7,default_max_tokens:e.default_max_tokens??4096,is_active:e.is_active!==!1,context_limit_tokens:e.context_limit_tokens??2e5,model_context_limits_json:e.model_context_limits?JSON.stringify(e.model_context_limits,null,2):"",p_input:Vd(e.pricing?.input_per_million),p_output:Vd(e.pricing?.output_per_million),p_cache_read:Vd(e.pricing?.cache_read_per_million),p_cache_write:Vd(e.pricing?.cache_write_per_million)}}function NI({open:e,initial:t,existingSlugs:a,onClose:o,onSave:l}){const i=!!t,[d,f]=x.useState(Gk),[m,h]=x.useState(!1),[g,b]=x.useState(null),[_,k]=x.useState([]),[N,y]=x.useState(!1),[w,E]=x.useState(null),[j,S]=x.useState(!1),[R,A]=x.useState("");x.useEffect(()=>{if(!e)return;const G=t?CI(t):Gk;f(G),b(null),E(null),S(!1);const Y=Za[G.engine];k(Y?.known_models||[])},[e,t]);const T=G=>f(Y=>({...Y,...G})),O=G=>{const Y=Za[G];T({engine:G,name:G==="custom"?d.name:Ic.find(I=>I.value===G)?.label||G,slug:G==="custom"?d.slug:G,base_url:Y.base_url,default_model:Y.default_model}),k(Y.known_models),E(null)},M=G=>{const Y=Za[G];T({engine:G,base_url:d.base_url||Y.base_url,default_model:d.default_model||Y.default_model}),k(Y.known_models)},B=async()=>{y(!0),E(null);try{const G=await Kc.models({engine:d.engine,slug:d.slug||vc(d.name),base_url:d.base_url||void 0,api_key:d.api_key_value||void 0});if(G.error){E(G.error);return}k(G.models),G.models.length===0&&E(u("providers_modal.err_no_models"))}catch(G){E(G.message||u("providers_modal.err_list_models"))}finally{y(!1)}},P=x.useMemo(()=>d.default_model&&!_.includes(d.default_model)?[d.default_model,..._]:_,[_,d.default_model]),$=()=>{const G=(d.slug||vc(d.name)).trim();if(!G)return b(u("providers_modal.err_slug_required")),null;if(!i&&a.includes(G))return b(u("providers_modal.err_slug_exists",{slug:G})),null;let Y;if(d.model_context_limits_json.trim())try{const J=JSON.parse(d.model_context_limits_json);if(!J||typeof J!="object"||Array.isArray(J))throw new Error;Y=J}catch{return b(u("providers_modal.err_model_limits_json")),null}const Q=[d.p_input,d.p_output,d.p_cache_read,d.p_cache_write].map(J=>J.trim()).some(Boolean)?{input_per_million:Number(d.p_input||0),output_per_million:Number(d.p_output||0),cache_read_per_million:Number(d.p_cache_read||0),cache_write_per_million:Number(d.p_cache_write||0)}:void 0;return{provider:{slug:G,name:d.name.trim()||G,engine:d.engine,base_url:d.base_url.trim()||void 0,default_model:d.default_model.trim()||void 0,default_temperature:d.default_temperature,default_max_tokens:d.default_max_tokens,is_active:d.is_active,context_limit_tokens:d.context_limit_tokens||void 0,model_context_limits:Y,pricing:Q},modelLimits:Y}},D=()=>{const G=$();if(!G)return;const{provider:Y}=G,I={name:Y.name,engine:Y.engine,is_active:Y.is_active!==!1,default_temperature:Y.default_temperature,default_max_tokens:Y.default_max_tokens};Y.base_url&&(I.base_url=Y.base_url),Y.default_model&&(I.default_model=Y.default_model),Y.context_limit_tokens&&(I.context_limit_tokens=Y.context_limit_tokens),Y.model_context_limits&&(I.model_context_limits=Y.model_context_limits),Y.pricing&&(I.pricing=Y.pricing),d.api_key_value.trim()&&(I.api_key=d.api_key_value.trim()),A(JSON.stringify(I,null,2)),b(null),S(!0)},L=async()=>{h(!0),b(null);try{if(j){const Y=(d.slug||vc(d.name)).trim();if(!Y){b(u("providers_modal.err_slug_required_form"));return}let I;try{I=JSON.parse(R)}catch{b(u("providers_modal.err_json_invalid"));return}if(!I||typeof I!="object"||Array.isArray(I)){b(u("providers_modal.err_json_object"));return}const Q=I;if(!Q.engine||typeof Q.engine!="string"){b(u("providers_modal.err_engine_missing"));return}const J={slug:Y,name:typeof Q.name=="string"?Q.name:Y,engine:String(Q.engine),base_url:typeof Q.base_url=="string"?Q.base_url:void 0,default_model:typeof Q.default_model=="string"?Q.default_model:void 0,is_active:Q.is_active!==!1};await l({provider:J,raw:Q,originalSlug:t?.slug}),o();return}const G=$();if(!G)return;await l({provider:G.provider,apiKeyValue:d.api_key_value.trim()||void 0,originalSlug:t?.slug}),o()}catch(G){b(G.message||u("providers_modal.err_save"))}finally{h(!1)}},H=i&&ps(t?.api_key),V=Io(t?.api_key),U=H?u("providers_modal.api_key_set",{suffix:V??""}):"sk-…",F=d.engine==="ollama",X=Za[d.engine]?.api_key_env;return n.jsx(Zt,{open:e,onClose:o,title:i?u("providers_modal.edit_title",{name:t?.name||t?.slug||""}):u("providers_modal.new_title"),description:u("providers_modal.description"),size:"lg",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:o,disabled:m,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:L,loading:m,children:u(i?"common.save":"common.create")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[i?n.jsx("span",{}):n.jsx("div",{className:"flex flex-wrap gap-1.5",children:SI.map(G=>{const Y=Hf[G],I=G==="custom"?u("providers_modal.custom"):Ic.find(J=>J.value===G)?.label||G,Q=d.engine===G;return n.jsxs("button",{type:"button",onClick:()=>O(G),className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs transition-colors ${Q?"border-emerald-500/50 bg-emerald-500/10 text-emerald-400":"border-border text-muted-fg hover:border-muted-fg/60 hover:text-foreground"}`,children:[n.jsx(Y,{className:"size-3.5"})," ",I]},G)})}),n.jsxs("button",{type:"button",onClick:()=>j?S(!1):D(),className:`flex shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs transition-colors ${j?"border-sky-500/50 bg-sky-500/10 text-sky-400":"border-border text-muted-fg hover:text-foreground"}`,children:[n.jsx(TA,{className:"size-3.5"})," ",u(j?"providers_modal.form_mode":"providers_modal.json_mode")]})]}),j?n.jsxs("div",{className:"space-y-2",children:[n.jsx(ce,{label:u("providers_modal.json_label"),hint:u("providers_modal.json_hint",{slug:d.slug||vc(d.name)||"<slug>"}),children:n.jsx(un,{rows:14,className:"font-mono text-xs",value:R,onChange:G=>A(G.target.value),spellCheck:!1})}),n.jsx("p",{className:"text-[11px] text-muted-fg",children:u("providers_modal.json_help")})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("providers_modal.name_label"),children:n.jsx(Te,{value:d.name,onChange:G=>T({name:G.target.value,slug:i?d.slug:vc(G.target.value)}),placeholder:u("providers_modal.name_ph")})}),n.jsx(ce,{label:u("providers_modal.engine_label"),children:n.jsx(ut,{value:d.engine,onChange:G=>M(G),options:Ic.map(G=>({value:G.value,label:G.label,icon:Hf[G.value]}))})})]}),n.jsx(ce,{label:u("providers_modal.base_url_label"),hint:u("providers_modal.base_url_hint"),children:n.jsx(Te,{value:d.base_url,onChange:G=>T({base_url:G.target.value}),placeholder:u("providers_modal.base_url_ph")})}),!F&&n.jsx(ce,{label:u("providers_modal.api_key_label"),hint:H?u("providers_modal.api_key_hint_existing"):X?u("providers_modal.api_key_hint_env",{env:X}):u("providers_modal.api_key_hint"),children:n.jsx(Te,{type:"password",autoComplete:"new-password",value:d.api_key_value,onChange:G=>T({api_key_value:G.target.value}),placeholder:U})}),n.jsx(ce,{label:u("providers_modal.model_label"),children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(mE,{value:d.default_model,onChange:G=>T({default_model:G}),options:P,className:"flex-1"}),n.jsx(qe,{content:u("providers_modal.list_models_hint"),children:n.jsxs(ie,{size:"sm",variant:"secondary",onClick:B,disabled:N,"aria-label":u("providers_modal.list_models_hint"),children:[N?n.jsx(Js,{className:"size-3.5 animate-spin"}):n.jsx(Ss,{className:"size-3.5"}),u("providers_modal.load_models")]})})]}),w&&n.jsx("p",{className:"text-[11px] text-amber-400",children:w})]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("providers_modal.max_tokens_label"),children:n.jsx(Te,{type:"number",min:256,step:256,value:d.default_max_tokens,onChange:G=>T({default_max_tokens:parseInt(G.target.value)||4096})})}),n.jsx(ce,{label:u("providers_modal.temperature_label",{value:d.default_temperature.toFixed(1)}),children:n.jsx("input",{type:"range",min:0,max:2,step:.1,value:d.default_temperature,onChange:G=>T({default_temperature:parseFloat(G.target.value)}),className:"mt-2 w-full accent-foreground"})})]}),n.jsxs("details",{className:"rounded-md border border-border bg-muted/20 p-3",children:[n.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-fg",children:u("providers_modal.pricing_summary")}),n.jsxs("div",{className:"mt-3 space-y-3",children:[n.jsx(ce,{label:u("providers_modal.context_limit_label"),children:n.jsx(Te,{type:"number",min:0,step:1024,value:d.context_limit_tokens,onChange:G=>T({context_limit_tokens:parseInt(G.target.value)||0})})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("providers_modal.price_input"),children:n.jsx(Te,{type:"number",min:0,step:1e-4,value:d.p_input,onChange:G=>T({p_input:G.target.value}),placeholder:"0.15"})}),n.jsx(ce,{label:u("providers_modal.price_output"),children:n.jsx(Te,{type:"number",min:0,step:1e-4,value:d.p_output,onChange:G=>T({p_output:G.target.value}),placeholder:"0.60"})}),n.jsx(ce,{label:u("providers_modal.price_cache_read"),children:n.jsx(Te,{type:"number",min:0,step:1e-4,value:d.p_cache_read,onChange:G=>T({p_cache_read:G.target.value}),placeholder:"0.03"})}),n.jsx(ce,{label:u("providers_modal.price_cache_write"),children:n.jsx(Te,{type:"number",min:0,step:1e-4,value:d.p_cache_write,onChange:G=>T({p_cache_write:G.target.value}),placeholder:"0.00"})})]}),n.jsx(ce,{label:u("providers_modal.model_limits_label"),hint:'{"gpt-4o-mini":128000}',children:n.jsx(un,{rows:3,className:"font-mono text-xs",value:d.model_context_limits_json,onChange:G=>T({model_context_limits_json:G.target.value})})})]})]}),n.jsx(Bt,{checked:d.is_active,onChange:G=>T({is_active:G}),label:u("providers_modal.active_label")})]}),g&&n.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:g})]})})}const EI=new Set(Ic.map(e=>e.value));function RI(e,t){const a=typeof t.engine=="string"&&t.engine||(EI.has(e)?e:"custom");return{slug:e,name:typeof t.name=="string"?t.name:void 0,engine:a,base_url:typeof t.base_url=="string"?t.base_url:void 0,api_key:typeof t.api_key=="string"?t.api_key:void 0,default_model:typeof t.default_model=="string"?t.default_model:void 0,default_temperature:typeof t.default_temperature=="number"?t.default_temperature:void 0,default_max_tokens:typeof t.default_max_tokens=="number"?t.default_max_tokens:void 0,is_active:typeof t.is_active=="boolean"?t.is_active:void 0,context_limit_tokens:typeof t.context_limit_tokens=="number"?t.context_limit_tokens:void 0,model_context_limits:t.model_context_limits||void 0,pricing:t.pricing||void 0}}function TI(){const e=Ze(),{config:t,isLoading:a,patch:o,mutate:l}=dr(),[i,d]=x.useState(!1),[f,m]=x.useState(null);if(a)return n.jsx(rt,{});const h=t.engines||{},g=Object.entries(h).map(([E,j])=>RI(E,j||{})),b=g.map(E=>E.slug),_=()=>{m(null),d(!0)},k=E=>{m(E),d(!0)},N=async({provider:E,apiKeyValue:j,raw:S})=>{if(S){await o({[`engines.${E.slug}`]:S}),e.success(u("engines_panel.saved_json")),l();return}const R=`engines.${E.slug}`,A={[`${R}.name`]:E.name,[`${R}.engine`]:E.engine,[`${R}.is_active`]:E.is_active!==!1,[`${R}.default_temperature`]:E.default_temperature,[`${R}.default_max_tokens`]:E.default_max_tokens},T=[],O=(M,B)=>{B===void 0||B===""?T.push(`${R}.${M}`):A[`${R}.${M}`]=B};O("base_url",E.base_url),O("default_model",E.default_model),O("context_limit_tokens",E.context_limit_tokens),O("pricing",E.pricing),O("model_context_limits",E.model_context_limits),j&&(A[`${R}.api_key`]=j),await o(A,T),e.success(u("engines_panel.saved")),l()},y=async E=>{try{await o({[`engines.${E.slug}.is_active`]:E.is_active===!1}),l()}catch(j){e.error(j.message)}},w=async E=>{if(confirm(u("engines_panel.delete_confirm",{name:E.name||E.slug})))try{await o(void 0,[`engines.${E.slug}`]),e.success(u("engines_panel.deleted")),l()}catch(j){e.error(j.message)}};return n.jsxs(Ye,{title:u("engines_panel.title"),description:u("engines_panel.description"),action:n.jsxs(ie,{size:"sm",variant:"primary",onClick:_,children:[n.jsx(Pt,{size:14})," ",u("engines_panel.new_btn")]}),children:[g.length===0?n.jsx(pt,{children:u("engines_panel.empty")}):n.jsxs("div",{className:"grid grid-cols-1 items-stretch gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[g.map(E=>n.jsx(wI,{provider:E,onEdit:()=>k(E),onDelete:()=>w(E),onToggle:()=>y(E)},E.slug)),n.jsxs("button",{type:"button",onClick:_,className:"flex min-h-[120px] flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border text-muted-fg transition-colors hover:border-muted-fg/60 hover:text-foreground",children:[n.jsx(Pt,{size:20}),n.jsx("span",{className:"text-sm font-medium",children:u("engines_panel.add_card")})]})]}),n.jsx(NI,{open:i,initial:f,existingSlugs:b,onClose:()=>{d(!1),m(null)},onSave:N})]})}function xE(){return n.jsxs("div",{className:"space-y-6",children:[n.jsx(vI,{}),n.jsx(kI,{}),n.jsx(TI,{})]})}function AI(){const e=Ze(),[t,a]=x.useState(!1),l=He(t?"/agents/vault?include_removed=1":"/agents/vault",()=>an.vault({includeRemoved:t})),i=l.data||[],[d,f]=x.useState(null),m=async g=>{const b=g.source!=="user",_=b?u("base.defaults_tombstone_msg",{slug:g.slug}):u("base.defaults_delete_msg",{slug:g.slug});if(confirm(_))try{await an.vaultRemove(g.slug),e.success(u(b?"base.defaults_hidden":"base.defaults_deleted")),l.mutate()}catch(k){e.error(k.message)}},h=async g=>{try{await an.vaultRestore(g),e.success(u("base.defaults_restored")),l.mutate()}catch(b){e.error(b.message)}};return n.jsxs(Ye,{title:u("base.defaults_title"),description:u("base.defaults_desc"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Bt,{checked:t,onChange:a,label:u("base.defaults_show_removed")}),n.jsxs(ie,{size:"sm",onClick:()=>f("new"),children:[n.jsx(Pt,{size:14})," ",u("base.defaults_new")]})]}),children:[l.isLoading&&n.jsx(rt,{}),!l.isLoading&&i.length===0&&n.jsx(pt,{children:u("base.defaults_empty")}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:i.map(g=>{const b=t&&g.tombstoned;return n.jsxs("div",{className:`flex flex-col gap-2 rounded-xl border bg-card p-4 ${b?"border-dashed border-border opacity-60":"border-border"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-slate-600 to-gray-600",children:g.is_master?n.jsx(ba,{className:"size-4 text-white"}):n.jsx(rn,{className:"size-4 text-white"})}),n.jsx("span",{className:"truncate text-sm font-semibold",children:g.slug}),n.jsx(MI,{source:g.source})]}),n.jsx("div",{className:"flex shrink-0 items-center gap-0.5",children:b?n.jsx(Rh,{label:u("base.defaults_restore"),onClick:()=>h(g.slug),variant:"secondary",children:n.jsx(gi,{size:13})}):n.jsxs(n.Fragment,{children:[n.jsx(Rh,{label:u("base.defaults_edit"),onClick:()=>f(g),variant:"ghost",children:n.jsx(ya,{size:13})}),n.jsx(Rh,{label:g.source==="user"?u("base.defaults_delete"):u("base.defaults_hide"),onClick:()=>m(g),variant:"ghost-destructive",children:n.jsx(vn,{size:13})})]})})]}),g.model?n.jsx(Ve,{tone:"info",children:g.model}):n.jsx("span",{className:"text-[10px] text-muted-fg",children:u("agents_ui.model_router_default")}),g.description&&n.jsx("p",{className:"line-clamp-3 text-xs text-muted-fg",children:g.description}),n.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.role&&n.jsx(Ve,{children:g.role}),g.skills?.map(_=>n.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[n.jsx(sa,{size:9})," ",_]},_)),g.tools?.map(_=>n.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[n.jsx(aa,{size:9})," ",_]},_))]})]},g.slug)})}),d!==null&&n.jsx(OI,{agent:d==="new"?null:d,onClose:()=>f(null),onSaved:()=>{f(null),l.mutate()}})]})}function MI({source:e}){return e==="user"?n.jsx(Ve,{tone:"success",children:u("agents_ui.source_user")}):e==="user-override"?n.jsx(Ve,{tone:"warning",children:u("agents_ui.source_override")}):n.jsx(Ve,{tone:"muted",children:u("agents_ui.source_bundled")})}function Rh({label:e,onClick:t,variant:a="ghost",children:o}){const l="inline-flex size-7 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",i={ghost:"text-muted-fg hover:bg-accent hover:text-accent-fg","ghost-destructive":"text-muted-fg hover:bg-destructive/15 hover:text-destructive",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80"};return n.jsxs(p_,{children:[n.jsx(m_,{render:n.jsx("button",{type:"button",onClick:t,"aria-label":e,className:`${l} ${i[a]}`,children:o})}),n.jsx(g_,{children:e})]})}function OI({agent:e,onClose:t,onSaved:a}){const o=Ze(),[l,i]=x.useState(!1),d=!e,[f,m]=x.useState(e?.slug??""),[h,g]=x.useState(e?.role??""),[b,_]=x.useState(e?.model??""),[k,N]=x.useState(e?.description??""),[y,w]=x.useState(e?.language??"es"),[E,j]=x.useState((e?.skills??[]).join(", ")),[S,R]=x.useState((e?.tools??[]).join(", ")),[A,T]=x.useState(!!e?.is_master),[O,M]=x.useState(e?.body??""),B=async()=>{const P={role:h||void 0,model:b||void 0,description:k||void 0,language:y||void 0,skills:E,tools:S,is_master:A};i(!0);try{if(d){if(!/^[a-z][a-z0-9_-]*$/.test(f))throw new Error(u("base.defaults_slug_invalid"));await an.vaultCreate(f,P,O),o.success(u("base.defaults_created",{slug:f}))}else await an.vaultPatch(e.slug,{fields:P,body:O}),o.success(u("base.defaults_saved",{slug:e.slug}));a()}catch($){o.error($.message)}finally{i(!1)}};return n.jsx(Zt,{open:!0,onClose:t,title:d?u("base.defaults_new_title"):u("base.defaults_edit_title",{slug:e.slug}),description:d?u("base.defaults_new_desc"):e.source==="bundled"?u("base.defaults_bundled_desc"):u("base.defaults_user_desc"),size:"lg",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:l,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:B,loading:l,children:u("common.save")})]}),children:n.jsxs("div",{className:"space-y-3",children:[d&&n.jsx(ce,{label:"slug",hint:u("agents_ui.slug_kebab_hint"),children:n.jsx(Te,{autoFocus:!0,value:f,onChange:P=>m(P.target.value),placeholder:"reviewer"})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:"role",children:n.jsx(Te,{value:h,onChange:P=>g(P.target.value),placeholder:"Code reviewer"})}),n.jsx(ce,{label:"model",children:n.jsx(Te,{value:b,onChange:P=>_(P.target.value),placeholder:"openrouter:..."})}),n.jsx(ce,{label:"language",children:n.jsx(Te,{value:y,onChange:P=>w(P.target.value),placeholder:"es"})}),n.jsx(ce,{label:"is_master",children:n.jsx("div",{className:"flex h-9 items-center",children:n.jsx(Bt,{checked:A,onChange:T,label:u("base.defaults_master_label")})})})]}),n.jsx(ce,{label:"description",children:n.jsx(Te,{value:k,onChange:P=>N(P.target.value)})}),n.jsx(ce,{label:"skills",hint:u("agents_ui.comma_separated"),children:n.jsx(Te,{value:E,onChange:P=>j(P.target.value),placeholder:"code-review, git"})}),n.jsx(ce,{label:"tools",hint:u("agents_ui.comma_separated"),children:n.jsx(Te,{value:S,onChange:P=>R(P.target.value),placeholder:"read, write, run"})}),n.jsx(ce,{label:"body",hint:u("agents_ui.body_hint"),children:n.jsx(un,{value:O,onChange:P=>M(P.target.value),rows:10,placeholder:"# Mission\\n..."})})]})})}const zI=20,Yk=[10,20,50,100];function G_({key:e,fetchPage:t,resetKey:a,initialPageSize:o=zI,swr:l}){const[i,d]=x.useState(1),[f,m]=x.useState(o);x.useEffect(()=>{d(1)},[a]);const h=(i-1)*f,g=He(e==null?null:[e,f,h],()=>t(f,h),{keepPreviousData:!0,...l}),b=g.data?.total??0,_=Math.max(1,Math.ceil(b/f)),k=Math.min(i,_);x.useEffect(()=>{i!==k&&d(k)},[i,k]);const N=b===0?0:h,y=Math.min(h+f,b);return{items:g.data?.items??[],isLoading:g.isLoading,error:g.error,mutate:g.mutate,page:k,pageCount:_,total:b,start:N,end:y,pageSize:f,setPage:d,setPageSize:w=>{m(w),d(1)}}}function DI({page:e,pageCount:t,total:a,start:o,end:l,pageSize:i,onPage:d,onPageSize:f}){return a<=Yk[0]?null:n.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-3 text-xs text-muted-fg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"tabular-nums",children:u("common.pager_range",{from:o+1,to:l,total:a})}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{children:u("common.pager_per_page")}),n.jsx("div",{className:"w-[4.5rem]",children:n.jsx(ut,{value:String(i),onChange:m=>f(Number(m)),options:Yk.map(m=>({value:String(m),label:String(m)}))})})]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ie,{size:"sm",variant:"ghost",disabled:e<=1,onClick:()=>d(e-1),"aria-label":u("common.pager_prev"),children:n.jsx(OA,{size:14})}),n.jsx("span",{className:"px-1 tabular-nums",children:u("common.pager_page",{page:e,total:t})}),n.jsx(ie,{size:"sm",variant:"ghost",disabled:e>=t,onClick:()=>d(e+1),"aria-label":u("common.pager_next"),children:n.jsx(Qr,{size:14})})]})]})}function Y_({paged:e,fullHeight:t,className:a,children:o}){const l=n.jsx(DI,{page:e.page,pageCount:e.pageCount,total:e.total,start:e.start,end:e.end,pageSize:e.pageSize,onPage:e.setPage,onPageSize:e.setPageSize});return t?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx("div",{className:ge("min-h-0 flex-1 overflow-y-auto",a),children:o}),n.jsx("div",{className:"shrink-0",children:l})]}):n.jsxs("div",{className:a,children:[o,l]})}const PI={apx:"success",claude:"info",codex:"warning"};function LI({pid:e}={}){const t=Ze(),a=Ep(),o=!e||String(e)==="0",{project:l}=du(o?"":e),i=o?void 0:l?.path||void 0,[d,f]=x.useState(""),[m,h]=x.useState(""),[g,b]=x.useState(""),[_,k]=x.useState(!1);x.useEffect(()=>{const R=setTimeout(()=>b(m.trim()),350);return()=>clearTimeout(R)},[m]);const N=G_({key:`/sessions?engine=${d}&q=${g}&deep=${_?1:0}&cwd=${i||""}`,fetchPage:(R,A)=>xP.page({engine:d||void 0,q:g||void 0,deep:_,cwd:i,limit:R,offset:A}),resetKey:`${d}|${g}|${_?1:0}|${i||""}`}),y=()=>{h(""),b(""),f(""),k(!1)},w=async R=>{try{await navigator.clipboard.writeText(`apx session resume ${R.id} --continue`),t.success(u("base.sessions_cmd_copied"))}catch{t.error(u("base.sessions_copy_failed"))}},E=R=>{const A=`Continue this session: ${R.id} (engine: ${R.engine}${R.title?`, title: "${R.title}"`:""}${R.cwd?`, folder: ${R.cwd}`:""}). With these instructions: `;window.dispatchEvent(new CustomEvent("apx:roby-prompt",{detail:{prompt:A}}))},j=async R=>{if(!R.cwd){t.error(u("base.sessions_no_folder"));return}try{await jN.exec({kind:"open_path",target:R.cwd})}catch(A){t.error(u("base.sessions_folder_failed",{msg:A.message}))}},S=async R=>{const A=R.path||R.cwd;if(!A){t.error(u("base.sessions_no_path"));return}try{await navigator.clipboard.writeText(A),t.success(u("base.sessions_path_copied"))}catch{t.error(u("base.sessions_copy_failed"))}};return n.jsxs(Ye,{fullHeight:!0,title:u("base.sessions_title"),description:o?u("base.sessions_desc"):u("base.sessions_desc_scoped",{path:i||"…"}),action:n.jsx(qe,{content:u("base.sessions_refresh"),children:n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>N.mutate(),children:n.jsx(Ss,{size:13})})}),children:[n.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Fl,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-fg"}),n.jsx(Te,{className:"pl-8",placeholder:u("base.sessions_search_ph"),value:m,onChange:R=>h(R.target.value)})]}),n.jsx(qe,{content:u("base.sessions_deep_tip"),children:n.jsx(ie,{size:"sm",variant:_?"primary":"secondary",onClick:()=>k(R=>!R),children:u("base.sessions_deep")})}),n.jsx("div",{className:"w-36",children:n.jsx(ut,{value:d,onChange:f,options:[{value:"",label:u("base.sessions_all")},{value:"apx",label:"apx"},{value:"claude",label:"claude"},{value:"codex",label:"codex"}]})}),n.jsx(qe,{content:u("base.sessions_clear"),children:n.jsx(ie,{size:"sm",variant:"ghost",onClick:y,children:n.jsx(gs,{size:14})})})]}),N.isLoading&&n.jsx(rt,{}),N.error&&n.jsx(pt,{children:u("base.sessions_error",{msg:N.error.message})}),!N.isLoading&&!N.error&&N.total===0&&n.jsx(pt,{children:g?u("base.sessions_no_match",{q:g}):u("base.sessions_empty")}),n.jsx(Y_,{paged:N,fullHeight:!0,children:n.jsx("ul",{className:"space-y-1 text-sm",children:N.items.map((R,A)=>n.jsxs("li",{className:"group flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx(Ve,{tone:PI[R.engine]||"muted",children:R.engine}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate",children:R.title||R.id}),n.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-fg",children:[n.jsx("span",{className:"shrink-0",children:R.id}),R.cwd&&n.jsxs("span",{className:"truncate",children:["· ",R.cwd]})]})]}),R.mtime>0&&n.jsx("span",{className:"shrink-0 text-[11px] text-muted-fg",children:new Date(R.mtime).toLocaleString()}),n.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 opacity-60 transition-opacity group-hover:opacity-100",children:[n.jsx(qe,{content:u("base.sessions_act_cmd"),children:n.jsx(ie,{size:"sm",variant:"ghost","aria-label":u("base.sessions_act_cmd"),onClick:()=>w(R),children:n.jsx(_a,{size:13})})}),n.jsx(qe,{content:u("base.sessions_act_ask",{name:a}),children:n.jsx(ie,{size:"sm",variant:"ghost","aria-label":u("base.sessions_act_ask",{name:a}),onClick:()=>E(R),children:n.jsx(rn,{size:13})})}),n.jsx(qe,{content:u("base.sessions_act_folder"),children:n.jsx(ie,{size:"sm",variant:"ghost","aria-label":u("base.sessions_act_folder"),onClick:()=>j(R),children:n.jsx(Fo,{size:13})})}),n.jsx(qe,{content:u("base.sessions_act_path"),children:n.jsx(ie,{size:"sm",variant:"ghost","aria-label":u("base.sessions_act_path"),onClick:()=>S(R),children:n.jsx(Ao,{size:13})})})]})]},`${R.engine}-${R.id}-${A}`))})})]})}function II(){const e=Pn(),[t,a]=x.useState("open"),o=G_({key:`/tasks?state=${t}`,fetchPage:(l,i)=>Xn.globalPage({state:t,limit:l,offset:i}),resetKey:t});return n.jsxs(Ye,{fullHeight:!0,title:u("project.global_tasks.title"),description:u("project.global_tasks.subtitle"),action:n.jsx("div",{className:"flex gap-1",children:["open","done","dropped","all"].map(l=>n.jsx(ie,{size:"sm",variant:t===l?"primary":"ghost",onClick:()=>a(l),children:l},l))}),children:[o.isLoading&&n.jsx(rt,{}),!o.isLoading&&o.total===0&&n.jsx(pt,{children:u("project.global_tasks.empty")}),n.jsx(Y_,{paged:o,fullHeight:!0,children:n.jsx("ul",{className:"space-y-2 text-sm",children:o.items.map(l=>n.jsxs("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx("button",{type:"button",onClick:()=>e(`/p/${l.project_id}/tasks`),title:u("project.global_tasks.go_project"),children:n.jsx(Ve,{tone:"info",children:(l.project_name||"").split("/").pop()||l.project_id})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"font-medium",children:l.title}),n.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[n.jsx("span",{children:l.state}),l.agent&&n.jsxs(Ve,{tone:"muted",children:["@",l.agent]}),l.tags?.map(i=>n.jsxs("span",{children:["#",i]},i)),l.due&&n.jsxs("span",{children:[u("project.global_tasks.due")," ",l.due]})]})]})]},`${l.project_id}-${l.id}`))})})]})}const bE=x.createContext(void 0);function K_(){const e=x.useContext(bE);if(e===void 0)throw new Error(cn(64));return e}let BI=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const Op={tabActivationDirection:e=>({[BI.activationDirection]:e})},$I=x.forwardRef(function(t,a){const{className:o,defaultValue:l=0,onValueChange:i,orientation:d="horizontal",render:f,value:m,style:h,...g}=t,b=t.defaultValue!==void 0,_=x.useRef([]),[k,N]=x.useState(()=>new Map),[y,w]=oi({controlled:m,default:l,name:"Tabs",state:"value"}),E=m!==void 0,[j,S]=x.useState(()=>new Map),R=x.useRef(void 0),A=x.useCallback(ne=>{if(ne===void 0)return null;for(const[ve,oe]of j.entries())if(oe!=null&&ne===(oe.value??oe.index))return ve;return null},[j]),[T,O]=x.useState(()=>({previousValue:y,tabActivationDirection:"none"})),{previousValue:M,tabActivationDirection:B}=T;let P=B,$=!1;M!==y&&(P=Kk(M,y,d,j),$=M!=null&&y!=null&&A(y)==null);const D=$?M:y,L=M!==D||B!==P;De(()=>{L&&O({previousValue:D,tabActivationDirection:P})},[D,L,P]);const H=Ue((ne,ve)=>{const oe=Kk(y,ne,d,j);ve.activationDirection=oe,i?.(ne,ve),!ve.isCanceled&&w(ne)}),V=Ue((ne,ve)=>{i?.(ne,st(ve,void 0,void 0,{activationDirection:"none"}))}),U=Ue((ne,ve)=>{N(oe=>{if(oe.get(ne)===ve)return oe;const fe=new Map(oe);return fe.set(ne,ve),fe})}),F=Ue((ne,ve)=>{N(oe=>{if(!oe.has(ne)||oe.get(ne)!==ve)return oe;const fe=new Map(oe);return fe.delete(ne),fe})}),X=x.useCallback(ne=>k.get(ne),[k]),G=x.useCallback(ne=>{for(const ve of j.values())if(ne===ve?.value)return ve?.id},[j]),Y=x.useMemo(()=>({getTabElementBySelectedValue:A,getTabIdByPanelValue:G,getTabPanelIdByValue:X,onValueChange:H,orientation:d,registerMountedTabPanel:U,setTabMap:S,unregisterMountedTabPanel:F,tabActivationDirection:P,value:y}),[A,G,X,H,d,U,S,F,P,y]),I=x.useMemo(()=>{for(const ne of j.values())if(ne!=null&&ne.value===y)return ne},[j,y]),Q=x.useMemo(()=>{for(const ne of j.values())if(ne!=null&&!ne.disabled)return ne.value},[j]),J=x.useRef(!b),K=x.useRef(l),se=x.useRef(b),te=x.useRef(!1);De(()=>{if(E)return;function ne(we,Ce){w(we),O(Le=>Le.previousValue===we&&Le.tabActivationDirection==="none"?Le:{previousValue:we,tabActivationDirection:"none"}),V(we,Ce),J.current=!1}if(j.size===0){te.current&&y!==null&&!R.current?.isConnected&&ne(null,Nj);return}te.current=!0,R.current=j.keys().next().value;const ve=I?.disabled,oe=I==null&&y!==null;if(!ve&&y===K.current&&(se.current=!1),se.current&&ve&&y===K.current)return;const fe=J.current;if(ve||oe){const we=Q??null;if(y===we){J.current=!1;return}let Ce=Nj;fe?Ce=Ej:ve&&(Ce=kS),ne(we,Ce);return}fe&&I!=null&&(V(y,Ej),J.current=!1)},[Q,E,V,I,w,j,y]);const W=Et("div",t,{state:{orientation:d,tabActivationDirection:P},ref:a,props:g,stateAttributesMapping:Op});return n.jsx(bE.Provider,{value:Y,children:n.jsx(Cp,{elementsRef:_,children:W})})});function Kk(e,t,a,o){if(e==null||t==null)return"none";let l=null,i=null;for(const[m,h]of o.entries()){if(h==null)continue;const g=h.value??h.index;if(e===g&&(l=m),t===g&&(i=m),l!=null&&i!=null)break}if(l==null||i==null)return l!==i&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?a==="horizontal"?t>e?"right":"left":t>e?"down":"up":"none";const d=l.getBoundingClientRect(),f=i.getBoundingClientRect();if(a==="horizontal"){if(f.left<d.left)return"left";if(f.left>d.left)return"right"}else{if(f.top<d.top)return"up";if(f.top>d.top)return"down"}return"none"}const _E="data-composite-item-active",vE=x.createContext(void 0);function UI(){const e=x.useContext(vE);if(e===void 0)throw new Error(cn(65));return e}const HI=x.forwardRef(function(t,a){const{className:o,disabled:l=!1,render:i,value:d,id:f,nativeButton:m=!0,style:h,...g}=t,{value:b,getTabPanelIdByValue:_,orientation:k,tabActivationDirection:N}=K_(),{activateOnFocus:y,highlightedTabIndex:w,onTabActivation:E,registerTabResizeObserverElement:j,setHighlightedTabIndex:S,tabsListElement:R}=UI(),A=ra(f),T=x.useMemo(()=>({disabled:l,id:A,value:d}),[l,A,d]),{compositeProps:O,compositeRef:M,index:B}=oN({metadata:T}),P=d===b,$=x.useRef(!1),D=x.useRef(null);De(()=>{const J=D.current;if(J)return j(J)},[j]),De(()=>{if($.current){$.current=!1;return}if(!(P&&B>-1&&w!==B))return;const J=R;if(J!=null){const K=Yn(xt(J));if(K&&We(J,K))return}l||S(B)},[P,B,w,S,l,R]);const{getButtonProps:L,buttonRef:H}=no({disabled:l,native:m,focusableWhenDisabled:!0}),V=_(d),U=x.useRef(!1),F=x.useRef(!1);function X(J){P||l||E(d,st(va,J.nativeEvent,void 0,{activationDirection:"none"}))}function G(J){P||(B>-1&&!l&&S(B),!l&&y&&(!U.current||U.current&&F.current)&&E(d,st(va,J.nativeEvent,void 0,{activationDirection:"none"})))}function Y(J){if(P||l)return;U.current=!0;function K(){U.current=!1,F.current=!1}(!J.button||J.button===0)&&(F.current=!0,xt(J.currentTarget).addEventListener("pointerup",K,{once:!0}))}return Et("button",t,{state:{disabled:l,active:P,orientation:k,tabActivationDirection:N},ref:[a,H,M,D],props:[O,{role:"tab","aria-controls":V,"aria-selected":P,id:A,onClick:X,onFocus:G,onPointerDown:Y,[_E]:P?"":void 0,onKeyDownCapture(){$.current=!0}},g,L],stateAttributesMapping:Op})});let qI=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e[e.startingStyle=Lo.startingStyle]="startingStyle",e[e.endingStyle=Lo.endingStyle]="endingStyle",e})({});const VI={...Op,...ur},FI=x.forwardRef(function(t,a){const{className:o,value:l,render:i,keepMounted:d=!1,style:f,...m}=t,{value:h,getTabIdByPanelValue:g,orientation:b,tabActivationDirection:_,registerMountedTabPanel:k,unregisterMountedTabPanel:N}=K_(),y=ra(),w=x.useMemo(()=>({id:y,value:l}),[y,l]),{ref:E,index:j}=lu({metadata:w}),S=l===h,{mounted:R,transitionStatus:A,setMounted:T}=_i(S),O=!R,M=g(l),B={hidden:O,orientation:b,tabActivationDirection:_,transitionStatus:A},P=x.useRef(null),$=Et("div",t,{state:B,ref:[a,E,P],props:[{"aria-labelledby":M,hidden:O,id:y,role:"tabpanel",tabIndex:S?0:-1,inert:yp(!S),[qI.index]:j},m],stateAttributesMapping:VI});return ka({open:S,ref:P,onComplete(){S||T(!1)}}),De(()=>{if(!(O&&!d)&&y!=null)return k(l,y),()=>{N(l,y)}},[O,d,l,y,k,N]),d||R?$:null}),GI=[];function YI(e){const{loopFocus:t=!0,orientation:a="both",grid:o,onLoop:l,direction:i,highlightedIndex:d,onHighlightedIndexChange:f,rootRef:m,enableHomeAndEndKeys:h=!1,stopEventPropagation:g=!1,disabledIndices:b,modifierKeys:_=GI}=e,[k,N]=x.useState(0),y=o!=null,w=x.useRef(null),E=rr(w,m),j=x.useRef([]),S=x.useRef(!1),R=d??k,A=Ue((P,$=!1)=>{if((f??N)(P),$){const D=j.current[P];uk(w.current,D,i,a)}}),T=Ue(P=>{if(P.size===0||S.current)return;S.current=!0;const $=Array.from(P.keys()),D=$.find(H=>H?.hasAttribute(_E))??null,L=D?$.indexOf(D):-1;if(L!==-1)A(L);else if(vf($,R,b)){const H=Qa($,{disabledIndices:b});Oc($,H)||A(H)}uk(w.current,D,i,a)});De(()=>{if(b==null||d!=null||!S.current)return;const P=j.current;if(vf(P,R,b)){const $=Qa(P,{disabledIndices:b});Oc(P,$)||A($)}},[b,d,R,j,A]);const O=Ue((P,$,D)=>l?l(P,$,D,j):D),M=Ue(P=>{const $=h?Sp:WC;if(!$.has(P.key)||KI(P,_)||!w.current)return;const L=i==="rtl",H=L?Ef:Rf,V={horizontal:H,vertical:Pc,both:H}[a],U=L?Rf:Ef,F={horizontal:U,vertical:Dc,both:U}[a],X=qn(P.nativeEvent);if(X!=null&&ck(X)&&!iN(X)){const se=X.selectionStart,te=X.selectionEnd,le=X.value??"";if(se==null||P.shiftKey||se!==te||P.key!==F&&se<le.length||P.key!==V&&se>0)return}let G=R;const Y=sf(j,b),I=Ex(j,b);o!=null&&(G=o({disabledIndices:b,elementsRef:j,event:P,highlightedIndex:R,loopFocus:t,maxIndex:I,minIndex:Y,onLoop:O,orientation:a,rtl:L}));const Q={horizontal:[H],vertical:[Pc],both:[H,Pc]}[a],J={horizontal:[U],vertical:[Dc],both:[U,Dc]}[a],K=y?$:{horizontal:h?V6:XC,vertical:h?F6:QC,both:$}[a];h&&(P.key===kp?G=Y:P.key===wp&&(G=I)),G===R&&(Q.includes(P.key)||J.includes(P.key))&&(t&&G===I&&Q.includes(P.key)?(G=Y,l&&(G=l(P,R,G,j))):t&&G===Y&&J.includes(P.key)?(G=I,l&&(G=l(P,R,G,j))):G=Qa(j.current,{startingIndex:G,decrement:J.includes(P.key),disabledIndices:b})),G!==R&&!Oc(j.current,G)&&(g&&P.stopPropagation(),K.has(P.key)&&P.preventDefault(),A(G,!0),queueMicrotask(()=>{j.current[G]?.focus()}))});return{props:{ref:E,onFocus(P){const $=w.current,D=qn(P.nativeEvent);!$||D==null||!ck(D)||D.setSelectionRange(0,D.value.length??0)},onKeyDown:M},highlightedIndex:R,onHighlightedIndexChange:A,elementsRef:j,disabledIndices:b,onMapChange:T,relayKeyboardEvent:M}}function KI(e,t){for(const a of Q6.values())if(!t.includes(a)&&e.getModifierState(a))return!0;return!1}function XI(e){const{render:t,className:a,style:o,refs:l=ar,props:i=ar,state:d=Xt,stateAttributesMapping:f,highlightedIndex:m,onHighlightedIndexChange:h,orientation:g,grid:b,loopFocus:_,onLoop:k,enableHomeAndEndKeys:N,onMapChange:y,stopEventPropagation:w=!0,rootRef:E,disabledIndices:j,modifierKeys:S,highlightItemOnHover:R=!1,tag:A="div",...T}=e,O=_p(),{props:M,highlightedIndex:B,onHighlightedIndexChange:P,elementsRef:$,onMapChange:D,relayKeyboardEvent:L}=YI({grid:b,loopFocus:_,onLoop:k,orientation:g,highlightedIndex:m,onHighlightedIndexChange:h,rootRef:E,stopEventPropagation:w,enableHomeAndEndKeys:N,direction:O,disabledIndices:j,modifierKeys:S}),H=Et(A,e,{state:d,ref:l,props:[M,...i,T],stateAttributesMapping:f}),V=x.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:P,highlightItemOnHover:R,relayKeyboardEvent:L}),[B,P,R,L]);return n.jsx(HC.Provider,{value:V,children:n.jsx(Cp,{elementsRef:$,onMapChange:U=>{y?.(U),D(U)},children:H})})}const QI=x.forwardRef(function(t,a){const{activateOnFocus:o=!1,className:l,loopFocus:i=!0,render:d,style:f,...m}=t,{onValueChange:h,orientation:g,value:b,setTabMap:_,tabActivationDirection:k}=K_(),[N,y]=x.useState(0),[w,E]=x.useState(null),j=x.useRef(new Set),S=x.useRef(new Set),R=x.useRef(null);De(()=>{if(typeof ResizeObserver>"u")return;const $=new ResizeObserver(()=>{j.current.forEach(D=>{D()})});return R.current=$,w&&$.observe(w),S.current.forEach(D=>{$.observe(D)}),()=>{$.disconnect(),R.current=null}},[w]);const A=Ue($=>(j.current.add($),()=>{j.current.delete($)})),T=Ue($=>(S.current.add($),R.current?.observe($),()=>{S.current.delete($),R.current?.unobserve($)})),O=Ue(($,D)=>{$!==b&&h($,D)}),M={orientation:g,tabActivationDirection:k},B={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},P=x.useMemo(()=>({activateOnFocus:o,highlightedTabIndex:N,registerIndicatorUpdateListener:A,registerTabResizeObserverElement:T,onTabActivation:O,setHighlightedTabIndex:y,tabsListElement:w}),[o,N,A,T,O,y,w]);return n.jsx(vE.Provider,{value:P,children:n.jsx(XI,{render:d,className:l,style:f,state:M,refs:[a,E],props:[B,m],stateAttributesMapping:Op,highlightedIndex:N,enableHomeAndEndKeys:!0,loopFocus:i,orientation:g,onHighlightedIndexChange:y,onMapChange:_,disabledIndices:ar})})});function zp({className:e,...t}){return n.jsx($I,{"data-slot":"tabs",className:Ct("flex flex-col gap-4",e),...t})}const WI=A_("inline-flex h-9 w-fit items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground data-[variant=line]:h-8 data-[variant=line]:gap-1 data-[variant=line]:rounded-none data-[variant=line]:bg-transparent data-[variant=line]:p-0",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Dp({className:e,variant:t="default",...a}){return n.jsx(QI,{"data-slot":"tabs-list","data-variant":t,className:Ct(WI({variant:t}),e),...a})}function Hs({className:e,...t}){return n.jsx(HI,{"data-slot":"tabs-trigger",className:Ct("inline-flex h-7 items-center justify-center gap-1.5 rounded-md border border-transparent px-3 py-1 text-sm font-medium whitespace-nowrap text-muted-fg transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-active:bg-background data-active:text-foreground data-active:shadow-sm dark:data-active:border-input dark:data-active:bg-input/30 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function fs({className:e,...t}){return n.jsx(FI,{"data-slot":"tabs-content",className:Ct("text-sm outline-none",e),...t})}function Xk(e,t){let a=e;for(const o of t.split(".")){if(!a||typeof a!="object"||Array.isArray(a))return;a=a[o]}return a}function X_(e,t=""){const a={};for(const[o,l]of Object.entries(e)){const i=t?`${t}.${o}`:o;l&&typeof l=="object"&&!Array.isArray(l)?Object.assign(a,X_(l,i)):a[i]=l}return a}function yE(e){const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("JSON debe ser objeto.");return t}function uf({sections:e,source:t,placeholderSource:a,jsonTitle:o,jsonDescription:l,saveLabel:i=u("common.save"),onSaveFields:d,onSaveJson:f,busy:m,hideJson:h=!1}){const g=e[0]?.key||"json",[b,_]=x.useState({}),[k,N]=x.useState(""),[y,w]=x.useState("");x.useEffect(()=>{const A={};for(const T of e.flatMap(O=>O.fields))A[T.path]=Xk(t,T.path)??"";_(A),N(JSON.stringify(t||{},null,2)),w("")},[t,e]);const E=x.useMemo(()=>new Set(e.flatMap(A=>A.fields.map(T=>T.path))),[e]),j=async()=>{const A={},T=[];for(const O of e.flatMap(M=>M.fields)){const M=b[O.path];if(!ps(M)){if(M===""||M===void 0||M===null){T.push(O.path);continue}if(O.kind==="number"){const B=Number(M);Number.isFinite(B)&&(A[O.path]=B)}else A[O.path]=M}}await d(A,T.filter(O=>E.has(O)))},S=async()=>{w("");try{await f(yE(k))}catch(A){w(A.message)}},R=A=>n.jsxs("div",{className:"space-y-4",children:[A.description&&n.jsx("p",{className:"text-sm text-muted-fg",children:A.description}),n.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:A.fields.map(T=>n.jsx(ZI,{field:T,value:b[T.path],inherited:Xk(a,T.path),onChange:O=>_(M=>({...M,[T.path]:O}))},T.path))}),n.jsx(ie,{variant:"primary",loading:m,onClick:j,children:i})]});return h&&e.length<=1?e[0]?R(e[0]):null:n.jsxs(zp,{defaultValue:g,className:"space-y-4",children:[n.jsxs(Dp,{className:"flex flex-wrap",children:[e.map(A=>n.jsx(Hs,{value:A.key,children:A.label},A.key)),!h&&n.jsx(Hs,{value:"json",children:"JSON"})]}),e.map(A=>n.jsx(fs,{value:A.key,children:R(A)},A.key)),!h&&n.jsx(fs,{value:"json",children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium",children:o}),l&&n.jsx("p",{className:"text-xs text-muted-fg",children:l})]}),n.jsx(un,{rows:18,className:"font-mono text-xs",value:k,onChange:A=>N(A.target.value)}),y&&n.jsx("p",{className:"text-xs text-destructive",children:y}),n.jsx(ie,{variant:"primary",loading:m,onClick:S,children:u("settings_ui.save_json")})]})})]})}function ZI({field:e,value:t,inherited:a,onChange:o}){const l=e.placeholder||Qk(a)||(ps(t)?Vr(t):""),i=e.hint||(a!==void 0?`Heredado: ${Qk(a)}`:void 0);return e.kind==="boolean"?n.jsx("div",{className:"flex items-end pb-1",children:n.jsx(Bt,{checked:t===!0,onChange:o,label:e.label})}):n.jsx(ce,{label:e.label,hint:i,children:e.kind==="select"?n.jsx(ut,{value:String(t||""),onChange:o,placeholder:l||"(sin override)",options:[{value:"",label:l||"(sin override)"},...(e.options||[]).map(d=>({value:String(d.value),label:d.label}))]}):e.kind==="textarea"?n.jsx(un,{rows:4,value:String(t||""),placeholder:l,onChange:d=>o(d.target.value)}):n.jsx(Te,{type:e.kind==="password"?"password":e.kind==="number"?"number":"text",value:String(ps(t)?"":t||""),placeholder:e.kind==="password"&&ps(t)?Vr(t):e.kind==="password"&&ps(a)?Vr(a):l,onChange:d=>o(d.target.value)})})}function Qk(e){return e==null||e===""?"":ps(e)?Vr(e):Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function JI(){return[{key:"routing",label:u("settings_ui.cfg_overrides_label"),description:u("settings_ui.cfg_overrides_desc"),fields:[{path:"route_to_agent",label:u("settings_ui.cfg_route_to_agent"),placeholder:"master"},{path:"super_agent.model",label:u("settings_ui.cfg_super_agent_model")},{path:"super_agent.permission_mode",label:u("settings_ui.cfg_permission_mode"),kind:"select",options:Cb.map(e=>({value:e,label:e}))},{path:"super_agent.system",label:u("settings_ui.cfg_extra_prompt"),kind:"textarea"}]}]}function e7(){return[{key:"engines",label:u("settings_ui.cfg_engines_label"),fields:[{path:"engines.ollama.base_url",label:u("settings_ui.cfg_ollama_url")},{path:"engines.anthropic.api_key",label:u("settings_ui.cfg_anthropic_key"),kind:"password"},{path:"engines.openai.api_key",label:u("settings_ui.cfg_openai_key"),kind:"password"},{path:"engines.groq.api_key",label:u("settings_ui.cfg_groq_key"),kind:"password"},{path:"engines.openrouter.api_key",label:u("settings_ui.cfg_openrouter_key"),kind:"password"},{path:"engines.gemini.api_key",label:u("settings_ui.cfg_gemini_key"),kind:"password"}]}]}function t7(){return[{key:"identity",label:u("settings_ui.cfg_project_label"),description:u("settings_ui.cfg_project_desc"),fields:[{path:"name",label:u("settings_ui.cfg_name")},{path:"version",label:u("settings_ui.cfg_version")},{path:"apf",label:u("settings_ui.cfg_apc_spec")},{path:"apx",label:u("settings_ui.cfg_apx_install")},{path:"apx_id",label:u("settings_ui.cfg_apx_storage_id")}]}]}function jE({pid:e}){const t=Ze(),{project:a}=du(e),{channels:o,isLoading:l,mutate:i}=P_(),d=String(e),f=a?.name||a?.path?.split("/").pop()||d,m=`proj-${d}`,h=o.find(O=>O.project===d||O.project===f||O.name===m),[g,b]=x.useState(!!h),[_,k]=x.useState(""),[N,y]=x.useState(""),[w,E]=x.useState(""),[j,S]=x.useState(!0),[R,A]=x.useState(!1);if(x.useEffect(()=>{h?(b(!0),k(""),y(h.chat_id||""),E(h.route_to_agent||""),S(h.respond_with_engine??!0)):(b(!1),k(""),y(""),E(""),S(!0))},[h?.name,h?.chat_id,h?.route_to_agent]),l)return n.jsx(rt,{});const T=async()=>{A(!0);try{if(!g){h&&(await Dn.channels.remove(h.name),t.success(u("project.telegram.cleared"))),await i();return}const O={name:h?.name||m,project:d,chat_id:N,route_to_agent:w,respond_with_engine:j,..._?{bot_token:_}:{}};h?await Dn.channels.patch(h.name,O):await Dn.channels.upsert(O),t.success(u("project.telegram.saved")),await i(),k("")}catch(O){t.error(O.message)}finally{A(!1)}};return n.jsx(Ye,{title:u("project.telegram.title"),description:u("project.telegram.subtitle"),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Bt,{checked:g,onChange:b,label:u(g?"project.telegram.override_active":"project.telegram.use_default")}),h&&n.jsx(Ve,{tone:"success",children:u("project.telegram.channel_badge",{name:h.name})})]}),g&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.telegram.bot_token"),hint:h?.bot_token?`${Vr(h.bot_token)} ${u("telegram_ui.empty_keep")}`:u("project.telegram.bot_hint_none"),children:n.jsx(Te,{type:"password",value:_,onChange:O=>k(O.target.value),placeholder:h?.bot_token?Vr(h.bot_token):""})}),n.jsx(ce,{label:u("project.telegram.chat_id"),children:n.jsx(Te,{value:N,onChange:O=>y(O.target.value)})}),n.jsx(ce,{label:u("project.telegram.route_agent"),hint:u("project.telegram.route_hint"),children:n.jsx(Te,{value:w,onChange:O=>E(O.target.value)})})]}),n.jsx(Bt,{checked:j,onChange:S,label:u("project.telegram.respond_engine")})]}),n.jsx("div",{className:"pt-2",children:n.jsx(ie,{variant:"primary",loading:R,onClick:T,children:u("common.save")})}),!g&&!h&&n.jsx(pt,{children:u("project.telegram.no_override")})]})})}function n7({pid:e}){const t=Ze(),a=Pn(),{project:o,mutate:l}=du(e),i=He(`/projects/${e}/config`,()=>Zn.config.show(e)),d=String(e)==="0";if(i.isLoading)return n.jsx(rt,{});if(!i.data)return n.jsx(pt,{children:u("project.config.no_data")});const f=async g=>{await Zn.apcProject.put(e,g),t.success(u("project.config.save_project")),i.mutate()},m=async g=>{await Zn.config.put(e,g),t.success(u("project.config.save_override")),i.mutate()},h=async(g,b)=>{await Zn.config.set(e,g),b.length&&await Zn.config.unset(e,b),t.success(u("project.config.save_fields_success")),i.mutate()};return n.jsxs("div",{className:"space-y-6",children:[n.jsx(Ye,{title:u("project.config.section_title"),description:u("project.config.section_desc"),children:n.jsxs(zp,{defaultValue:"settings",className:"space-y-4",children:[n.jsxs(Dp,{className:"flex flex-wrap",children:[n.jsx(Hs,{value:"settings",children:u("project.config.tab_settings")}),n.jsx(Hs,{value:"engines",children:u("settings_ui.cfg_engines_label")}),!d&&n.jsx(Hs,{value:"telegram",children:u("project.nav.telegram")}),n.jsx(Hs,{value:"project",children:u("project.config.tab_project")}),n.jsx(Hs,{value:"json",children:"JSON"})]}),n.jsx(fs,{value:"settings",children:n.jsx(uf,{sections:JI(),source:i.data.project_only,placeholderSource:i.data.effective,jsonTitle:i.data.project_config_path,onSaveFields:h,onSaveJson:m,hideJson:!0})}),n.jsx(fs,{value:"engines",children:n.jsx(uf,{sections:e7(),source:i.data.project_only,placeholderSource:i.data.effective,jsonTitle:i.data.project_config_path,onSaveFields:h,onSaveJson:m,hideJson:!0})}),!d&&n.jsx(fs,{value:"telegram",children:n.jsx(jE,{pid:e})}),n.jsx(fs,{value:"project",children:n.jsx(uf,{sections:t7(),source:i.data.apc_project||{},jsonTitle:i.data.project_json_path,onSaveFields:async(g,b)=>{await Zn.apcProject.set(e,a7(g),b),t.success(u("project.config.save_meta_success")),i.mutate()},onSaveJson:f,hideJson:!0})}),n.jsx(fs,{value:"json",children:n.jsxs("div",{className:"space-y-6",children:[n.jsx(Wk,{title:i.data.project_config_path,description:".apc/config.json — overrides del proyecto.",source:i.data.project_only,onSave:m}),n.jsx(Wk,{title:i.data.project_json_path,description:".apc/project.json — metadata APC portable.",source:i.data.apc_project||{},onSave:f}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("p",{className:"text-xs text-muted-fg",children:u("project.config.effective_read")}),n.jsx("pre",{className:"max-h-96 overflow-auto rounded-lg border border-border bg-muted/40 p-3 text-xs",children:JSON.stringify(i.data.effective,null,2)})]})]})})]})}),!d&&o?n.jsx(s7,{pid:e,label:o.name||o.path,onRebuilt:()=>i.mutate(),onUnregistered:()=>{l(),a("/")}}):null]})}function s7({pid:e,label:t,onRebuilt:a,onUnregistered:o}){const l=Ze(),[i,d]=x.useState(null),[f,m]=x.useState(null),h=async()=>{d("rebuild");try{await Zn.rebuild(e),l.success(u("project.rebuild_done")),a()}catch(b){l.error(b.message)}finally{d(null),m(null)}},g=async()=>{d("unregister");try{await Zn.remove(e),l.success(u("project.unregistered")),o()}catch(b){l.error(b.message)}finally{d(null),m(null)}};return n.jsxs(n.Fragment,{children:[n.jsx(Ye,{title:u("project.danger.title"),description:u("project.danger.subtitle"),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-border bg-muted/30 px-3 py-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-medium",children:u("project.rebuild")}),n.jsx("div",{className:"text-xs text-muted-fg",children:u("project.danger.rebuild_desc")})]}),n.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>m("rebuild"),children:[n.jsx(Ss,{size:13})," ",u("project.rebuild")]})]}),n.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-red-500/40 bg-red-500/5 px-3 py-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-medium",children:u("admin.unregister")}),n.jsx("div",{className:"text-xs text-muted-fg",children:u("project.danger.unregister_desc")})]}),n.jsxs(ie,{size:"sm",variant:"destructive",onClick:()=>m("unregister"),children:[n.jsx(vn,{size:13})," ",u("admin.unregister")]})]})]})}),n.jsx(Zt,{open:f==="rebuild",onClose:()=>i?null:m(null),title:u("project.danger.rebuild_confirm_title"),description:u("project.danger.rebuild_confirm_desc",{label:t}),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>m(null),disabled:i!==null,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:h,loading:i==="rebuild",children:u("project.rebuild")})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.danger.rebuild_long")})}),n.jsx(Zt,{open:f==="unregister",onClose:()=>i?null:m(null),title:u("project.danger.unregister_confirm_title"),description:u("project.unregister_confirm",{label:t}),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>m(null),disabled:i!==null,children:u("common.cancel")}),n.jsx(ie,{variant:"destructive",onClick:g,loading:i==="unregister",children:u("admin.unregister")})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.danger.unregister_long")})})]})}function Wk({title:e,description:t,source:a,onSave:o}){const[l,i]=x.useState(""),[d,f]=x.useState(""),[m,h]=x.useState(!1);x.useEffect(()=>{i(JSON.stringify(a||{},null,2)),f("")},[a]);const g=async()=>{f(""),h(!0);try{await o(yE(l))}catch(b){f(b.message)}finally{h(!1)}};return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium",children:e}),t&&n.jsx("p",{className:"text-xs text-muted-fg",children:t})]}),n.jsx(un,{rows:14,className:"font-mono text-xs",value:l,onChange:b=>i(b.target.value)}),d&&n.jsx("p",{className:"text-xs text-destructive",children:d}),n.jsx(ie,{variant:"primary",loading:m,onClick:g,children:u("settings_ui.save_json")})]})}function a7(e){const t={};for(const[a,o]of Object.entries(X_(e)))ps(o)||(t[a]=o);return t}function Zl(e){return String(e||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function kE({open:e,onClose:t,pid:a,editing:o,onSaved:l}){const i=Ze(),[d,f]=x.useState(""),[m,h]=x.useState(""),[g,b]=x.useState(""),[_,k]=x.useState(!1);x.useEffect(()=>{e&&(f(o?.name??""),h(o?.slug??""),b(o?.goal??""))},[e,o]);const N=async()=>{if(d.trim()){k(!0);try{o?await qr.updateArea(a,o.slug,{name:d,goal:g}):await qr.createArea(a,{name:d,slug:m||Zl(d),goal:g}),i.success(u("common.saved")),l(),t()}catch(y){i.error(y instanceof Error?y.message:String(y))}finally{k(!1)}}};return n.jsx(Zt,{open:e,onClose:t,title:u(o?"structure.edit_area":"structure.new_area"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,children:u("common.cancel")}),n.jsx(ie,{variant:"primary","data-testid":"area-create",onClick:()=>void N(),loading:_,disabled:!d.trim(),children:u(o?"common.save":"structure.create_area")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("structure.name"),children:n.jsx(Te,{autoFocus:!0,"data-testid":"area-name",value:d,onChange:y=>{f(y.target.value),o||h(Zl(y.target.value))},placeholder:"Engineering"})}),!o&&n.jsx(ce,{label:u("structure.slug"),children:n.jsx(Te,{value:m,onChange:y=>h(Zl(y.target.value)),className:"font-mono",placeholder:"engineering"})}),n.jsx(ce,{label:u("structure.goal"),hint:u("structure.goal_hint"),children:n.jsx(un,{value:g,onChange:y=>b(y.target.value),rows:2})})]})})}function wE({open:e,onClose:t,pid:a,areas:o,editing:l,presetArea:i,onSaved:d}){const f=Ze(),[m,h]=x.useState(""),[g,b]=x.useState(""),[_,k]=x.useState(""),[N,y]=x.useState(""),[w,E]=x.useState(!1);x.useEffect(()=>{e&&(h(l?.name??""),b(l?.slug??""),k(l?.area??i??""),y(l?.description??""))},[e,l,i]);const j=async()=>{if(m.trim()){E(!0);try{l?await qr.updateRole(a,l.slug,{name:m,area:_||null,description:N}):await qr.createRole(a,{name:m,slug:g||Zl(m),area:_||null,description:N}),f.success(u("common.saved")),d(),t()}catch(R){f.error(R instanceof Error?R.message:String(R))}finally{E(!1)}}},S=[{value:"",label:u("structure.no_area")},...o.map(R=>({value:R.slug,label:R.name}))];return n.jsx(Zt,{open:e,onClose:t,title:u(l?"structure.edit_role":"structure.new_role"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:()=>void j(),loading:w,disabled:!m.trim(),children:u(l?"common.save":"structure.create_role")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("structure.name"),children:n.jsx(Te,{autoFocus:!0,value:m,onChange:R=>{h(R.target.value),l||b(Zl(R.target.value))},placeholder:"Tech Lead"})}),!l&&n.jsx(ce,{label:u("structure.slug"),children:n.jsx(Te,{value:g,onChange:R=>b(Zl(R.target.value)),className:"font-mono",placeholder:"tech-lead"})}),n.jsx(ce,{label:u("structure.area"),children:n.jsx(ut,{value:_,onChange:k,options:S,placeholder:u("structure.no_area")})}),n.jsx(ce,{label:u("structure.description"),children:n.jsx(un,{value:N,onChange:R=>y(R.target.value),rows:2})})]})})}function SE({value:e,onChange:t}){return n.jsx(Te,{value:e,onChange:a=>t([...a.target.value].slice(-2).join("")),className:"text-center text-lg",placeholder:"🤖","aria-label":u("agents_form.emoji")})}const r7=[{value:"total",labelKey:"auto_total"},{value:"automatico",labelKey:"auto_automatico"},{value:"permiso",labelKey:"auto_permiso"}];function CE({value:e,onChange:t}){return n.jsx("div",{className:"inline-flex w-full rounded-lg border border-border p-0.5",children:r7.map(a=>n.jsx("button",{type:"button",onClick:()=>t(a.value),className:ge("flex-1 rounded-md px-2 py-1 text-[12px] font-medium capitalize transition-colors",e===a.value?"bg-primary/15 text-foreground":"text-muted-foreground hover:text-foreground"),children:u(`agents_form.${a.labelKey}`)},a.value))})}function NE({pid:e,area:t,role:a,onArea:o,onRole:l}){const i=He(`/projects/${e}/organization`,()=>qr.get(e)),[d,f]=x.useState(!1),[m,h]=x.useState(!1),g=i.data?.areas??[],_=(i.data?.roles??[]).filter(y=>t?y.area===t||y.area===null:!0),k=[{value:"",label:u("structure.no_area")},...g.map(y=>({value:y.slug,label:y.name}))],N=[{value:"",label:u("agents_form.no_role")},..._.map(y=>({value:y.slug,label:y.name}))];return n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("agents_form.area"),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ut,{value:t,onChange:y=>{o(y)},options:k,placeholder:u("structure.no_area"),className:"flex-1"}),n.jsx(Zk,{label:u("structure.new_area"),onClick:()=>f(!0)})]})}),n.jsx(ce,{label:u("agents_form.role"),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ut,{value:a,onChange:l,options:N,placeholder:u("agents_form.no_role"),className:"flex-1"}),n.jsx(Zk,{label:u("structure.new_role"),onClick:()=>h(!0)})]})})]}),n.jsx(kE,{open:d,onClose:()=>f(!1),pid:e,onSaved:()=>void i.mutate()}),n.jsx(wE,{open:m,onClose:()=>h(!1),pid:e,areas:g,presetArea:t||null,onSaved:()=>void i.mutate()})]})}function Zk({label:e,onClick:t}){return n.jsx("button",{type:"button",onClick:t,title:e,"aria-label":e,className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(Pt,{className:"size-4"})})}function EE({open:e,onClose:t,onConfirm:a,title:o,description:l,confirmLabel:i,destructive:d=!0}){const[f,m]=x.useState(!1),h=async()=>{m(!0);try{await a(),t()}finally{m(!1)}};return n.jsx(Zt,{open:e,onClose:t,title:o,footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:f,children:u("common.cancel")}),n.jsx(ie,{variant:d?"destructive":"primary",onClick:()=>void h(),loading:f,children:i??u("common.confirm")})]}),children:n.jsx("p",{className:"text-sm text-muted-foreground",children:l})})}function Fd(e,t){const a=[],o=/(\*\*([^*]+)\*\*)|(\*([^*]+)\*)|(`([^`]+)`)|(\[([^\]]+)\]\(([^)]+)\))/g;let l=0,i,d=0;for(;i=o.exec(e);)i.index>l&&a.push(n.jsx(x.Fragment,{children:e.slice(l,i.index)},`${t}-t${d}`)),i[2]!==void 0?a.push(n.jsx("strong",{children:i[2]},`${t}-b${d}`)):i[4]!==void 0?a.push(n.jsx("em",{children:i[4]},`${t}-i${d}`)):i[6]!==void 0?a.push(n.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:i[6]},`${t}-c${d}`)):i[8]!==void 0&&a.push(n.jsx("a",{href:i[9],target:"_blank",rel:"noreferrer",className:"text-sky-500 underline underline-offset-2 hover:text-sky-400",children:i[8]},`${t}-l${d}`)),l=o.lastIndex,d+=1;return l<e.length&&a.push(n.jsx(x.Fragment,{children:e.slice(l)},`${t}-tend`)),a}function RE({content:e,className:t}){const a=e.replace(/\r\n/g,`
|
|
784
|
-
`).split(`
|
|
785
|
-
`),o=[];let l=0,i=0;const d=(f,m)=>{const h=m?"ol":"ul";o.push(n.jsx(h,{className:ge("my-2 space-y-1 pl-5",m?"list-decimal":"list-disc"),children:f.map((g,b)=>n.jsx("li",{children:Fd(g,`li${i}-${b}`)},b))},`k${i++}`))};for(;l<a.length;){const f=a[l];if(/^```/.test(f.trim())){const g=[];for(l+=1;l<a.length&&!/^```/.test(a[l].trim());)g.push(a[l++]);l+=1,o.push(n.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg bg-muted/60 p-3 font-mono text-[12px] leading-[1.6]",children:n.jsx("code",{children:g.join(`
|
|
786
|
-
`)})},`k${i++}`));continue}if(f.trim()===""){l+=1;continue}const m=f.match(/^(#{1,6})\s+(.*)$/);if(m){const g=m[1].length,b=["text-2xl","text-xl","text-lg","text-base","text-sm","text-sm"];o.push(n.jsx("div",{className:ge("mt-3 mb-1 font-semibold text-foreground",b[g-1]),children:Fd(m[2],`h${i}`)},`k${i++}`)),l+=1;continue}if(/^(-{3,}|\*{3,}|_{3,})$/.test(f.trim())){o.push(n.jsx("hr",{className:"my-3 border-border"},`k${i++}`)),l+=1;continue}if(/^>\s?/.test(f)){const g=[];for(;l<a.length&&/^>\s?/.test(a[l]);)g.push(a[l++].replace(/^>\s?/,""));o.push(n.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-muted-foreground",children:Fd(g.join(" "),`q${i}`)},`k${i++}`));continue}if(/^\s*[-*+]\s+/.test(f)){const g=[];for(;l<a.length&&/^\s*[-*+]\s+/.test(a[l]);)g.push(a[l++].replace(/^\s*[-*+]\s+/,""));d(g,!1);continue}if(/^\s*\d+\.\s+/.test(f)){const g=[];for(;l<a.length&&/^\s*\d+\.\s+/.test(a[l]);)g.push(a[l++].replace(/^\s*\d+\.\s+/,""));d(g,!0);continue}const h=[];for(;l<a.length&&a[l].trim()!==""&&!/^(#{1,6})\s/.test(a[l])&&!/^```/.test(a[l].trim())&&!/^>\s?/.test(a[l])&&!/^\s*[-*+]\s+/.test(a[l])&&!/^\s*\d+\.\s+/.test(a[l]);)h.push(a[l++]);o.push(n.jsx("p",{className:"my-2 leading-relaxed",children:Fd(h.join(" "),`p${i}`)},`k${i++}`))}return n.jsx("div",{className:ge("text-sm text-foreground/90",t),children:o})}function o7({value:e,onChange:t,showPreview:a=!1,placeholder:o,onSave:l,className:i}){return n.jsxs("div",{className:ge("flex min-h-0 flex-1",i),children:[n.jsx("textarea",{value:e,onChange:d=>t(d.target.value),onKeyDown:d=>{l&&(d.metaKey||d.ctrlKey)&&d.key==="s"&&(d.preventDefault(),l())},placeholder:o,spellCheck:!1,className:ge("min-h-0 resize-none bg-transparent p-4 font-mono text-[13px] leading-[1.7] text-foreground/90 outline-none",a?"w-1/2 border-r border-border":"w-full")}),a&&n.jsx("div",{className:"min-h-0 w-1/2 overflow-y-auto p-4",children:n.jsx(RE,{content:e})})]})}function Gd({onClick:e,active:t,disabled:a,children:o}){return n.jsx("button",{type:"button",onClick:e,disabled:a,className:ge("inline-flex items-center gap-1 rounded px-2 py-0.5 text-[11px] font-medium transition-colors disabled:opacity-40",t?"bg-primary/15 text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:o})}function l7({content:e}){return n.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:n.jsx("table",{className:"w-full border-collapse font-mono text-[12px] leading-[1.6]",children:n.jsx("tbody",{children:e.split(`
|
|
787
|
-
`).map((t,a)=>n.jsxs("tr",{className:"hover:bg-accent/20",children:[n.jsx("td",{className:"w-12 select-none border-r border-border/30 px-3 text-right align-top text-[10px] text-muted-foreground/40","aria-hidden":"true",children:a+1}),n.jsx("td",{className:"whitespace-pre px-4 align-top text-foreground/90",children:t||" "})]},a))})})})}function Q_({file:e,loading:t,onSave:a}){const o=typeof a=="function",[l,i]=x.useState(""),[d,f]=x.useState(!1),[m,h]=x.useState(!0),[g,b]=x.useState(!1);if(x.useEffect(()=>{i(e?.content??""),f(!1),h(!0)},[e?.path,e?.content]),t)return n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(_n,{size:16})});if(!e)return n.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:u("files.select_prompt")});const _=e.kind==="markdown",k=e.kind==="text"||e.kind==="markdown",N=d&&l!==(e.content??""),y=async()=>{if(!(!a||!N)){b(!0);try{await a(l),f(!1)}finally{b(!1)}}};return n.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/40","data-testid":"file-viewer",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[n.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:[e.path,N&&n.jsx("span",{className:"ml-1 text-amber-400",children:"•"})]}),_&&d&&n.jsxs(Gd,{onClick:()=>h(w=>!w),active:m,children:[n.jsx(UA,{className:"size-3"}),u("files.preview")]}),o&&k&&(d?n.jsxs(n.Fragment,{children:[n.jsxs(Gd,{onClick:()=>{i(e.content??""),f(!1)},disabled:g,children:[n.jsx(gi,{className:"size-3"}),u("files.discard")]}),n.jsxs(Gd,{onClick:()=>void y(),disabled:!N||g,active:N,children:[g?n.jsx(_n,{size:10}):n.jsx(Jf,{className:"size-3"}),u("files.save")]})]}):n.jsxs(Gd,{onClick:()=>f(!0),children:[n.jsx(ya,{className:"size-3"}),u("files.edit")]}))]}),_?d?n.jsx(o7,{value:l,onChange:i,showPreview:m,onSave:()=>void y()}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:n.jsx(RE,{content:e.content??""})}):e.kind==="text"?d?n.jsx("textarea",{value:l,onChange:w=>i(w.target.value),onKeyDown:w=>{(w.metaKey||w.ctrlKey)&&w.key==="s"&&(w.preventDefault(),y())},spellCheck:!1,className:"min-h-0 flex-1 resize-none bg-transparent p-4 font-mono text-[12px] leading-[1.6] text-foreground/90 outline-none"}):n.jsx(l7,{content:e.content??""}):e.kind==="image"&&e.encoding==="base64"?n.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-auto p-4",children:n.jsx("img",{src:`data:${e.mime};base64,${e.content}`,alt:e.name,className:"max-h-full max-w-full rounded object-contain"})}):n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-sm text-muted-foreground",children:[n.jsx(XA,{className:"size-8 opacity-50"}),n.jsx("span",{children:e.too_large?u("files.too_large"):u("files.no_preview")}),n.jsxs("span",{className:"flex items-center gap-1 text-xs opacity-70",children:[n.jsx(FA,{className:"size-3"}),(e.size/1024).toFixed(1)," KB"]})]})]})}function i7(){return[{key:"overview",label:u("agents_ui.tab_explorer"),icon:Qf},{key:"memories",label:u("project.nav.memories"),icon:Uc},{key:"records",label:u("project.agent_detail.records_title"),icon:Kf},{key:"sleep",label:u("project.agent_detail.sleep_title"),icon:Mo},{key:"brain",label:u("project.agent_detail.brain_title"),icon:sa},{key:"config",label:u("settings.tabs.advanced"),icon:ep}]}function TE(){return[{value:"",label:u("agents_ui.type_none")},{value:"orchestrator",label:u("agents_ui.type_orchestrator"),description:u("agents_ui.type_orchestrator_desc")},{value:"specialist",label:u("agents_ui.type_specialist"),description:u("agents_ui.type_specialist_desc")},{value:"assistant",label:u("agents_ui.type_assistant"),description:u("agents_ui.type_assistant_desc")},{value:"worker",label:u("agents_ui.type_worker"),description:u("agents_ui.type_worker_desc")},{value:"monitor",label:u("agents_ui.type_monitor"),description:u("agents_ui.type_monitor_desc")}]}const Xx=e=>e.split(",").map(t=>t.trim()).filter(Boolean),c7=(e,t)=>e.filter(a=>a.spec?.agent===t||t==="super-agent"&&a.kind==="super_agent");function u7(e){return e.split(`
|
|
788
|
-
`).map(t=>t.replace(/^[-*#>\s]+/,"").trim()).filter(t=>t.length>2&&!t.startsWith("```")).slice(0,12)}function d7({pid:e}){const{slug:t=""}=M2(),a=Pn(),[o,l]=x.useState("overview"),i=i7(),d=He(`/projects/${e}/agents/${t}`,()=>an.get(e,t)),f=He(`/projects/${e}/agents`,()=>an.list(e)),m=He(`/projects/${e}/routines`,()=>Br.list(e)),h=He(`/projects/${e}/messages?agent=${t}`,()=>Mf.project(e,{agent:t,limit:200})),g=He(`/projects/${e}/agents/${t}/conversations`,()=>Xr.list(e,t)),b=He(`/projects/${e}/tasks?all`,()=>Xn.list(e,"all")),_=d.data,k=c7(m.data||[],t),N=(b.data||[]).filter(E=>E.agent===t),y=(f.data||[]).filter(E=>E.parent===t);if(d.isLoading)return n.jsx(rt,{});if(!_)return n.jsx("div",{className:"text-sm text-muted-fg",children:u("project.agent_detail.not_found")});const w=_.is_master?ba:rn;return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("button",{onClick:()=>a(`/p/${e}/agents`),className:"mt-1 text-muted-fg hover:text-foreground",children:n.jsx(SA,{size:16})}),n.jsx("div",{className:ge("flex size-11 items-center justify-center rounded-xl bg-gradient-to-br",_.is_master?"from-violet-600 to-indigo-600":"from-slate-600 to-gray-600"),children:n.jsx(w,{className:"size-5 text-white"})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("h1",{className:"text-lg font-semibold",children:_.slug}),_.is_master&&n.jsxs(Ve,{tone:"success",children:[n.jsx(ba,{size:10})," ",u("project.agents.orchestrator")]}),_.role&&n.jsx(Ve,{children:_.role}),_.model&&n.jsx(Ve,{tone:"info",children:_.model}),_.parent&&n.jsxs("button",{onClick:()=>a(`/p/${e}/agents/${_.parent}`),className:"text-[11px] text-violet-400 hover:underline",children:[u("project.agent_detail.reports_to")," ",_.parent]})]}),_.description&&n.jsx("p",{className:"mt-0.5 max-w-2xl text-xs text-muted-fg",children:_.description})]})]}),n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>a(`/p/${e}/chat?agent=${t}`),children:[n.jsx(ja,{size:13})," ",u("project.agent_detail.chat_btn",{slug:_.slug})]})]}),n.jsx("div",{className:"flex flex-wrap gap-1 border-b border-border",children:i.map(({key:E,label:j,icon:S})=>n.jsxs("button",{onClick:()=>l(E),className:ge("flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm transition-colors -mb-px",o===E?"border-foreground text-foreground":"border-transparent text-muted-fg hover:text-foreground"),children:[n.jsx(S,{size:14})," ",j]},E))}),o==="overview"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(Yd,{label:u("agents_ui.stat_threads"),value:g.data?.length??0,icon:Wf}),n.jsx(Yd,{label:u("agents_ui.stat_records"),value:h.data?.length??0,icon:Kf}),n.jsx(Yd,{label:u("agents_ui.stat_tasks"),value:N.length,icon:Qf}),n.jsx(Yd,{label:u("agents_ui.stat_heartbeats"),value:k.length,icon:Mo})]}),n.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[n.jsx(Ye,{title:u("agent_detail_extra.skills_title"),description:"",children:n.jsxs("div",{className:"flex flex-wrap gap-1",children:[_.skills?.map(E=>n.jsxs(Ve,{tone:"info",children:[n.jsx(sa,{size:10})," ",E]},E)),_.tools?.map(E=>n.jsxs(Ve,{children:[n.jsx(aa,{size:10})," ",E]},E)),!_.skills?.length&&!_.tools?.length&&n.jsx("span",{className:"text-xs text-muted-fg",children:"—"})]})}),n.jsx(Ye,{title:u("project.agent_detail.threads_recent"),description:"",children:n.jsxs("ul",{className:"space-y-1 text-xs",children:[(g.data||[]).slice(0,6).map(E=>n.jsxs("li",{className:"flex items-center justify-between rounded-md bg-muted/30 px-2 py-1",children:[n.jsx("span",{className:"truncate",children:E.title||E.filename}),n.jsxs("span",{className:"shrink-0 text-muted-fg",children:[E.messages??0," ",u("project.agent_detail.msgs_count")]})]},E.id)),!g.data?.length&&n.jsx("li",{className:"text-muted-fg",children:u("project.agent_detail.no_threads")})]})})]}),y.length>0&&n.jsx(Ye,{title:u("project.agent_detail.subagents"),description:u("project.agent_detail.subagents_desc"),children:n.jsx("div",{className:"flex flex-wrap gap-2",children:y.map(E=>n.jsxs("button",{onClick:()=>a(`/p/${e}/agents/${E.slug}`),className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm hover:border-muted-fg/50",children:[n.jsx(rn,{size:14,className:"text-muted-fg"})," ",E.slug]},E.slug))})})]}),o==="memories"&&n.jsx(p7,{pid:e,slug:t,onSaved:()=>d.mutate()}),o==="records"&&n.jsx(m7,{records:h.data||[],loading:h.isLoading}),o==="sleep"&&n.jsx(g7,{routines:k}),o==="brain"&&n.jsx(_7,{slug:t,emoji:_.emoji||void 0,memory:_.memory||"",threads:(g.data||[]).map(E=>({id:E.id,label:E.title||E.filename})),tasks:N.map(E=>({id:E.id,label:E.title,detail:E.body||void 0})),routines:k,parent:_.parent||null,children:y.map(E=>E.slug)}),o==="config"&&n.jsx(f7,{pid:e,agent:_,agents:f.data||[],onSaved:()=>{d.mutate(),f.mutate()},onDeleted:()=>{f.mutate(),a(`/p/${e}/agents`)}})]})}function f7({pid:e,agent:t,agents:a,onSaved:o,onDeleted:l}){const i=Ze(),[d,f]=x.useState(t.emoji||""),[m,h]=x.useState(t.type||""),[g,b]=x.useState(t.area||""),[_,k]=x.useState(t.role||""),[N,y]=x.useState(t.autonomy||""),[w,E]=x.useState(t.model||""),[j,S]=x.useState(t.parent||""),[R,A]=x.useState(!!t.is_master),[T,O]=x.useState((t.skills||[]).join(", ")),[M,B]=x.useState((t.tools||[]).join(", ")),[P,$]=x.useState(t.description||""),[D,L]=x.useState(t.system||""),[H,V]=x.useState(!1),[U,F]=x.useState(!1),X=async()=>{V(!0);try{await an.update(e,t.slug,{emoji:d||null,type:m||null,area:g||null,role:_||null,autonomy:N||null,model:w||null,parent:j||null,is_master:R||m==="orchestrator",skills:Xx(T),tools:Xx(M),description:P||null,system:D}),i.success(u("project.agent_detail.update_success")),o()}catch(Y){i.error(Y.message)}finally{V(!1)}},G=async()=>{await an.remove(e,t.slug),i.success(u("project.agent_detail.delete_success")),l()};return n.jsxs(Ye,{title:u("project.agent_detail.config_title"),description:`.apc/agents/${t.slug}.md — ${u("agents_ui.config_def_desc")}`,children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-3",children:[n.jsx(ce,{label:u("agents_form.emoji"),children:n.jsx(SE,{value:d,onChange:f})}),n.jsx(ce,{label:u("project.agent_detail.type_label"),children:n.jsx(ut,{value:m,onChange:h,options:TE()})})]}),n.jsx(NE,{pid:e,area:g,role:_,onArea:b,onRole:k}),n.jsx(ce,{label:u("agents_form.autonomy"),hint:u("agents_form.autonomy_hint"),children:n.jsx(CE,{value:N,onChange:y})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.agent_detail.parent_label"),children:n.jsx(ut,{value:j,onChange:S,placeholder:u("project.agent_detail.none_parent"),options:[{value:"",label:u("project.agent_detail.none_parent")},...a.filter(Y=>Y.slug!==t.slug).map(Y=>({value:Y.slug,label:Y.slug}))]})}),n.jsx(ce,{label:u("project.agent_detail.model_label"),hint:u("project.agent_detail.model_hint"),children:n.jsx(Te,{value:w,onChange:Y=>E(Y.target.value),placeholder:u("project.agent_detail.model_ph")})})]}),n.jsx(ce,{label:u("project.agent_detail.skills_label"),children:n.jsx(Te,{value:T,onChange:Y=>O(Y.target.value),placeholder:"skill-a, skill-b"})}),n.jsx(h7,{value:M,onChange:B}),n.jsx(ce,{label:u("project.agent_detail.bio_label"),children:n.jsx(un,{rows:2,value:P,onChange:Y=>$(Y.target.value)})}),n.jsx(ce,{label:u("project.agent_detail.system_label"),hint:u("project.agent_detail.system_hint"),children:n.jsx(un,{rows:10,className:"font-mono text-xs",value:D,onChange:Y=>L(Y.target.value),placeholder:"You are…"})}),n.jsx(Bt,{checked:R,onChange:A,label:u("project.agent_detail.master_label")}),n.jsxs("div",{className:"flex items-center justify-between border-t border-border pt-3",children:[n.jsxs(ie,{variant:"destructive",onClick:()=>F(!0),children:[n.jsx(vn,{size:13})," ",u("project.agent_detail.delete_btn")]}),n.jsxs(ie,{variant:"primary",loading:H,onClick:X,children:[n.jsx(Jf,{size:13})," ",u("project.agent_detail.save_btn")]})]})]}),n.jsx(EE,{open:U,onClose:()=>F(!1),onConfirm:G,title:u("project.agent_detail.delete_btn"),description:u("project.agent_detail.delete_confirm",{slug:t.slug}),confirmLabel:u("project.agent_detail.delete_btn")})]})}function Yd({label:e,value:t,icon:a}){return n.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-fg",children:[n.jsx(a,{size:13})," ",e]}),n.jsx("div",{className:"mt-1 text-2xl font-semibold",children:t})]})}function p7({pid:e,slug:t,onSaved:a}){const o=Ze(),l=He(`/memory/${e}/agent:${t}`,()=>an.memory.get(e,t).then(f=>f.body)),i=x.useMemo(()=>{if(l.data===void 0)return null;const f=l.data??"";return{path:`agents/${t}/memory.md`,name:"memory.md",kind:"markdown",size:f.length,modified:"",encoding:"utf8",content:f}},[l.data,t]),d=async f=>{await an.memory.put(e,t,f),o.success(u("project.agent_detail.memory_saved")),l.mutate(f,{revalidate:!1}),a()};return n.jsx("div",{className:"flex h-[65vh] min-h-[420px] flex-col overflow-hidden rounded-xl border border-border bg-card",children:n.jsx(Q_,{file:i,loading:l.isLoading,onSave:d})})}function m7({records:e,loading:t}){const a=x.useMemo(()=>[...e].sort((o,l)=>(l.ts||"").localeCompare(o.ts||"")),[e]);return n.jsxs(Ye,{title:u("project.agent_detail.records_title"),description:u("project.agent_detail.records_desc"),children:[t&&n.jsx(rt,{}),!t&&a.length===0&&n.jsx("p",{className:"text-xs text-muted-fg",children:u("project.agent_detail.no_activity")}),n.jsx("ul",{className:"space-y-1 text-sm",children:a.map((o,l)=>n.jsxs("li",{className:"flex items-start gap-2 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx("span",{className:"mt-0.5 shrink-0",children:o.direction==="in"?n.jsx($2,{size:13,className:"text-blue-400"}):n.jsx(H2,{size:13,className:"text-emerald-400"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-fg",children:[n.jsx("span",{className:"font-mono",children:new Date(o.ts).toLocaleString()}),n.jsx(Ve,{tone:"info",children:o.channel}),o.type&&n.jsx(Ve,{children:o.type})]}),o.body&&n.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-xs",children:o.body.length>400?`${o.body.slice(0,400)}…`:o.body})]})]},`${o.ts}-${l}`))})]})}function g7({routines:e}){return e.length===0?n.jsx(Ye,{title:u("project.agent_detail.sleep_title"),description:u("project.agent_detail.sleep_desc"),children:n.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm",children:[n.jsx("div",{className:"font-medium text-amber-400",children:u("project.agent_detail.sleep_deep")}),n.jsx("p",{className:"mt-1 text-xs text-muted-fg",children:u("project.agent_detail.sleep_deep_desc")})]})}):n.jsx(Ye,{title:u("project.agent_detail.sleep_title"),description:u("project.agent_detail.sleep_desc"),children:n.jsx("div",{className:"space-y-3",children:e.map(t=>{const a=t.enabled,o=t.last_status==="error";return n.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ge("size-2 rounded-full",o?"bg-destructive":a?"bg-emerald-400":"bg-muted-fg/40")}),n.jsx("span",{className:"text-sm font-medium",children:t.name}),n.jsx(Ve,{tone:a?"success":"muted",children:u(a?"agents_ui.running":"agents_ui.paused")}),o&&n.jsx(Ve,{tone:"danger",children:u("agents_ui.last_error")})]}),n.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs sm:grid-cols-4",children:[n.jsx(Kd,{label:u("agents_ui.field_tick"),value:t.schedule}),n.jsx(Kd,{label:u("agents_ui.field_next_tick"),value:t.next_run_at?new Date(t.next_run_at).toLocaleString():"—"}),n.jsx(Kd,{label:u("agents_ui.field_last_tick"),value:t.last_run_at?new Date(t.last_run_at).toLocaleString():"—"}),n.jsx(Kd,{label:u("agents_ui.field_last_run"),value:t.last_status||"—"})]}),t.last_error&&n.jsx("p",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:t.last_error})]},t.name)})})})}function Kd({label:e,value:t}){return n.jsxs("div",{className:"rounded-md border border-border bg-card p-2",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-fg",children:e}),n.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px]",children:t})]})}function h7({value:e,onChange:t}){const a=He("/tools",()=>bP.list()),o=Xx(e),l=a.data||[],i=f=>{const m=new Set(o);m.has(f)?m.delete(f):m.add(f),t([...m].join(", "))},d=o.filter(f=>!l.some(m=>m.name===f));return n.jsxs(ce,{label:u("agents_ui.tools_label"),hint:u("project.agent_detail.tools_hint"),children:[n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.map(f=>{const m=o.includes(f.name);return n.jsx(qe,{content:f.description||f.name,children:n.jsx("button",{type:"button",onClick:()=>i(f.name),className:ge("rounded-md border px-2 py-0.5 font-mono text-[11px] transition-colors",m?"border-emerald-500/50 bg-emerald-500/10 text-emerald-400":"border-border text-muted-fg hover:text-foreground"),children:f.name})},f.name)}),d.map(f=>n.jsxs("button",{type:"button",onClick:()=>i(f),className:"rounded-md border border-sky-500/50 bg-sky-500/10 px-2 py-0.5 font-mono text-[11px] text-sky-400",children:[f," ✕"]},f))]}),n.jsx(Te,{className:"mt-2",value:e,onChange:f=>t(f.target.value),placeholder:u("project.agent_detail.tools_custom_ph")})]})}const x7=new Set(["the","and","for","with","from","into","your","that","this","una","las","los","del","por","con","para","post","posts","demo","week","weekly"]);function Jk(e){return new Set(e.toLowerCase().split(/[^a-záéíóúñ0-9]+/).filter(t=>t.length>3&&!x7.has(t)))}function b7(e,t){for(const a of e)if(t.has(a))return!0;return!1}function _7({slug:e,emoji:t,memory:a,threads:o,tasks:l,routines:i,parent:d,children:f}){const{nodes:m,edges:h}=x.useMemo(()=>{const g=[],b=[],_="__core";g.push({id:_,label:e,kind:"agent",role:"core",emoji:t,relation:"self"});const k=(j,S,R)=>{g.push({id:j,label:S,kind:R,role:"hub",relation:"cluster"}),b.push({source:_,target:j})},N=u7(a),y=o.slice(0,8),w=l.slice(0,8);N.length&&(k("hub-mem",u("agents_ui.kind_memory"),"memory"),N.forEach((j,S)=>{g.push({id:`m${S}`,label:j,kind:"memory",relation:"knows",detail:j}),b.push({source:"hub-mem",target:`m${S}`})})),y.length&&(k("hub-thread",u("agents_ui.kind_thread"),"thread"),y.forEach(j=>{g.push({id:`th-${j.id}`,label:j.label,kind:"thread",relation:"in_thread"}),b.push({source:"hub-thread",target:`th-${j.id}`})})),w.length&&(k("hub-task",u("agents_ui.kind_task"),"task"),w.forEach(j=>{g.push({id:`ts-${j.id}`,label:j.label,kind:"task",relation:"handles_task",detail:j.detail}),b.push({source:"hub-task",target:`ts-${j.id}`})})),i.length&&(k("hub-routine",u("agents_ui.kind_routine"),"routine"),i.forEach(j=>{g.push({id:`rt-${j.name}`,label:j.name,kind:"routine",relation:"ticks",detail:`schedule: ${j.schedule}`}),b.push({source:"hub-routine",target:`rt-${j.name}`})})),f.length&&(k("hub-team",u("agents_ui.kind_hierarchy"),"agentlink"),f.forEach(j=>{g.push({id:`c-${j}`,label:j,kind:"agentlink",role:"hub",relation:"orchestrates",slug:j}),b.push({source:"hub-team",target:`c-${j}`})})),d&&(g.push({id:`p-${d}`,label:d,kind:"agentlink",role:"hub",relation:"reports_to",slug:d}),b.push({source:`p-${d}`,target:_}));const E=y.map(j=>({id:`th-${j.id}`,kw:Jk(j.label)}));return w.forEach(j=>{const S=Jk(j.label),R=E.find(A=>b7(S,A.kw));R&&b.push({source:`ts-${j.id}`,target:R.id})}),{nodes:g,edges:b}},[e,t,a,o,l,i,d,f]);return n.jsx(Ye,{title:u("project.agent_detail.brain_title"),description:u("project.agent_detail.brain_desc"),children:m.length<=1?n.jsx("p",{className:"text-xs text-muted-fg",children:u("project.agent_detail.brain_empty")}):n.jsx(sE,{nodes:m,edges:h})})}const v7=["","es","en","pt","fr","it","de"],ew=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function AE(e){return e.is_master?{gradient:"from-violet-600 to-indigo-600",Icon:ba}:{gradient:"from-slate-600 to-gray-600",Icon:rn}}const y7=[{key:"threads",icon:Wf,i18n:"agents_ui.stat_threads"},{key:"records",icon:Kf,i18n:"agents_ui.stat_records"},{key:"tasks",icon:hi,i18n:"agents_ui.stat_tasks"},{key:"heartbeats",icon:Mo,i18n:"agents_ui.stat_heartbeats"}];function ME({stats:e,className:t}){return e?n.jsx("div",{className:ge("flex items-center gap-3 text-[11px] text-muted-fg",t),children:y7.map(({key:a,icon:o,i18n:l})=>n.jsx(qe,{content:u(l),children:n.jsxs("span",{className:"inline-flex items-center gap-1 tabular-nums",children:[n.jsx(o,{size:12})," ",e[a]]})},a))}):null}function j7(e){const t=new Map;for(const a of e){const o=a.area||null;t.has(o)||t.set(o,[]),t.get(o).push(a)}return[...t.entries()].sort(([a],[o])=>a===null?1:o===null?-1:a.localeCompare(o)).map(([a,o])=>({area:a,agents:o}))}function k7(e){const t=e.filter(d=>d.is_master),a=t.length===1?t[0]:null,o=d=>d.parent?d.parent:a&&!d.is_master&&d.slug!==a.slug?a.slug:null,l=new Map,i=[];for(const d of e){const f=o(d);f&&e.some(m=>m.slug===f)?(l.has(f)||l.set(f,[]),l.get(f).push(d)):i.push(d)}return{roots:i,childrenByParent:l}}function w7({pid:e}){const t=Pn();Ze();const a=He(`/projects/${e}/agents?stats=1`,()=>an.list(e,{stats:!0})),[o,l]=x.useState("hierarchy"),[i,d]=x.useState(!1),[f,m]=x.useState(!1),h=a.data||[],g=N=>t(`/p/${e}/agents/${N}`),b=N=>t(N?`/p/${e}/chat?agent=${N}`:`/p/${e}/chat`),{roots:_,childrenByParent:k}=x.useMemo(()=>k7(h),[h]);return n.jsxs(Ye,{title:u("project.agents.title"),description:u("project.agents.subtitle_full"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[n.jsxs("button",{onClick:()=>l("hierarchy"),className:ge("flex items-center gap-1 rounded-md px-2 py-1 text-xs",o==="hierarchy"?"bg-accent text-accent-fg":"text-muted-fg"),children:[n.jsx(su,{size:13})," ",u("project.agents.hierarchy")]}),n.jsxs("button",{onClick:()=>l("list"),className:ge("flex items-center gap-1 rounded-md px-2 py-1 text-xs",o==="list"?"bg-accent text-accent-fg":"text-muted-fg"),children:[n.jsx(cM,{size:13})," ",u("project.agents.list_view")]})]}),n.jsxs(ie,{size:"sm",variant:"ghost",onClick:()=>m(!0),children:[n.jsx(oS,{size:13})," ",u("project.agents.import")]}),n.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>b(),children:[n.jsx(ja,{size:13})," ",u("project.agents.chat")]}),n.jsxs(ie,{size:"sm",variant:"primary","data-testid":"agent-new",onClick:()=>d(!0),children:[n.jsx(Pt,{size:14})," ",u("project.agents.new")]})]}),children:[a.isLoading&&n.jsx(rt,{}),!a.isLoading&&h.length===0&&n.jsx(pt,{children:u("project.agents.empty_text")}),!a.isLoading&&h.length>0&&(o==="hierarchy"?n.jsx(C7,{roots:_,childrenByParent:k,onOpen:g,onChat:b}):n.jsx(N7,{agents:h,onOpen:g,onChat:b})),n.jsx(E7,{open:i,pid:e,agents:h,onClose:()=>d(!1),onCreated:()=>{d(!1),a.mutate()}}),n.jsx(S7,{open:f,pid:e,existing:h.map(N=>N.slug),onClose:()=>m(!1),onImported:()=>a.mutate()})]})}function S7({open:e,onClose:t,onImported:a,pid:o,existing:l}){const i=Ze(),d=He(e?"/agents/vault":null,()=>an.vault()),[f,m]=x.useState(""),h=d.data||[],g=async b=>{m(b);try{await an.import(o,b),i.success(u("project.agents.import_success",{slug:b})),a()}catch(_){i.error(_.message)}finally{m("")}};return n.jsxs(Zt,{open:e,onClose:t,title:u("project.agents.import_title"),description:u("project.agents.import_desc"),size:"lg",footer:n.jsx(ie,{variant:"ghost",onClick:t,children:u("common.close")}),children:[d.isLoading&&n.jsx(rt,{}),!d.isLoading&&h.length===0&&n.jsx(pt,{children:u("project.agents.import_empty")}),n.jsx("ul",{className:"space-y-2",children:h.map(b=>{const _=l.includes(b.slug);return n.jsxs("li",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted/30 p-3",children:[n.jsx(rn,{size:16,className:"shrink-0 text-muted-fg"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium",children:b.slug}),b.is_master&&n.jsxs(Ve,{tone:"success",children:[n.jsx(ba,{size:9})," ",u("project.agents.orchestrator")]}),b.model&&n.jsx(Ve,{tone:"info",children:b.model})]}),b.description&&n.jsx("p",{className:"truncate text-xs text-muted-fg",children:b.description})]}),n.jsx(ie,{size:"sm",variant:"primary",disabled:_||f===b.slug,loading:f===b.slug,onClick:()=>g(b.slug),children:u(_?"project.agents.import_already":"project.agents.import_btn")})]},b.slug)})})]})}function C7({roots:e,childrenByParent:t,onOpen:a,onChat:o}){return n.jsx("div",{className:"space-y-8",children:e.map(l=>{const i=t.get(l.slug)||[],d=j7(i),f=d.some(m=>m.area);return n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx(Th,{agent:l,onOpen:a,onChat:o,wide:!0}),i.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"h-5 w-px bg-border"}),n.jsx("div",{className:"flex flex-col gap-6 border-t border-border pt-5",children:d.map(m=>n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[f&&n.jsxs("span",{className:"rounded-full border border-border bg-muted/40 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-fg",children:[m.area||u("agents_ui.uncategorized")," · ",m.agents.length]}),n.jsx("div",{className:"flex flex-wrap items-start justify-center gap-4",children:m.agents.map(h=>n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx(Th,{agent:h,onOpen:a,onChat:o}),(t.get(h.slug)||[]).length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"h-4 w-px bg-border"}),n.jsx("div",{className:"flex flex-wrap justify-center gap-3 border-t border-border pt-4",children:(t.get(h.slug)||[]).map(g=>n.jsx(Th,{agent:g,onOpen:a,onChat:o,compact:!0},g.slug))})]})]},h.slug))})]},m.area??"__none"))})]})]},l.slug)})})}function Th({agent:e,onOpen:t,onChat:a,wide:o,compact:l}){const{gradient:i,Icon:d}=AE(e);return n.jsxs("div",{"data-testid":`agent-card-${e.slug}`,className:ge("cursor-pointer rounded-xl border border-border bg-card p-3 transition-colors hover:border-muted-fg/50",o?"w-64":l?"w-44":"w-52"),onClick:()=>t(e.slug),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:ge("flex size-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br",i),children:e.emoji?n.jsx("span",{className:"text-base leading-none",children:e.emoji}):n.jsx(d,{className:"size-4 text-white"})}),n.jsx("span",{className:"truncate text-sm font-semibold",children:e.slug})]}),n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:[e.is_master&&n.jsxs(Ve,{tone:"success",children:[n.jsx(ba,{size:9})," ",u("project.agents.orchestrator")]}),e.role&&n.jsx(Ve,{children:e.role}),e.model&&!l&&n.jsx(Ve,{tone:"info",children:e.model})]}),n.jsx(ME,{stats:e.stats,className:"mt-2"}),n.jsxs("div",{className:"mt-2 flex items-center gap-3 border-t border-border pt-2 text-xs text-muted-fg",onClick:f=>f.stopPropagation(),children:[n.jsxs("button",{onClick:()=>t(e.slug),className:"flex items-center gap-1 hover:text-foreground",children:[n.jsx(nu,{size:12})," ",u("project.agents.view")]}),n.jsxs("button",{onClick:()=>a(e.slug),className:"flex items-center gap-1 text-emerald-500 hover:text-emerald-400",children:[n.jsx(ja,{size:12})," ",u("project.agents.chat")]})]})]})}function N7({agents:e,onOpen:t,onChat:a}){const o=[...e].sort((l,i)=>+!!i.is_master-+!!l.is_master||l.slug.localeCompare(i.slug));return n.jsx("div",{className:"space-y-2",children:o.map(l=>{const{gradient:i,Icon:d}=AE(l);return n.jsxs("div",{"data-testid":`agent-card-${l.slug}`,className:"flex cursor-pointer items-center gap-4 rounded-xl border border-border bg-muted/30 p-3 hover:border-muted-fg/50",onClick:()=>t(l.slug),children:[n.jsx("div",{className:ge("flex size-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br",i),children:l.emoji?n.jsx("span",{className:"text-lg leading-none",children:l.emoji}):n.jsx(d,{className:"size-4 text-white"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"text-sm font-semibold",children:l.slug}),l.is_master&&n.jsxs(Ve,{tone:"success",children:[n.jsx(ba,{size:10})," ",u("project.agents.orchestrator")]}),l.role&&n.jsx(Ve,{children:l.role}),l.model&&n.jsx(Ve,{tone:"info",children:l.model}),l.parent&&n.jsxs("span",{className:"text-[10px] text-violet-400",children:["↳ ",l.parent]})]}),l.description&&n.jsx("p",{className:"mt-1 truncate text-xs text-muted-fg",children:l.description}),n.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[l.skills?.map(f=>n.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[n.jsx(sa,{size:9})," ",f]},f)),l.tools?.map(f=>n.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[n.jsx(aa,{size:9})," ",f]},f))]})]}),n.jsx(ME,{stats:l.stats,className:"hidden shrink-0 sm:flex"}),n.jsxs("div",{className:"flex shrink-0 items-center gap-3 text-xs text-muted-fg",onClick:f=>f.stopPropagation(),children:[n.jsxs("button",{onClick:()=>t(l.slug),className:"flex items-center gap-1 hover:text-foreground",children:[n.jsx(nu,{size:12})," ",u("project.agents.view")]}),n.jsxs("button",{onClick:()=>a(l.slug),className:"flex items-center gap-1 text-emerald-500 hover:text-emerald-400",children:[n.jsx(ja,{size:12})," ",u("project.agents.chat")]})]})]},l.slug)})})}function E7({open:e,onClose:t,onCreated:a,pid:o,agents:l}){const i=Ze(),[d,f]=x.useState(""),[m,h]=x.useState(""),[g,b]=x.useState(""),[_,k]=x.useState(""),[N,y]=x.useState(""),[w,E]=x.useState(""),[j,S]=x.useState(""),[R,A]=x.useState(""),[T,O]=x.useState(""),[M,B]=x.useState(""),[P,$]=x.useState(""),[D,L]=x.useState(!1),[H,V]=x.useState(""),[U,F]=x.useState(!1),X=()=>{f(""),h(""),b(""),k(""),y(""),E(""),S(""),A(""),O(""),B(""),$(""),L(!1),V("")},G=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(d)){i.error(u("project.agents.slug_invalid"));return}F(!0);try{await an.create(o,{slug:d,emoji:m||void 0,type:g||void 0,role:_||void 0,area:N||void 0,autonomy:w||void 0,model:j||void 0,language:R||void 0,description:T||void 0,skills:ew(M),tools:ew(P),is_master:D||g==="orchestrator",parent:H||void 0}),i.success(u("project.agents.create_success",{slug:d})),a(),X()}catch(Y){i.error(Y?.message||u("project.agents.create_error"))}finally{F(!1)}};return n.jsx(Zt,{open:e,onClose:t,title:u("project.agents.new_title"),description:u("project.agents.new_desc"),size:"lg",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:U,children:u("common.cancel")}),n.jsx(ie,{variant:"primary","data-testid":"agent-create-submit",onClick:G,loading:U,children:u("common.create")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] gap-3",children:[n.jsx(ce,{label:u("agents_form.emoji"),children:n.jsx(SE,{value:m,onChange:h})}),n.jsx(ce,{label:u("project.agents.slug_label"),children:n.jsx(Te,{autoFocus:!0,"data-testid":"agent-slug",value:d,onChange:Y=>f(Y.target.value),placeholder:u("project.agents.slug_ph")})}),n.jsx(ce,{label:u("project.agent_detail.type_label"),children:n.jsx(ut,{value:g,onChange:b,options:TE()})})]}),n.jsx(NE,{pid:o,area:N,role:_,onArea:y,onRole:k}),n.jsx(ce,{label:u("agents_form.autonomy"),hint:u("agents_form.autonomy_hint"),children:n.jsx(CE,{value:w,onChange:E})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.agents.model_label"),hint:u("project.agents.model_hint"),children:n.jsx(Te,{value:j,onChange:Y=>S(Y.target.value)})}),n.jsx(ce,{label:u("project.agents.lang_label"),children:n.jsx(ut,{value:R,onChange:A,options:v7.map(Y=>({value:Y,label:Y||"—"}))})})]}),n.jsx(ce,{label:u("project.agents.desc_label"),children:n.jsx(un,{rows:2,value:T,onChange:Y=>O(Y.target.value),placeholder:u("project.agents.desc_ph")})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.agents.skills_label"),children:n.jsx(Te,{value:M,onChange:Y=>B(Y.target.value),placeholder:u("project.agents.skills_ph")})}),n.jsx(ce,{label:u("project.agents.tools_label"),children:n.jsx(Te,{value:P,onChange:Y=>$(Y.target.value),placeholder:u("project.agents.tools_ph")})})]}),n.jsxs("div",{className:"grid grid-cols-2 items-end gap-3",children:[n.jsx(ce,{label:u("project.agents.parent_label"),hint:u("project.agents.parent_hint"),children:n.jsx(ut,{value:H,onChange:V,placeholder:u("project.agents.none_parent"),options:[{value:"",label:u("project.agents.none_parent")},...l.filter(Y=>Y.slug!==d).map(Y=>({value:Y.slug,label:Y.slug}))]})}),n.jsx(Bt,{checked:D,onChange:L,label:u("project.agents.master_label")})]})]})})}function Xd(e){return e.split(`
|
|
789
|
-
`).map(t=>t.trim()).filter(Boolean)}function Qc(){return{exec_agent:{label:u("agents_ui.kind_exec_agent"),desc:u("agents_ui.kind_exec_agent_desc"),icon:rn},super_agent:{label:u("agents_ui.kind_super_agent"),desc:u("agents_ui.kind_super_agent_desc"),icon:ba},telegram:{label:u("agents_ui.kind_telegram"),desc:u("agents_ui.kind_telegram_desc"),icon:ja},shell:{label:u("agents_ui.kind_shell"),desc:u("agents_ui.kind_shell_desc"),icon:_a},heartbeat:{label:u("agents_ui.kind_heartbeat"),desc:u("agents_ui.kind_heartbeat_desc"),icon:Mo}}}function R7(e){const t=Qc();return Object.keys(t).filter(a=>a!=="heartbeat"||e==="heartbeat").map(a=>({value:a,label:t[a].label,description:t[a].desc,icon:t[a].icon}))}function W_(e){if(!e)return"—";if(e.startsWith("every:")){const t=e.slice(6),a=t.match(/^(\d+)(s|m|h|d)$/);if(a){const o=a[1],l={s:u("agents_ui.unit_seconds"),m:u("agents_ui.unit_minutes"),h:u("agents_ui.unit_hours"),d:u("agents_ui.unit_days")}[a[2]]||a[2];return u("agents_ui.every_n_unit",{n:o,unit:l})}return u("agents_ui.every_v",{v:t})}return e.startsWith("once:")?`once · ${new Date(e.slice(5)).toLocaleString()}`:e.startsWith("cron ")?`cron · ${e.slice(5)}`:e}function T7(){return[{label:u("agents_ui.preset_every_10m"),value:"every:10m"},{label:u("agents_ui.preset_hourly"),value:"every:1h"},{label:u("agents_ui.preset_daily_9am"),value:"cron 0 9 * * *"},{label:u("agents_ui.preset_weekdays_9am"),value:"cron 0 9 * * 1-5"}]}function OE(){return[{v:"{{pre_output}}",where:"prompt",desc:u("agents_ui.var_pre_output_prompt")},{v:"$APX_LLM_OUTPUT",where:"post",desc:u("agents_ui.var_llm_output")},{v:"$APX_STATUS",where:"post",desc:u("agents_ui.var_status")},{v:"$APX_SKIPPED",where:"post",desc:u("agents_ui.var_skipped")},{v:"$APX_PRE_OUTPUT",where:"post",desc:u("agents_ui.var_pre_output")},{v:"$APX_PRE_OUTPUT_FILE",where:"post",desc:u("agents_ui.var_pre_output_file")},{v:"$APX_PRE_EXIT",where:"post",desc:u("agents_ui.var_pre_exit")},{v:"$APX_ROUTINE",where:"pre/post",desc:u("agents_ui.var_routine")}]}function yc(e){return OE().filter(t=>e==="pre"?t.where.includes("pre"):e==="prompt"?t.where==="prompt":t.where==="post"||t.where==="pre/post")}function A7({routines:e,selectedName:t,onSelect:a}){return n.jsxs("aside",{className:"flex h-full min-h-0 flex-col border-r border-border",children:[n.jsx("div",{className:"shrink-0 px-3 py-2.5 text-[11px] font-semibold uppercase tracking-wide text-muted-fg",children:u("project.routines.list_title")}),n.jsx("ul",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto p-2 pt-0",children:e.map(o=>{const l=Qc()[o.kind],i=l?.icon||hi,d=o.name===t;return n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>a(o.name),"aria-current":d,className:ge("w-full rounded-lg border px-2.5 py-2 text-left transition-colors",d?"border-primary/50 bg-primary/10":"border-transparent hover:border-border hover:bg-accent/40"),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ge("flex size-6 shrink-0 items-center justify-center rounded-md",o.enabled?"bg-emerald-500/15 text-emerald-400":"bg-muted text-muted-fg"),children:n.jsx(i,{size:13})}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o.name}),!o.enabled&&n.jsx("span",{className:"shrink-0 text-[10px] text-muted-fg",children:u("project.routines.paused")}),n.jsx(fu,{ok:o.last_status==="ok"?!0:o.last_status==="error"?!1:null})]}),n.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 pl-8 text-[10px] text-muted-fg",children:[n.jsx("span",{className:"truncate",children:l?.label||o.kind}),n.jsxs("span",{className:"shrink-0",children:["⏱ ",W_(o.schedule)]})]})]})},o.name)})})]})}function M7({title:e,body:t,mono:a}){return n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-fg",children:e}),n.jsx("div",{className:ge("max-h-44 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/20 px-3 py-2 text-xs",a&&"font-mono"),children:t.trim()?t:n.jsx("span",{className:"text-muted-fg",children:u("project.routines.block_empty")})})]})}function zE(e){const t=e.meta||{};return t.skipped?"skipped":t.status==="error"?"error":"ok"}function DE(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function PE({st:e}){return e==="ok"?n.jsx(Gr,{size:13,className:"shrink-0 text-emerald-500"}):e==="error"?n.jsx(gs,{size:13,className:"shrink-0 text-destructive"}):n.jsx(NA,{size:13,className:"shrink-0 text-amber-500"})}function LE(e){return u(e==="ok"?"project.routines.status_ok":e==="error"?"project.routines.status_error":"project.routines.status_skipped")}function Ah({title:e,children:t}){return n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-fg",children:e}),t]})}const Mh="whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/20 px-3 py-2 font-mono text-[11px]";function O7({m:e,onClose:t}){const a=zE(e),o=e.meta||{},l=o.result||{},i=o.flow||null,d=String(l.reply??l.text??l.stdout??""),f=String(l.error??l.stderr??""),m=String(l.note??""),h=n.jsx("span",{className:"text-muted-fg",children:u("project.routines.block_empty")});return n.jsxs("div",{className:"flex min-h-0 flex-col border-l border-border",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 px-4 py-2",children:[n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx(PE,{st:a}),n.jsx("span",{className:ge("font-medium",a==="ok"&&"text-emerald-500",a==="error"&&"text-destructive",a==="skipped"&&"text-amber-500"),children:LE(a)}),n.jsx("span",{className:"font-mono text-muted-fg",children:DE(e.ts)})]}),n.jsx("button",{type:"button",onClick:t,"aria-label":u("project.routines.runs_close"),className:"rounded-md p-1 text-muted-fg hover:bg-muted hover:text-foreground",children:n.jsx(gs,{size:14})})]}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-3 overflow-y-auto px-4 pb-4 text-xs",children:[e.body&&n.jsx("div",{className:"text-muted-fg",children:e.body}),i?.pre&&n.jsx(Ah,{title:u("project.routines.block_pre"),children:i.pre.output?.trim()?n.jsx("pre",{className:Mh,children:i.pre.output}):h}),n.jsx(Ah,{title:u("project.routines.runs_output"),children:d?n.jsx("pre",{className:Mh,children:d}):f?n.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-lg bg-destructive/10 px-3 py-2 font-mono text-[11px] text-destructive",children:f}):m?n.jsx("div",{className:"text-muted-fg",children:m}):h}),i?.post&&i.post.length>0&&n.jsx(Ah,{title:u("project.routines.block_post"),children:n.jsx("div",{className:"space-y-1.5",children:i.post.map((g,b)=>n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-mono text-[10px] text-muted-fg",children:["$ ",g.cmd," ",n.jsxs("span",{className:"opacity-70",children:["· exit ",g.exit]})]}),(g.stdout||g.stderr)&&n.jsx("pre",{className:Mh,children:g.stdout||g.stderr})]},b))})})]})]})}function z7({pid:e,name:t,running:a}){const o=He(`/projects/${e}/routines/${t}/runs`,async()=>(await Mf.project(e,{channel:"routine",limit:200})).filter(h=>h.meta?.routine===t&&(h.actor_id==="apx:routine"||h.type==="system"))),l=(o.data||[]).slice(0,50),[i,d]=x.useState(null),f=i&&l.find(m=>m.ts===i)||null;return n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-border",children:[n.jsx("div",{className:"shrink-0 px-4 pb-1.5 pt-3 text-[11px] font-semibold uppercase tracking-wide text-muted-fg",children:u("project.routines.runs_title")}),n.jsxs("div",{className:ge("grid min-h-0 flex-1 overflow-hidden",f?"grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)]":"grid-cols-1"),children:[n.jsxs("div",{className:"min-h-0 overflow-y-auto px-4 pb-4",children:[o.isLoading&&n.jsx(rt,{}),!o.isLoading&&l.length===0&&n.jsx("div",{className:"text-xs text-muted-fg",children:u("project.routines.runs_empty")}),n.jsxs("ul",{className:"space-y-1",children:[a&&n.jsx("li",{children:n.jsxs("div",{className:"flex w-full items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-1.5 text-xs",children:[n.jsx(_n,{size:12}),n.jsx("span",{className:"text-muted-fg",children:u("project.routines.running")})]})}),l.map((m,h)=>{const g=zE(m),b=i===m.ts;return n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>d(b?null:m.ts),"aria-current":b,className:ge("flex w-full items-center gap-2 rounded-md border px-3 py-1.5 text-left text-xs transition-colors",b?"border-primary/50 bg-primary/10":"border-border bg-muted/30 hover:border-muted-fg/40"),children:[n.jsx(PE,{st:g}),n.jsx("span",{className:"font-mono text-muted-fg",children:DE(m.ts)}),n.jsx("span",{className:ge("font-medium",g==="ok"&&"text-emerald-500",g==="error"&&"text-destructive",g==="skipped"&&"text-amber-500"),children:LE(g)})]})},`${m.ts}-${h}`)})]})]}),f&&n.jsx(O7,{m:f,onClose:()=>d(null)})]})]})}function D7({pid:e,routine:t,onEdit:a,onRun:o,onToggle:l,onDelete:i,running:d}){const f=Qc()[t.kind],m=f?.icon||hi,h=t.spec||{},g=t.pre_commands||[],b=t.post_commands||[],_=[];return g.length&&_.push({title:u("project.routines.block_pre"),body:g.join(`
|
|
790
|
-
`),mono:!0}),t.kind==="exec_agent"||t.kind==="super_agent"?_.push({title:u("project.routines.block_prompt"),body:String(h.prompt||"")}):t.kind==="telegram"?_.push({title:u("project.routines.block_text"),body:String(h.text||"")}):t.kind==="shell"?_.push({title:u("project.routines.block_command"),body:String(h.command||""),mono:!0}):t.kind==="heartbeat"&&_.push({title:u("project.routines.block_text"),body:String(h.message||"")}),b.length&&_.push({title:u("project.routines.block_post"),body:b.join(`
|
|
791
|
-
`),mono:!0}),n.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[n.jsxs("div",{className:"min-h-0 shrink space-y-4 overflow-y-auto p-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:ge("flex size-7 shrink-0 items-center justify-center rounded-lg",t.enabled?"bg-emerald-500/15 text-emerald-400":"bg-muted text-muted-fg"),children:n.jsx(m,{size:14})}),n.jsx("h3",{className:"truncate text-base font-semibold",children:t.name}),n.jsx(Ve,{tone:t.kind==="shell"?"warning":"info",children:f?.label||t.kind})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(Bt,{checked:t.enabled,onChange:l}),n.jsx(qe,{content:u("common.run"),children:n.jsx(ie,{size:"sm",variant:"secondary",onClick:o,loading:d,children:n.jsx(jb,{size:13})})}),n.jsx(qe,{content:u("project.routines.edit_hint"),children:n.jsxs(ie,{size:"sm",variant:"secondary",onClick:a,children:[n.jsx(ya,{size:13})," ",u("project.routines.edit_btn")]})}),n.jsx(qe,{content:u("common.delete"),children:n.jsx(ie,{size:"sm",variant:"destructive",onClick:i,children:n.jsx(vn,{size:13})})})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-fg",children:[n.jsxs("span",{children:["⏱ ",W_(t.schedule)]}),t.next_run_at&&n.jsxs("span",{children:[u("project.routines.next_run")," ",new Date(t.next_run_at).toLocaleString()]}),t.last_run_at&&n.jsxs("span",{children:[u("project.routines.last_run")," ",new Date(t.last_run_at).toLocaleString()]}),n.jsxs("span",{className:ge(t.last_status==="ok"&&"text-emerald-500",t.last_status==="error"&&"text-destructive"),children:[u("agents_ui.last_label")," ",t.last_status||"—"]})]}),t.last_error&&n.jsx("div",{className:"rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive",children:t.last_error}),n.jsx("div",{className:"space-y-3",children:_.map(k=>n.jsx(M7,{title:k.title,body:k.body,mono:k.mono},k.title))})]}),n.jsx(z7,{pid:e,name:t.name,running:d})]})}function Ll({label:e,hint:t,value:a,onChange:o,vars:l,rows:i=3,mono:d,placeholder:f}){const m=x.useRef(null),h=g=>{const b=m.current?.querySelector("textarea");if(!b){o(a?`${a}${g}`:g);return}const _=b.selectionStart??a.length,k=b.selectionEnd??a.length,N=a.slice(0,_)+g+a.slice(k);o(N),requestAnimationFrame(()=>{b.focus();const y=_+g.length;b.setSelectionRange(y,y)})};return n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:e}),t&&n.jsx("div",{className:"text-[11px] text-muted-foreground/70",children:t}),n.jsxs("div",{ref:m,className:"space-y-1.5",children:[n.jsx(un,{rows:i,className:ge(d&&"font-mono text-xs"),value:a,onChange:g=>o(g.target.value),placeholder:f}),l.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1",children:l.map(g=>n.jsx("button",{type:"button",onClick:()=>h(g.v),className:"inline-flex items-center rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[10px] text-muted-fg transition-colors hover:border-muted-fg/50 hover:text-foreground",children:g.v},g.v))})]})]})}function P7(){return n.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 p-3",children:[n.jsx("div",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-fg",children:u("project.routines.vars_title")}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:OE().map(e=>n.jsx(qe,{content:n.jsx("span",{className:"block max-w-[240px] whitespace-normal leading-snug",children:e.desc}),children:n.jsxs("span",{className:"inline-flex cursor-help items-center gap-1 rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[10px]",children:[e.v,n.jsxs("span",{className:"not-italic text-muted-fg",children:["· ",e.where]})]})},e.v))})]})}function L7({draft:e,onClose:t,onSaved:a,pid:o}){const l=Ze(),i=He(e?`/projects/${o}/agents`:null,()=>an.list(o)),[d,f]=x.useState(!1),[m,h]=x.useState(""),[g,b]=x.useState("super_agent"),[_,k]=x.useState("every:10m"),[N,y]=x.useState(!0),[w,E]=x.useState(""),[j,S]=x.useState(""),[R,A]=x.useState("default"),[T,O]=x.useState(""),[M,B]=x.useState(""),[P,$]=x.useState(""),[D,L]=x.useState("heartbeat"),[H,V]=x.useState(""),[U,F]=x.useState(""),[X,G]=x.useState(""),Y=He(e&&g==="telegram"?"/telegram/channels":null,()=>Dn.channels.list());x.useEffect(()=>{if(!e)return;const oe=e.spec&&typeof e.spec=="object"?e.spec:{};h(e.name||""),b(e.kind||"super_agent"),k(e.schedule||"every:10m"),y(e.enabled??!0),E(oe.agent||""),S(oe.prompt||""),A(oe.channel||"default"),O(oe.chat_id?String(oe.chat_id):""),B(oe.text||""),$(oe.command||""),L(oe.channel||"heartbeat"),V(oe.message||""),F((e.pre_commands||[]).join(`
|
|
792
|
-
`)),G((e.post_commands||[]).join(`
|
|
793
|
-
`))},[e]);const I=g==="exec_agent"||g==="super_agent"||g==="telegram",Q=()=>{switch(g){case"exec_agent":return{agent:w,prompt:j};case"super_agent":return{prompt:j};case"telegram":return{channel:R,...T?{chat_id:T}:{},text:M};case"shell":return{command:P};case"heartbeat":return{channel:D,message:H}}},J=async()=>{if(!m){l.error(u("project.routines.name_required"));return}f(!0);try{await Br.upsert(o,{name:m,kind:g,schedule:_,enabled:N,spec:Q(),pre_commands:I?Xd(U):[],post_commands:I?Xd(X):[]}),l.success(u("project.routines.saved")),a()}catch(oe){l.error(oe?.message||u("project.routines.save_error"))}finally{f(!1)}},K=(()=>{const oe=Y.data?.channels||[],fe=["default",...oe.map(Ce=>Ce.name)];R&&!fe.includes(R)&&fe.push(R);const we=new Set;return fe.filter(Ce=>we.has(Ce)?!1:(we.add(Ce),!0)).map(Ce=>{const Le=oe.find(Ee=>Ee.name===Ce),$e=Le?.project?`proyecto ${Le.project}`:Le?.chat_id?`chat ${Le.chat_id}`:void 0;return{value:Ce,label:Ce,description:$e}})})(),se=I?Xd(U):[],te=I?Xd(X):[],le=(()=>{switch(g){case"exec_agent":return w?u("agents_ui.action_agent_answers",{agent:w}):u("agents_ui.action_agent_pick_answers");case"super_agent":return u("agents_ui.action_super_answers");case"telegram":return u("agents_ui.action_telegram_channel",{channel:R});case"shell":return P?u("agents_ui.summary_runs_cmd",{cmd:P.slice(0,48)}):u("agents_ui.action_runs_shell");case"heartbeat":return u("agents_ui.summary_heartbeat")}})(),W=g==="telegram"?M:g==="shell"?P:g==="heartbeat"?H:j,ne=Qc()[g].icon,ve=[...se.map((oe,fe)=>({id:`pre-${fe}`,icon:_a,label:u("agents_ui.step_pre"),detail:oe,action:!1})),{id:"action",icon:ne,label:le,detail:W?W.slice(0,90):u("project.routines.block_empty"),action:!0},...te.map((oe,fe)=>({id:`post-${fe}`,icon:_a,label:u("agents_ui.step_post"),detail:oe,action:!1}))];return n.jsx(Zt,{open:!!e,onClose:t,title:e?.name?u("project.routines.edit_title",{name:e.name}):u("project.routines.new_title"),description:u("project.routines.dialog_desc"),size:"xl",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:d,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:J,loading:d,children:u("common.save")})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/20 px-3 py-2",children:[n.jsx(Bt,{checked:N,onChange:y,label:u("project.routines.enabled_label")}),n.jsx("span",{className:"text-[11px] text-muted-fg",children:u(N?"project.routines.enabled_hint":"project.routines.disabled_hint")})]}),n.jsx(ce,{label:u("project.routines.name_field"),hint:e?.name?u("project.routines.name_no_edit"):void 0,children:n.jsx(Te,{value:m,disabled:!!e?.name,onChange:oe=>h(oe.target.value),placeholder:"resumen-diario"})}),n.jsx(ce,{label:u("project.routines.kind_field"),children:n.jsx(ut,{value:g,onChange:oe=>b(oe),options:R7(g)})}),n.jsx("p",{className:"-mt-1 text-[11px] text-muted-fg",children:Qc()[g].desc}),g==="exec_agent"&&n.jsx(ce,{label:u("project.routines.agent_field"),hint:u("project.routines.agent_hint"),children:n.jsx(ut,{value:w,onChange:E,placeholder:i.isLoading?u("project.routines.agent_loading"):u("project.routines.agent_pick"),options:(i.data||[]).map(oe=>({value:oe.slug,label:oe.slug,description:[oe.role,oe.model].filter(Boolean).join(" · ")||void 0}))})}),n.jsx(ce,{label:u("project.routines.schedule_field"),hint:u("project.routines.schedule_hint"),children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex flex-wrap gap-1",children:[T7().map(oe=>n.jsx("button",{type:"button",onClick:()=>k(oe.value),className:ge("rounded-md border px-2 py-0.5 text-[11px]",_===oe.value?"border-emerald-500/50 text-emerald-400":"border-border text-muted-fg hover:text-foreground"),children:oe.label},oe.value)),n.jsx("button",{type:"button",onClick:()=>k("manual"),className:ge("rounded-md border px-2 py-0.5 text-[11px]",_==="manual"?"border-emerald-500/50 text-emerald-400":"border-border text-muted-fg hover:text-foreground"),children:u("agents_ui.preset_manual")})]}),n.jsx(Te,{value:_,onChange:oe=>k(oe.target.value),placeholder:"every:10m · cron 0 9 * * 1-5 · once:ISO · manual"})]})}),n.jsx(P7,{})]}),n.jsxs("div",{className:"space-y-3",children:[I&&n.jsx(Ll,{label:u("project.routines.pre_field"),hint:u("project.routines.pre_hint"),rows:2,mono:!0,value:U,onChange:F,vars:yc("pre"),placeholder:"curl -s https://wttr.in/Bariloche"}),g==="exec_agent"&&n.jsx(Ll,{label:u("project.routines.prompt_exec"),rows:4,value:j,onChange:S,vars:yc("prompt"),placeholder:u("project.routines.prompt_exec_ph")}),g==="super_agent"&&n.jsx(Ll,{label:u("project.routines.prompt_super"),rows:4,value:j,onChange:S,vars:yc("prompt"),placeholder:u("project.routines.prompt_super_ph")}),g==="telegram"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.routines.tg_channel"),children:n.jsx(ut,{value:R,onChange:A,options:K})}),n.jsx(ce,{label:u("project.routines.tg_chat_id"),children:n.jsx(Te,{value:T,onChange:oe=>O(oe.target.value),placeholder:u("agents_ui.tg_chat_id_ph")})})]}),n.jsx(Ll,{label:u("project.routines.tg_text"),hint:u("project.routines.tg_text_hint"),rows:6,value:M,onChange:B,vars:yc("prompt"),placeholder:u("agents_ui.tg_text_ph")})]}),g==="shell"&&n.jsx(Ll,{label:u("project.routines.shell_field"),hint:u("project.routines.shell_hint"),rows:11,mono:!0,value:P,onChange:$,vars:[],placeholder:"cd /repo && git pull && npm test"}),g==="heartbeat"&&n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.routines.hb_channel"),children:n.jsx(Te,{value:D,onChange:oe=>L(oe.target.value),placeholder:"heartbeat"})}),n.jsx(ce,{label:u("project.routines.hb_message"),children:n.jsx(Te,{value:H,onChange:oe=>V(oe.target.value),placeholder:u("agents_ui.hb_message_ph")})})]}),I&&n.jsx(Ll,{label:u("project.routines.post_field"),hint:u("project.routines.post_hint"),rows:2,mono:!0,value:X,onChange:G,vars:yc("post"),placeholder:'apx telegram send "$APX_LLM_OUTPUT"'})]})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3",children:[n.jsxs("div",{className:"mb-2 text-xs font-semibold text-muted-fg",children:[u("project.routines.what_happens")," ",n.jsxs("span",{className:"font-normal text-muted-fg",children:["· ⏱ ",W_(_)]})]}),n.jsx("div",{className:"flex flex-wrap items-stretch gap-2",children:ve.map((oe,fe)=>n.jsxs("div",{className:"flex items-stretch gap-2",children:[n.jsxs("div",{className:ge("flex max-w-[240px] flex-col gap-1 rounded-lg border px-2.5 py-2",oe.action?"border-emerald-500/40 bg-emerald-500/5":"border-border bg-card"),children:[n.jsxs("div",{className:ge("flex items-center gap-1.5 text-[11px] font-medium",oe.action?"text-emerald-400":"text-muted-fg"),children:[n.jsx(oe.icon,{size:12})," ",oe.label]}),oe.detail&&n.jsx("div",{className:"line-clamp-2 font-mono text-[10px] text-muted-fg",children:oe.detail})]}),fe<ve.length-1&&n.jsx(U2,{size:14,className:"shrink-0 self-center text-muted-fg"})]},oe.id))})]})]})})}function I7({pid:e}){const t=Ze(),a=He(`/projects/${e}/routines`,()=>Br.list(e)),[o,l]=Vo(),[i,d]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(!1),[b,_]=x.useState(null),[k,N]=x.useState(null),y=a.data||[],w=o.get("r_id"),E=y.find(T=>T.name===w)||null,j=T=>l(O=>{const M=new URLSearchParams(O);return T?M.set("r_id",T):M.delete("r_id"),M},{replace:!0});x.useEffect(()=>{y.length!==0&&(w&&y.some(T=>T.name===w)||j(y[0].name))},[y,w]);const S=async T=>{try{await(T.enabled?Br.disable:Br.enable)(e,T.name),a.mutate()}catch(O){t.error(O?.message||u("project.routines.toggle_error"))}},R=async()=>{if(!b)return;const T=b;_(null),N(T.name);try{await Br.run(e,T.name),t.success(u("project.routines.run_success",{name:T.name})),await Promise.all([a.mutate(),Tf(`/projects/${e}/routines/${T.name}/runs`)])}catch(O){t.error(O?.message||u("project.routines.run_error"))}finally{N(null)}},A=async()=>{if(f){g(!0);try{await Br.remove(e,f.name),t.success(u("project.routines.delete_success")),w===f.name&&j(null),m(null),a.mutate()}catch(T){t.error(T?.message||u("project.routines.delete_error"))}finally{g(!1)}}};return n.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[n.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-4",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:u("project.routines.title")}),n.jsx("p",{className:"mt-0.5 text-sm text-muted-fg",children:u("project.routines.subtitle")})]}),n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>d({kind:"super_agent",schedule:"every:10m",enabled:!0}),children:[n.jsx(Pt,{size:14})," ",u("project.routines.new_btn")]})]}),a.isLoading&&n.jsx(rt,{}),!a.isLoading&&y.length===0&&n.jsx(pt,{children:u("project.routines.empty")}),y.length>0&&n.jsxs("div",{className:"grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)] grid-cols-[minmax(200px,260px)_1fr] overflow-hidden rounded-xl border border-border bg-card/40",children:[n.jsx(A7,{routines:y,selectedName:E?.name??null,onSelect:j}),n.jsx("div",{className:"min-h-0 min-w-0 overflow-hidden",children:E?n.jsx(D7,{pid:e,routine:E,onEdit:()=>d({...E}),onRun:()=>_(E),onToggle:()=>S(E),onDelete:()=>m(E),running:k===E.name},E.name):n.jsx("div",{className:"flex h-full items-center justify-center p-8",children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.routines.detail_empty")})})})]}),n.jsx(L7,{draft:i,onClose:()=>d(null),onSaved:()=>{d(null),a.mutate()},pid:e}),n.jsx(Zt,{open:!!f,onClose:()=>h?null:m(null),title:u("project.routines.delete_confirm",{name:f?.name||""}),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>m(null),disabled:h,children:u("common.cancel")}),n.jsx(ie,{variant:"destructive",onClick:A,loading:h,children:u("common.delete")})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.routines.delete_confirm_body")})}),n.jsx(Zt,{open:!!b,onClose:()=>_(null),title:u("project.routines.run_confirm",{name:b?.name||""}),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>_(null),children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:R,children:u("common.run")})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.routines.run_confirm_body")})})]})}function So({label:e,children:t}){return n.jsxs("div",{className:"flex items-baseline justify-between gap-3 text-xs",children:[n.jsx("span",{className:"text-muted-foreground",children:e}),n.jsx("span",{className:"text-right font-mono text-foreground/90",children:t})]})}function B7({pid:e,taskId:t,onClose:a,onChanged:o}){const l=Ze(),i=Pn(),{data:d,isLoading:f,mutate:m}=He(`/projects/${e}/tasks/${t}`,()=>Xn.get(e,t)),[h,g]=x.useState(""),[b,_]=x.useState(!1);x.useEffect(()=>{g(d?.body??"")},[d?.id,d?.body]);const k=()=>{m(),o()},N=async j=>{_(!0);try{await j(),k()}catch(S){l.error(S instanceof Error?S.message:String(S))}finally{_(!1)}};if(f)return n.jsx("div",{className:"flex w-80 items-center justify-center border-l border-border",children:n.jsx(_n,{})});if(!d)return null;const y=Pf(d),w=d.state==="open",E=h!==(d.body??"");return n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-l border-border bg-card/40","data-testid":"task-detail",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5",children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:u("tasks.detail_title")}),n.jsx("button",{type:"button",onClick:a,"aria-label":u("common.close"),className:"text-muted-foreground hover:text-foreground",children:n.jsx(gs,{className:"size-4"})})]}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-4",children:[n.jsxs("div",{children:[n.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:u("tasks.field_title")}),n.jsx("div",{className:"text-sm font-semibold",children:d.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx($_,{status:y}),n.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:d.id})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:u("tasks.field_prompt")}),E&&n.jsxs("button",{type:"button",onClick:()=>N(async()=>{await Xn.patch(e,d.id,{body:h}),l.success(u("common.saved"))}),className:"flex items-center gap-1 text-[10px] text-emerald-500 hover:text-emerald-400",children:[n.jsx(Jf,{className:"size-3"}),u("files.save")]})]}),n.jsx(un,{rows:4,value:h,onChange:j=>g(j.target.value),placeholder:u("tasks.prompt_ph"),className:"text-xs"})]}),w&&n.jsxs("div",{children:[n.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:u("tasks.field_status")}),n.jsx(ut,{value:d.status??"pending",onChange:j=>N(()=>Xn.status(e,d.id,j)),options:QN.map(j=>({value:j,label:B_(j)}))})]}),n.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border bg-background/40 p-2.5",children:[d.agent&&n.jsxs(So,{label:u("tasks.field_agent"),children:["@",d.agent]}),d.created_by&&n.jsx(So,{label:u("tasks.field_creator"),children:d.created_by}),d.source&&n.jsx(So,{label:u("tasks.field_source"),children:d.source}),d.due&&n.jsx(So,{label:u("project.tasks.due"),children:d.due}),n.jsx(So,{label:u("tasks.field_created"),children:new Date(d.created_at).toLocaleString()}),n.jsx(So,{label:u("tasks.field_updated"),children:new Date(d.updated_at).toLocaleString()}),d.done_at&&n.jsx(So,{label:u("tasks.field_done"),children:new Date(d.done_at).toLocaleString()})]}),d.thread&&n.jsxs("button",{type:"button",onClick:()=>i(`/p/${e}/chat?thread=${d.thread}`),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-sky-500/30 bg-sky-500/5 px-3 py-2 text-xs text-sky-500 hover:bg-sky-500/10",children:[n.jsx(hb,{className:"size-3.5"}),u("tasks.view_thread")]})]}),n.jsx("div",{className:"flex shrink-0 gap-2 border-t border-border px-4 py-3",children:w?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{size:"sm",variant:"primary",className:"flex-1",loading:b,onClick:()=>N(()=>Xn.done(e,d.id)),children:[n.jsx(Gr,{size:13}),u("tasks.mark_done")]}),n.jsx(ie,{size:"sm",variant:"destructive",loading:b,onClick:()=>N(()=>Xn.drop(e,d.id)),"aria-label":u("project.tasks.aria_drop"),children:n.jsx(vn,{size:13})})]}):n.jsxs(ie,{size:"sm",variant:"secondary",className:"flex-1",loading:b,onClick:()=>N(()=>Xn.reopen(e,d.id)),children:[n.jsx(gi,{size:13}),u("project.tasks.reopen")]})})]})}function $7({pid:e}){const[t,a]=x.useState("open"),[o,l]=Vo(),i=o.get("task"),d=Ze(),f=G_({key:`/projects/${e}/tasks?state=${t}`,fetchPage:(S,R)=>Xn.listPage(e,{state:t,limit:S,offset:R}),resetKey:t,swr:{dedupingInterval:0,revalidateOnFocus:!0}}),[m,h]=x.useState(""),[g,b]=x.useState(""),[_,k]=x.useState(!1),[N,y]=x.useState(!1),w=S=>{const R=new URLSearchParams(o);S?R.set("task",S):R.delete("task"),l(R,{replace:!0})},E=async()=>{if(m.trim()){y(!0);try{await Xn.add(e,{title:m.trim(),body:g.trim()||null,source:"web"}),h(""),b(""),k(!1),d.success(u("project.tasks.created")),f.mutate()}catch(S){d.error(S?.message||u("project.tasks.create_error"))}finally{y(!1)}}},j=async(S,R)=>{try{await S(),d.success(R),f.mutate()}catch(A){d.error(A?.message||u("common.error_generic"))}};return n.jsxs(Ye,{fullHeight:!0,title:u("project.tasks.title"),description:u("project.tasks.subtitle"),action:n.jsx("div",{className:"flex gap-1",children:["open","done","dropped"].map(S=>n.jsx(ie,{size:"sm","data-testid":`task-filter-${S}`,variant:t===S?"primary":"ghost",onClick:()=>a(S),children:u(`tasks.state_${S}`)},S))}),children:[n.jsxs("div",{className:"mb-4 shrink-0 space-y-2",children:[n.jsxs("div",{className:"flex items-end gap-2",children:[n.jsx(ce,{label:u("project.tasks.add_label"),children:n.jsx(Te,{"data-testid":"task-input",placeholder:u("project.tasks.add_placeholder"),value:m,onChange:S=>h(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!_&&E()}})}),n.jsxs(ie,{variant:"ghost",size:"sm",onClick:()=>k(S=>!S),"aria-label":u("tasks.toggle_prompt"),children:[_?n.jsx(pb,{size:14}):n.jsx(ms,{size:14})," ",u("tasks.field_prompt")]}),n.jsxs(ie,{variant:"primary","data-testid":"task-add",onClick:E,loading:N,children:[n.jsx(Pt,{size:14})," ",u("project.tasks.add")]})]}),_&&n.jsx(un,{rows:3,value:g,onChange:S=>b(S.target.value),placeholder:u("tasks.prompt_ph"),className:"text-xs"})]}),n.jsxs("div",{className:"flex min-h-0 flex-1 gap-4",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f.isLoading&&n.jsx(rt,{}),!f.isLoading&&f.total===0&&n.jsxs(pt,{children:[t==="open"?u("project.tasks.empty_open"):u("project.tasks.empty",{state:t})," ",n.jsx("code",{children:'apx task add "…"'})]}),n.jsx(Y_,{paged:f,fullHeight:!0,children:n.jsx("ul",{className:"space-y-2 text-sm","data-testid":"task-list",children:f.items.map(S=>{const R=Pf(S);return n.jsxs("li",{"data-testid":`task-${S.id}`,onClick:()=>w(S.id),className:`flex cursor-pointer items-start gap-3 rounded-md border px-3 py-2 hover:border-muted-fg/50 ${i===S.id?"border-primary/50 bg-primary/5":"border-border bg-muted/30"}`,children:[n.jsx(Lf,{status:R,className:"mt-0.5 shrink-0"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate font-medium",children:S.title}),n.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[S.state==="open"&&n.jsx($_,{status:R}),S.tags?.map(A=>n.jsxs(Ve,{children:["#",A]},A)),S.agent&&n.jsxs(Ve,{tone:"info",children:["@",S.agent]}),S.due&&n.jsxs("span",{children:[u("project.tasks.due")," ",S.due]})]})]}),n.jsx("div",{className:"flex shrink-0 gap-1",onClick:A=>A.stopPropagation(),children:S.state==="open"?n.jsxs(n.Fragment,{children:[n.jsx(ie,{size:"sm",variant:"secondary","aria-label":u("project.tasks.aria_done"),"data-testid":`task-done-${S.id}`,onClick:()=>j(()=>Xn.done(e,S.id),u("project.tasks.done")),children:n.jsx(Gr,{size:13})}),n.jsx(ie,{size:"sm",variant:"destructive","aria-label":u("project.tasks.aria_drop"),"data-testid":`task-drop-${S.id}`,onClick:()=>j(()=>Xn.drop(e,S.id),u("project.tasks.drop")),children:n.jsx(vn,{size:13})})]}):n.jsx(ie,{size:"sm",variant:"ghost","aria-label":u("project.tasks.aria_reopen"),"data-testid":`task-reopen-${S.id}`,onClick:()=>j(()=>Xn.reopen(e,S.id),u("project.tasks.reopen")),children:n.jsx(gi,{size:13})})})]},S.id)})})})]}),i&&n.jsx(B7,{pid:e,taskId:i,onClose:()=>w(null),onChanged:()=>f.mutate()})]})]})}const U7="\\$\\{var\\.([^}\\s]+)\\}";function IE(e="g"){return new RegExp(U7,e)}function BE(e){return IE("").test(e)}function H7(e){const t=[];let a=0;for(const o of e.matchAll(IE("g"))){const l=o.index??0;l>a&&t.push({type:"text",value:e.slice(a,l)}),t.push({type:"var",value:o[1]}),a=l+o[0].length}return a<e.length&&t.push({type:"text",value:e.slice(a)}),t}function Oh(e){let t="";for(const a of Array.from(e.childNodes))if(a.nodeType===Node.TEXT_NODE)t+=a.textContent??"";else if(a instanceof HTMLElement){const o=a.dataset.varName;o?t+=`\${var.${o}}`:a.tagName==="BR"?t+="":t+=a.textContent??""}return t.replace(/[\u200B-\u200F\u202A-\u202E\u2060\uFEFF]/g,"").replace(/\u00A0/g," ")}function tw(e,t){e.replaceChildren();const a=H7(t);for(const o of a)o.type==="text"?e.appendChild(document.createTextNode(o.value)):e.appendChild($E(o.value));(a.length===0||a[a.length-1].type==="var")&&e.appendChild(document.createTextNode(""))}function $E(e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.varName=e,t.className="inline-flex items-baseline px-1 rounded bg-primary/10 text-primary font-mono text-[12px] select-none cursor-default whitespace-nowrap",t.textContent=`$${e}`,t.title=`\${var.${e}}`,t}function q7(e,t){e.deleteContents(),e.insertNode(t),e.setStartAfter(t),e.collapse(!0);const a=window.getSelection();a?.removeAllRanges(),a?.addRange(e)}function V7(e){const t=document.createRange();t.selectNodeContents(e),t.collapse(!1);const a=window.getSelection();a?.removeAllRanges(),a?.addRange(t)}const Z_=x.forwardRef(function({value:t,onChange:a,placeholder:o,className:l,varNames:i=[],onCreateVar:d},f){const m=x.useRef(null),h=x.useRef(null),g=x.useRef(null),[b,_]=x.useState(!1),[k,N]=x.useState(""),y=x.useRef(t);x.useEffect(()=>{const T=m.current;T&&(t===y.current&&T.childNodes.length>0||(tw(T,t),y.current=t))},[t]);const w=x.useCallback(()=>{const T=m.current;if(!T)return;const O=Oh(T);y.current=O,O!==t&&a(O)},[a,t]),E=x.useCallback(()=>{const T=m.current;if(!T)return;const O=Oh(T);if(BE(O)&&G7(T)){const M=Y7(T);tw(T,O),M!=null&&K7(T,M)}y.current=Oh(T),y.current!==t&&a(y.current)},[a,t]),j=x.useCallback(()=>{const T=window.getSelection();if(!T||T.rangeCount===0)return;const O=T.getRangeAt(0),M=m.current;M&&M.contains(O.startContainer)&&(g.current=O.cloneRange())},[]),S=x.useCallback(T=>{if(T.key==="Enter"){T.preventDefault(),T.currentTarget.blur();return}if(T.key==="Backspace"){const O=window.getSelection();if(!O||O.rangeCount===0)return;const M=O.getRangeAt(0);if(!M.collapsed)return;const{startContainer:B,startOffset:P}=M;if(B.nodeType===Node.TEXT_NODE&&P===0){const $=B.previousSibling;if($ instanceof HTMLElement&&$.dataset.varName){T.preventDefault(),$.remove(),w();return}}else if(B===m.current){const $=B.childNodes[P-1];if($ instanceof HTMLElement&&$.dataset.varName){T.preventDefault(),$.remove(),w();return}}}},[w]),R=x.useCallback(T=>{const O=m.current;if(!O)return;const M=g.current;O.focus();let B;M&&O.contains(M.startContainer)?B=M:(B=document.createRange(),B.selectNodeContents(O),B.collapse(!1)),q7(B,$E(T)),g.current=null,w()},[w]);x.useImperativeHandle(f,()=>({insertVar:R,focus:()=>m.current?.focus()}),[R]);const A=i.filter(T=>T.toLowerCase().includes(k.toLowerCase()));return n.jsxs("div",{className:ge("group flex items-stretch w-full min-w-0 rounded-lg border border-input bg-transparent dark:bg-input/30 transition-colors","focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",l),children:[n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx("div",{ref:m,role:"textbox",contentEditable:!0,suppressContentEditableWarning:!0,onInput:E,onKeyDown:S,onBlur:w,onFocus:j,onMouseUp:j,onKeyUp:j,className:ge("h-8 w-full whitespace-nowrap overflow-x-auto px-2.5 py-1 text-sm rounded-l-lg","focus:outline-none font-mono leading-7","[&_*]:align-baseline"),"data-placeholder":o||"",style:{caretColor:"currentColor"}}),t===""&&o&&n.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 select-none text-sm text-muted-foreground font-mono",children:o})]}),n.jsxs("div",{ref:h,className:"relative flex",children:[n.jsx(qe,{content:u("chat_ui.insert_variable"),children:n.jsx("button",{type:"button",onMouseDown:T=>{T.preventDefault(),j()},onClick:()=>_(T=>!T),"aria-label":u("chat_ui.insert_variable"),className:ge("flex items-center justify-center px-2 min-w-8 border-l border-input text-muted-foreground rounded-r-lg","hover:bg-muted/60 hover:text-foreground transition-colors",b&&"bg-muted/60 text-foreground"),children:n.jsx(Pt,{size:14})})}),b&&n.jsx(F7,{anchorRef:h,query:k,onQuery:N,varNames:A,onPick:T=>{R(T),_(!1),N("")},onClose:()=>{_(!1),N("")},onCreateVar:d})]})]})});function F7({anchorRef:e,query:t,onQuery:a,varNames:o,onPick:l,onClose:i,onCreateVar:d}){const f=x.useRef(null),m=x.useRef(null),[h,g]=x.useState(null),b=x.useCallback(()=>{const _=e.current;if(!_)return;const k=_.getBoundingClientRect(),N=256,y=4,w=8,E=window.innerWidth-N-w,j=Math.max(w,Math.min(k.right-N,E)),S=k.bottom+y,R=f.current?.offsetHeight??260,A=S+R<=window.innerHeight-w?S:Math.max(w,k.top-R-y);g({left:j,top:A,width:N})},[e]);return x.useLayoutEffect(()=>{b()},[b,t,o.length]),x.useEffect(()=>(b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}),[b]),x.useEffect(()=>{m.current?.focus({preventScroll:!0})},[]),x.useEffect(()=>{function _(k){const N=k.target;f.current?.contains(N)||e.current?.contains(N)||i()}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[e,i]),h?Fs.createPortal(n.jsxs("div",{ref:f,style:h,className:"fixed z-[1000] rounded-md border border-border bg-popover shadow-lg",children:[n.jsx("div",{className:"border-b border-border p-2",children:n.jsx("input",{ref:m,value:t,onChange:_=>a(_.target.value),placeholder:u("shared_ui.search_variable_ph"),className:"w-full rounded bg-muted/40 px-2 py-1 text-xs font-mono outline-none"})}),n.jsxs("ul",{className:"max-h-44 overflow-auto p-1 text-xs",children:[o.length===0&&n.jsx("li",{className:"px-2 py-1.5 text-muted-foreground",children:u("shared_ui.no_matches")}),o.map(_=>n.jsx("li",{children:n.jsx("button",{type:"button",onMouseDown:k=>k.preventDefault(),onClick:()=>l(_),className:"block w-full rounded px-2 py-1.5 text-left font-mono hover:bg-muted/60",children:_})},_))]}),d&&n.jsx("div",{className:"border-t border-border p-1",children:n.jsxs("button",{type:"button",onMouseDown:_=>_.preventDefault(),onClick:()=>{d(),i()},className:"flex w-full items-center gap-1 rounded px-2 py-1.5 text-left text-xs hover:bg-muted/60",children:[n.jsx(Pt,{size:12})," ",u("shared_ui.create_variable")]})})]}),document.body):null}function G7(e){for(const t of Array.from(e.childNodes))if(t.nodeType===Node.TEXT_NODE&&BE(t.textContent??""))return!0;return!1}function Y7(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0);if(!e.contains(a.startContainer))return null;const o=a.cloneRange();return o.selectNodeContents(e),o.setEnd(a.startContainer,a.startOffset),o.toString().length}function K7(e,t){const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let o=t,l=a.nextNode();for(;l;){const i=(l.textContent??"").length;if(o<=i){const d=document.createRange();d.setStart(l,o),d.collapse(!0);const f=window.getSelection();f?.removeAllRanges(),f?.addRange(d);return}o-=i,l=a.nextNode()}V7(e)}function nw(e){return e?Object.entries(e).map(([t,a])=>({key:t,value:String(a)})):[]}function sw(e){const t={};for(const a of e)a.key.trim()&&(t[a.key.trim()]=a.value);return t}function aw({rows:e,onChange:t,keyPlaceholder:a=u("shared_ui.kv_key_ph"),valuePlaceholder:o=u("shared_ui.kv_value_ph"),varNames:l,onCreateVar:i,emptyLabel:d}){const f=(g,b)=>{const _=e.slice();_[g]={..._[g],...b},t(_)},m=g=>t(e.filter((b,_)=>_!==g)),h=()=>t([...e,{key:"",value:""}]);return n.jsxs("div",{className:"space-y-2",children:[e.length===0&&d&&n.jsx("p",{className:"text-[11px] text-muted-foreground",children:d}),e.map((g,b)=>n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Te,{value:g.key,onChange:_=>f(b,{key:_.target.value}),placeholder:a,className:"w-40 font-mono text-xs"}),n.jsx("div",{className:"flex-1",children:n.jsx(Z_,{value:g.value,onChange:_=>f(b,{value:_}),placeholder:o,varNames:l,onCreateVar:i})}),n.jsx(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>m(b),"aria-label":u("shared_ui.remove_row"),children:n.jsx(vn,{size:13})})]},b)),n.jsxs(ie,{type:"button",size:"sm",variant:"ghost",onClick:h,children:[n.jsx(Pt,{size:12})," ",u("shared_ui.add_row")]})]})}function X7(e){const t=e.raw||{};if(typeof t.description=="string"&&t.description.trim())return t.description.trim();if(e.transport==="http"&&e.url)return e.url.length>64?e.url.slice(0,61)+"…":e.url;const a=[e.command,...e.args||[]].filter(Boolean).join(" ");return a?"$ "+(a.length>64?a.slice(0,61)+"…":a):""}function Q7(e,t){return t?.busy?"bg-amber-400 animate-pulse":t?.ok===!1?"bg-red-400":t?.ok?"bg-emerald-400":e?"bg-emerald-500/70":"bg-slate-500"}const W7={apc:"info",runtime:"success",global:"muted"};function Qx(e){return e==="runtime"?"runtime":e==="global"?"global":"shared"}function zh(e){return e==="runtime"?u("project.mcps.source_runtime"):e==="apc"?u("project.mcps.source_apc"):e==="claude"?u("project.mcps.source_claude"):e==="codex"?u("project.mcps.source_codex"):e==="cursor"?u("project.mcps.source_cursor"):e==="vscode"?u("project.mcps.source_vscode"):e==="roo"?u("project.mcps.source_roo"):e==="gemini"?u("project.mcps.source_gemini"):e==="global"?u("project.mcps.scope_global"):e}function Z7({pid:e}){const t=Ze(),a=He(`/projects/${e}/mcps`,()=>$r.list(e)),o=He(`/projects/${e}/mcps/check`,()=>$r.check(e)),l=He(`/projects/${e}/vars`,()=>Yc.list(e)),[i,d]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState({}),[b,_]=x.useState({}),k=x.useMemo(()=>l.data?Object.keys(l.data.effective).sort():[],[l.data]),N=async(E,j)=>{if(confirm(u("project.mcps.delete_confirm",{name:E,scope:j})))try{await $r.remove(e,E,j),t.success(u("project.mcps.removed")),a.mutate(),f===E&&m(null)}catch(S){t.error(S?.message||u("common.error_generic"))}},y=async E=>{try{await $r.add(e,Qx(E.source),{name:E.name,enabled:!E.enabled}),a.mutate()}catch(j){t.error(j?.message||u("common.error_generic"))}},w=async E=>{m(E),g(j=>({...j,[E]:{busy:!0}})),_(j=>({...j,[E]:!0}));try{const j=await $r.test(e,E);g(S=>({...S,[E]:{ok:j.ok,error:j.error,tools:j.tools}}))}catch(j){g(S=>({...S,[E]:{ok:!1,error:j?.message||"error"}}))}};return n.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-4",children:[n.jsx("div",{className:"lg:col-span-3",children:n.jsxs(Ye,{title:u("project.mcps.title"),description:u("project.mcps.subtitle"),action:n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>d({kind:"new"}),children:[n.jsx(Pt,{size:14})," ",u("project.mcps.new")]}),children:[o.data?.conflicts?.length?n.jsxs("div",{className:"mb-3 rounded-md border border-amber-500/40 bg-amber-500/10 p-2 text-xs",children:[n.jsx("div",{className:"font-medium",children:u("project.mcps.conflicts",{names:o.data.conflicts.map(E=>E.name).join(", ")})}),n.jsx("ul",{className:"mt-1 space-y-1 text-muted-fg",children:o.data.conflicts.map(E=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("span",{"aria-hidden":"true",children:"•"}),n.jsx("span",{children:u("project.mcps.conflict_detail",{name:E.name,winner:zh(E.winner),loser:zh(E.loser)})})]},`${E.name}-${E.winner}-${E.loser}`))})]}):null,a.isLoading&&n.jsx(rt,{}),!a.isLoading&&(a.data?.length??0)===0&&n.jsx(pt,{children:u("project.mcps.empty")}),n.jsx("ul",{className:"space-y-2 text-sm",children:(a.data||[]).map(E=>{const j=E.source==="apc"||E.source==="runtime"||E.source==="global",S=Qx(E.source),R=f===E.name,A=E.enabled!==!1,T=h[E.name],O=T?.tools||[],M=!!b[E.name],B=X7(E),P=E.transport==="http"?W2:mM;return n.jsx("li",{className:"rounded-md border px-3 py-2 transition-colors "+(R?"border-primary/50 bg-primary/5":"border-border bg-muted/30 hover:bg-muted/50"),onClick:()=>m(E.name),role:"button",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsxs("div",{className:"relative mt-0.5 flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg border border-border bg-background",children:[n.jsx(P,{size:16,className:"text-muted-fg"}),n.jsx("span",{className:ge("absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-card",Q7(A,T))})]}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"font-medium",children:E.name}),n.jsx(Ve,{tone:W7[E.source]??"muted",children:zh(E.source)}),n.jsx("span",{className:"ml-auto text-xs text-muted-fg",children:(E.transport||"stdio").toUpperCase()}),n.jsx("div",{onClick:$=>$.stopPropagation(),children:n.jsx(Bt,{checked:A,onChange:()=>y(E),label:""})}),n.jsx(qe,{content:u("project.mcps.test_btn"),children:n.jsx(ie,{size:"sm",variant:"ghost",onClick:$=>{$.stopPropagation(),w(E.name)},"aria-label":u("project.mcps.test_btn"),children:T?.busy?n.jsx(xx,{size:13,className:"animate-pulse"}):n.jsx(xx,{size:13})})}),n.jsx(qe,{content:u("project.mcps.logs_btn"),children:n.jsx(ie,{size:"sm",variant:"ghost",onClick:$=>{$.stopPropagation(),m(E.name)},"aria-label":u("project.mcps.logs_btn"),children:n.jsx(kb,{size:13})})}),j&&n.jsx(qe,{content:u("project.mcps.edit_btn"),children:n.jsx(ie,{size:"sm",variant:"ghost",onClick:$=>{$.stopPropagation(),d({kind:"edit",entry:E})},"aria-label":u("project.mcps.edit_btn"),children:n.jsx(ya,{size:13})})}),j&&n.jsx(ie,{size:"sm",variant:"destructive",onClick:$=>{$.stopPropagation(),N(E.name,S)},children:n.jsx(vn,{size:13})})]}),B&&n.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted-fg",children:B}),T?.ok===!1&&T.error&&n.jsxs("p",{className:"mt-1 flex items-start gap-1 text-xs text-red-400",children:[n.jsx(q2,{size:12,className:"mt-0.5 flex-shrink-0"})," ",n.jsx("span",{className:"break-words",children:T.error})]}),O.length>0&&n.jsxs("div",{className:"mt-1.5",onClick:$=>$.stopPropagation(),children:[n.jsxs("button",{type:"button",onClick:()=>_($=>({...$,[E.name]:!$[E.name]})),className:"flex items-center gap-1 text-xs text-muted-fg transition-colors hover:text-fg",children:[n.jsx(aa,{size:12})," ",u("project.mcps.tools_count",{n:O.length}),n.jsx(ms,{size:12,className:ge("transition-transform",M&&"rotate-180")})]}),M&&n.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[O.slice(0,40).map($=>n.jsx(qe,{content:$.description||"—",children:n.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-fg",children:[n.jsx(_a,{size:10})," ",$.name]})},$.name)),O.length>40&&n.jsxs("span",{className:"text-[10px] text-muted-fg",children:["… +",O.length-40]})]})]})]})]})},`${E.source}-${E.name}`)})}),i&&n.jsx(e9,{mode:i,pid:e,varNames:k,onClose:()=>d(null),onSaved:()=>{d(null),a.mutate()},onVarsChanged:()=>l.mutate()})]})}),n.jsx("div",{className:"lg:col-span-1",children:n.jsx(J7,{pid:e,mcpName:f,runningTest:!!(f&&h[f]?.busy)})})]})}function J7({pid:e,mcpName:t,runningTest:a}){const[o,l]=x.useState(null),[i,d]=x.useState(null),f=x.useRef(null);x.useEffect(()=>{if(!t){l(null),d(null);return}f.current!==t&&(l(null),d(null),f.current=t);let h=!1;const g=async()=>{try{const k=await $r.logs(e,t);h||(l(k),d(null))}catch(k){h||d(k?.message||"error")}};g();const _=setInterval(g,a?1200:4e3);return()=>{h=!0,clearInterval(_)}},[e,t,a]);const m=x.useRef(null);return x.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[o?.events?.length,o?.stderr_tail]),n.jsxs("div",{className:"sticky top-3 flex h-[calc(100vh-7rem)] min-h-[24rem] flex-col rounded-xl border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 text-xs",children:[n.jsx(_a,{size:13,className:"text-muted-fg"}),n.jsx("span",{className:"font-medium",children:u("project.mcps.logs_panel_title")}),t?n.jsx(Ve,{tone:"info",children:t}):n.jsxs("span",{className:"text-muted-fg",children:["— ",u("project.mcps.logs_panel_pick")]})]}),n.jsxs("div",{ref:m,className:"flex-1 overflow-auto bg-background/60 px-3 py-2 font-mono text-[11px]",children:[!t&&n.jsx("p",{className:"text-muted-fg",children:u("project.mcps.logs_panel_hint")}),t&&i&&n.jsx("p",{className:"text-red-400",children:i}),t&&!i&&o&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-2 text-muted-fg",children:[o.transport.toUpperCase(),o.url?` · ${o.url}`:o.command?` · ${o.command}`:"",o.last_error?` · last_error: ${o.last_error}`:""]}),o.note&&n.jsx("p",{className:"text-muted-fg",children:o.note}),(!o.events||o.events.length===0)&&!o.stderr_tail&&!o.note&&n.jsx("p",{className:"text-muted-fg",children:u("project.mcps.logs_panel_idle")}),o.events?.map((h,g)=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx("span",{className:"text-muted-fg",children:h.ts.slice(11,19)}),n.jsx("span",{className:h.level==="error"?"text-red-400":h.level==="stderr"?"text-amber-400":"text-emerald-400",children:h.level}),n.jsx("span",{className:"flex-1 break-all",children:h.msg})]},g)),o.stderr_tail&&n.jsxs("div",{className:"mt-2 border-t border-border/60 pt-2",children:[n.jsx("div",{className:"mb-1 text-muted-fg",children:"stderr"}),n.jsx("pre",{className:"whitespace-pre-wrap break-all text-amber-300/80",children:o.stderr_tail})]})]})]})]})}function e9({mode:e,pid:t,varNames:a,onClose:o,onSaved:l,onVarsChanged:i}){const d=Ze(),f=e.kind==="edit",m=f?e.entry:null,[h,g]=x.useState(!1),[b,_]=x.useState(m?Qx(m.source):"runtime"),[k,N]=x.useState(m?.name||""),[y,w]=x.useState(m?.transport==="http"||m?.url?"http":"stdio"),[E,j]=x.useState(m?.command||""),[S,R]=x.useState(m?.args&&m.args.length?m.args:[""]),[A,T]=x.useState(nw(m?.env)),[O,M]=x.useState(m?.url||""),[B,P]=x.useState(nw(m?.headers)),[$,D]=x.useState(m?.enabled!==!1),[L,H]=x.useState(!1),V=async()=>{if(!k.trim()){d.error(u("project.mcps.name_required"));return}g(!0);try{const U=S.map(X=>X.trim()).filter(Boolean),F=y==="stdio"?{name:k.trim(),command:E.trim(),args:U.length?U:void 0,env:A.length?sw(A):void 0,enabled:$}:{name:k.trim(),url:O.trim(),headers:B.length?sw(B):void 0,enabled:$};await $r.add(t,b,F),d.success(u(f?"project.mcps.updated":"project.mcps.added")),l()}catch(U){d.error(U?.message||u("common.error_generic"))}finally{g(!1)}};return n.jsxs(n.Fragment,{children:[n.jsx(Zt,{open:!0,onClose:()=>h?null:o(),title:u(f?"project.mcps.edit_title":"project.mcps.new_title"),description:f?m?.name:u("project.mcps.new_desc"),size:"lg",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:o,disabled:h,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:V,loading:h,children:u(f?"project.mcps.save_btn":"project.mcps.add_btn")})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("project.mcps.scope_label"),children:n.jsx(ut,{value:b,onChange:U=>_(U),options:[{value:"runtime",label:u("project.mcps.scope_runtime"),description:u("project.mcps.scope_runtime_desc")},{value:"shared",label:u("project.mcps.scope_shared"),description:u("project.mcps.scope_shared_desc")},{value:"global",label:u("project.mcps.scope_global"),description:u("project.mcps.scope_global_desc")}]})}),n.jsx(ce,{label:u("project.mcps.transport_label"),children:n.jsx(ut,{value:y,onChange:U=>w(U),options:[{value:"stdio",label:u("project.mcps.transport_stdio"),description:u("project.mcps.transport_stdio_desc")},{value:"http",label:u("project.mcps.transport_http"),description:u("project.mcps.transport_http_desc")}]})})]}),n.jsx(ce,{label:u("project.mcps.name_label"),children:n.jsx(Te,{value:k,onChange:U=>N(U.target.value),placeholder:u("project.mcps.name_ph"),disabled:f})}),y==="stdio"?n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("project.mcps.cmd_label"),children:n.jsx(Te,{value:E,onChange:U=>j(U.target.value),placeholder:u("project.mcps.cmd_ph")})}),n.jsx(ce,{label:u("project.mcps.args_label"),hint:u("project.mcps.args_hint_tokens"),children:n.jsx(t9,{args:S,onChange:R,varNames:a,onCreateVar:()=>H(!0)})}),n.jsx(ce,{label:u("project.mcps.env_label"),hint:u("project.mcps.env_hint_tokens"),children:n.jsx(aw,{rows:A,onChange:T,keyPlaceholder:"API_KEY",valuePlaceholder:"${var.MY_TOKEN}",varNames:a,onCreateVar:()=>H(!0),emptyLabel:u("project.mcps.env_empty")})})]}):n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("project.mcps.url_label"),children:n.jsx(Z_,{value:O,onChange:M,placeholder:u("project.mcps.url_ph"),varNames:a,onCreateVar:()=>H(!0)})}),n.jsx(ce,{label:u("project.mcps.headers_label"),hint:u("project.mcps.headers_hint"),children:n.jsx(aw,{rows:B,onChange:P,keyPlaceholder:"Authorization",valuePlaceholder:"Bearer ${var.TOKEN}",varNames:a,onCreateVar:()=>H(!0),emptyLabel:u("project.mcps.headers_empty")})})]}),n.jsx(Bt,{checked:$,onChange:D,label:u("project.mcps.enabled_label")})]})}),L&&n.jsx(n9,{pid:t,onClose:()=>H(!1),onCreated:()=>{H(!1),i()}})]})}function t9({args:e,onChange:t,varNames:a,onCreateVar:o}){const l=(f,m)=>{const h=e.slice();h[f]=m,t(h)},i=f=>t(e.filter((m,h)=>h!==f)),d=()=>t([...e,""]);return n.jsxs("div",{className:"space-y-2",children:[e.map((f,m)=>n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("div",{className:"flex-1",children:n.jsx(Z_,{value:f,onChange:h=>l(m,h),placeholder:u("agents_ui.arg_placeholder"),varNames:a,onCreateVar:o})}),n.jsx(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>i(m),"aria-label":u("agents_ui.remove_arg"),children:n.jsx(vn,{size:13})})]},m)),n.jsxs(ie,{type:"button",size:"sm",variant:"ghost",onClick:d,children:[n.jsx(Pt,{size:12})," ",u("project.mcps.add_arg")]})]})}function n9({pid:e,onClose:t,onCreated:a}){const o=Ze(),l=String(e)==="0",[i,d]=x.useState(""),[f,m]=x.useState(""),[h,g]=x.useState(!1),[b,_]=x.useState(l?"global":"project"),k=async()=>{if(!i.trim()){o.error(u("project.vars.name_required"));return}if(!f){o.error(u("project.vars.value_required"));return}g(!0);try{await Yc.upsert(e,{name:i.trim(),value:f,scope:b}),o.success(u("project.vars.added")),a()}catch(N){o.error(N?.message||u("common.error_generic"))}finally{g(!1)}};return n.jsx(Zt,{open:!0,onClose:()=>h?null:t(),title:u("project.vars.new_title"),description:u("project.vars.new_desc"),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:h,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:k,loading:h,children:u("project.vars.add_btn")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("project.vars.scope_label"),children:n.jsx(ut,{value:b,onChange:N=>_(N),options:[...l?[]:[{value:"project",label:u("project.vars.scope_project"),description:u("project.vars.scope_project_desc")}],{value:"global",label:u("project.vars.scope_global"),description:u("project.vars.scope_global_desc")}]})}),n.jsx(ce,{label:u("project.vars.name_label"),hint:u("project.vars.name_hint"),children:n.jsx(Te,{value:i,onChange:N=>d(N.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),placeholder:"MY_API_KEY",autoFocus:!0})}),n.jsx(ce,{label:u("project.vars.value_label"),hint:u("project.vars.value_hint"),children:n.jsx(Te,{type:"password",value:f,onChange:N=>m(N.target.value),className:"font-mono text-xs"})})]})})}function UE({icon:e,title:t,description:a,badges:o,rightContent:l,hasTools:i,expanded:d,onToggle:f,children:m}){return n.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[n.jsxs("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left transition-colors hover:bg-muted/40",onClick:f,children:[e,n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("p",{className:"text-sm font-semibold text-foreground",children:t}),o,i&&n.jsx(qe,{content:"Esta integración expone tools para los agentes",children:n.jsx("span",{children:n.jsx(aa,{className:"h-3 w-3 text-muted-foreground"})})})]}),n.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:a})]}),n.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[l,n.jsx(Qr,{className:ge("h-4 w-4 text-muted-foreground transition-transform",d&&"rotate-90")})]})]}),d&&m&&n.jsx("div",{className:"border-t border-border",children:m})]})}function s9({tools:e,isActive:t}){return t?n.jsxs("div",{className:"space-y-2.5 rounded-xl border border-border bg-muted/30 p-3",children:[n.jsx("div",{className:"flex items-center justify-between",children:n.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:u("integrations.tools_for_agents")})}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(a=>n.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1",children:[n.jsx(aa,{className:"h-2.5 w-2.5 flex-shrink-0 text-muted-foreground"}),n.jsx("span",{className:"font-mono text-[10px] text-foreground",children:a.slug}),n.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"·"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:a.desc})]},a.slug))}),n.jsx("p",{className:"text-[10px] text-muted-foreground/70",children:u("integrations.tools_available_note")})]}):null}function a9({value:e,onChange:t,onEnter:a,placeholder:o,ringClassName:l,btnClassName:i}){const[d,f]=x.useState(!1),[m,h]=x.useState(""),[g,b]=x.useState([]),[_,k]=x.useState(null),[N,y]=x.useState(""),[w,E]=x.useState(!1),j=async R=>{E(!0),y("");try{const A=await Of.dirs(R||"~");h(A.path),t(A.path),k(A.parent),b(A.entries)}catch(A){y(A.message)}finally{E(!1)}},S=async()=>{E(!0);try{const R=await Of.pickDir(u("add_project.picker_prompt"));if("cancelled"in R)return;t(R.path)}catch{f(!0),await j(e||"~")}finally{E(!1)}};return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{type:"text",placeholder:o,value:e,onChange:R=>t(R.target.value),onKeyDown:R=>R.key==="Enter"&&a?.(),className:ge("w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs outline-none placeholder:text-muted-foreground/60",l)}),n.jsxs("button",{type:"button",onClick:S,disabled:w,className:ge("flex flex-shrink-0 items-center gap-1.5 rounded-lg border px-3 py-2 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",i),children:[w?n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Fl,{className:"h-3.5 w-3.5"}),u("add_project.search_btn")]})]}),d&&n.jsxs("div",{className:"rounded-lg border border-border bg-muted/20",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[n.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:m||e||"~"}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{type:"button",onClick:()=>j("~"),disabled:w,className:"rounded p-1 hover:bg-accent disabled:opacity-50",children:n.jsx(Z2,{className:"h-3 w-3"})}),n.jsx("button",{type:"button",onClick:()=>_&&j(_),disabled:!_||w,className:"rounded px-1.5 py-0.5 text-[10px] hover:bg-accent disabled:opacity-50",children:".."}),n.jsx("button",{type:"button",onClick:()=>f(!1),disabled:w,className:"rounded p-1 hover:bg-accent disabled:opacity-50",children:n.jsx(gs,{className:"h-3 w-3"})})]})]}),n.jsxs("div",{className:"max-h-56 overflow-y-auto p-2",children:[w&&n.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"})," ",u("common.loading")]}),!w&&N&&n.jsx("p",{className:"px-2 py-1.5 text-[11px] text-muted-foreground",children:u("add_project.browser_unavailable")}),!w&&!N&&g.length===0&&n.jsx("p",{className:"px-2 py-1.5 text-[11px] text-muted-foreground",children:u("add_project.no_folders")}),!w&&!N&&g.map(R=>n.jsxs("button",{type:"button",onClick:()=>j(R),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-accent",children:[n.jsx(Fo,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),n.jsx("span",{className:"truncate",children:R.split("/").pop()}),n.jsx("span",{className:"ml-auto truncate font-mono text-[10px] text-muted-foreground",children:R})]},R))]})]})]})}const Qs=(e,t)=>u(e,t);function rw({on:e,onChange:t,disabled:a,accent:o}){return n.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:a,onClick:()=>t(!e),className:ge("relative inline-flex h-5 w-9 flex-shrink-0 items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50",e?ge("bg-emerald-500/30",o.border):"border-border bg-muted"),children:n.jsx("span",{className:ge("inline-block h-3.5 w-3.5 transform rounded-full bg-foreground transition-transform",e?"translate-x-4":"translate-x-0.5")})})}const ow={rose:{text:"text-rose-400",border:"border-rose-700/50",hover:"hover:bg-rose-900/20",ring:"focus:border-rose-500/50",wrap:"border-rose-500/30 from-rose-500/20 to-pink-500/20"},slate:{text:"text-slate-200",border:"border-slate-600/60",hover:"hover:bg-slate-700/30",ring:"focus:border-slate-400/60",wrap:"border-slate-500/30 from-slate-500/20 to-slate-700/20"},purple:{text:"text-purple-400",border:"border-purple-700/50",hover:"hover:bg-purple-900/20",ring:"focus:border-purple-500/50",wrap:"border-purple-500/30 from-purple-500/20 to-violet-500/20"}};function r9(e,t){return e==="github"?n.jsx(Q2,{className:ge("h-6 w-6",t.text)}):e==="asana"?n.jsx(RL,{className:ge("h-6 w-6",t.text)}):e==="obsidian"?n.jsx(YN,{className:ge("h-6 w-6",t.text)}):n.jsx("span",{className:ge("text-lg",t.text),children:"◆"})}function o9({pid:e,scope:t,entry:a}){const o=a.ui,l=ow[o.accent||"rose"]||ow.rose,[i,d]=x.useState(!1),[f,m]=x.useState({}),[h,g]=x.useState({}),[b,_]=x.useState(null),[k,N]=x.useState("idle"),[y,w]=x.useState(null),[E,j]=x.useState([]),[S,R]=x.useState(""),[A,T]=x.useState(null),[O,M]=x.useState(null),{data:B,mutate:P,isLoading:$}=He(`integration-status-${a.slug}-${e}-${t}`,()=>Gn.status(e,a.slug,t),{shouldRetryOnError:!1}),D=B?.status==="active"&&B.is_enabled===!0,L=k==="saving"||k==="validating",H=!D&&E.length===0,V=o.configFields.filter(K=>K.type==="toggle"),F=o.configFields.filter(K=>K.type!=="toggle").some(K=>!f[K.key]?.trim());async function X(){if(!F){N("saving"),w(null);try{const K={...f};for(const te of V)K[te.key]===void 0&&(K[te.key]=te.default?"true":"false");await Gn.configure(e,a.slug,t,K),N("validating");const se=await Gn.validate(e,a.slug,t);if(await P(),o.select&&!se[o.select.key]){const le=(await Gn.action(e,a.slug,o.select.action,t))[o.select.listKey]||[];le.length>1&&j(le.map(W=>({value:String(W[o.select.valueKey]),label:String(W[o.select.labelKey])})))}N("done"),m({})}catch(K){w(K instanceof Error?K.message:u("integrations.err_connect")),N("idle")}}}async function G(){if(!(!S||!o.select)){N("saving"),w(null);try{await Gn.configure(e,a.slug,t,{[o.select.key]:S}),await Gn.validate(e,a.slug,t),await P(),j([]),N("done")}catch(K){w(K instanceof Error?K.message:u("integrations.err_generic")),N("idle")}}}async function Y(){w(null);try{await Gn.deactivate(e,a.slug,t),await P()}catch(K){w(K instanceof Error?K.message:u("integrations.err_generic"))}}async function I(K,se){w(null),M(null);try{await Gn.configure(e,a.slug,t,{[K]:se?"true":"false"}),await Gn.validate(e,a.slug,t),await P()}catch(te){w(te instanceof Error?te.message:u("integrations.err_generic"))}}async function Q(K){w(null),M(null),T(K);try{const se=await Gn.action(e,a.slug,K,t);typeof se?.count=="number"?M(Qs(`integrations.${a.slug}.actions.${K}_done`,{count:se.count,changed:Number(se.changed??0)})):M(u("integrations.action_done")),await P()}catch(se){w(se instanceof Error?se.message:u("integrations.err_generic"))}finally{T(null)}}const J=$?"…":D?u("integrations.status_active"):B?.status==="error"?u("integrations.status_error"):u("integrations.status_unconfigured");return n.jsx(UE,{icon:n.jsx("div",{className:ge("flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-2xl border bg-gradient-to-br",l.wrap),children:r9(a.slug,l)}),title:a.name,description:a.description,hasTools:(a.tools?.length??0)>0,badges:n.jsxs("span",{className:ge("flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px]",D?"border-emerald-700 bg-emerald-900/20 text-emerald-400":"border-border bg-muted text-muted-foreground"),children:[n.jsx("span",{className:ge("h-1.5 w-1.5 rounded-full",D?"bg-emerald-400":"bg-muted-foreground")}),J]}),expanded:i,onToggle:()=>d(K=>!K),children:n.jsxs("div",{className:"space-y-4 p-4",children:[y&&n.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-700/30 bg-red-900/20 px-3 py-2.5 text-xs text-red-300",children:[n.jsx(DA,{className:"h-3.5 w-3.5 flex-shrink-0"}),n.jsx("span",{className:"flex-1",children:y}),n.jsx("button",{onClick:()=>w(null),children:n.jsx(gs,{className:"h-3.5 w-3.5"})})]}),D&&E.length===0&&n.jsxs("div",{className:"space-y-1 rounded-xl border border-emerald-700/30 bg-emerald-900/10 p-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(mb,{className:"h-3.5 w-3.5 text-emerald-400"}),n.jsx("span",{className:"text-xs font-medium text-emerald-300",children:u("integrations.connected")})]}),(o.connectedFields||[]).map(K=>{const se=B?.[K];return se?n.jsxs("p",{className:"pl-5 text-[10px] text-muted-foreground",children:[Qs(`integrations.${a.slug}.connected.${K}`),": ",String(se)]},K):null})]}),D&&E.length===0&&V.length>0&&n.jsx("div",{className:"space-y-2 rounded-xl border border-border p-3",children:V.map(K=>n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-medium text-foreground",children:Qs(`integrations.${a.slug}.fields.${K.key}.label`)}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:Qs(`integrations.${a.slug}.fields.${K.key}.hint`)})]}),n.jsx(rw,{on:!!B?.[K.key],accent:l,onChange:se=>I(K.key,se)})]},K.key))}),D&&E.length===0&&(o.actions?.length??0)>0&&n.jsxs("div",{className:"space-y-2",children:[O&&n.jsx("p",{className:"text-[11px] text-emerald-400",children:O}),n.jsx("div",{className:"flex flex-wrap gap-2",children:o.actions.map(K=>n.jsxs("button",{onClick:()=>Q(K.action),disabled:A===K.action,className:ge("flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",l.border,l.text,l.hover),children:[A===K.action?n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ss,{className:"h-3.5 w-3.5"}),Qs(`integrations.${a.slug}.actions.${K.action}`)]},K.action))})]}),E.length>1&&o.select&&n.jsxs("div",{className:"space-y-2",children:[n.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[Qs(`integrations.${a.slug}.select_label`),":"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("select",{value:S,onChange:K=>R(K.target.value),className:ge("flex-1 rounded-lg border border-border bg-background px-2 py-1.5 text-xs outline-none",l.ring),children:[n.jsx("option",{value:"",children:u("integrations.select_placeholder")}),E.map(K=>n.jsx("option",{value:K.value,children:K.label},K.value))]}),n.jsx("button",{onClick:G,disabled:!S||L,className:ge("rounded-lg border px-3 py-1.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",l.border,l.text,l.hover),children:L?n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"}):u("integrations.confirm")})]})]}),H&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{className:"text-xs font-semibold text-foreground",children:u("integrations.credentials",{name:a.name})}),o.configFields.map(K=>{if(K.type==="toggle"){const se=f[K.key]!==void 0?f[K.key]==="true":!!K.default;return n.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-medium text-foreground",children:Qs(`integrations.${a.slug}.fields.${K.key}.label`)}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:Qs(`integrations.${a.slug}.fields.${K.key}.hint`)})]}),n.jsx(rw,{on:se,accent:l,onChange:te=>m(le=>({...le,[K.key]:te?"true":"false"}))})]},K.key)}return n.jsxs("div",{className:"space-y-2",children:[K.help_url&&n.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[n.jsxs("button",{type:"button",onClick:()=>_(se=>se===K.key?null:K.key),className:"flex w-full items-center justify-between px-3 py-2 text-left transition-colors hover:bg-muted/40",children:[n.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[Qs(`integrations.${a.slug}.fields.${K.key}.help_label`)," ·"," ",n.jsxs("a",{href:K.help_url,target:"_blank",rel:"noreferrer",onClick:se=>se.stopPropagation(),className:ge("inline-flex items-center gap-0.5 hover:underline",l.text),children:[K.help_url_label," ",n.jsx(hb,{className:"h-2.5 w-2.5"})]})]}),n.jsx(ms,{className:ge("h-3.5 w-3.5 flex-shrink-0 text-muted-foreground transition-transform",b===K.key&&"rotate-180")})]}),b===K.key&&n.jsx("div",{className:"space-y-1.5 border-t border-border px-3 pb-3 pt-2.5",children:Qs(`integrations.${a.slug}.fields.${K.key}.help_steps`).split(`
|
|
794
|
-
`).map((se,te)=>n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsxs("span",{className:ge("mt-0.5 flex-shrink-0 font-mono text-[10px]",l.text),children:[te+1,"."]}),n.jsx("p",{className:"text-[11px] text-muted-foreground",children:se})]},te))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-[10px] text-muted-foreground",children:Qs(`integrations.${a.slug}.fields.${K.key}.label`)}),K.type==="path"?n.jsx(a9,{value:f[K.key]||"",onChange:se=>m(te=>({...te,[K.key]:se})),onEnter:X,placeholder:K.placeholder,ringClassName:l.ring,btnClassName:ge(l.border,l.text,l.hover)}):n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:K.type==="password"&&!h[K.key]?"password":"text",placeholder:K.placeholder,value:f[K.key]||"",onChange:se=>m(te=>({...te,[K.key]:se.target.value})),onKeyDown:se=>se.key==="Enter"&&X(),className:ge("w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs outline-none placeholder:text-muted-foreground/60",K.type==="password"&&"pr-14",l.ring)}),K.type==="password"&&n.jsxs("button",{type:"button",onClick:()=>g(se=>({...se,[K.key]:!se[K.key]})),className:"absolute right-2.5 top-1/2 flex -translate-y-1/2 items-center gap-0.5 text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[h[K.key]?n.jsx(G2,{className:"h-3 w-3"}):n.jsx(nu,{className:"h-3 w-3"}),h[K.key]?u("integrations.hide"):u("integrations.reveal")]})]})]})]},K.key)}),k==="validating"&&n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"})," ",u("integrations.verifying")]}),n.jsx("button",{onClick:X,disabled:F||L,className:ge("flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",l.border,l.text,l.hover),children:L?n.jsxs(n.Fragment,{children:[n.jsx(Js,{className:"h-3.5 w-3.5 animate-spin"}),u(k==="saving"?"integrations.saving":"integrations.validating")]}):u("integrations.connect")})]}),a.tools&&a.tools.length>0&&n.jsx(s9,{pid:e,tools:a.tools,isActive:D}),D&&n.jsx("div",{className:"flex justify-end border-t border-border pt-2",children:n.jsxs("button",{onClick:Y,className:"flex items-center gap-1.5 rounded-lg border border-red-700/50 px-3 py-1.5 text-xs text-red-400 transition-all hover:bg-red-900/20",children:[n.jsx(TM,{className:"h-3.5 w-3.5"})," ",u("integrations.deactivate")]})})]})})}const l9={github:{icon:Q2,className:"text-slate-200",wrap:"border-slate-500/30 from-slate-500/20 to-slate-700/20"},whatsapp:{icon:TL,className:"text-[#25D366]",wrap:"border-[#25D366]/30 from-[#25D366]/20 to-[#128C7E]/20"},"local-transcription":{icon:vb,className:"text-orange-400",wrap:"border-orange-500/30 from-orange-500/20 to-amber-500/20"}};function i9({entry:e}){const[t,a]=x.useState(!1),o=l9[e.slug]||{icon:Zf,className:"text-muted-foreground",wrap:"border-border from-muted to-muted"},l=o.icon;return n.jsx(UE,{icon:n.jsx("div",{className:`flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-2xl border bg-gradient-to-br ${o.wrap}`,children:n.jsx(l,{className:`h-6 w-6 ${o.className}`})}),title:e.name,description:e.description,badges:n.jsx("span",{className:"rounded-full border border-border bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:u("integrations.coming_soon")}),expanded:t,onToggle:()=>a(i=>!i),children:n.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:u("integrations.coming_soon_body")})})}const c9=[{value:"plugins",labelKey:"integrations.tab_plugins",icon:Zf},{value:"tools",labelKey:"integrations.tab_tools",icon:aa}];function u9({pid:e,scope:t,entry:a}){return a.coming_soon||!a.ui?n.jsx(i9,{entry:a}):n.jsx(o9,{pid:e,scope:t,entry:a})}function d9({pid:e,scope:t}){const{data:a,isLoading:o}=He(`integrations-catalog-${e}`,()=>Gn.catalog(e));return n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:u("integrations.plugins_hint")}),o&&n.jsx(rt,{}),(a||[]).map(l=>n.jsx(u9,{pid:e,scope:t,entry:l},l.slug)),n.jsx("div",{className:"rounded-xl border border-dashed border-border p-6 text-center",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:u("integrations.more_soon")})})]})}function f9({pid:e}){const{data:t}=He(`integrations-catalog-${e}`,()=>Gn.catalog(e)),a=(t||[]).filter(o=>!o.coming_soon&&(o.tools?.length??0)>0).flatMap(o=>(o.tools||[]).map(l=>({...l,plugin:o.name,active:o.status.is_enabled})));return n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:u("integrations.tools_hint")}),a.length===0?n.jsx(pt,{children:u("integrations.tools_empty")}):n.jsx("ul",{className:"space-y-2",children:a.map(o=>n.jsxs("li",{className:ge("rounded-md border border-border bg-muted/30 px-3 py-2",!o.active&&"opacity-55"),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(aa,{className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx("span",{className:"font-mono text-xs text-foreground",children:o.slug}),n.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:o.plugin}),n.jsx("span",{className:ge("rounded border px-1.5 py-0.5 text-[10px]",o.active?"border-emerald-700/40 bg-emerald-900/20 text-emerald-400":"border-border bg-muted text-muted-foreground"),children:o.active?u("integrations.tool_active"):u("integrations.tool_inactive")})]}),n.jsx("p",{className:"mt-0.5 pl-5 text-[10px] text-muted-foreground",children:o.desc})]},o.slug))})]})}function p9({pid:e}){const t=String(e)==="0",[a,o]=x.useState("plugins"),[l,i]=x.useState(t?"global":"project");return n.jsxs(Ye,{title:u("integrations.title"),description:u("integrations.description"),children:[!t&&n.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:u("integrations.scope_label")}),["project","global"].map(d=>n.jsx("button",{onClick:()=>i(d),className:ge("rounded-md border px-2.5 py-1 text-xs transition-colors",l===d?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-muted/30 text-muted-foreground hover:bg-muted/50"),children:u(d==="project"?"integrations.scope_project":"integrations.scope_global")},d))]}),n.jsx("div",{className:"mb-4 inline-flex rounded-lg border border-border bg-muted/30 p-0.5",children:c9.map(d=>{const f=d.icon;return n.jsxs("button",{onClick:()=>o(d.value),className:ge("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",a===d.value?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(f,{className:"h-3.5 w-3.5"})," ",u(d.labelKey)]},d.value)})}),a==="plugins"&&n.jsx(d9,{pid:e,scope:l}),a==="tools"&&n.jsx(f9,{pid:e})]})}function m9({pid:e}){const t=Ze(),a=String(e)==="0",[o,l]=x.useState(a?"global":"all"),[i,d]=x.useState(!1),f=He(`/projects/${e}/vars?reveal=${i?1:0}`,()=>Yc.list(e,{reveal:i})),[m,h]=x.useState(null),g=x.useMemo(()=>{if(!f.data)return[];const _=[],k=f.data.project||{},N=f.data.global||{};for(const[y,w]of Object.entries(k))_.push({name:y,scope:"project",masked:w});for(const[y,w]of Object.entries(N))k[y]===void 0&&_.push({name:y,scope:"global",masked:w});return _.filter(y=>o==="all"?!0:y.scope===o).sort((y,w)=>y.name.localeCompare(w.name))},[f.data,o]),b=async(_,k)=>{if(confirm(u("project.vars.delete_confirm",{name:_,scope:k})))try{await Yc.remove(e,_,k),t.success(u("project.vars.removed")),f.mutate()}catch(N){t.error(N?.message||u("common.error_generic"))}};return n.jsxs(Ye,{title:u("project.vars.title"),description:u(a?"project.vars.subtitle_base":"project.vars.subtitle_project"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Bt,{checked:i,onChange:d,label:u("project.vars.reveal_all")}),n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>h({}),children:[n.jsx(Pt,{size:14})," ",u("project.vars.new")]})]}),children:[!a&&n.jsxs("div",{className:"mb-3 flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"text-muted-fg",children:u("project.vars.filter_label")}),n.jsx(Dh,{active:o==="all",onClick:()=>l("all"),children:u("project.vars.filter_all")}),n.jsx(Dh,{active:o==="project",onClick:()=>l("project"),children:u("project.vars.filter_project")}),n.jsx(Dh,{active:o==="global",onClick:()=>l("global"),children:u("project.vars.filter_global")})]}),f.isLoading&&n.jsx(rt,{}),!f.isLoading&&g.length===0&&n.jsx(pt,{children:u("project.vars.empty")}),g.length>0&&n.jsx("ul",{className:"space-y-2 text-sm",children:g.map(_=>n.jsxs("li",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx("span",{className:"font-mono text-xs font-medium",children:_.name}),n.jsx(Ve,{tone:_.scope==="project"?"info":"muted",children:_.scope==="project"?u("project.vars.scope_project"):u("project.vars.scope_global")}),n.jsx("span",{className:"ml-2 font-mono text-xs text-muted-fg",children:_.masked}),n.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>h({name:_.name,scope:_.scope}),"aria-label":u("project.vars.edit_btn"),children:n.jsx(ya,{size:13})}),!(a&&_.scope==="project")&&n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>b(_.name,_.scope),"aria-label":u("project.vars.delete_btn"),children:n.jsx(vn,{size:13})})]})]},`${_.scope}-${_.name}`))}),n.jsx(g9,{open:m!==null,initial:m||void 0,onClose:()=>h(null),pid:e,isBase:a,onSaved:()=>{h(null),f.mutate()}})]})}function Dh({active:e,onClick:t,children:a}){return n.jsx("button",{type:"button",onClick:t,className:e?"rounded-full border border-primary/50 bg-primary/10 px-2 py-0.5 text-xs":"rounded-full border border-border bg-muted/30 px-2 py-0.5 text-xs hover:bg-muted/60",children:a})}function g9({open:e,onClose:t,pid:a,isBase:o,initial:l,onSaved:i}){const d=Ze(),[f,m]=x.useState(!1),[h,g]=x.useState(!1),[b,_]=x.useState(l?.name||""),[k,N]=x.useState(l?.value||""),[y,w]=x.useState(l?.scope||(o?"global":"project")),E=!!l?.name;x.useEffect(()=>{e&&(_(l?.name||""),N(l?.value||""),w(l?.scope||(o?"global":"project")),g(!1))},[e,l?.name,l?.scope,l?.value,o]);const j=async()=>{if(!b.trim()){d.error(u("project.vars.name_required"));return}if(!k){d.error(u("project.vars.value_required"));return}m(!0);try{await Yc.upsert(a,{name:b.trim(),value:k,scope:y}),d.success(u(E?"project.vars.updated":"project.vars.added")),i()}catch(S){d.error(S?.message||u("common.error_generic"))}finally{m(!1)}};return n.jsx(Zt,{open:e,onClose:()=>f?null:t(),title:u(E?"project.vars.edit_title":"project.vars.new_title"),description:u("project.vars.new_desc"),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:f,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:j,loading:f,children:u(E?"project.vars.save_btn":"project.vars.add_btn")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("project.vars.scope_label"),children:n.jsx(ut,{value:y,onChange:S=>w(S),options:[...o?[]:[{value:"project",label:u("project.vars.scope_project"),description:u("project.vars.scope_project_desc")}],{value:"global",label:u("project.vars.scope_global"),description:u("project.vars.scope_global_desc")}]})}),n.jsx(ce,{label:u("project.vars.name_label"),hint:u("project.vars.name_hint"),children:n.jsx(Te,{value:b,onChange:S=>_(S.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),placeholder:"MY_API_KEY",disabled:E,autoFocus:!E})}),n.jsx(ce,{label:u("project.vars.value_label"),hint:u("project.vars.value_hint"),children:n.jsxs("div",{className:"relative",children:[n.jsx(Te,{type:h?"text":"password",value:k,onChange:S=>N(S.target.value),placeholder:E?u("project.vars.value_edit_ph"):"",className:"pr-9 font-mono text-xs",autoFocus:E}),n.jsx("button",{type:"button",onClick:()=>g(S=>!S),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-fg hover:text-fg","aria-label":u(h?"project.vars.hide":"project.vars.reveal"),children:h?n.jsx(G2,{size:14}):n.jsx(nu,{size:14})})]})})]})})}function J_({value:e,onValueChange:t,onSubmit:a,onStop:o,busy:l=!1,disabled:i=!1,placeholder:d,autoFocus:f,minRows:m=2,maxRows:h=8,footer:g,className:b}){const _=x.useRef(null);x.useLayoutEffect(()=>{const N=_.current;if(!N)return;const y=()=>{N.style.height="auto",N.offsetHeight;const E=parseFloat(getComputedStyle(N).lineHeight)||20,j=E*m,S=E*h;N.style.height=`${Math.min(Math.max(N.scrollHeight,j),S)}px`,N.style.overflowY=N.scrollHeight>S?"auto":"hidden"};y();const w=requestAnimationFrame(y);return()=>cancelAnimationFrame(w)},[e,m,h]);const k=e.trim().length>0&&!i;return n.jsxs("div",{className:Ct("flex flex-col gap-1.5 rounded-2xl border border-border bg-muted/60 p-2 shadow-sm transition-colors","focus-within:border-foreground/25 focus-within:bg-muted",i&&"opacity-60",b),children:[n.jsx("textarea",{ref:_,rows:m,value:e,autoFocus:f,disabled:i,placeholder:d,onChange:N=>t(N.target.value),onKeyDown:N=>{if(N.key==="Enter"&&!N.shiftKey){if(N.preventDefault(),l||!k)return;a()}},className:"w-full resize-none bg-transparent px-2 pt-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground"}),n.jsxs("div",{className:"flex items-center justify-between gap-2 pl-1",children:[n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-[11px] text-muted-foreground",children:g}),l&&o?n.jsx(qe,{content:u("chat_ui.stop"),children:n.jsx(lr,{type:"button",size:"icon-sm",variant:"destructive",onClick:o,"aria-label":u("chat_ui.stop"),children:n.jsx(wb,{className:"size-3.5",fill:"currentColor"})})}):n.jsx(qe,{content:u("chat_ui.send"),children:n.jsx(lr,{type:"button",size:"icon-sm",variant:"default",onClick:a,disabled:!k,"aria-label":u("chat_ui.send"),children:n.jsx(CA,{className:"size-4"})})})]})]})}function ev({value:e,onChange:t,disabled:a}){const[o,l]=x.useState(!1),[i,d]=x.useState(""),[f,m]=x.useState([]),[h,g]=x.useState(!1),b=x.useRef(null);x.useEffect(()=>{if(!o)return;const w=E=>{b.current&&!b.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]),x.useEffect(()=>{if(!o||h)return;let w=!1;return(async()=>{try{const{engines:E}=await Kc.list(),j=await Promise.all(E.map(S=>Kc.models({engine:S}).then(R=>(R.models||[]).map(A=>A.includes(":")?A:`${S}:${A}`)).catch(()=>[])));if(!w){const S=Array.from(new Set(j.flat())).sort();m(S),g(!0)}}catch{w||g(!0)}})(),()=>{w=!0}},[o,h]);const _=i.trim().toLowerCase(),k=_?f.filter(w=>w.toLowerCase().includes(_)):f,N=e||u("shared_ui.auto"),y=w=>{t(w),l(!1),d("")};return n.jsxs("div",{ref:b,className:"relative",children:[n.jsx(qe,{content:u("chat_ui.pick_model"),children:n.jsxs("button",{type:"button",disabled:a,onClick:()=>l(w=>!w),"data-testid":"chat-model-picker",className:ge("flex max-w-[200px] items-center gap-1 rounded-md border border-transparent px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors","hover:bg-accent/60 hover:text-foreground",e&&"text-foreground"),"aria-label":u("chat_ui.pick_model"),children:[n.jsx(aS,{className:"size-3 shrink-0"}),n.jsx("span",{className:"truncate font-mono",children:N}),n.jsx(ms,{className:"size-3 shrink-0 opacity-60"})]})}),o&&n.jsxs("div",{className:"absolute bottom-full left-0 z-50 mb-1.5 w-64 rounded-lg border border-border bg-popover p-1.5 shadow-md ring-1 ring-foreground/10",children:[n.jsx("input",{autoFocus:!0,value:i,placeholder:u("shared_ui.model_filter_ph"),onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&i.trim()&&y(i.trim())},className:"mb-1 w-full rounded-md border border-border bg-background px-2 py-1 text-xs outline-none focus:border-foreground/30"}),n.jsxs("ul",{className:"max-h-56 overflow-y-auto",children:[n.jsx("li",{children:n.jsxs("button",{type:"button",onMouseDown:w=>{w.preventDefault(),y("")},className:ge("flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-xs hover:bg-accent hover:text-accent-fg",!e&&"bg-accent/50"),children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(gs,{className:"size-3"})," ",u("shared_ui.auto_router")]}),!e&&n.jsx(Gr,{className:"size-3"})]})}),!h&&n.jsx("li",{className:"px-2 py-1 text-[11px] text-muted-fg",children:u("shared_ui.loading_models")}),h&&k.length===0&&i.trim()&&n.jsx("li",{children:n.jsx("button",{type:"button",onMouseDown:w=>{w.preventDefault(),y(i.trim())},className:"w-full rounded-md px-2 py-1 text-left font-mono text-xs hover:bg-accent hover:text-accent-fg",children:u("shared_ui.use_value",{value:i.trim()})})}),k.map(w=>n.jsx("li",{children:n.jsxs("button",{type:"button",onMouseDown:E=>{E.preventDefault(),y(w)},className:ge("flex w-full items-center justify-between rounded-md px-2 py-1 text-left font-mono text-xs hover:bg-accent hover:text-accent-fg",w===e&&"bg-accent/50"),children:[n.jsx("span",{className:"truncate",children:w}),w===e&&n.jsx(Gr,{className:"size-3 shrink-0"})]})},w))]})]})]})}function h9({onSend:e,onStop:t,streaming:a,model:o,onModelChange:l}){const[i,d]=x.useState(""),f=()=>{const m=i.trim();m&&(d(""),e(m))};return n.jsx("div",{className:"border-t border-border bg-card/60 p-3",children:n.jsx(J_,{value:i,onValueChange:d,onSubmit:f,onStop:t,busy:a,placeholder:u("project.chat.placeholder"),maxRows:12,footer:l?n.jsx(ev,{value:o||"",onChange:l,disabled:a}):void 0})})}function x9(){return{read_file:{icon:Xf,label:u("shared_ui.tool_read_file")},write_file:{icon:KA,label:u("shared_ui.tool_write_file")},edit_file:{icon:gf,label:u("shared_ui.tool_edit_file")},list_files:{icon:bb,label:u("shared_ui.tool_list_files")},search_files:{icon:Fl,label:u("shared_ui.tool_search_files")},search_messages:{icon:Fl,label:u("shared_ui.tool_search_messages")},tail_messages:{icon:Fl,label:u("shared_ui.tool_tail_messages")},run_shell:{icon:_a,label:u("shared_ui.tool_run_shell")},send_telegram:{icon:ja,label:u("shared_ui.tool_send_telegram")},call_agent:{icon:rn,label:u("shared_ui.tool_call_agent")},call_mcp:{icon:bM,label:u("shared_ui.tool_call_mcp")},call_runtime:{icon:rn,label:u("shared_ui.tool_call_runtime")},create_task:{icon:iM,label:u("shared_ui.tool_create_task")}}}const HE=new Set(["write_file","edit_file"]);function b9(e){return x9()[e]||{icon:aa,label:e}}function _9(e,t){if(!t)return"";const a=l=>typeof t[l]=="string"?t[l]:void 0,o=a("path")||a("file")||a("pattern")||a("query")||a("command")||a("slug")||a("name")||a("agent");return o?String(o):""}function lw(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function v9({status:e}){return e==="running"?n.jsx(Js,{className:"size-3 shrink-0 animate-spin text-sky-400"}):e==="error"?n.jsx(gs,{className:"size-3 shrink-0 text-rose-400"}):e==="deduped"?n.jsx(VA,{className:"size-3 shrink-0 text-amber-400"}):n.jsx(Gr,{className:"size-3 shrink-0 text-emerald-400"})}function y9({part:e}){const[t,a]=x.useState(!1),{icon:o,label:l}=b9(e.tool),i=_9(e.tool,e.args),d=HE.has(e.tool),f=!!e.args||e.result!==void 0;return n.jsxs("div",{className:ge("rounded-lg border bg-muted/30 text-[12px]",e.status==="error"?"border-rose-500/30":"border-border"),children:[n.jsxs("button",{type:"button",onClick:()=>f&&a(m=>!m),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left",children:[f?n.jsx(Qr,{className:ge("size-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-90")}):n.jsx("span",{className:"size-3 shrink-0"}),n.jsx(o,{className:ge("size-3.5 shrink-0",d?"text-violet-400":"text-muted-foreground")}),n.jsx("span",{className:"shrink-0 font-medium",children:l}),i&&n.jsx("span",{className:"truncate font-mono text-muted-foreground",children:i}),n.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.status==="deduped"&&n.jsx("span",{className:"text-[10px] text-amber-400",children:u("shared_ui.dedup")}),n.jsx(v9,{status:e.status})]})]}),t&&f&&n.jsxs("div",{className:"space-y-2 border-t border-border/60 px-2.5 py-2",children:[e.args&&Object.keys(e.args).length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:u("shared_ui.args")}),n.jsx("pre",{className:"max-h-48 overflow-auto rounded-md bg-background/60 p-2 font-mono text-[11px] leading-relaxed text-foreground",children:lw(e.args)})]}),e.result!==void 0&&n.jsxs("div",{children:[n.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:u("shared_ui.result")}),n.jsx("pre",{className:ge("max-h-64 overflow-auto rounded-md bg-background/60 p-2 font-mono text-[11px] leading-relaxed",e.status==="error"?"text-rose-300":"text-foreground"),children:lw(e.result)})]})]})]})}function j9(e){const t=e.args;return(t&&Array.isArray(t.questions)?t.questions:[]).map(o=>typeof o=="string"?o:o&&typeof o=="object"&&typeof o.question=="string"?o.question:null).filter(o=>!!o)}function k9({part:e,pending:t}){const a=j9(e),o=u(t?"ask_panel.status_waiting":"ask_panel.status_received");return n.jsxs("div",{className:ge("rounded-2xl border px-3 py-2 text-sm shadow-sm",t?"rounded-bl-sm border-amber-500/30 bg-amber-500/5 text-foreground":"rounded-bl-sm border-emerald-500/30 bg-emerald-500/5 text-foreground"),"data-testid":"ask-questions-card","data-state":t?"pending":"answered",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[t?n.jsx(Js,{className:"size-3.5 shrink-0 animate-spin text-amber-600 dark:text-amber-400"}):n.jsx(mb,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),n.jsx(nS,{className:"size-3.5 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"text-[12px] font-medium",children:o}),a.length>1&&n.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:[a.length," preguntas"]})]}),a.length>0&&n.jsx("ul",{className:"mt-1.5 space-y-0.5 pl-5 text-[12px] text-muted-foreground",children:a.map((l,i)=>n.jsx("li",{className:"list-disc",children:l},i))})]})}function qE(e){const t=e.split(`
|
|
795
|
-
`),a=[];let o=null;for(const l of t)if(l.startsWith("- "))o&&a.push(o),o={question:l.slice(2),answer:"",skipped:!1};else if(l.startsWith(" → ")&&o){const i=l.slice(4);o.answer=i,o.skipped=i==="(omitido)"}else return null;return o&&a.push(o),a.length>0?a:null}function w9({text:e}){const t=qE(e);return t?n.jsx("div",{className:"flex w-full justify-center",children:n.jsxs("div",{className:"w-full max-w-[85%] rounded-2xl border border-border/70 bg-card/40 px-4 py-3 shadow-sm","data-testid":"ask-answers-card",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(nS,{className:"size-3.5"}),n.jsx("span",{children:u("ask_panel.answers_header")})]}),n.jsx("ul",{className:"space-y-2.5",children:t.map((a,o)=>n.jsxs("li",{className:"space-y-0.5",children:[n.jsx("div",{className:"text-sm font-medium leading-snug text-foreground",children:a.question}),n.jsx("div",{className:ge("whitespace-pre-wrap text-[13px] leading-snug",a.skipped?"italic text-muted-foreground/70":"text-muted-foreground"),children:a.answer})]},o))})]})}):null}function Wx(e){return e.parts.filter(t=>t.kind==="text").map(t=>t.text).join(`
|
|
796
|
-
|
|
797
|
-
`).trim()}function S9(e){const t=e.args?.questions;if(!Array.isArray(t)||t.length===0)return null;const a=t.map(o=>{if(typeof o=="string")return`- ${o}`;if(!o||typeof o!="object")return null;const l=o;if(typeof l.question!="string")return null;const d=(Array.isArray(l.options)?l.options:[]).map(f=>typeof f=="string"?f:f&&typeof f=="object"&&typeof f.label=="string"?f.label:"").filter(f=>f).join(", ");return d?`- ${l.question} (opciones: ${d})`:`- ${l.question}`}).filter(o=>!!o);return a.length===0?null:`[ask_questions]
|
|
798
|
-
${a.join(`
|
|
799
|
-
`)}`}function C9(e){const t=[];for(const a of e.parts)if(a.kind==="text"&&a.text)t.push(a.text);else if(a.kind==="tool"&&a.tool==="ask_questions"){const o=S9(a);o&&t.push(o)}return t.join(`
|
|
800
|
-
|
|
801
|
-
`).trim()}const VE=e=>[{kind:"text",text:e}];function FE(e){if(!e||typeof e!="object")return!1;const t=e;return"error"in t&&!!t.error}function N9(e){const t=[];let a=null,o,l=0;for(const i of e){const d=i.ts||new Date().toISOString();if(i.role==="user")a=null,o=void 0,t.push({role:"user",parts:VE(i.content),ts:d});else if(i.role==="assistant"||i.role==="tool"){const f=i.role==="assistant"?i.agent:o;(!a||i.role==="assistant"&&f!==o)&&(a={role:"assistant",parts:[],ts:d},o=f,t.push(a)),i.role==="tool"?a.parts.push({kind:"tool",id:`hist-${l++}`,tool:i.tool||"tool",args:i.args,result:i.result,status:FE(i.result)?"error":"done"}):(i.agent&&(a.agentId=i.agent),i.agent_name&&(a.agent=i.agent_name),i.model&&(a.model=i.model),i.usage&&(a.usage={input_tokens:(a.usage?.input_tokens||0)+(i.usage.input_tokens||0),output_tokens:(a.usage?.output_tokens||0)+(i.usage.output_tokens||0)}),i.content&&a.parts.push({kind:"text",text:i.content}))}}return t}function tv(e,t){const a=o=>({...e,notes:[...e.notes||[],o]});switch(t.type){case"model_start":return t.model?{...e,model:t.model}:e;case"model_routed":{const o=t.model?{...e,model:t.model}:e;return t.from_fallback?{...o,notes:[...o.notes||[],`routing fell back → ${t.model}`]}:o}case"engine_failed":return a(`engine ${t.model||"?"} failed → ${t.retry_with||"retry"}`);case"model_retry":return a(`retry (${t.reason||"?"})`);case"tools_suppressed":return a(`tools suppressed: ${(t.tools||[]).join(", ")}`);case"skill_inspector":{const o=t.inspector;return!o||!o.loaded?.length&&!o.hinted?.length?e:{...e,inspector:{embedder:o.embedder,loaded:o.loaded||[],hinted:o.hinted||[]}}}case"assistant_text":return t.text?{...e,parts:[...e.parts,{kind:"text",text:t.text}]}:e;case"tool_start":return t.trace?{...e,parts:[...e.parts,{kind:"tool",id:t.trace.id,tool:t.trace.tool,args:t.trace.args,status:"running"}]}:e;case"tool_deduped":return t.trace?{...e,parts:e.parts.map(o=>o.kind==="tool"&&o.id===t.trace.id?{...o,status:"deduped"}:o)}:e;case"tool_result":if(!t.trace)return e;{const o=FE(t.trace.result);return{...e,parts:e.parts.map(l=>l.kind==="tool"&&l.id===t.trace.id?{...l,result:t.trace.result,status:o?"error":l.status==="deduped"?"deduped":"done"}:l)}}case"final":return{...e,pending:!1,usage:t.result?.usage??e.usage,model:e.model??t.result?.model,agent:e.agent??t.result?.name,parts:t.result?.text&&!e.parts.some(o=>o.kind==="text")?[...e.parts,{kind:"text",text:t.result.text}]:e.parts};default:{const o=t.delta||t.content||"";if(!o)return e;const l=[...e.parts],i=l[l.length-1];return i&&i.kind==="text"?l[l.length-1]={...i,text:i.text+o}:l.push({kind:"text",text:o}),{...e,parts:l}}}}function E9(e,t){const[a,o]=x.useState([]),[l,i]=x.useState(!1),[d,f]=x.useState(void 0),m=x.useRef(null),h=x.useRef(void 0),g=x.useRef(0),b=x.useCallback(j=>{o(S=>{const R=[...S],A=R[R.length-1];return A&&A.role==="assistant"&&(R[R.length-1]=j(A)),R})},[]),_=x.useCallback(j=>{if(j.type==="error"){t?.(j.error||u("shared_ui.err_stream"));return}b(S=>tv(S,j))},[b,t]),k=x.useCallback(async(j,S={})=>{const R=j.trim();if(!R||l)return;const A=()=>new Date().toISOString(),T=a.map(M=>({role:M.role,content:C9(M)}));if(o(M=>[...M,{role:"user",parts:VE(R),ts:A()},{role:"assistant",parts:[],ts:A(),pending:!0}]),i(!0),S.agentSlug){try{const M=await an.chat(e,S.agentSlug,{prompt:R,conversation_id:h.current,model:S.model||void 0,channel:"web"});h.current=M.conversation_id,f(M.conversation_id),b(B=>({...B,pending:!1,model:M.engine,agent:S.agentSlug,agentId:S.agentSlug,usage:M.usage,parts:[{kind:"text",text:M.text}]}))}catch(M){t?.(M?.message||u("shared_ui.err_chat_failed")),o(B=>B.filter((P,$)=>$!==B.length-1))}finally{i(!1)}return}const O=new AbortController;m.current=O;try{await yN.stream(e,{prompt:R,previousMessages:T,model:S.model||void 0,channel:"web"},_,O.signal),b(M=>({...M,pending:!1}))}catch(M){O.signal.aborted?b(B=>({...B,pending:!1,parts:[...B.parts,{kind:"text",text:u("code_module.stopped")}]})):(t?.(M?.message||u("shared_ui.err_stream_failed")),o(B=>B.filter((P,$)=>$!==B.length-1)))}finally{i(!1),m.current=null}},[e,a,l,_,b,t]),N=x.useCallback(()=>m.current?.abort(),[]),y=x.useCallback(()=>{l||(g.current++,h.current=void 0,f(void 0),o([]))},[l]),w=x.useCallback(async(j,S)=>{if(l)return;const R=++g.current;o([]);try{const A=await Xr.get(e,j,S);if(R!==g.current)return;const T=(A.messages??[]).filter(O=>O.role==="user"||O.role==="assistant").map(O=>({role:O.role,parts:[{kind:"text",text:O.content}],ts:O.ts||new Date().toISOString()}));h.current=S,f(S),o(T)}catch(A){if(R!==g.current)return;h.current=void 0,f(void 0),o([]),t?.(A?.message||u("shared_ui.err_load_conversation"))}},[e,l,t]),E=x.useCallback(async(j,S)=>{if(l)return;const R=++g.current;o([]);try{const A=await Xr.thread(e,j,S);if(R!==g.current)return;const T=N9(A.messages??[]);h.current=void 0,f(void 0),o(T)}catch(A){if(R!==g.current)return;h.current=void 0,f(void 0),o([]),t?.(A?.message||u("shared_ui.err_load_conversation"))}},[e,l,t]);return{msgs:a,send:k,stop:N,clear:y,load:w,loadThread:E,streaming:l,conversationId:d}}function R9({msg:e,isLast:t,isAskAnswer:a,onCopy:o}){const l=e.role==="user",i=Wx(e),d=e.parts.some(f=>f.kind==="tool");if(l&&a){const f=Wx(e);if(qE(f))return n.jsx(w9,{text:f})}return n.jsxs("div",{className:ge("group flex items-start gap-2",l?"justify-end":"justify-start"),children:[!l&&n.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground",children:n.jsx(rn,{size:14})}),n.jsxs("div",{className:ge("flex min-w-0 flex-col gap-1.5",l?"items-end":"w-full max-w-[85%]"),children:[!l&&e.notes&&e.notes.length>0&&n.jsx("div",{className:"flex flex-col gap-0.5",children:e.notes.map((f,m)=>n.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-400/80",children:[n.jsx(J2,{size:10})," ",f]},m))}),!l&&e.inspector&&(e.inspector.loaded?.length||e.inspector.hinted?.length)?n.jsx(qe,{content:u("shared_ui.skill_inspector_title",{embedder:e.inspector.embedder||"RAG"}),children:n.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-[10px] text-sky-400/90",children:[n.jsx(sa,{size:10}),e.inspector.loaded?.map(f=>n.jsx("span",{className:"rounded bg-sky-500/15 px-1 py-0.5 font-mono",children:f},`l-${f}`)),e.inspector.hinted?.map(f=>n.jsxs("span",{className:"rounded border border-sky-500/30 px-1 py-0.5 font-mono opacity-70",children:[f,"?"]},`h-${f}`))]})}):null,e.parts.map((f,m)=>f.kind==="tool"?f.tool==="ask_questions"&&!l?n.jsx(k9,{part:f,pending:!!t},`${f.id}-${m}`):n.jsx(y9,{part:f},`${f.id}-${m}`):f.text?n.jsx("div",{className:ge("whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed shadow-sm",l?"rounded-br-sm border border-emerald-500/30 bg-emerald-500/10 text-foreground dark:bg-emerald-500/15":"w-full rounded-bl-sm border border-border bg-card text-foreground"),children:f.text},m):null),!l&&e.pending&&e.parts.length===0&&n.jsx("div",{className:"rounded-2xl rounded-bl-sm border border-border bg-card px-3 py-2 text-sm text-muted-foreground",children:"…"}),!l&&(e.agent||e.model)&&n.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-[10px]",children:[e.agent&&n.jsx("span",{className:"rounded bg-emerald-500/15 px-1 py-0.5 font-medium text-emerald-300",children:e.agent}),e.model&&n.jsx("span",{className:"rounded border border-border px-1 py-0.5 font-mono text-muted-foreground",children:e.model})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",children:[n.jsx("span",{children:T9(e.ts)}),!l&&e.usage&&(e.usage.input_tokens||e.usage.output_tokens)?n.jsxs("span",{className:"font-mono",children:["· ",(e.usage.input_tokens||0)+(e.usage.output_tokens||0)," tok"]}):null,!l&&d&&n.jsxs("span",{children:["· ",u("shared_ui.tools_count",{n:e.parts.filter(f=>f.kind==="tool").length})]}),o&&i&&n.jsx(qe,{content:u("chat_ui.copy"),children:n.jsxs("button",{type:"button",onClick:()=>o(i),className:"inline-flex items-center gap-1 hover:text-foreground","aria-label":u("chat_ui.copy"),children:[n.jsx(Ao,{size:10})," ",u("chat_ui.copy")]})})]})]}),l&&n.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground",children:n.jsx(Sb,{size:14})})]})}function T9(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function nv({msgs:e,onCopy:t}){const a=x.useRef(null);if(x.useEffect(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"end"})},[e]),e.length===0)return n.jsx("div",{className:"grid h-full place-items-center p-6",children:n.jsx(pt,{children:u("project.chat.empty")})});const o=e.length-1;return n.jsxs("div",{className:"space-y-4 px-3 py-4",children:[e.map((l,i)=>n.jsx(R9,{msg:l,isLast:i===o,isAskAnswer:A9(e,i),onCopy:t},i)),n.jsx("div",{ref:a})]})}function A9(e,t){const a=e[t];if(!a||a.role!=="user")return!1;const o=e[t-1];if(!o||o.role!=="assistant")return!1;for(let l=o.parts.length-1;l>=0;l--){const i=o.parts[l];if(i.kind==="tool")return i.tool==="ask_questions"}return!1}function M9(e){if(!e)return;const t=e.path??e.file??e.filename;return typeof t=="string"?t:void 0}function GE({msgs:e}){const[t,a]=x.useState(!1),{inTok:o,outTok:l,toolCount:i,changed:d,actors:f}=x.useMemo(()=>{let g=0,b=0,_=0;const k=new Set,N=[],y=new Map;for(const w of e){if(w.role!=="assistant")continue;const E=w.usage?.input_tokens||0,j=w.usage?.output_tokens||0;if(g+=E,b+=j,w.agent||w.model){const S=`${w.agent||""}::${w.model||""}`,R=y.get(S);R?(R.inTok+=E,R.outTok+=j,R.turns+=1):y.set(S,{key:S,agent:w.agent,model:w.model,inTok:E,outTok:j,turns:1})}for(const S of w.parts)if(S.kind==="tool"&&(_+=1,HE.has(S.tool)&&S.status!=="error")){const R=M9(S.args);R&&!k.has(R)&&(k.add(R),N.push({path:R,tool:S.tool}))}}return{inTok:g,outTok:b,toolCount:_,changed:N,actors:[...y.values()]}},[e]),m=o+l,h=d.length>0||f.length>1;return m===0&&i===0&&f.length===0?null:n.jsxs("div",{className:"shrink-0 border-t border-border bg-card/40 text-[11px]",children:[n.jsxs("button",{type:"button",onClick:()=>h&&a(g=>!g),className:ge("flex w-full items-center gap-3 px-4 py-1.5 text-muted-foreground",h&&"hover:text-foreground"),children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Qf,{size:12})," ",Il(m)," tok",n.jsxs("span",{className:"text-muted-foreground/60",children:["(",Il(o),"↑ / ",Il(l),"↓)"]})]}),i>0&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(aa,{size:12})," ",i," tools"]}),d.length>0&&n.jsxs("span",{className:"flex items-center gap-1 text-violet-400",children:[n.jsx(gf,{size:12})," ",d.length," ",u("chat_ui.ctx_files")]}),f.length===1&&n.jsx("span",{className:"ml-auto truncate font-mono text-muted-foreground/70",children:[f[0].agent,f[0].model].filter(Boolean).join(" · ")}),f.length>1&&n.jsxs("span",{className:"ml-auto flex items-center gap-1 text-sky-400",children:[n.jsx(rn,{size:12})," ",u("chat_ui.ctx_actors",{n:f.length})]}),h&&n.jsx(ms,{className:ge("size-3 shrink-0 transition-transform",t&&"rotate-180")})]}),t&&n.jsxs("div",{className:"max-h-52 space-y-2 overflow-y-auto border-t border-border/60 px-4 py-2",children:[f.length>1&&n.jsx("ul",{className:"space-y-0.5",children:f.map(g=>n.jsxs("li",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx(rn,{size:11,className:"shrink-0 text-sky-400"}),n.jsx("span",{className:"shrink-0 font-medium text-emerald-300",children:g.agent||"—"}),n.jsx("span",{className:"truncate font-mono text-muted-foreground/70",children:g.model||"—"}),n.jsxs("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground/60",children:[Il(g.inTok+g.outTok)," tok (",Il(g.inTok),"↑ / ",Il(g.outTok),"↓) ·"," ",u("chat_ui.ctx_turns",{n:g.turns})]})]},g.key))}),d.length>0&&n.jsx("ul",{className:"space-y-0.5",children:d.map(g=>n.jsxs("li",{className:"flex items-center gap-2 font-mono text-[11px]",children:[n.jsx(gf,{size:11,className:"shrink-0 text-violet-400"}),n.jsx("span",{className:"truncate",children:g.path}),n.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground/60",children:g.tool==="write_file"?"write":"edit"})]},g.path))})]})]})}function Il(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ul(){return{picked:new Set,text:"",skipped:!1}}function iw(e,t){const a=[];return e.forEach((o,l)=>{const i=t[l]||Ul();if(i.skipped){a.push(`- ${o.question}
|
|
802
|
-
→ (omitido)`);return}const d=[];if(o.options&&o.options.length>0){const h=[...i.picked].sort((g,b)=>g-b).map(g=>o.options[g]?.label).filter(Boolean);h.length>0&&d.push(h.join(", "))}const f=i.text.trim();f&&d.push(o.options&&o.options.length>0?`(Otro: ${f})`:f);const m=d.length>0?d.join(" "):"(sin respuesta)";a.push(`- ${o.question}
|
|
803
|
-
→ ${m}`)}),a.join(`
|
|
804
|
-
`)}function YE({turnKey:e,questions:t,onSubmit:a,onDismiss:o,disabled:l}){const i=t.length,[d,f]=x.useState(0),[m,h]=x.useState(()=>t.map(()=>Ul()));x.useEffect(()=>{f(0),h(t.map(()=>Ul()))},[e,t]);const g=t[d],b=m[d]||Ul(),_=!!g?.options&&g.options.length>0,k=!!g?.multiSelect,N=g?.allowText!==!1,y=T=>{h(O=>{const M=[...O],B=M[d]||Ul();return M[d]={...B,...T,skipped:!1},M})},w=T=>{h(O=>{const M=[...O],B=M[d]||Ul(),P=new Set(B.picked);return k?P.has(T)?P.delete(T):P.add(T):(P.clear(),P.add(T)),M[d]={...B,picked:P,skipped:!1},M})},E=x.useMemo(()=>!0,[]),j=d===i-1,S=()=>f(T=>Math.max(0,T-1)),R=()=>{if(j){a(iw(t,m));return}f(T=>Math.min(i-1,T+1))},A=()=>{if(h(T=>{const O=[...T];return O[d]={picked:new Set,text:"",skipped:!0},O}),j){const T=m.map((O,M)=>M===d?{picked:new Set,text:"",skipped:!0}:O);a(iw(t,T))}else f(T=>Math.min(i-1,T+1))};return x.useEffect(()=>{const T=O=>{if(l)return;const M=O.target?.tagName?.toLowerCase(),B=M==="input"||M==="textarea";if(O.key==="Enter"&&(O.metaKey||O.ctrlKey)){O.preventDefault(),R();return}if(!B&&_&&/^[1-9]$/.test(O.key)){const P=parseInt(O.key,10)-1;P<(g?.options?.length||0)&&(O.preventDefault(),w(P))}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)}),!g||i===0?null:n.jsxs("div",{className:ge("mx-3 mb-2 rounded-xl border border-border bg-card/95 shadow-xl backdrop-blur supports-[backdrop-filter]:bg-card/80",l&&"pointer-events-none opacity-60"),"data-testid":"inline-ask-panel",children:[n.jsxs("header",{className:"flex items-start gap-2 border-b border-border px-3 py-2",children:[n.jsxs("span",{className:"mt-0.5 shrink-0 rounded-md bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-mono font-medium text-amber-700 dark:text-amber-300",children:[d+1,"/",i]}),g.header&&n.jsx("span",{className:"mt-0.5 shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:g.header}),n.jsx("p",{className:"min-w-0 flex-1 text-sm font-semibold leading-snug",children:g.question}),o&&n.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":u("common.close"),children:n.jsx(gs,{className:"size-3.5"})})]}),n.jsxs("div",{className:"space-y-1 px-2 py-2",children:[_&&g.options.map((T,O)=>{const M=b.picked.has(O);return n.jsxs("button",{type:"button",onClick:()=>w(O),className:ge("flex w-full items-start gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition",M?"border-emerald-500/40 bg-emerald-500/10":"hover:border-border hover:bg-accent/40"),children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-xs font-medium",children:T.label}),T.description&&n.jsx("div",{className:"text-[11px] text-muted-foreground",children:T.description})]}),k?n.jsx("span",{className:ge("mt-0.5 grid size-4 shrink-0 place-items-center rounded border",M?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-background"),children:M&&n.jsx("span",{className:"text-[10px] leading-none",children:"✓"})}):n.jsx("span",{className:ge("mt-0.5 grid size-4 shrink-0 place-items-center rounded border font-mono text-[10px]",M?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-muted text-muted-foreground"),children:O+1})]},`${O}:${T.label}`)}),(N||!_)&&n.jsxs("div",{className:"rounded-md border border-transparent px-2 py-1.5 hover:border-border",children:[_&&n.jsx("div",{className:"mb-1 text-xs font-medium",children:u("ask_panel.other")}),n.jsx("input",{type:"text",value:b.text,onChange:T=>y({text:T.target.value}),placeholder:u(_?"ask_panel.other_placeholder":"ask_panel.text_placeholder"),className:"w-full rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:border-emerald-500"})]})]}),n.jsxs("footer",{className:"flex items-center justify-between gap-2 border-t border-border px-3 py-2",children:[n.jsx("button",{type:"button",onClick:S,disabled:d===0,className:"rounded px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent disabled:opacity-30",children:u("ask_panel.back")}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:A,className:"rounded px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",children:u("ask_panel.skip")}),n.jsxs("button",{type:"button",onClick:R,disabled:!E,className:"inline-flex items-center gap-1 rounded bg-emerald-500/15 px-2 py-1 text-[11px] font-medium text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-300",children:[u(j?"ask_panel.submit":"ask_panel.next"),n.jsx(qA,{className:"size-3 opacity-60"})]})]})]})]})}function O9(e){if(typeof e=="string")return{question:e,options:[],multiSelect:!1,allowText:!0};if(!e||typeof e!="object")return null;const t=e,a=typeof t.question=="string"?t.question:"";if(!a)return null;const l=(Array.isArray(t.options)?t.options:[]).map(i=>{if(typeof i=="string")return{label:i};if(i&&typeof i=="object"&&typeof i.label=="string"){const d=i;return{label:d.label,description:typeof d.description=="string"?d.description:void 0}}return null}).filter(i=>i!==null);return{question:a,header:typeof t.header=="string"?t.header:void 0,options:l,multiSelect:t.multiSelect===!0,allowText:t.allowText!==!1}}function KE(e){if(!e.length)return null;const t=e[e.length-1];if(t.role!=="assistant")return null;let a=null,o=-1;for(let h=t.parts.length-1;h>=0;h--){const g=t.parts[h];if(g.kind==="tool"&&g.tool==="ask_questions"){a=g,o=h;break}}if(!a||o<0)return null;let l=null;if(typeof a.result=="string")try{l=JSON.parse(a.result)}catch{l=null}else a.result&&typeof a.result=="object"&&(l=a.result);const i=[];Array.isArray(a.args?.questions)&&i.push(a.args.questions),l&&Array.isArray(l.questions)&&i.push(l.questions);let d=[];for(const h of i)if(d=h.map(O9).filter(g=>!!g),d.length>0)break;return d.length?{turnKey:`${t.ts||""}#${o}`,questions:d}:null}const Zx={web:{label:"Web",icon:_b,order:0},telegram:{label:"Telegram",icon:ja,order:1},desktop:{label:"Desktop",icon:yb,order:2},voice:{label:"Voice",icon:vb,order:3},a2a:{label:"Agent ↔ Agent",icon:rn,order:4},schedule:{label:"Schedule",icon:NM,order:5},other:{label:"Other",icon:Fo,order:6}};function cw(e){if(!e)return"web";const t=e.toLowerCase();return t==="telegram"?"telegram":t==="voice"||t==="overlay"?"voice":t==="desktop"?"desktop":t==="web"||t==="sidebar"||t==="web-sidebar"?"web":t==="a2a"||t.startsWith("agent")?"a2a":t==="schedule"||t==="cron"||t==="routine"?"schedule":"other"}function z9({pid:e,slug:t,onLoaded:a}){const{data:o}=He(`/projects/${e}/agents/${t}/conversations`,()=>Xr.list(e,t),{revalidateOnFocus:!1});return x.useEffect(()=>{a(t,o)},[t,o]),null}function D9({pid:e,agents:t,superAgentSlug:a,superAgentLabel:o,selected:l,onSelect:i,onNewChat:d}){const[f,m]=x.useState(""),[h,g]=x.useState(""),[b,_]=x.useState({}),[k,N]=x.useState({}),[y,w]=x.useState(!1),E=String(e)==="0",j=He(E?`/projects/${e}/super-agent/threads`:null,()=>Xr.threads(e),{revalidateOnFocus:!1}),S=(D,L)=>{L&&N(H=>{const V=H[D];return V&&V.length===L.length&&V===L?H:{...H,[D]:L}})},R=x.useMemo(()=>{const D=[];for(const L of t)for(const H of k[L.slug]||[])D.push({...H,agent_slug:H.agent_slug||L.slug});return D},[t,k]),A=x.useMemo(()=>{const D=f.trim().toLowerCase();return R.filter(L=>!(h&&L.agent_slug!==h||D&&!`${L.title||""} ${L.id} ${L.agent_slug}`.toLowerCase().includes(D)))},[R,f,h]),T=x.useMemo(()=>{if(h&&h!==a)return[];const D=f.trim().toLowerCase();return(j.data||[]).filter(L=>D?`${L.title} ${L.id} ${L.channel}`.toLowerCase().includes(D):!0)},[j.data,f,h,a]),O=x.useMemo(()=>{const D=new Map,L=(H,V)=>{const U=D.get(H);U?U.push(V):D.set(H,[V])};for(const H of A)L(cw(H.channel),{type:"conv",conv:H,sortTs:H.started_at||""});for(const H of T)L(cw(H.channel),{type:"thread",thread:H,sortTs:H.last_ts||H.started_at||""});return Array.from(D.entries()).map(([H,V])=>({key:H,items:V.sort((U,F)=>new Date(F.sortTs||0).getTime()-new Date(U.sortTs||0).getTime())})).sort((H,V)=>Zx[H.key].order-Zx[V.key].order)},[A,T]),M=x.useMemo(()=>[{slug:a,label:o},...t.map(D=>({slug:D.slug,label:D.slug}))],[t,a,o]),B=x.useMemo(()=>[{value:"",label:u("project.chat.list.all_agents")},{value:a,label:o},...t.map(D=>({value:D.slug,label:D.slug}))],[t,a,o]),P=R.length+(j.data?.length||0),$=Object.keys(k).length>0||t.length===0||!!j.data;return n.jsxs("aside",{className:"flex h-full w-72 shrink-0 flex-col border-r border-border bg-card/30",children:[t.map(D=>n.jsx(z9,{pid:e,slug:D.slug,onLoaded:S},D.slug)),n.jsxs("header",{className:"flex h-[57px] shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"truncate text-sm font-semibold",children:u("project.chat.list.title")}),n.jsx("p",{className:"text-[10px] text-muted-fg",children:u("project.chat.list.count",{n:P})})]}),n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>w(D=>!D),className:"inline-flex items-center gap-1 rounded-md border border-border bg-accent/60 px-2 py-1 text-[11px] font-medium hover:bg-accent",children:[n.jsx(Pt,{className:"size-3"})," ",u("project.chat.list.new")]}),y&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button","aria-hidden":!0,tabIndex:-1,className:"fixed inset-0 z-10 cursor-default",onClick:()=>w(!1)}),n.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1 w-56 rounded-md border border-border bg-card p-1 shadow-lg",children:[n.jsx("p",{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-fg",children:u("project.chat.list.pick_agent")}),n.jsx("div",{className:"max-h-64 overflow-y-auto",children:M.map(D=>n.jsxs("button",{type:"button",onClick:()=>{w(!1),d(D.slug)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-accent/50",children:[n.jsx(rn,{className:"size-3 shrink-0 text-muted-fg"}),n.jsx("span",{className:"truncate",children:D.label})]},`new-${D.slug}`))})]})]})]})]}),n.jsxs("div",{className:"space-y-2 border-b border-border p-2",children:[n.jsx(Te,{value:f,onChange:D=>m(D.target.value),placeholder:u("project.chat.list.search")}),n.jsx(ut,{value:h,onChange:g,options:B})]}),n.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto p-2",children:[!$&&n.jsx("div",{className:"px-2 py-1",children:n.jsx(rt,{})}),O.map(D=>n.jsx(P9,{keyName:D.key,count:D.items.length,collapsed:!!b[D.key],onToggle:()=>_(L=>({...L,[D.key]:!L[D.key]})),children:D.items.map(L=>{if(L.type==="thread"){const U=L.thread,F=l.kind==="thread"&&l.channel===U.channel&&l.threadId===U.id;return n.jsx(uw,{title:U.title,subtitle:[U.channel,`${U.messages} msg`].join(" · "),badge:"super",timeAgo:U.last_ts,selected:F,onClick:()=>i({kind:"thread",channel:U.channel,threadId:U.id},{channel:U.channel,createdAt:U.started_at,title:U.title})},`thread-${U.channel}-${U.id}`)}const H=L.conv,V=l.kind==="conv"&&l.agentSlug===H.agent_slug&&l.convId===H.id;return n.jsx(uw,{title:H.title||H.id,subtitle:[H.agent_slug,`${H.messages??0} msg`].filter(Boolean).join(" · "),badge:H.agent_slug,timeAgo:H.started_at,selected:V,onClick:()=>i({kind:"conv",agentSlug:H.agent_slug,convId:H.id},{channel:H.channel,createdAt:H.started_at,title:H.title})},`${H.agent_slug}-${H.id}`)})},D.key)),$&&R.length===0&&T.length===0&&n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-fg",children:u("project.chat.list.empty")})]})]})}function P9({keyName:e,count:t,collapsed:a,onToggle:o,children:l}){const i=Zx[e],d=i.icon;return n.jsxs("section",{className:"space-y-1",children:[n.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-center justify-between rounded-md px-2 py-1 text-muted-fg hover:bg-accent/30",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a?n.jsx(Qr,{className:"size-3"}):n.jsx(ms,{className:"size-3"}),n.jsx(d,{className:"size-3"}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",children:i.label})]}),n.jsx("span",{className:"text-[10px]",children:t})]}),!a&&n.jsx("div",{className:"space-y-0.5",children:l})]})}function uw({title:e,subtitle:t,badge:a,timeAgo:o,selected:l,onClick:i}){return n.jsxs("button",{type:"button",onClick:i,className:Hc("w-full rounded-md border px-2.5 py-2 text-left transition-colors",l?"border-primary/50 bg-primary/10":"border-transparent hover:border-border hover:bg-accent/40"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("p",{className:Hc("truncate text-sm",l?"font-semibold":"font-medium"),children:e}),o&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-[10px] text-muted-fg",children:[n.jsx(V2,{className:"size-2.5"}),L9(o)]})]}),n.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 text-[10px] text-muted-fg",children:[n.jsx("span",{className:"truncate",children:t}),a&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-accent/50 px-1.5 py-0.5",children:[n.jsx(Sb,{className:"size-2.5"}),a]})]})]})}function L9(e){if(!e)return"";const t=new Date(e).getTime();if(!Number.isFinite(t))return"";const a=Date.now()-t,o=Math.floor(a/6e4);if(o<1)return"now";if(o<60)return`${o}m`;const l=Math.floor(o/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}const Qd="__super_agent__";function I9({pid:e}){const t=Ze(),[a,o]=Vo(),l=He(`/projects/${e}/agents`,()=>an.list(e)),[i,d]=x.useState(!1),[f,m]=x.useState(""),[h,g]=x.useState(null),{msgs:b,send:_,stop:k,clear:N,load:y,loadThread:w,streaming:E}=E9(e,te=>t.error(te)),j=Ep(),[S,R]=x.useState(()=>{const te=a.get("agent"),le=a.get("conv"),W=a.get("channel"),ne=a.get("thread");return W&&ne?{kind:"thread",channel:W,threadId:ne}:te&&le?{kind:"conv",agentSlug:te,convId:le}:te?{kind:"live",agentSlug:te}:{kind:"live",agentSlug:Qd}}),[A,T]=x.useState(void 0),[O,M]=x.useState(!1),[B,P]=x.useState(!1),$=(te,le)=>{R(te),T(le);const W=new URLSearchParams;te.kind==="conv"?(W.set("agent",te.agentSlug),W.set("conv",te.convId)):te.kind==="thread"?(W.set("channel",te.channel),W.set("thread",te.threadId)):W.set("agent",te.agentSlug),o(W,{replace:!0})},D=l.data||[],L=te=>te===Qd,H=x.useMemo(()=>S.kind==="thread"?void 0:D.find(te=>te.slug===S.agentSlug),[D,S]),V=S.kind==="thread"||L(S.agentSlug);x.useEffect(()=>{S.kind==="conv"?y(S.agentSlug,S.convId):S.kind==="thread"?w(S.channel,S.threadId):N()},[S.kind,S.kind==="conv"?S.convId:S.kind==="thread"?`${S.channel}:${S.threadId}`:S.agentSlug]);const U=async te=>{if(V){await _(te,{model:f||void 0});return}H&&await _(te,{model:f||void 0,agentSlug:H.slug})},F=async te=>{try{await navigator.clipboard.writeText(te),t.info(u("project.chat.copied"))}catch{}},X=te=>{$({kind:"live",agentSlug:te}),N()},G=()=>{const te=V?Qd:H?.slug??S.agentSlug;$({kind:"live",agentSlug:te}),N()},Y=async()=>{P(!0);try{S.kind==="conv"?(await Xr.remove(e,S.agentSlug,S.convId),Tf(`/projects/${e}/agents/${S.agentSlug}/conversations`)):S.kind==="thread"&&(await Xr.removeThread(e,S.channel,S.threadId),Tf(`/projects/${e}/super-agent/threads`)),t.success(u("project.chat.deleted")),M(!1),G()}catch(te){t.error(te?.message||u("shared_ui.err_chat_failed"))}finally{P(!1)}},I=V?j:H?.slug??S.agentSlug,Q=S.kind==="thread"?S.channel:A?.channel||"web",J=S.kind==="thread"?S.threadId:A?.createdAt,K=S.kind==="live"?u("project.chat.live_title",{agent:I}):A?.title||(S.kind==="thread"?S.threadId:S.convId),se=J?u("project.chat.meta_created",{date:B9(J),channel:Q}):u("project.chat.meta_new",{channel:Q});return l.isLoading?n.jsx(rt,{}):n.jsxs("div",{className:"flex h-full overflow-hidden rounded-xl border border-border bg-card/40",children:[n.jsx(D9,{pid:e,agents:D,superAgentSlug:Qd,superAgentLabel:u("agents_ui.super_agent_label",{persona:j}),selected:S,onSelect:$,onNewChat:X}),n.jsxs("section",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-4 py-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"truncate text-sm font-semibold",children:K}),n.jsx("p",{className:"truncate text-[11px] text-muted-fg",children:se})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[V?n.jsx(Ve,{tone:"success",children:u("agents_ui.super_agent_badge")}):n.jsx(Ve,{tone:"info",children:I}),!D.length&&!V&&n.jsxs(ie,{variant:"primary",size:"sm",onClick:()=>d(!0),children:[n.jsx(Pt,{size:14})," ",u("project.chat.create_agent")]}),n.jsxs(ie,{variant:"ghost",size:"sm",disabled:E||b.length===0,onClick:G,children:[n.jsx(gi,{size:13})," ",u("project.chat.new_session")]}),(S.kind==="conv"||S.kind==="thread")&&n.jsxs(ie,{variant:"destructive",size:"sm",disabled:E,onClick:()=>M(!0),children:[n.jsx(vn,{size:13})," ",u("project.chat.delete")]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:b.length?n.jsx(nv,{msgs:b,onCopy:F}):n.jsx("div",{className:"flex h-full items-center justify-center p-8",children:n.jsx("p",{className:"text-sm text-muted-fg",children:u("project.chat.empty")})})}),n.jsx(GE,{msgs:b}),(()=>{const te=E?null:KE(b);return!te||te.turnKey===h?null:n.jsx(YE,{turnKey:te.turnKey,questions:te.questions,onSubmit:le=>void U(le),onDismiss:()=>g(te.turnKey),disabled:E})})(),n.jsx(h9,{onSend:U,onStop:k,streaming:E,model:f,onModelChange:m})]}),n.jsx($9,{open:i,pid:e,onClose:()=>d(!1),onCreated:()=>{d(!1),l.mutate()}}),n.jsx(Zt,{open:O,onClose:()=>M(!1),title:u("project.chat.delete_confirm_title"),description:u("project.chat.delete_confirm_desc"),size:"sm",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:()=>M(!1),disabled:B,children:u("common.cancel")}),n.jsxs(ie,{variant:"destructive",onClick:Y,loading:B,children:[n.jsx(vn,{size:14})," ",u("project.chat.delete")]})]}),children:n.jsx("p",{className:"text-sm text-muted-fg",children:K})})]})}function B9(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}function $9({open:e,onClose:t,onCreated:a,pid:o}){const l=Ze(),[i,d]=x.useState(""),[f,m]=x.useState("master"),[h,g]=x.useState(""),[b,_]=x.useState(!0),[k,N]=x.useState(!1),y=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(i)){l.error(u("project.agents.slug_invalid"));return}N(!0);try{await an.create(o,{slug:i,role:f,model:h||void 0,is_master:b}),l.success(u("project.agents.created",{slug:i})),d(""),m("master"),g(""),_(!0),a()}catch(w){l.error(w.message)}finally{N(!1)}};return n.jsx(Zt,{open:e,onClose:t,title:u("project.chat.create_agent_title"),description:u("project.chat.create_agent_desc"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:k,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:y,loading:k,children:u("common.create")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:"slug",children:n.jsx(Te,{autoFocus:!0,value:i,onChange:w=>d(w.target.value),placeholder:"master"})}),n.jsx(ce,{label:u("project.chat.role_label"),children:n.jsx(Te,{value:f,onChange:w=>m(w.target.value),placeholder:"master"})}),n.jsx(ce,{label:u("project.chat.model_label"),hint:u("project.chat.model_hint"),children:n.jsx(Te,{value:h,onChange:w=>g(w.target.value)})}),n.jsx(Bt,{checked:b,onChange:_,label:u("project.chat.master_label")})]})})}function U9(e){return e.kind==="project"?"project":`agent:${e.slug}`}function H9(e){return e.kind==="project"?".apc/memory.md":`agents/${e.slug}/memory.md`}function q9(e,t){return t.kind==="project"?Zn.memory.get(e).then(a=>a.body):an.memory.get(e,t.slug).then(a=>a.body)}function V9(e,t,a){return t.kind==="project"?Zn.memory.put(e,a).then(()=>{}):an.memory.put(e,t.slug,a).then(()=>{})}function dw({active:e,onClick:t,icon:a,iconClass:o,label:l,sub:i}){return n.jsxs("button",{type:"button",onClick:t,className:ge("flex w-full items-center gap-2 rounded px-1.5 py-1 text-left text-[13px]",e?"bg-primary/15 text-foreground":"text-foreground/80 hover:bg-accent/40"),children:[n.jsx(a,{className:ge("size-3.5 shrink-0",o??"text-muted-foreground")}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:l}),i&&n.jsx("span",{className:"shrink-0 truncate text-[11px] text-muted-foreground",children:i})]})}function F9({pid:e}){const t=Ze(),[a,o]=x.useState({kind:"project"}),l=He(`/projects/${e}/agents`,()=>an.list(e)),i=`/memory/${e}/${U9(a)}`,d=He(i,()=>q9(e,a)),f=x.useMemo(()=>{if(d.data===void 0)return null;const g=d.data??"";return{path:H9(a),name:"memory.md",kind:"markdown",size:g.length,modified:"",encoding:"utf8",content:g}},[d.data,a]),m=async g=>{await V9(e,a,g),t.success(u("project.memories.saved")),d.mutate(g,{revalidate:!1})},h=l.data||[];return n.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden rounded-xl border border-border bg-card",children:[n.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[n.jsx(Uc,{className:"size-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:u("project.memories.sidebar_title")}),n.jsx("button",{type:"button",onClick:()=>{l.mutate(),d.mutate()},className:"text-muted-foreground hover:text-foreground","aria-label":u("common.refresh"),children:n.jsx(Ss,{className:l.isValidating?"size-3.5 animate-spin":"size-3.5"})})]}),n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:[n.jsx("p",{className:"px-1.5 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/60",children:u("project.memories.general_group")}),n.jsx(dw,{active:a.kind==="project",onClick:()=>o({kind:"project"}),icon:Uc,iconClass:"text-sky-500",label:u("project.memories.general_item")}),n.jsx("p",{className:"px-1.5 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/60",children:u("project.memories.agents_title")}),l.isLoading?n.jsx("div",{className:"flex justify-center py-4",children:n.jsx(_n,{size:14})}):h.length===0?n.jsx("div",{className:"px-1.5 py-2",children:n.jsx(pt,{children:u("project.memories.no_agents")})}):h.map(g=>n.jsx(dw,{active:a.kind==="agent"&&a.slug===g.slug,onClick:()=>o({kind:"agent",slug:g.slug}),icon:g.is_master?ba:rn,iconClass:g.is_master?"text-violet-400":"text-muted-foreground",label:g.slug,sub:g.role||void 0},g.slug))]})]}),n.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:n.jsx(Q_,{file:f,loading:d.isLoading,onSave:m})})]})}function G9({pid:e}){return n.jsx("div",{className:"h-full",children:n.jsx(F9,{pid:e})})}const Y9=/\.(html?|jsx|tsx|js)$/i;function K9({pid:e,entry:t,onDeleted:a,onRenamed:o,onRunInTerminal:l,onEditArtifact:i}){const[d,f]=x.useState(!1),[m,h]=x.useState(null),g=Ze(),[b,_]=x.useState(null),[k,N]=x.useState(!1),[y,w]=x.useState(!1),E=Y9.test(t.name),[j,S]=x.useState(!1),[R,A]=x.useState(t.name),T=x.useRef(null),[O,M]=x.useState(!1),[B,P]=x.useState(!1),[$,D]=x.useState(!1),L=O?["artifact",e,t.name]:null,H=He(L,()=>Ws.read(e,t.name),{revalidateOnFocus:!1}),V=!H.data?.content||H.data.content.startsWith("#!"),U=async K=>{try{await navigator.clipboard.writeText(K),g.info(u("modules_ui.code_copied"))}catch{}},F=async()=>{f(!0),h(null);try{const K=await Ws.run(e,t.name);h(K),K.ok?g.info(u("modules_ui.code_artifact_exit_ok",{ms:K.durationMs??0})):g.error(u("modules_ui.code_artifact_exit_fail",{code:K.exitCode??K.signal??"?",timeout:K.timedOut?u("modules_ui.code_artifact_timeout_suffix"):""}))}catch(K){g.error(K.message)}finally{f(!1)}},X=async()=>{N(!0);try{const K=await Ws.preview(e,t.name);_(K),window.open(K.url,"_blank","noopener,noreferrer")}catch(K){g.error(K.message)}finally{N(!1)}},G=async()=>{if(b){w(!0);try{const K=await Ws.openTunnel(b.id);_({...b,tunnel:{id:K.id,url:K.url,provider:K.provider}}),window.open(K.url,"_blank","noopener,noreferrer")}catch(K){g.error(K.message)}finally{w(!1)}}},Y=async()=>{if(b){try{await Ws.stopPreview(b.id)}catch{}_(null)}},I=async()=>{D(!0);try{await Ws.remove(e,t.name),P(!1),a()}catch(K){g.error(K.message)}finally{D(!1)}},Q=()=>{A(t.name),S(!0),requestAnimationFrame(()=>T.current?.select())},J=async()=>{const K=R.trim();if(S(!1),!(!K||K===t.name))try{await Ws.rename(e,t.name,K),o()}catch(se){g.error(se.message)}};return n.jsxs("li",{className:"rounded-md border border-border",children:[n.jsxs("div",{className:"flex w-full items-center gap-2 px-2 py-1.5 text-xs",children:[n.jsx(xb,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),j?n.jsx("input",{ref:T,value:R,onChange:K=>A(K.target.value),onBlur:()=>void J(),onKeyDown:K=>{K.key==="Enter"&&J(),K.key==="Escape"&&S(!1)},autoFocus:!0,className:"min-w-0 flex-1 rounded border border-border bg-background px-1 py-0.5 font-mono text-xs outline-none focus:ring-1 focus:ring-ring"}):n.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:t.name}),n.jsx(qe,{content:u("code_module.artifacts_rename"),children:n.jsx("button",{type:"button",onClick:Q,className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(ya,{className:"size-3"})})}),n.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:[t.size,"b"]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border p-2",children:[n.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5",children:[n.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted-foreground",children:t.path}),n.jsx(qe,{content:u("code_module.artifacts_copy_path"),children:n.jsx("button",{type:"button",onClick:()=>void U(t.path),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(Ao,{className:"size-3"})})})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1 mt-1",children:[n.jsxs(Ux,{open:O,onOpenChange:M,children:[n.jsx(qe,{content:u("code_module.artifacts_view"),children:n.jsxs("button",{type:"button",onClick:()=>M(!0),className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium bg-blue-500/15 text-blue-700 hover:bg-blue-500/25 dark:text-blue-300",children:[n.jsx(nu,{className:"size-3"}),u("modules_ui.code_artifact_view_short")]})}),n.jsxs(Hx,{className:"sm:max-w-lg",children:[n.jsx(qx,{children:n.jsx(Vx,{className:"font-mono text-sm",children:t.name})}),H.isLoading?n.jsx("div",{className:"flex justify-center py-6",children:n.jsx(_n,{size:16})}):n.jsx("pre",{className:"max-h-96 overflow-auto rounded bg-muted/50 p-3 font-mono text-[11px] leading-tight whitespace-pre-wrap break-all",children:H.data?.content??""}),n.jsx(Nk,{showCloseButton:!0})]})]}),i&&n.jsx(qe,{content:u("code_module.artifacts_edit"),children:n.jsxs("button",{type:"button",onClick:()=>i(t.name),className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium bg-violet-500/15 text-violet-700 hover:bg-violet-500/25 dark:text-violet-300",children:[n.jsx(SM,{className:"size-3"}),u("modules_ui.code_artifact_edit_short")]})}),V&&n.jsx(qe,{content:u("code_module.artifacts_run"),children:n.jsxs("button",{type:"button",disabled:d,onClick:()=>l?l(`apx artifact run ${t.name}`):void F(),className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium bg-emerald-500/15 text-emerald-700 hover:bg-emerald-500/25 disabled:opacity-60 dark:text-emerald-300",children:[d?n.jsx(_n,{size:10}):n.jsx(jb,{className:"size-3"}),u("code_module.artifacts_run")]})}),E&&n.jsx(qe,{content:u("code_module.artifacts_preview_hint"),children:n.jsxs("button",{type:"button",disabled:k,onClick:()=>void X(),className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium bg-sky-500/15 text-sky-700 hover:bg-sky-500/25 disabled:opacity-60 dark:text-sky-300",children:[k?n.jsx(_n,{size:10}):n.jsx(hb,{className:"size-3"}),u("code_module.artifacts_preview")]})}),b&&!b.tunnel&&n.jsx(qe,{content:u("code_module.artifacts_share_hint"),children:n.jsxs("button",{type:"button",disabled:y,onClick:()=>void G(),className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium bg-amber-500/15 text-amber-700 hover:bg-amber-500/25 disabled:opacity-60 dark:text-amber-300",children:[y?n.jsx(_n,{size:10}):n.jsx(jM,{className:"size-3"}),u("code_module.artifacts_share")]})}),n.jsxs(Ux,{open:B,onOpenChange:P,children:[n.jsx(qe,{content:u("code_module.artifacts_delete"),children:n.jsx("button",{type:"button",onClick:()=>P(!0),className:"ml-auto rounded p-1 text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950",children:n.jsx(vn,{className:"size-3"})})}),n.jsxs(Hx,{className:"sm:max-w-sm",children:[n.jsx(qx,{children:n.jsxs(Vx,{className:"font-mono text-sm",children:[u("code_module.artifacts_delete")," — ",t.name]})}),n.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:u("code_module.artifacts_delete_confirm")}),n.jsxs(Nk,{children:[n.jsx(uL,{render:n.jsx("button",{type:"button",className:"rounded px-3 py-1.5 text-xs font-medium hover:bg-accent"}),children:u("common.cancel")}),n.jsxs("button",{type:"button",onClick:()=>void I(),disabled:$,className:ge("inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium",$?"bg-muted text-muted-foreground":"bg-rose-500/15 text-rose-700 hover:bg-rose-500/25 dark:text-rose-300"),children:[$&&n.jsx(_n,{size:10}),u("code_module.delete")]})]})]})]})]}),n.jsxs("div",{className:"mt-1 text-[10px] text-muted-foreground",children:[u("code_module.artifacts_run_hint")," ",n.jsxs("code",{className:"rounded bg-muted px-1 font-mono",children:["apx artifact run ",t.name]})]}),b&&n.jsxs("div",{className:"space-y-1 rounded border border-sky-500/30 bg-sky-500/5 p-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"shrink-0 text-[10px] font-medium text-muted-foreground",children:u("code_module.artifacts_preview_local")}),n.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"min-w-0 flex-1 truncate font-mono text-[10px] text-sky-700 underline hover:text-sky-900 dark:text-sky-300",children:b.url}),n.jsx(qe,{content:u("code_module.artifacts_copy_url"),children:n.jsx("button",{type:"button",onClick:()=>void U(b.url),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(Ao,{className:"size-3"})})}),n.jsx(qe,{content:u("code_module.artifacts_stop_preview"),children:n.jsx("button",{type:"button",onClick:()=>void Y(),className:"shrink-0 rounded p-0.5 text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950",children:n.jsx(wb,{className:"size-3"})})})]}),b.tunnel&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"shrink-0 text-[10px] font-medium text-amber-700 dark:text-amber-300",children:u("code_module.artifacts_preview_public")}),n.jsx("a",{href:b.tunnel.url,target:"_blank",rel:"noopener noreferrer",className:"min-w-0 flex-1 truncate font-mono text-[10px] text-amber-700 underline hover:text-amber-900 dark:text-amber-300",children:b.tunnel.url}),n.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground",children:b.tunnel.provider}),n.jsx(qe,{content:u("code_module.artifacts_copy_url"),children:n.jsx("button",{type:"button",onClick:()=>void U(b.tunnel.url),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(Ao,{className:"size-3"})})})]})]}),m&&n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[n.jsx("span",{className:ge("rounded px-1.5 py-0.5 font-mono",m.ok?"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300":"bg-rose-500/15 text-rose-700 dark:text-rose-300"),children:u("modules_ui.code_artifact_exit_badge",{code:m.exitCode??m.signal??"?"})}),m.timedOut&&n.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 font-mono text-amber-700 dark:text-amber-300",children:u("modules_ui.code_artifact_timeout")}),m.truncated&&n.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 font-mono text-amber-700 dark:text-amber-300",children:u("modules_ui.code_artifact_truncated")}),n.jsxs("span",{className:"font-mono text-muted-foreground",children:[m.durationMs,"ms"]})]}),m.stdout&&n.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-background/60 p-2 text-[10px] leading-tight",children:m.stdout}),m.stderr&&n.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-rose-500/5 p-2 text-[10px] leading-tight text-rose-700 dark:text-rose-300",children:m.stderr})]})]})]})}function XE({pid:e,onRunInTerminal:t,onEditArtifact:a}){const o=He(e?["artifacts",e]:null,()=>Ws.list(e)),l=o.data||[];return n.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-artifacts-tab",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[n.jsx("span",{className:"text-[11px] text-muted-foreground",children:l.length>0?u("code_module.artifacts_count",{n:l.length}):""}),n.jsx(qe,{content:u("code_module.reload"),children:n.jsx("button",{type:"button",onClick:()=>void o.mutate(),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.isLoading?n.jsx(_n,{size:12}):n.jsx(Ss,{className:"size-3"})})})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3",children:l.length===0?n.jsx(pt,{children:u("code_module.artifacts_none")}):n.jsx("ul",{className:"space-y-1.5",children:l.map(i=>n.jsx(K9,{pid:e,entry:i,onDeleted:()=>void o.mutate(),onRenamed:()=>void o.mutate(),onRunInTerminal:t,onEditArtifact:a},i.name))})})]})}function X9({pid:e}){const t=Pn(),a=o=>{const l=new URLSearchParams({pid:e,...o}).toString();t(`/m/code?${l}`)};return n.jsx(Ye,{title:u("project.artifacts.title"),description:u("project.artifacts.subtitle"),fullHeight:!0,className:"min-h-[24rem]",children:n.jsx(XE,{pid:e,onRunInTerminal:o=>a({cmd:o}),onEditArtifact:o=>a({edit:o})})})}function Q9({pid:e}){const t=Ze(),a=He(`/projects/${e}/organization`,()=>qr.get(e)),[o,l]=x.useState(null),[i,d]=x.useState(null),[f,m]=x.useState(null),h=()=>void a.mutate(),g=a.data?.areas??[],b=a.data?.roles??[],_=N=>b.filter(y=>y.area===N),k=async()=>{f&&(f.kind==="area"?await qr.removeArea(e,f.slug):await qr.removeRole(e,f.slug),t.success(u("common.deleted")),h())};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Ye,{title:u("structure.title"),description:u("structure.subtitle"),action:n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(ie,{size:"sm",variant:"secondary","data-testid":"structure-new-area",onClick:()=>l({}),children:[n.jsx(Pt,{className:"size-3.5"}),u("structure.new_area")]}),n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>d({}),children:[n.jsx(Pt,{className:"size-3.5"}),u("structure.new_role")]})]}),children:[n.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-sky-500/20 bg-sky-500/5 px-3 py-2 text-[13px] text-muted-foreground",children:[n.jsx(J2,{className:"mt-0.5 size-4 shrink-0 text-sky-500"}),n.jsx("span",{children:u("structure.info")})]}),a.isLoading?n.jsx(rt,{}):g.length===0&&b.length===0?n.jsx(pt,{children:u("structure.empty")}):n.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:[g.map(N=>n.jsxs("div",{className:"group rounded-lg border border-border bg-card/50 p-3",children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(K2,{className:"mt-0.5 size-4 shrink-0 text-emerald-500"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:N.name}),n.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:N.slug})]}),N.goal&&n.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:N.goal})]}),n.jsxs("div",{className:"flex shrink-0 gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[n.jsx("button",{type:"button",onClick:()=>l({editing:N}),className:"text-muted-foreground hover:text-foreground","aria-label":u("common.edit"),children:n.jsx(ya,{className:"size-3.5"})}),n.jsx("button",{type:"button",onClick:()=>m({kind:"area",slug:N.slug,name:N.name}),className:"text-muted-foreground hover:text-red-500","aria-label":u("common.delete"),children:n.jsx(vn,{className:"size-3.5"})})]})]}),n.jsxs("div",{className:"mt-3 border-t border-border/60 pt-2",children:[n.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[u("structure.roles")," (",_(N.slug).length,")"]}),n.jsxs("button",{type:"button",onClick:()=>d({presetArea:N.slug}),className:"text-[11px] text-sky-500 hover:text-sky-400",children:["+ ",u("structure.add_role")]})]}),n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[_(N.slug).map(y=>n.jsx(fw,{role:y,onEdit:()=>d({editing:y}),onDelete:()=>m({kind:"role",slug:y.slug,name:y.name})},y.slug)),_(N.slug).length===0&&n.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:u("structure.no_roles")})]})]})]},N.slug)),_(null).length>0&&n.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-card/30 p-3",children:[n.jsxs("div",{className:"mb-2 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[n.jsx(fb,{className:"size-3.5"}),u("structure.general_roles")]}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:_(null).map(N=>n.jsx(fw,{role:N,onEdit:()=>d({editing:N}),onDelete:()=>m({kind:"role",slug:N.slug,name:N.name})},N.slug))})]})]})]}),n.jsx(kE,{open:!!o,onClose:()=>l(null),pid:e,editing:o?.editing,onSaved:h}),n.jsx(wE,{open:!!i,onClose:()=>d(null),pid:e,areas:g,editing:i?.editing,presetArea:i?.presetArea,onSaved:h}),n.jsx(EE,{open:!!f,onClose:()=>m(null),onConfirm:k,title:f?.kind==="area"?u("structure.delete_area"):u("structure.delete_role"),description:f?.kind==="area"?u("structure.delete_area_desc",{name:f?.name??""}):u("structure.delete_role_desc",{name:f?.name??""}),confirmLabel:u("common.delete")})]})}function fw({role:e,onEdit:t,onDelete:a}){return n.jsxs("span",{className:"group/chip inline-flex items-center gap-1 rounded-md border border-border bg-background px-1.5 py-0.5 text-[11px]",children:[n.jsx(fb,{className:"size-3 text-muted-foreground"}),n.jsx("span",{children:e.name}),n.jsx("button",{type:"button",onClick:t,className:"opacity-0 transition-opacity group-hover/chip:opacity-100 text-muted-foreground hover:text-foreground","aria-label":u("common.edit"),children:n.jsx(ya,{className:"size-2.5"})}),n.jsx("button",{type:"button",onClick:a,className:"opacity-0 transition-opacity group-hover/chip:opacity-100 text-muted-foreground hover:text-red-500","aria-label":u("common.delete"),children:n.jsx(vn,{className:"size-2.5"})})]})}function W9(e){switch(e){case"markdown":return{Icon:Xf,color:"text-sky-500"};case"text":return{Icon:YA,color:"text-amber-500"};case"image":return{Icon:bx,color:"text-pink-500"};default:return{Icon:Y2,color:"text-muted-foreground"}}}function Z9(e){const t=e.split("/"),a=[];for(let o=1;o<t.length;o++)a.push(t.slice(0,o).join("/"));return a}function QE({node:e,depth:t,selectedPath:a,expanded:o,toggle:l,onSelect:i,onDelete:d}){const f=e.type==="dir",m=o.has(e.path),h=a===e.path,{Icon:g,color:b}=f?{Icon:m?Fo:X2,color:"text-muted-foreground"}:W9(e.kind);return n.jsxs("div",{children:[n.jsxs("div",{className:ge("group flex items-center gap-1 rounded px-1.5 py-1 text-[13px] cursor-pointer",h?"bg-primary/15 text-foreground":"hover:bg-accent/40 text-foreground/80"),style:{paddingLeft:t*12+6},onClick:()=>f?l(e.path):i(e),children:[f?m?n.jsx(ms,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Qr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx("span",{className:"w-3.5 shrink-0"}),n.jsx(g,{className:ge("size-3.5 shrink-0",b)}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name}),d&&!f&&n.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),d(e)},className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-red-500","aria-label":`delete ${e.name}`,children:n.jsx(vn,{className:"size-3.5"})})]}),f&&m&&e.children?.map(_=>n.jsx(QE,{node:_,depth:t+1,selectedPath:a,expanded:o,toggle:l,onSelect:i,onDelete:d},_.path))]})}function J9({nodes:e,selectedPath:t,onSelect:a,onDelete:o,className:l}){const[i,d]=x.useState(()=>new Set);x.useEffect(()=>{t&&d(m=>{const h=new Set(m);for(const g of Z9(t))h.add(g);return h})},[t]);const f=m=>d(h=>{const g=new Set(h);return g.has(m)?g.delete(m):g.add(m),g});return n.jsx("div",{className:ge("select-none",l),children:e.map(m=>n.jsx(QE,{node:m,depth:0,selectedPath:t,expanded:i,toggle:f,onSelect:a,onDelete:o},m.path))})}function eB({open:e,onClose:t,pid:a,scope:o,onCreated:l}){const i=Ze(),[d,f]=x.useState(""),[m,h]=x.useState(!1),g=async()=>{let b=d.trim().replace(/^\/+/,"");if(b){/\.[a-z0-9]+$/i.test(b)||(b+=".md"),h(!0);try{await Cc.write(a,b,"",o),i.success(u("files.created")),f(""),l(b)}catch(_){i.error(_ instanceof Error?_.message:String(_))}finally{h(!1)}}};return n.jsx(Zt,{open:e,onClose:t,title:u("files.new_doc"),description:u("files.new_doc_hint"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,children:u("common.cancel")}),n.jsx(ie,{variant:"primary","data-testid":"new-file-create",onClick:()=>void g(),loading:m,disabled:!d.trim(),children:u("files.create")})]}),children:n.jsx(ce,{label:u("files.path_label"),hint:u("files.path_example"),children:n.jsx(Te,{autoFocus:!0,"data-testid":"new-file-path",value:d,onChange:b=>f(b.target.value),onKeyDown:b=>{b.key==="Enter"&&g()},placeholder:"cases/onboarding/spec.md"})})})}function WE({pid:e,scope:t,editable:a=!1,emptyHint:o}){const l=Ze(),[i,d]=x.useState(null),[f,m]=x.useState(!1),h=`/projects/${e}/fs/tree?scope=${t}`,g=He(h,()=>Cc.tree(e,t)),b=i?`/projects/${e}/fs/file?scope=${t}&path=${i}`:null,_=He(b,()=>i?Cc.read(e,i,t):null),k=S=>d(S.path),N=a?async S=>{i&&(await Cc.write(e,i,S,t),l.success(u("files.saved")),_.mutate())}:void 0,y=a?async S=>{await Cc.remove(e,S.path,t),i===S.path&&d(null),l.success(u("files.deleted")),g.mutate()}:void 0,w=S=>{m(!1),d(S),g.mutate()},E=g.data?.tree??[],j=!g.isLoading&&E.length===0;return n.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden rounded-xl border border-border bg-card",children:[n.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[n.jsx(Fo,{className:"size-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:u(t==="docs"?"files.docs_label":"files.files_label")}),a&&n.jsx("button",{type:"button","data-testid":"docs-new",onClick:()=>m(!0),className:"text-muted-foreground hover:text-foreground","aria-label":u("files.new_doc"),title:u("files.new_doc"),children:n.jsx(hx,{className:"size-4"})}),n.jsx("button",{type:"button",onClick:()=>void g.mutate(),className:"text-muted-foreground hover:text-foreground","aria-label":u("common.refresh"),children:n.jsx(Ss,{className:g.isValidating?"size-3.5 animate-spin":"size-3.5"})})]}),n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:[g.isLoading?n.jsx("div",{className:"flex justify-center py-6",children:n.jsx(_n,{size:14})}):j?n.jsx("div",{className:"p-3",children:n.jsx(pt,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("p",{children:o??u("files.empty")}),a&&n.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>m(!0),children:[n.jsx(hx,{className:"size-3.5"}),u("files.new_doc")]})]})})}):n.jsx(J9,{nodes:E,selectedPath:i,onSelect:k,onDelete:y}),g.data?.truncated&&n.jsx("p",{className:"px-2 py-1 text-[10px] text-muted-foreground/60",children:u("files.truncated")})]})]}),n.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:n.jsx(Q_,{file:_.data??null,loading:!!b&&_.isLoading,onSave:N})}),a&&n.jsx(eB,{open:f,onClose:()=>m(!1),pid:e,scope:t,onCreated:w})]})}function tB({pid:e}){return n.jsx("div",{className:"h-full",children:n.jsx(WE,{pid:e,scope:"docs",editable:!0,emptyHint:u("files.docs_empty")})})}function nB({pid:e}){return n.jsx("div",{className:"h-full",children:n.jsx(WE,{pid:e,scope:"project"})})}const Ph="default";function sB(e){const t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function ZE(e){return e==="builtin"?{label:u("skills_page.source_builtin"),tone:"info"}:e==="project"?{label:u("skills_page.source_project"),tone:"success"}:{label:u("skills_page.source_global"),tone:"muted"}}function Lh(e){const t=[],a=/(\*\*[^*]+\*\*|`[^`]+`)/g;let o=0,l,i=0;for(;l=a.exec(e);){l.index>o&&t.push(e.slice(o,l.index));const d=l[0];d.startsWith("**")?t.push(n.jsx("strong",{children:d.slice(2,-2)},i++)):t.push(n.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-[0.85em]",children:d.slice(1,-1)},i++)),o=l.index+d.length}return o<e.length&&t.push(e.slice(o)),t}function aB(e){const t=e.split(`
|
|
805
|
-
`),a=[];let o=0,l=0;for(;o<t.length;){const i=t[o];if(i.trim().startsWith("```")){const m=[];for(o++;o<t.length&&!t[o].trim().startsWith("```");)m.push(t[o]),o++;o++,a.push(n.jsx("pre",{className:"my-2 overflow-x-auto rounded-md border border-border bg-muted/50 p-3 text-xs",children:n.jsx("code",{children:m.join(`
|
|
806
|
-
`)})},l++));continue}const d=i.match(/^(#{1,4})\s+(.*)$/);if(d){const m=d[1].length,h=m===1?"mt-4 mb-1 text-lg font-semibold":m===2?"mt-3 mb-1 text-base font-semibold":"mt-2 mb-0.5 text-sm font-semibold";a.push(n.jsx("div",{className:h,children:Lh(d[2])},l++)),o++;continue}if(/^\s*[-*]\s+/.test(i)){const m=[];for(;o<t.length&&/^\s*[-*]\s+/.test(t[o]);)m.push(n.jsx("li",{children:Lh(t[o].replace(/^\s*[-*]\s+/,""))},m.length)),o++;a.push(n.jsx("ul",{className:"my-1 list-disc space-y-0.5 pl-5 text-sm",children:m},l++));continue}if(i.trim()===""){o++;continue}const f=[];for(;o<t.length&&t[o].trim()!==""&&!/^(#{1,4})\s/.test(t[o])&&!/^\s*[-*]\s+/.test(t[o])&&!t[o].trim().startsWith("```");)f.push(t[o]),o++;a.push(n.jsx("p",{className:"my-1.5 text-sm leading-relaxed",children:Lh(f.join(" "))},l++))}return a}function rB(e){return new Promise((t,a)=>{const o=new FileReader;o.onload=()=>t(String(o.result).replace(/^data:.*;base64,/,"")),o.onerror=()=>a(new Error("read failed")),o.readAsDataURL(e)})}function JE({scope:e,selectable:t=!1}){const a=Ze(),[o,l]=x.useState(e??Ph),i=e??o,d=i===Ph?void 0:i,[f,m]=x.useState(!1),[h,g]=x.useState(null),[b,_]=x.useState("preview"),[k,N]=x.useState(!1),[y,w]=x.useState(!1),E=x.useRef(null),{data:j}=He(t?"/projects":null,()=>Zn.list()),S=x.useMemo(()=>[{value:Ph,label:u("skills_page.scope_super_agent")},...(j??[]).map(F=>({value:F.path,label:F.name||sB(F.path)}))],[j]),{data:R,mutate:A,isLoading:T}=He(["/skills",i],()=>Us.list(d)),O=x.useMemo(()=>R?.skills??[],[R]),M=O.filter(F=>F.enabled!==!1).length,B=h&&O.some(F=>F.slug===h)?h:O[0]?.slug??null,{data:P}=He(B?["/skill-detail",i,B]:null,()=>Us.detail(B,d)),$=async(F,X)=>{m(!0);try{await Us.setEnabled({slug:F,enabled:X,scope:i}),await A()}catch(G){a.error(u("skills_page.toggle_failed",{msg:G.message}))}finally{m(!1)}},D=async F=>{if(window.confirm(u("skills_page.delete_confirm",{slug:F}))){m(!0);try{await Us.remove(F,d),a.success(u("skills_page.deleted_ok",{slug:F})),h===F&&g(null),await A()}catch(X){a.error(u("skills_page.delete_failed",{msg:X.message}))}finally{m(!1)}}},L=async(F,X)=>{a.success(X),g(F),await A()},H=async(F,X,G)=>{await Us.create({slug:F,description:X,body:G,project_path:d}),await L(F,u("skills_page.created_ok",{slug:F}))},V=async F=>{const X=await Us.importRepo({url:F,project_path:d});await L(X.slug,u("skills_page.imported_ok",{slug:X.slug}))},U=async F=>{if(F){m(!0);try{const X=await rB(F),G=await Us.importZip({data:X,project_path:d});await L(G.slug,u("skills_page.imported_ok",{slug:G.slug}))}catch(X){a.error(u("skills_page.import_failed",{msg:X.message}))}finally{m(!1),E.current&&(E.current.value="")}}};return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t?n.jsx("div",{className:"w-64",children:n.jsx(ut,{value:i,onChange:F=>{l(F),g(null)},options:S,placeholder:u("skills_page.scope_ph")})}):null,n.jsx(Ve,{tone:"muted",children:u("skills_page.count_label",{n:O.length,on:M})})]}),n.jsxs(y_,{children:[n.jsxs(j_,{disabled:f,className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50",children:[n.jsx(Pt,{size:15})," ",u("skills_page.add_menu")," ",n.jsx(ms,{size:14})]}),n.jsxs(k_,{align:"end",sideOffset:6,className:"w-72",children:[n.jsxs(lf,{onClick:()=>N(!0),children:[n.jsx(xM,{size:15,className:"text-muted-fg"}),n.jsx(Ih,{title:u("skills_page.add_online"),hint:u("skills_page.add_online_hint")})]}),n.jsxs(lf,{onClick:()=>E.current?.click(),children:[n.jsx(oS,{size:15,className:"text-muted-fg"}),n.jsx(Ih,{title:u("skills_page.add_zip"),hint:u("skills_page.add_zip_hint")})]}),n.jsxs(lf,{onClick:()=>w(!0),children:[n.jsx(su,{size:15,className:"text-muted-fg"}),n.jsx(Ih,{title:u("skills_page.add_repo"),hint:u("skills_page.add_repo_hint")})]})]})]}),n.jsx("input",{ref:E,type:"file",accept:".zip",className:"hidden",onChange:F=>U(F.target.files?.[0])})]}),T||!R?n.jsx(rt,{}):n.jsxs("div",{className:"grid min-h-[62vh] gap-4 lg:grid-cols-[20rem_1fr]",children:[n.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:n.jsx("ul",{className:"max-h-[62vh] divide-y divide-border overflow-y-auto",children:O.length===0?n.jsx("li",{className:"px-3 py-4 text-sm text-muted-fg",children:u("skills_page.empty")}):O.map(F=>n.jsx(oB,{skill:F,active:F.slug===B,busy:f,onSelect:()=>g(F.slug),onToggle:X=>$(F.slug,X)},F.slug))})}),n.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border bg-card",children:B?P?n.jsxs("div",{className:"flex h-full max-h-[62vh] flex-col",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border px-5 py-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("code",{className:"text-sm font-semibold",children:P.slug}),(()=>{const F=ZE(P.source);return n.jsx(Ve,{tone:F.tone,children:F.label})})(),P.private&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-fg",children:[n.jsx(tS,{size:11})," ",u("skills_page.private_badge")]})]}),P.description&&n.jsx("p",{className:"mt-1 text-sm text-muted-fg",children:P.description}),n.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-fg",children:[n.jsxs("span",{children:[u("skills_page.added_by"),": ",n.jsx("span",{className:"text-foreground",children:P.private?u("skills_page.by_apx"):u("skills_page.by_you")})]}),n.jsxs("span",{children:[u("skills_page.activator"),": ",n.jsx("span",{className:"text-foreground",children:u("skills_page.activator_value")})]})]})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[(P.source==="global"||P.source==="project")&&n.jsx(qe,{content:u("skills_page.delete_btn"),children:n.jsx(ie,{variant:"ghost",size:"sm",disabled:f,onClick:()=>D(P.slug),"aria-label":u("skills_page.delete_btn"),children:n.jsx(vn,{size:14})})}),n.jsx(Bt,{checked:P.private?!0:P.enabled,disabled:f||P.private,onChange:F=>$(P.slug,F),label:P.private||P.enabled?u("skills_page.on"):u("skills_page.off")})]})]}),n.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:[n.jsx(pw,{active:b==="preview",onClick:()=>_("preview"),icon:Xf,label:u("skills_page.tab_preview")}),n.jsx(pw,{active:b==="source",onClick:()=>_("source"),icon:$A,label:u("skills_page.tab_source")})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:b==="preview"?n.jsx("div",{className:"prose-none",children:aB(P.body||"")}):n.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-fg",children:P.body})})]}):n.jsx("div",{className:"p-6",children:n.jsx(rt,{})}):n.jsx("div",{className:"grid h-full place-items-center p-8 text-sm text-muted-fg",children:u("skills_page.select_a_skill")})})]}),n.jsx(lB,{open:k,onClose:()=>N(!1),onCreate:H}),n.jsx(iB,{open:y,onClose:()=>w(!1),onImport:V})]})}function Ih({title:e,hint:t}){return n.jsxs("span",{className:"flex min-w-0 flex-col leading-tight",children:[n.jsx("span",{className:"font-medium",children:e}),n.jsx("span",{className:"text-[11px] text-muted-fg",children:t})]})}function pw({active:e,onClick:t,icon:a,label:o}){return n.jsxs("button",{type:"button",onClick:t,className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition ${e?"bg-accent text-foreground":"text-muted-fg hover:text-foreground"}`,children:[n.jsx(a,{size:13})," ",o]})}function oB({skill:e,active:t,busy:a,onSelect:o,onToggle:l}){const i=ZE(e.source),d=e.private?!0:e.enabled!==!1;return n.jsx("li",{children:n.jsxs("div",{className:`flex items-center gap-2 px-3 py-2.5 ${t?"bg-accent/50":"hover:bg-accent/25"}`,children:[n.jsxs("button",{type:"button",onClick:o,className:"min-w-0 flex-1 text-left",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("code",{className:"truncate text-[13px] font-medium",children:e.slug}),e.private&&n.jsx(tS,{size:10,className:"shrink-0 text-muted-fg"})]}),n.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[n.jsx(Ve,{tone:i.tone,children:i.label}),e.overridden&&n.jsx(Ve,{tone:"warning",children:u("skills_page.overridden_badge")})]})]}),n.jsx(Bt,{checked:d,disabled:a||e.private,onChange:l})]})})}function lB({open:e,onClose:t,onCreate:a}){const o=Ze(),[l,i]=x.useState(""),[d,f]=x.useState(""),[m,h]=x.useState(""),[g,b]=x.useState(!1),_=/^[a-z0-9][a-z0-9-]*$/.test(l),k=()=>{i(""),f(""),h("")},N=async()=>{if(_){b(!0);try{await a(l,d,m),k(),t()}catch(y){o.error(u("skills_page.create_failed",{msg:y.message}))}finally{b(!1)}}};return n.jsx(Zt,{open:e,onClose:t,title:u("skills_page.create_dialog_title"),description:u("skills_page.add_desc"),size:"lg",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:g,children:u("skills_page.cancel")}),n.jsxs(ie,{variant:"primary",onClick:N,disabled:g||!_,loading:g,children:[n.jsx(Pt,{size:14})," ",u("skills_page.add_btn")]})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[n.jsx(ce,{label:u("skills_page.add_slug_label"),children:n.jsx(Te,{value:l,placeholder:u("skills_page.add_slug_ph"),disabled:g,onChange:y=>i(y.target.value.toLowerCase())})}),n.jsx(ce,{label:u("skills_page.add_desc_label"),children:n.jsx(Te,{value:d,placeholder:u("skills_page.add_desc_ph"),disabled:g,onChange:y=>f(y.target.value)})})]}),n.jsx(ce,{label:u("skills_page.add_body_label"),children:n.jsx(un,{value:m,placeholder:u("skills_page.add_body_ph"),disabled:g,rows:10,onChange:y=>h(y.target.value)})})]})})}function iB({open:e,onClose:t,onImport:a}){const o=Ze(),[l,i]=x.useState(""),[d,f]=x.useState(!1),m=/^(https?:\/\/|git@|ssh:\/\/|git:\/\/)\S+$/.test(l.trim()),h=async()=>{if(m){f(!0);try{await a(l.trim()),i(""),t()}catch(g){o.error(u("skills_page.import_failed",{msg:g.message}))}finally{f(!1)}}};return n.jsx(Zt,{open:e,onClose:t,title:u("skills_page.repo_dialog_title"),size:"md",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:d,children:u("skills_page.cancel")}),n.jsxs(ie,{variant:"primary",onClick:h,disabled:d||!m,loading:d,children:[n.jsx(su,{size:14})," ",u("skills_page.import_btn")]})]}),children:n.jsx(ce,{label:u("skills_page.repo_url_label"),hint:u("skills_page.repo_url_hint"),children:n.jsx(Te,{value:l,placeholder:u("skills_page.repo_url_ph"),disabled:d,onChange:g=>i(g.target.value),onKeyDown:g=>{g.key==="Enter"&&h()}})})})}function cB({pid:e}){const{project:t}=du(e),a=e==="0"?"default":t?.path;return a?n.jsx(JE,{scope:a}):n.jsx(rt,{})}function uB(){const e=Pn(),t=ss(),{pid:a=""}=M2(),{project:o}=du(a),{collapsed:l,toggle:i}=C_(zn.sidebarCollapsed+".project"),d=String(a)==="0",{data:f}=He(`integrations-catalog-${a}`,()=>Gn.catalog(a),{shouldRetryOnError:!1}),m=f?.find(k=>k.slug==="obsidian"),h=m?.status?.status==="active"&&!!m?.status?.is_enabled,g=x.useMemo(()=>{const k=h?n.jsx(YN,{className:"size-3 text-purple-400"}):void 0,N=!d&&o?.kind==="company";return[d?{title:u("base.nav_general"),items:[{key:"workspaces",label:u("base.workspaces_title"),icon:RA},{key:"models",label:u("settings.tabs.engines"),icon:gb},{key:"agent-defaults",label:u("base.defaults_title"),icon:rn}]}:null,{title:u("project.sections.workspace"),items:[{key:"",label:u("project.nav.overview"),icon:oM},...N?[{key:"structure",label:u("project.nav.structure"),icon:AA}]:[],{key:"agents",label:u("project.nav.agents"),icon:rn},{key:"memories",label:u("project.nav.memories"),icon:Uc,mark:k},{key:"skills",label:u("skills_page.title"),icon:sa},{key:"artifacts",label:u("project.nav.artifacts"),icon:xb}]},{title:u("base.nav_activity"),items:[{key:"chat",label:u("project.nav.chat"),icon:Wf},{key:"sessions",label:u("base.sessions_title"),icon:aM},{key:"logs",label:u("project.nav.logs"),icon:kb}]},d?null:{title:u("project.sections.content"),items:[{key:"docs",label:u("project.nav.docs"),icon:Xf},{key:"files",label:u("project.nav.files"),icon:bb}]},{title:u("project.sections.automation"),items:[{key:"routines",label:u("project.nav.routines"),icon:Mo},{key:"tasks",label:u("project.nav.tasks"),icon:hi},{key:"mcps",label:u("project.nav.mcps"),icon:Zf},{key:"integrations",label:"Integrations",icon:MA},{key:"vars",label:u("project.nav.vars"),icon:eS}]},{title:u("project.sections.config"),items:[{key:"config",label:u("project.nav.config"),icon:ep}]}].filter(Boolean)},[d,o?.kind,h]),b=t.pathname.replace(`/p/${a}`,"").replace(/^\//,"").split("/")[0];if(!o)return n.jsx(XN,{testId:"screen-project-not-found",mood:"confused",message:u("project.not_found",{pid:a}),action:n.jsx(lr,{variant:"outline",onClick:()=>e("/"),children:u("not_found.home")})});const _=k=>{const N=k?`/p/${a}/${k}`:`/p/${a}`;e(N)};return n.jsx(GN,{sections:g,active:b,onChange:_,collapsed:l,onToggleCollapse:i,contentClassName:"w-full space-y-6 py-6 pt-3 pr-6 pl-1",testId:`project-tab-${b||"overview"}`,children:n.jsxs(P2,{children:[n.jsx(Dt,{index:!0,element:n.jsx(Bk,{pid:a})}),n.jsx(Dt,{path:"workspaces",element:n.jsx(y8,{})}),n.jsx(Dt,{path:"models",element:n.jsx(xE,{})}),n.jsx(Dt,{path:"agent-defaults",element:n.jsx(AI,{})}),n.jsx(Dt,{path:"sessions",element:n.jsx(LI,{pid:a})}),n.jsx(Dt,{path:"logs",element:n.jsx(pI,{pid:a})}),n.jsx(Dt,{path:"config",element:n.jsx(n7,{pid:a})}),n.jsx(Dt,{path:"telegram",element:n.jsx(jE,{pid:a})}),n.jsx(Dt,{path:"agents",element:n.jsx(w7,{pid:a})}),n.jsx(Dt,{path:"agents/:slug",element:n.jsx(d7,{pid:a})}),n.jsx(Dt,{path:"structure",element:n.jsx(Q9,{pid:a})}),n.jsx(Dt,{path:"docs",element:n.jsx(tB,{pid:a})}),n.jsx(Dt,{path:"files",element:n.jsx(nB,{pid:a})}),n.jsx(Dt,{path:"memories",element:n.jsx(G9,{pid:a})}),n.jsx(Dt,{path:"skills",element:n.jsx(cB,{pid:a})}),n.jsx(Dt,{path:"routines",element:n.jsx(I7,{pid:a})}),n.jsx(Dt,{path:"tasks",element:d?n.jsx(II,{}):n.jsx($7,{pid:a})}),n.jsx(Dt,{path:"mcps",element:n.jsx(Z7,{pid:a})}),n.jsx(Dt,{path:"integrations",element:n.jsx(p9,{pid:a})}),n.jsx(Dt,{path:"artifacts",element:n.jsx(X9,{pid:a})}),n.jsx(Dt,{path:"vars",element:n.jsx(m9,{pid:a})}),n.jsx(Dt,{path:"threads",element:n.jsx(U3,{to:`/p/${a}/chat`,replace:!0})}),n.jsx(Dt,{path:"chat",element:n.jsx(I9,{pid:a})}),n.jsx(Dt,{path:"*",element:n.jsx(Bk,{pid:a})})]})})}function dB({value:e,onChange:t,options:a,placeholder:o,className:l}){const i=j=>a.find(S=>S.value===j)?.label??j,[d,f]=x.useState(!1),[m,h]=x.useState(i(e)),g=x.useRef(null),b=x.useRef(null),[_,k]=x.useState(null);x.useEffect(()=>{h(i(e))},[e,a]),x.useLayoutEffect(()=>{if(!d)return;const j=()=>{const S=g.current;if(!S)return;const R=S.getBoundingClientRect();k({top:R.bottom+4,left:R.left,width:R.width})};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[d]),x.useEffect(()=>{if(!d)return;const j=S=>{const R=S.target;g.current?.contains(R)||b.current?.contains(R)||(h(i(e)),f(!1))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[d,e,a]);const N=m.trim().toLowerCase(),y=m===i(e),w=N&&!y?a.filter(j=>j.label.toLowerCase().includes(N)||j.value.toLowerCase().includes(N)):a,E=j=>{t(j.value),h(j.label),f(!1)};return n.jsxs("div",{ref:g,className:ge("relative",l),children:[n.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-input bg-transparent px-2.5 transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring dark:bg-input/30 dark:hover:bg-input/50",children:[n.jsx("input",{value:m,placeholder:o,onChange:j=>{h(j.target.value),f(!0)},onFocus:()=>f(!0),className:"w-full bg-transparent py-1.5 text-sm outline-none placeholder:text-muted-fg/60"}),n.jsx("button",{type:"button",tabIndex:-1,onClick:()=>f(j=>!j),className:"shrink-0 text-muted-fg hover:text-foreground",children:n.jsx(ms,{className:"size-4"})})]}),d&&w.length>0&&_&&Fs.createPortal(n.jsx("ul",{ref:b,style:{position:"fixed",top:_.top,left:_.left,width:_.width},className:"z-[1000] max-h-60 overflow-y-auto rounded-lg bg-popover p-1 shadow-md ring-1 ring-foreground/10",children:w.map(j=>n.jsx("li",{children:n.jsx("button",{type:"button",onMouseDown:S=>{S.preventDefault(),E(j)},className:ge("flex w-full items-center rounded-md px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-fg",j.value===e&&"bg-accent/50"),children:n.jsx("span",{className:"truncate font-mono text-xs",children:j.label})})},j.value))}),document.body)]})}const fB=["es","en","pt","fr","it","de","ca","gl","eu","nl","sv","no","da","fi","is","pl","cs","sk","sl","hr","sr","uk","ru","bg","ro","hu","el","tr","ar","he","fa","hi","bn","ta","ur","id","ms","vi","th","ko","ja","zh"];function pB(e){return e&&e.charAt(0).toLocaleUpperCase()+e.slice(1)}function mB(){const e=S_();let t=null;try{t=new Intl.DisplayNames([e],{type:"language"})}catch{t=null}return fB.map(a=>{const o=t?.of(a);return{value:a,label:o?pB(o):a}}).sort((a,o)=>a.label.localeCompare(o.label,e))}const gB=["UTC","America/Argentina/Buenos_Aires","America/Sao_Paulo","America/New_York","America/Los_Angeles","America/Mexico_City","Europe/London","Europe/Madrid","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function hB(){try{const e=Intl.supportedValuesOf;if(typeof e=="function")return e("timeZone")}catch{}return gB}function mw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function xB(e,t){try{const a=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(t).find(i=>i.type==="timeZoneName")?.value??"GMT",o=/GMT([+-])(\d{1,2})(?::(\d{2}))?/.exec(a);return o?(o[1]==="-"?-1:1)*(parseInt(o[2],10)*60+(o[3]?parseInt(o[3],10):0)):0}catch{return 0}}function bB(e){const t=e<0?"-":"+",a=Math.abs(e),o=String(Math.floor(a/60)).padStart(2,"0"),l=String(a%60).padStart(2,"0");return`GMT${t}${o}:${l}`}let Wd=null;function _B(){if(Wd)return Wd;const e=new Date;return Wd=hB().map(t=>({value:t,label:t,off:xB(t,e)})).sort((t,a)=>t.off-a.off||t.value.localeCompare(a.value)).map(({value:t,off:a})=>({value:t,label:`(${bB(a)}) ${t}`})),Wd}function vB(){const e=Ze(),{identity:t,isLoading:a,save:o}=T_(),[l,i]=x.useState({}),[d,f]=x.useState(!1),m=x.useMemo(()=>_B(),[]);if(x.useEffect(()=>{i({...t,timezone:t?.timezone||mw()})},[t]),a)return n.jsx(rt,{});const h=async()=>{f(!0);try{await o({owner_name:l.owner_name,owner_context:l.owner_context,language:l.language,timezone:l.timezone}),e.success(u("settings.identity.saved"))}catch(g){e.error(g.message)}finally{f(!1)}};return n.jsxs(Ye,{title:u("settings.identity.title"),description:u("settings.identity.subtitle"),children:[t?null:n.jsx(pt,{children:u("common.none_yet")}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("settings.identity.owner_name"),children:n.jsx(Te,{value:l.owner_name||"",onChange:g=>i({...l,owner_name:g.target.value})})}),n.jsx(ce,{label:u("settings.identity.language"),children:n.jsx(ut,{value:l.language||"es",onChange:g=>i({...l,language:g}),options:mB()})}),n.jsx(ce,{label:u("settings.identity.timezone"),hint:u("settings.identity.timezone_hint"),children:n.jsx(dB,{value:l.timezone||mw(),onChange:g=>i({...l,timezone:g}),options:m})})]}),n.jsx("div",{className:"mt-3",children:n.jsx(ce,{label:u("settings.identity.owner_context"),hint:u("settings.identity.owner_context_hint"),children:n.jsx(un,{rows:3,value:l.owner_context||"",onChange:g=>i({...l,owner_context:g.target.value})})})}),n.jsx("div",{className:"mt-4",children:n.jsx(ie,{variant:"primary",loading:d,onClick:h,children:u("common.save")})})]})}function yB(){const e=Ze(),t=Pn(),{superAgent:a,isLoading:o,mutate:l}=gE(),{patch:i}=dr(),{identity:d,save:f}=T_(),[m,h]=x.useState(!0),[g,b]=x.useState(""),[_,k]=x.useState(""),[N,y]=x.useState("permiso"),[w,E]=x.useState(!1);if(x.useEffect(()=>{a&&(h(!!a.enabled),b(a.system||""),y(a.permission_mode||"permiso"))},[a]),x.useEffect(()=>{k(d.personality||"")},[d.personality]),o||!a)return n.jsx(rt,{});const j=async()=>{E(!0);try{await i({"super_agent.enabled":m,"super_agent.system":g,"super_agent.permission_mode":N},["super_agent.name"]),await f({personality:_}),e.success(u("settings.super_agent.saved")),l()}catch(S){e.error(S.message)}finally{E(!1)}};return n.jsx(Ye,{title:u("settings.super_agent.title"),description:u("settings.super_agent.behavior_subtitle"),children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsx(Bt,{checked:m,onChange:h,label:u("settings.super_agent.enabled_label")})}),n.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/20 p-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-medium",children:u("settings.super_agent.model_active")}),n.jsx("div",{className:"truncate font-mono text-xs text-muted-fg",children:a.model||"—"})]}),n.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>t("/p/0/models"),children:[n.jsx(gb,{size:13})," ",u("settings.super_agent.model_configure")]})]}),n.jsx(ce,{label:u("settings.super_agent.permission_mode"),children:n.jsx(ut,{value:N,onChange:y,options:Cb.map(S=>({value:S,label:S}))})}),n.jsx(ce,{label:u("settings.super_agent.personality"),children:n.jsx(un,{rows:2,value:_,onChange:S=>k(S.target.value)})}),n.jsx(ce,{label:u("settings.super_agent.system"),hint:u("settings.super_agent.system_hint"),children:n.jsx(un,{rows:6,className:"font-mono text-xs",value:g,onChange:S=>b(S.target.value),placeholder:u("settings.super_agent.system_ph")})}),n.jsx(ie,{variant:"primary",loading:w,onClick:j,children:u("common.save")})]})})}const Bh={providers:()=>re.get("/embeddings/providers"),test:(e={})=>re.post("/embeddings/test",e),reindex:()=>re.post("/embeddings/reindex",{})},jB=()=>[{value:"auto",label:u("memory_panel.provider_auto")},{value:"ollama",label:u("memory_panel.provider_ollama")},{value:"gemini",label:u("memory_panel.provider_gemini")},{value:"openai",label:u("memory_panel.provider_openai")},{value:"tf",label:u("memory_panel.provider_tf")}],kB=()=>[{value:"chain",label:u("memory_panel.mode_chain")},{value:"single",label:u("memory_panel.mode_single")}],gw=e=>e.startsWith("***");function wB(){const e=Ze(),{config:t,isLoading:a,patch:o}=dr(),{data:l,mutate:i}=He("/embeddings/providers",()=>Bh.providers()),[d,f]=x.useState(!1),[m,h]=x.useState(null);if(a)return n.jsx(rt,{});const g=t.memory||{},b=g.embeddings||{},_=l?.configured_provider||b.provider||"auto",k=l?.mode||b.mode||"chain",N=l?.engines||[],y=async j=>{f(!0);try{await o(j),await i()}catch(S){e.error(u("memory_panel.save_failed",{msg:S.message}))}finally{f(!1)}},w=async()=>{f(!0),h(null);try{const j=await Bh.test({});h(`${j.embedder} · dim ${j.dim} · ${j.ms}ms`),e.success(u("memory_panel.test_ok",{embedder:j.embedder}))}catch(j){e.error(u("memory_panel.test_failed",{msg:j.message}))}finally{f(!1)}},E=async()=>{f(!0);try{const j=await Bh.reindex();e.success(u("memory_panel.reindexed",{indexed:j.indexed,cleared:j.cleared}))}catch(j){e.error(u("memory_panel.reindex_failed",{msg:j.message}))}finally{f(!1)}};return n.jsxs("div",{className:"grid gap-6 xl:grid-cols-2 xl:items-start",children:[n.jsx(Ye,{title:u("memory_panel.embeddings_title"),description:u("memory_panel.embeddings_desc"),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("memory_panel.provider_label"),hint:u("memory_panel.provider_hint"),children:n.jsx(ut,{value:_,onChange:j=>y({"memory.embeddings.provider":j}),options:jB(),disabled:d,className:"max-w-xl"})}),n.jsx(ce,{label:u("memory_panel.mode_label"),hint:u("memory_panel.mode_hint"),children:n.jsx(ut,{value:k,onChange:j=>y({"memory.embeddings.mode":j}),options:kB(),disabled:d,className:"max-w-md"})}),n.jsx("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:N.map(j=>n.jsxs(Ve,{tone:j.available?"success":"muted",children:[j.id,": ",j.available?u("memory_panel.available"):u("memory_panel.unavailable")]},j.id))}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[n.jsxs(ie,{variant:"secondary",onClick:w,loading:d,children:[n.jsx(sa,{size:14})," ",u("memory_panel.test_btn")]}),n.jsxs(ie,{variant:"secondary",onClick:E,loading:d,children:[n.jsx(F2,{size:14})," ",u("memory_panel.reindex_btn")]}),m&&n.jsx("span",{className:"text-sm text-muted-foreground",children:m})]})]})}),n.jsxs(Ye,{title:u("memory_panel.ollama_title"),description:u("memory_panel.ollama_desc"),children:[n.jsx(ce,{label:u("memory_panel.model_label"),children:n.jsx(Te,{defaultValue:b.ollama?.model||"nomic-embed-text",placeholder:"nomic-embed-text",disabled:d,onBlur:j=>{const S=j.target.value.trim();S&&S!==b.ollama?.model&&y({"memory.embeddings.ollama.model":S})},className:"max-w-md"})}),n.jsx(ce,{label:u("memory_panel.base_url_label"),hint:u("memory_panel.ollama_base_url_hint"),children:n.jsx(Te,{defaultValue:b.ollama?.base_url||"",placeholder:"http://localhost:11434",disabled:d,onBlur:j=>y({"memory.embeddings.ollama.base_url":j.target.value.trim()}),className:"max-w-md"})})]}),n.jsxs(Ye,{title:u("memory_panel.openai_title"),description:u("memory_panel.openai_desc"),children:[n.jsx(ce,{label:u("memory_panel.model_label"),children:n.jsx(Te,{defaultValue:b.openai?.model||"text-embedding-3-small",placeholder:"text-embedding-3-small",disabled:d,onBlur:j=>{const S=j.target.value.trim();S&&S!==b.openai?.model&&y({"memory.embeddings.openai.model":S})},className:"max-w-md"})}),n.jsx(ce,{label:u("memory_panel.api_key_label"),hint:u("memory_panel.openai_key_hint"),children:n.jsx(Te,{type:"password",defaultValue:b.openai?.api_key||"",placeholder:"sk-…",disabled:d,onBlur:j=>{const S=j.target.value;S&&!gw(S)&&y({"memory.embeddings.openai.api_key":S})},className:"max-w-md"})})]}),n.jsxs(Ye,{title:u("memory_panel.gemini_title"),description:u("memory_panel.gemini_desc"),children:[n.jsx(ce,{label:u("memory_panel.model_label"),children:n.jsx(Te,{defaultValue:b.gemini?.model||"text-embedding-004",placeholder:"text-embedding-004",disabled:d,onBlur:j=>{const S=j.target.value.trim();S&&S!==b.gemini?.model&&y({"memory.embeddings.gemini.model":S})},className:"max-w-md"})}),n.jsx(ce,{label:u("memory_panel.api_key_label"),hint:u("memory_panel.gemini_key_hint"),children:n.jsx(Te,{type:"password",defaultValue:b.gemini?.api_key||"",placeholder:"AIza…",disabled:d,onBlur:j=>{const S=j.target.value;S&&!gw(S)&&y({"memory.embeddings.gemini.api_key":S})},className:"max-w-md"})})]}),n.jsxs(Ye,{title:u("memory_panel.compaction_title"),description:u("memory_panel.compaction_desc"),children:[n.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[n.jsx(ce,{label:u("memory_panel.threshold_label"),hint:u("memory_panel.threshold_hint"),children:n.jsx(Te,{type:"number",min:1,defaultValue:g.compact_threshold??60,placeholder:"60",disabled:d,onBlur:j=>{const S=parseInt(j.target.value,10);Number.isFinite(S)&&S>0&&S!==g.compact_threshold&&y({"memory.compact_threshold":S})},className:"max-w-[10rem]"})}),n.jsx(ce,{label:u("memory_panel.keep_recent_label"),hint:u("memory_panel.keep_recent_hint"),children:n.jsx(Te,{type:"number",min:1,defaultValue:g.keep_recent??40,placeholder:"40",disabled:d,onBlur:j=>{const S=parseInt(j.target.value,10);Number.isFinite(S)&&S>0&&S!==g.keep_recent&&y({"memory.keep_recent":S})},className:"max-w-[10rem]"})})]}),n.jsx(ce,{label:u("memory_panel.compact_model_label"),hint:u("memory_panel.compact_model_hint"),children:n.jsx(Te,{defaultValue:g.compact_model||"ollama:gemma4:31b-cloud",placeholder:"ollama:gemma4:31b-cloud",disabled:d,onBlur:j=>{const S=j.target.value.trim();S&&S!==g.compact_model&&y({"memory.compact_model":S})},className:"max-w-md"})}),n.jsx(ce,{label:u("memory_panel.compact_fallback_label"),hint:u("memory_panel.compact_fallback_hint"),children:n.jsx(Te,{defaultValue:g.compact_fallback_model||"",placeholder:u("memory_panel.compact_fallback_ph"),disabled:d,onBlur:j=>{const S=j.target.value.trim();S!==(g.compact_fallback_model||"")&&y({"memory.compact_fallback_model":S})},className:"max-w-md"})})]})]})}function SB(){return[{key:"load_threshold",label:u("settings_ui.knob_load_threshold"),hint:u("settings_ui.knob_load_threshold_hint"),step:.01,min:0,max:1},{key:"hint_threshold",label:u("settings_ui.knob_hint_threshold"),hint:u("settings_ui.knob_hint_threshold_hint"),step:.01,min:0,max:1},{key:"margin",label:u("settings_ui.knob_margin"),hint:u("settings_ui.knob_margin_hint"),step:.01,min:0,max:1},{key:"max_loaded",label:u("settings_ui.knob_max_loaded"),hint:u("settings_ui.knob_max_loaded_hint"),step:1,min:0,max:5},{key:"max_hints",label:u("settings_ui.knob_max_hints"),hint:u("settings_ui.knob_max_hints_hint"),step:1,min:0,max:8},{key:"prompt_floor",label:u("settings_ui.knob_prompt_floor"),hint:u("settings_ui.knob_prompt_floor_hint"),step:1,min:0,max:40},{key:"body_char_cap",label:u("settings_ui.knob_body_char_cap"),hint:u("settings_ui.knob_body_char_cap_hint"),step:500,min:500,max:2e4}]}function CB(){const e=Ze(),{data:t,mutate:a,isLoading:o}=He("/skills/inspector",()=>Us.inspector()),[l,i]=x.useState(!1),[d,f]=x.useState(""),[m,h]=x.useState(null);if(o||!t)return n.jsx(rt,{});const g=t.config,b=t.index,_=async y=>{i(!0);try{await Us.updateInspector(y),await a()}catch(w){e.error(u("settings_ui.could_not_save",{msg:w.message}))}finally{i(!1)}},k=async(y=!1)=>{i(!0);try{const w=await Us.index({force:y});e.success(u("settings_ui.indexed_with",{embedder:w.embedder,dim:w.dim,added:w.changed.added,refreshed:w.changed.refreshed,removed:w.changed.removed})),await a()}catch(w){e.error(u("settings_ui.index_failed",{msg:w.message}))}finally{i(!1)}},N=async()=>{if(d.trim()){i(!0),h(null);try{const y=await Us.inspect(d.trim());h(y.trace)}catch(y){e.error(u("settings_ui.dry_run_failed",{msg:y.message}))}finally{i(!1)}}};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid gap-6 lg:grid-cols-2 lg:items-start",children:[n.jsx(Ye,{title:u("settings_ui.inspector_title"),description:u("settings_ui.inspector_desc"),children:n.jsxs("div",{className:"space-y-4",children:[n.jsx(ce,{label:u("settings_ui.enable_inspector"),hint:u("settings_ui.enable_inspector_hint"),children:n.jsx(Bt,{checked:g.enabled,disabled:l,onChange:y=>_({enabled:y}),label:g.enabled?u("settings_ui.on"):u("settings_ui.off")})}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[n.jsx(Ve,{tone:b.count>0?"success":"warning",children:u("settings_ui.index_count",{n:b.count})}),n.jsx(Ve,{tone:"muted",children:b.embedder||u("settings_ui.not_indexed")}),b.dim?n.jsx(Ve,{tone:"muted",children:u("settings_ui.dim",{dim:b.dim})}):null,b.updated_at?n.jsx("span",{className:"text-xs text-muted-foreground",children:u("settings_ui.updated_at",{date:new Date(b.updated_at).toLocaleString()})}):null]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[n.jsxs(ie,{variant:"secondary",onClick:()=>k(!1),loading:l,children:[n.jsx(Ss,{size:14})," ",u("settings_ui.reindex")]}),n.jsxs(ie,{variant:"secondary",onClick:()=>k(!0),loading:l,children:[n.jsx(Ss,{size:14})," ",u("settings_ui.reindex_forced")]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("settings_ui.embedder_source")})]})]})}),n.jsx(Ye,{title:u("settings_ui.test_title"),description:u("settings_ui.test_desc"),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(Te,{value:d,placeholder:u("settings_ui.test_placeholder"),disabled:l,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&N()},className:"max-w-xl flex-1"}),n.jsxs(ie,{variant:"primary",onClick:N,loading:l,children:[n.jsx(RM,{size:14})," ",u("settings_ui.test_btn")]})]}),m&&n.jsxs("div",{className:"rounded-md border border-border/60 bg-muted/30 p-3 text-sm",children:[n.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[n.jsx(sa,{size:14,className:"text-muted-foreground"}),n.jsx("span",{className:"text-muted-foreground",children:m.embedder||"—"}),m.jit?n.jsx(Ve,{tone:"warning",children:u("settings_ui.jit_empty_index")}):null,m.reason&&!m.loaded?.length&&!m.hinted?.length?n.jsx(Ve,{tone:"muted",children:m.reason}):null]}),m.loaded?.length?n.jsxs("div",{className:"mb-1",children:[n.jsxs("span",{className:"text-muted-foreground",children:[u("settings_ui.loaded_label")," "]}),m.loaded.map(y=>n.jsx(Ve,{tone:"success",className:"mr-1",children:y},y))]}):null,m.hinted?.length?n.jsxs("div",{className:"mb-1",children:[n.jsxs("span",{className:"text-muted-foreground",children:[u("settings_ui.suggested_label")," "]}),m.hinted.map(y=>n.jsx(Ve,{tone:"info",className:"mr-1",children:y},y))]}):null,m.scored?.length?n.jsx("div",{className:"mt-2 space-y-0.5 font-mono text-xs text-muted-foreground",children:m.scored.map(y=>n.jsxs("div",{children:[y.sim.toFixed(3)," ",y.slug]},y.slug))}):null]})]})})]}),n.jsx(Ye,{title:u("settings_ui.thresholds_title"),description:u("settings_ui.thresholds_desc"),children:n.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:SB().map(y=>n.jsx(ce,{label:y.label,hint:y.hint,children:n.jsx(Te,{type:"number",step:y.step,min:y.min,max:y.max,defaultValue:String(g[y.key]),disabled:l,onBlur:w=>{const E=Number(w.target.value);Number.isFinite(E)&&E!==g[y.key]&&_({[y.key]:E})},className:"max-w-[12rem]"})},y.key))})})]})}function NB(){const[e,t]=Vo(),a=e.get("tab")==="rag"?"rag":"manager",o=l=>{const i=new URLSearchParams(e);i.set("tab",l),t(i,{replace:!0})};return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex items-center gap-1 border-b border-border",children:[n.jsx(hw,{active:a==="manager",onClick:()=>o("manager"),icon:sa,label:u("skills_page.manager_tab")}),n.jsx(hw,{active:a==="rag",onClick:()=>o("rag"),icon:kM,label:u("skills_page.rag_tab")})]}),a==="manager"?n.jsx(JE,{selectable:!0}):n.jsx(CB,{})]})}function hw({active:e,onClick:t,icon:a,label:o}){return n.jsxs("button",{type:"button",onClick:t,className:`-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition ${e?"border-foreground text-foreground":"border-transparent text-muted-fg hover:text-foreground"}`,children:[n.jsx(a,{size:15})," ",o]})}function EB(){const e=Ze(),{config:t,isLoading:a,patch:o,mutate:l}=dr(),i=t.telegram?.channels||[],d=Math.max(0,i.findIndex(A=>A.name==="default")),f=i[d],[m,h]=x.useState(!0),[g,b]=x.useState(1500),[_,k]=x.useState(!0),[N,y]=x.useState(""),[w,E]=x.useState(""),[j,S]=x.useState(!1);if(x.useEffect(()=>{h(!!t.telegram?.enabled),b(Number(t.telegram?.poll_interval_ms||1500)),k(!!t.telegram?.respond_with_engine),y(""),E(f?.chat_id||"")},[t,f?.chat_id]),a)return n.jsx(rt,{});const R=async()=>{S(!0);try{const A=i.slice(),T={name:"default",chat_id:w,respond_with_engine:_,...N?{bot_token:N}:{}};i.length===0?A.push(T):A[d]={...f,...T},await o({"telegram.enabled":m,"telegram.poll_interval_ms":g,"telegram.respond_with_engine":_,"telegram.channels":A}),e.success(u("settings.telegram_global.saved")),l(),y("")}catch(A){e.error(A.message)}finally{S(!1)}};return n.jsx(Ye,{title:u("settings.telegram_global.title"),description:u("settings.telegram_global.subtitle"),children:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Bt,{checked:m,onChange:h,label:u("settings.telegram_global.enabled")}),n.jsx(Bt,{checked:_,onChange:k,label:u("settings.telegram_global.respond_with_engine")})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("settings.telegram_global.bot_token"),hint:f?.bot_token?`…${Io(f.bot_token)??""} ${u("telegram_ui.secret_set_replace")}`:u("telegram_ui.bot_token_hint_short"),children:n.jsx(Te,{type:"password",value:N,onChange:A=>y(A.target.value),placeholder:f?.bot_token?`…${Io(f.bot_token)??""} ${u("telegram_ui.secret_already_set")}`:""})}),n.jsx(ce,{label:u("settings.telegram_global.chat_id"),children:n.jsx(Te,{value:w,onChange:A=>E(A.target.value),placeholder:"889721252"})}),n.jsx(ce,{label:u("settings.telegram_global.poll_interval"),children:n.jsx(Te,{type:"number",value:String(g),onChange:A=>b(Number(A.target.value)||1500)})})]}),n.jsx(ie,{variant:"primary",loading:j,onClick:R,children:u("common.save")})]})})}function RB(){const e=Ze(),{channels:t,isLoading:a,mutate:o}=P_(),{contacts:l}=L_(),[i,d]=x.useState(null),[f,m]=x.useState(null),h=new Map;for(const b of l)h.set(String(b.user_id),b.name||`@${b.username||b.user_id}`);const g=async b=>{if(confirm(u("telegram_channels.delete_confirm",{name:b})))try{await Dn.channels.remove(b),e.success(u("telegram_channels.removed")),o()}catch(_){e.error(_.message)}};return n.jsxs(Ye,{title:u("telegram_channels.title"),description:u("telegram_channels.desc"),action:n.jsxs(ie,{size:"sm",onClick:()=>d({name:""}),children:[n.jsx(Pt,{size:14})," ",u("telegram_channels.new_btn")]}),children:[a&&n.jsx(rt,{}),!a&&t.length===0&&n.jsx(pt,{children:u("telegram_channels.empty")}),n.jsx("ul",{className:"space-y-2 text-sm",children:t.map(b=>{const _=b.owner_user_id!=null?h.get(String(b.owner_user_id))||u("telegram_ui.user_id_fallback",{id:b.owner_user_id}):u("telegram_channels.no_owner");return n.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-medium",children:b.name}),n.jsxs("div",{className:"flex items-center gap-2",children:[b.project&&n.jsxs(Ve,{tone:"success",children:["project = ",b.project]}),n.jsxs(ie,{size:"sm",variant:"ghost",onClick:()=>m(b),children:[n.jsx(ja,{size:13})," ",u("admin.telegram_send_test")]}),n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>d(b),children:u("common.edit")}),n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>g(b.name),children:u("common.delete")})]})]}),n.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2 text-xs text-muted-fg",children:[n.jsxs("span",{children:["chat_id: ",b.chat_id||"—"]}),n.jsxs("span",{children:["bot_token: ",b.bot_token?`…${Io(b.bot_token)??""}`:"—"]}),n.jsxs("span",{children:["route_to_agent: ",b.route_to_agent||u("telegram_ui.default_apx")]}),n.jsxs("span",{children:["engine: ",b.respond_with_engine?u("telegram_ui.yes"):u("telegram_ui.no")]}),n.jsxs("span",{className:"col-span-2",children:[u("telegram_channels.owner_label")," ",_]})]})]},b.name)})}),n.jsx(LN,{channel:i,onClose:()=>d(null),onSaved:()=>{d(null),o()}}),n.jsx(IN,{channel:f,onClose:()=>m(null)})]})}const xw=new Set(["owner","guest"]);function TB(){const e=Ze(),{roles:t,mutate:a,isLoading:o}=L_(),[l,i]=x.useState(""),[d,f]=x.useState(""),[m,h]=x.useState(!1),[g,b]=x.useState(!1),_=async()=>{const y=l.trim();if(!y){e.error(u("telegram_roles.name_required"));return}if(xw.has(y)){e.error(u("telegram_roles.builtin_error",{name:y}));return}b(!0);try{const w=m?"*":d.split(",").map(E=>E.trim()).filter(Boolean);await Dn.roles.set(y,w),e.success(u("telegram_roles.saved",{name:y})),i(""),f(""),h(!1),a()}catch(w){e.error(w.message)}finally{b(!1)}},k=async y=>{if(confirm(u("telegram_roles.delete_confirm",{name:y})))try{await Dn.roles.remove(y),e.success(u("telegram_roles.removed")),a()}catch(w){e.error(w.message)}},N=Object.entries(t);return n.jsxs(Ye,{title:u("telegram_roles.title"),description:u("telegram_roles.desc"),children:[o&&n.jsx(rt,{}),N.length===0&&!o&&n.jsx(pt,{children:u("telegram_roles.empty")}),N.length>0&&n.jsx("ul",{className:"space-y-2 text-sm",children:N.map(([y,w])=>{const E=xw.has(y),j=w?.tools==="*"?u("telegram_roles.tools_all"):Array.isArray(w?.tools)&&w.tools.length>0?w.tools.join(", "):u("telegram_roles.tools_none");return n.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"font-medium",children:y}),E&&n.jsx(Ve,{tone:"info",children:u("telegram_roles.builtin")})]}),!E&&n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>k(y),children:u("telegram_roles.delete_btn")})]}),n.jsxs("div",{className:"mt-1 text-xs text-muted-fg",children:[u("telegram_contacts.tools_label")," ",j]})]},y)})}),n.jsxs("div",{className:"mt-4 space-y-3 rounded-md border border-dashed border-border p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[n.jsx(Pt,{size:14})," ",u("telegram_roles.new_title")]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ce,{label:u("telegram_roles.name_label"),children:n.jsx(Te,{value:l,onChange:y=>i(y.target.value),placeholder:u("telegram_roles.name_ph")})}),n.jsx(ce,{label:u("telegram_roles.tools_label"),hint:u("telegram_roles.tools_hint"),children:n.jsx(Te,{value:d,onChange:y=>f(y.target.value),disabled:m,placeholder:u("telegram_roles.tools_ph")})})]}),n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx(Bt,{checked:m,onChange:h,label:u("telegram_roles.full_access")}),n.jsx(ie,{variant:"primary",loading:g,onClick:_,children:u("telegram_roles.save_btn")})]})]})]})}const eR="apx.settings.telegramTab";function AB(){if(typeof window>"u")return"default";const e=window.localStorage.getItem(eR);return e==="channels"||e==="contacts"||e==="roles"||e==="default"?e:"default"}function MB(){const[e,t]=x.useState("default");x.useEffect(()=>{t(AB())},[]);const a=o=>{const l=o==="channels"||o==="contacts"||o==="roles"||o==="default"?o:"default";t(l);try{window.localStorage.setItem(eR,l)}catch{}};return n.jsxs(zp,{value:e,onValueChange:a,className:"w-full",children:[n.jsxs(Dp,{children:[n.jsx(Hs,{value:"default",children:u("settings.telegram_global.title")}),n.jsx(Hs,{value:"channels",children:u("telegram_channels.title")}),n.jsx(Hs,{value:"contacts",children:u("telegram_contacts.title")}),n.jsx(Hs,{value:"roles",children:u("telegram_roles.title")})]}),n.jsx(fs,{value:"default",className:"mt-4",children:n.jsx(EB,{})}),n.jsx(fs,{value:"channels",className:"mt-4",children:n.jsx(RB,{})}),n.jsx(fs,{value:"contacts",className:"mt-4",children:n.jsx(BN,{})}),n.jsx(fs,{value:"roles",className:"mt-4",children:n.jsx(TB,{})})]})}function OB(){const{data:e,error:t,isLoading:a,mutate:o}=He("/pair/list",()=>ci.list(),{refreshInterval:tp.pairList});return{clients:e?.clients||[],error:t,isLoading:a,mutate:o}}var Bl={},$h,bw;function zB(){return bw||(bw=1,$h=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),$h}var Uh={},Ir={},_w;function Xo(){if(_w)return Ir;_w=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Ir.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},Ir.getSymbolTotalCodewords=function(o){return t[o]},Ir.getBCHDigit=function(a){let o=0;for(;a!==0;)o++,a>>>=1;return o},Ir.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},Ir.isKanjiModeEnabled=function(){return typeof e<"u"},Ir.toSJIS=function(o){return e(o)},Ir}var Hh={},vw;function sv(){return vw||(vw=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+a)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,l){if(e.isValid(o))return o;try{return t(o)}catch{return l}}})(Hh)),Hh}var qh,yw;function DB(){if(yw)return qh;yw=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const a=Math.floor(t/8);return(this.buffer[a]>>>7-t%8&1)===1},put:function(t,a){for(let o=0;o<a;o++)this.putBit((t>>>a-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),t&&(this.buffer[a]|=128>>>this.length%8),this.length++}},qh=e,qh}var Vh,jw;function PB(){if(jw)return Vh;jw=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,a,o,l){const i=t*this.size+a;this.data[i]=o,l&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,a){return this.data[t*this.size+a]},e.prototype.xor=function(t,a,o){this.data[t*this.size+a]^=o},e.prototype.isReserved=function(t,a){return this.reservedBit[t*this.size+a]},Vh=e,Vh}var Fh={},kw;function LB(){return kw||(kw=1,(function(e){const t=Xo().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const l=Math.floor(o/7)+2,i=t(o),d=i===145?26:Math.ceil((i-13)/(2*l-2))*2,f=[i-7];for(let m=1;m<l-1;m++)f[m]=f[m-1]-d;return f.push(6),f.reverse()},e.getPositions=function(o){const l=[],i=e.getRowColCoords(o),d=i.length;for(let f=0;f<d;f++)for(let m=0;m<d;m++)f===0&&m===0||f===0&&m===d-1||f===d-1&&m===0||l.push([i[f],i[m]]);return l}})(Fh)),Fh}var Gh={},ww;function IB(){if(ww)return Gh;ww=1;const e=Xo().getSymbolSize,t=7;return Gh.getPositions=function(o){const l=e(o);return[[0,0],[l-t,0],[0,l-t]]},Gh}var Yh={},Sw;function BB(){return Sw||(Sw=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(l){return l!=null&&l!==""&&!isNaN(l)&&l>=0&&l<=7},e.from=function(l){return e.isValid(l)?parseInt(l,10):void 0},e.getPenaltyN1=function(l){const i=l.size;let d=0,f=0,m=0,h=null,g=null;for(let b=0;b<i;b++){f=m=0,h=g=null;for(let _=0;_<i;_++){let k=l.get(b,_);k===h?f++:(f>=5&&(d+=t.N1+(f-5)),h=k,f=1),k=l.get(_,b),k===g?m++:(m>=5&&(d+=t.N1+(m-5)),g=k,m=1)}f>=5&&(d+=t.N1+(f-5)),m>=5&&(d+=t.N1+(m-5))}return d},e.getPenaltyN2=function(l){const i=l.size;let d=0;for(let f=0;f<i-1;f++)for(let m=0;m<i-1;m++){const h=l.get(f,m)+l.get(f,m+1)+l.get(f+1,m)+l.get(f+1,m+1);(h===4||h===0)&&d++}return d*t.N2},e.getPenaltyN3=function(l){const i=l.size;let d=0,f=0,m=0;for(let h=0;h<i;h++){f=m=0;for(let g=0;g<i;g++)f=f<<1&2047|l.get(h,g),g>=10&&(f===1488||f===93)&&d++,m=m<<1&2047|l.get(g,h),g>=10&&(m===1488||m===93)&&d++}return d*t.N3},e.getPenaltyN4=function(l){let i=0;const d=l.data.length;for(let m=0;m<d;m++)i+=l.data[m];return Math.abs(Math.ceil(i*100/d/5)-10)*t.N4};function a(o,l,i){switch(o){case e.Patterns.PATTERN000:return(l+i)%2===0;case e.Patterns.PATTERN001:return l%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(l+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(l/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return l*i%2+l*i%3===0;case e.Patterns.PATTERN110:return(l*i%2+l*i%3)%2===0;case e.Patterns.PATTERN111:return(l*i%3+(l+i)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(l,i){const d=i.size;for(let f=0;f<d;f++)for(let m=0;m<d;m++)i.isReserved(m,f)||i.xor(m,f,a(l,m,f))},e.getBestMask=function(l,i){const d=Object.keys(e.Patterns).length;let f=0,m=1/0;for(let h=0;h<d;h++){i(h),e.applyMask(h,l);const g=e.getPenaltyN1(l)+e.getPenaltyN2(l)+e.getPenaltyN3(l)+e.getPenaltyN4(l);e.applyMask(h,l),g<m&&(m=g,f=h)}return f}})(Yh)),Yh}var Zd={},Cw;function tR(){if(Cw)return Zd;Cw=1;const e=sv(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Zd.getBlocksCount=function(l,i){switch(i){case e.L:return t[(l-1)*4+0];case e.M:return t[(l-1)*4+1];case e.Q:return t[(l-1)*4+2];case e.H:return t[(l-1)*4+3];default:return}},Zd.getTotalCodewordsCount=function(l,i){switch(i){case e.L:return a[(l-1)*4+0];case e.M:return a[(l-1)*4+1];case e.Q:return a[(l-1)*4+2];case e.H:return a[(l-1)*4+3];default:return}},Zd}var Kh={},jc={},Nw;function $B(){if(Nw)return jc;Nw=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let o=1;for(let l=0;l<255;l++)e[l]=o,t[o]=l,o<<=1,o&256&&(o^=285);for(let l=255;l<512;l++)e[l]=e[l-255]})(),jc.log=function(o){if(o<1)throw new Error("log("+o+")");return t[o]},jc.exp=function(o){return e[o]},jc.mul=function(o,l){return o===0||l===0?0:e[t[o]+t[l]]},jc}var Ew;function UB(){return Ew||(Ew=1,(function(e){const t=$B();e.mul=function(o,l){const i=new Uint8Array(o.length+l.length-1);for(let d=0;d<o.length;d++)for(let f=0;f<l.length;f++)i[d+f]^=t.mul(o[d],l[f]);return i},e.mod=function(o,l){let i=new Uint8Array(o);for(;i.length-l.length>=0;){const d=i[0];for(let m=0;m<l.length;m++)i[m]^=t.mul(l[m],d);let f=0;for(;f<i.length&&i[f]===0;)f++;i=i.slice(f)}return i},e.generateECPolynomial=function(o){let l=new Uint8Array([1]);for(let i=0;i<o;i++)l=e.mul(l,new Uint8Array([1,t.exp(i)]));return l}})(Kh)),Kh}var Xh,Rw;function HB(){if(Rw)return Xh;Rw=1;const e=UB();function t(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(o){this.degree=o,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const l=new Uint8Array(o.length+this.degree);l.set(o);const i=e.mod(l,this.genPoly),d=this.degree-i.length;if(d>0){const f=new Uint8Array(this.degree);return f.set(i,d),f}return i},Xh=t,Xh}var Qh={},Wh={},Zh={},Tw;function nR(){return Tw||(Tw=1,Zh.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Zh}var da={},Aw;function sR(){if(Aw)return da;Aw=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
|
|
807
|
-
]))+`;da.KANJI=new RegExp(a,"g"),da.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),da.BYTE=new RegExp(o,"g"),da.NUMERIC=new RegExp(e,"g"),da.ALPHANUMERIC=new RegExp(t,"g");const l=new RegExp("^"+a+"$"),i=new RegExp("^"+e+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return da.testKanji=function(m){return l.test(m)},da.testNumeric=function(m){return i.test(m)},da.testAlphanumeric=function(m){return d.test(m)},da}var Mw;function Qo(){return Mw||(Mw=1,(function(e){const t=nR(),a=sR();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,d){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?i.ccBits[0]:d<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return a.testNumeric(i)?e.NUMERIC:a.testAlphanumeric(i)?e.ALPHANUMERIC:a.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function o(l){if(typeof l!="string")throw new Error("Param is not a string");switch(l.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+l)}}e.from=function(i,d){if(e.isValid(i))return i;try{return o(i)}catch{return d}}})(Wh)),Wh}var Ow;function qB(){return Ow||(Ow=1,(function(e){const t=Xo(),a=tR(),o=sv(),l=Qo(),i=nR(),d=7973,f=t.getBCHDigit(d);function m(_,k,N){for(let y=1;y<=40;y++)if(k<=e.getCapacity(y,N,_))return y}function h(_,k){return l.getCharCountIndicator(_,k)+4}function g(_,k){let N=0;return _.forEach(function(y){const w=h(y.mode,k);N+=w+y.getBitsLength()}),N}function b(_,k){for(let N=1;N<=40;N++)if(g(_,N)<=e.getCapacity(N,k,l.MIXED))return N}e.from=function(k,N){return i.isValid(k)?parseInt(k,10):N},e.getCapacity=function(k,N,y){if(!i.isValid(k))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=l.BYTE);const w=t.getSymbolTotalCodewords(k),E=a.getTotalCodewordsCount(k,N),j=(w-E)*8;if(y===l.MIXED)return j;const S=j-h(y,k);switch(y){case l.NUMERIC:return Math.floor(S/10*3);case l.ALPHANUMERIC:return Math.floor(S/11*2);case l.KANJI:return Math.floor(S/13);case l.BYTE:default:return Math.floor(S/8)}},e.getBestVersionForData=function(k,N){let y;const w=o.from(N,o.M);if(Array.isArray(k)){if(k.length>1)return b(k,w);if(k.length===0)return 1;y=k[0]}else y=k;return m(y.mode,y.getLength(),w)},e.getEncodedBits=function(k){if(!i.isValid(k)||k<7)throw new Error("Invalid QR Code version");let N=k<<12;for(;t.getBCHDigit(N)-f>=0;)N^=d<<t.getBCHDigit(N)-f;return k<<12|N}})(Qh)),Qh}var Jh={},zw;function VB(){if(zw)return Jh;zw=1;const e=Xo(),t=1335,a=21522,o=e.getBCHDigit(t);return Jh.getEncodedBits=function(i,d){const f=i.bit<<3|d;let m=f<<10;for(;e.getBCHDigit(m)-o>=0;)m^=t<<e.getBCHDigit(m)-o;return(f<<10|m)^a},Jh}var ex={},tx,Dw;function FB(){if(Dw)return tx;Dw=1;const e=Qo();function t(a){this.mode=e.NUMERIC,this.data=a.toString()}return t.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){let l,i,d;for(l=0;l+3<=this.data.length;l+=3)i=this.data.substr(l,3),d=parseInt(i,10),o.put(d,10);const f=this.data.length-l;f>0&&(i=this.data.substr(l),d=parseInt(i,10),o.put(d,f*3+1))},tx=t,tx}var nx,Pw;function GB(){if(Pw)return nx;Pw=1;const e=Qo(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(o){this.mode=e.ALPHANUMERIC,this.data=o}return a.getBitsLength=function(l){return 11*Math.floor(l/2)+6*(l%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(l){let i;for(i=0;i+2<=this.data.length;i+=2){let d=t.indexOf(this.data[i])*45;d+=t.indexOf(this.data[i+1]),l.put(d,11)}this.data.length%2&&l.put(t.indexOf(this.data[i]),6)},nx=a,nx}var sx,Lw;function YB(){if(Lw)return sx;Lw=1;const e=Qo();function t(a){this.mode=e.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return t.getBitsLength=function(o){return o*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(a){for(let o=0,l=this.data.length;o<l;o++)a.put(this.data[o],8)},sx=t,sx}var ax,Iw;function KB(){if(Iw)return ax;Iw=1;const e=Qo(),t=Xo();function a(o){this.mode=e.KANJI,this.data=o}return a.getBitsLength=function(l){return l*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(o){let l;for(l=0;l<this.data.length;l++){let i=t.toSJIS(this.data[l]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[l]+`
|
|
808
|
-
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),o.put(i,13)}},ax=a,ax}var rx={exports:{}},Bw;function XB(){return Bw||(Bw=1,(function(e){var t={single_source_shortest_paths:function(a,o,l){var i={},d={};d[o]=0;var f=t.PriorityQueue.make();f.push(o,0);for(var m,h,g,b,_,k,N,y,w;!f.empty();){m=f.pop(),h=m.value,b=m.cost,_=a[h]||{};for(g in _)_.hasOwnProperty(g)&&(k=_[g],N=b+k,y=d[g],w=typeof d[g]>"u",(w||y>N)&&(d[g]=N,f.push(g,N),i[g]=h))}if(typeof l<"u"&&typeof d[l]>"u"){var E=["Could not find a path from ",o," to ",l,"."].join("");throw new Error(E)}return i},extract_shortest_path_from_predecessor_list:function(a,o){for(var l=[],i=o;i;)l.push(i),a[i],i=a[i];return l.reverse(),l},find_path:function(a,o,l){var i=t.single_source_shortest_paths(a,o,l);return t.extract_shortest_path_from_predecessor_list(i,l)},PriorityQueue:{make:function(a){var o=t.PriorityQueue,l={},i;a=a||{};for(i in o)o.hasOwnProperty(i)&&(l[i]=o[i]);return l.queue=[],l.sorter=a.sorter||o.default_sorter,l},default_sorter:function(a,o){return a.cost-o.cost},push:function(a,o){var l={value:a,cost:o};this.queue.push(l),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(rx)),rx.exports}var $w;function QB(){return $w||($w=1,(function(e){const t=Qo(),a=FB(),o=GB(),l=YB(),i=KB(),d=sR(),f=Xo(),m=XB();function h(E){return unescape(encodeURIComponent(E)).length}function g(E,j,S){const R=[];let A;for(;(A=E.exec(S))!==null;)R.push({data:A[0],index:A.index,mode:j,length:A[0].length});return R}function b(E){const j=g(d.NUMERIC,t.NUMERIC,E),S=g(d.ALPHANUMERIC,t.ALPHANUMERIC,E);let R,A;return f.isKanjiModeEnabled()?(R=g(d.BYTE,t.BYTE,E),A=g(d.KANJI,t.KANJI,E)):(R=g(d.BYTE_KANJI,t.BYTE,E),A=[]),j.concat(S,R,A).sort(function(O,M){return O.index-M.index}).map(function(O){return{data:O.data,mode:O.mode,length:O.length}})}function _(E,j){switch(j){case t.NUMERIC:return a.getBitsLength(E);case t.ALPHANUMERIC:return o.getBitsLength(E);case t.KANJI:return i.getBitsLength(E);case t.BYTE:return l.getBitsLength(E)}}function k(E){return E.reduce(function(j,S){const R=j.length-1>=0?j[j.length-1]:null;return R&&R.mode===S.mode?(j[j.length-1].data+=S.data,j):(j.push(S),j)},[])}function N(E){const j=[];for(let S=0;S<E.length;S++){const R=E[S];switch(R.mode){case t.NUMERIC:j.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:j.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:j.push([R,{data:R.data,mode:t.BYTE,length:h(R.data)}]);break;case t.BYTE:j.push([{data:R.data,mode:t.BYTE,length:h(R.data)}])}}return j}function y(E,j){const S={},R={start:{}};let A=["start"];for(let T=0;T<E.length;T++){const O=E[T],M=[];for(let B=0;B<O.length;B++){const P=O[B],$=""+T+B;M.push($),S[$]={node:P,lastCount:0},R[$]={};for(let D=0;D<A.length;D++){const L=A[D];S[L]&&S[L].node.mode===P.mode?(R[L][$]=_(S[L].lastCount+P.length,P.mode)-_(S[L].lastCount,P.mode),S[L].lastCount+=P.length):(S[L]&&(S[L].lastCount=P.length),R[L][$]=_(P.length,P.mode)+4+t.getCharCountIndicator(P.mode,j))}}A=M}for(let T=0;T<A.length;T++)R[A[T]].end=0;return{map:R,table:S}}function w(E,j){let S;const R=t.getBestModeForData(E);if(S=t.from(j,R),S!==t.BYTE&&S.bit<R.bit)throw new Error('"'+E+'" cannot be encoded with mode '+t.toString(S)+`.
|
|
809
|
-
Suggested mode is: `+t.toString(R));switch(S===t.KANJI&&!f.isKanjiModeEnabled()&&(S=t.BYTE),S){case t.NUMERIC:return new a(E);case t.ALPHANUMERIC:return new o(E);case t.KANJI:return new i(E);case t.BYTE:return new l(E)}}e.fromArray=function(j){return j.reduce(function(S,R){return typeof R=="string"?S.push(w(R,null)):R.data&&S.push(w(R.data,R.mode)),S},[])},e.fromString=function(j,S){const R=b(j,f.isKanjiModeEnabled()),A=N(R),T=y(A,S),O=m.find_path(T.map,"start","end"),M=[];for(let B=1;B<O.length-1;B++)M.push(T.table[O[B]].node);return e.fromArray(k(M))},e.rawSplit=function(j){return e.fromArray(b(j,f.isKanjiModeEnabled()))}})(ex)),ex}var Uw;function WB(){if(Uw)return Uh;Uw=1;const e=Xo(),t=sv(),a=DB(),o=PB(),l=LB(),i=IB(),d=BB(),f=tR(),m=HB(),h=qB(),g=VB(),b=Qo(),_=QB();function k(T,O){const M=T.size,B=i.getPositions(O);for(let P=0;P<B.length;P++){const $=B[P][0],D=B[P][1];for(let L=-1;L<=7;L++)if(!($+L<=-1||M<=$+L))for(let H=-1;H<=7;H++)D+H<=-1||M<=D+H||(L>=0&&L<=6&&(H===0||H===6)||H>=0&&H<=6&&(L===0||L===6)||L>=2&&L<=4&&H>=2&&H<=4?T.set($+L,D+H,!0,!0):T.set($+L,D+H,!1,!0))}}function N(T){const O=T.size;for(let M=8;M<O-8;M++){const B=M%2===0;T.set(M,6,B,!0),T.set(6,M,B,!0)}}function y(T,O){const M=l.getPositions(O);for(let B=0;B<M.length;B++){const P=M[B][0],$=M[B][1];for(let D=-2;D<=2;D++)for(let L=-2;L<=2;L++)D===-2||D===2||L===-2||L===2||D===0&&L===0?T.set(P+D,$+L,!0,!0):T.set(P+D,$+L,!1,!0)}}function w(T,O){const M=T.size,B=h.getEncodedBits(O);let P,$,D;for(let L=0;L<18;L++)P=Math.floor(L/3),$=L%3+M-8-3,D=(B>>L&1)===1,T.set(P,$,D,!0),T.set($,P,D,!0)}function E(T,O,M){const B=T.size,P=g.getEncodedBits(O,M);let $,D;for($=0;$<15;$++)D=(P>>$&1)===1,$<6?T.set($,8,D,!0):$<8?T.set($+1,8,D,!0):T.set(B-15+$,8,D,!0),$<8?T.set(8,B-$-1,D,!0):$<9?T.set(8,15-$-1+1,D,!0):T.set(8,15-$-1,D,!0);T.set(B-8,8,1,!0)}function j(T,O){const M=T.size;let B=-1,P=M-1,$=7,D=0;for(let L=M-1;L>0;L-=2)for(L===6&&L--;;){for(let H=0;H<2;H++)if(!T.isReserved(P,L-H)){let V=!1;D<O.length&&(V=(O[D]>>>$&1)===1),T.set(P,L-H,V),$--,$===-1&&(D++,$=7)}if(P+=B,P<0||M<=P){P-=B,B=-B;break}}}function S(T,O,M){const B=new a;M.forEach(function(H){B.put(H.mode.bit,4),B.put(H.getLength(),b.getCharCountIndicator(H.mode,T)),H.write(B)});const P=e.getSymbolTotalCodewords(T),$=f.getTotalCodewordsCount(T,O),D=(P-$)*8;for(B.getLengthInBits()+4<=D&&B.put(0,4);B.getLengthInBits()%8!==0;)B.putBit(0);const L=(D-B.getLengthInBits())/8;for(let H=0;H<L;H++)B.put(H%2?17:236,8);return R(B,T,O)}function R(T,O,M){const B=e.getSymbolTotalCodewords(O),P=f.getTotalCodewordsCount(O,M),$=B-P,D=f.getBlocksCount(O,M),L=B%D,H=D-L,V=Math.floor(B/D),U=Math.floor($/D),F=U+1,X=V-U,G=new m(X);let Y=0;const I=new Array(D),Q=new Array(D);let J=0;const K=new Uint8Array(T.buffer);for(let ne=0;ne<D;ne++){const ve=ne<H?U:F;I[ne]=K.slice(Y,Y+ve),Q[ne]=G.encode(I[ne]),Y+=ve,J=Math.max(J,ve)}const se=new Uint8Array(B);let te=0,le,W;for(le=0;le<J;le++)for(W=0;W<D;W++)le<I[W].length&&(se[te++]=I[W][le]);for(le=0;le<X;le++)for(W=0;W<D;W++)se[te++]=Q[W][le];return se}function A(T,O,M,B){let P;if(Array.isArray(T))P=_.fromArray(T);else if(typeof T=="string"){let V=O;if(!V){const U=_.rawSplit(T);V=h.getBestVersionForData(U,M)}P=_.fromString(T,V||40)}else throw new Error("Invalid data");const $=h.getBestVersionForData(P,M);if(!$)throw new Error("The amount of data is too big to be stored in a QR Code");if(!O)O=$;else if(O<$)throw new Error(`
|
|
810
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
811
|
-
Minimum version required to store current data is: `+$+`.
|
|
812
|
-
`);const D=S(O,M,P),L=e.getSymbolSize(O),H=new o(L);return k(H,O),N(H),y(H,O),E(H,M,0),O>=7&&w(H,O),j(H,D),isNaN(B)&&(B=d.getBestMask(H,E.bind(null,H,M))),d.applyMask(B,H),E(H,M,B),{modules:H,version:O,errorCorrectionLevel:M,maskPattern:B,segments:P}}return Uh.create=function(O,M){if(typeof O>"u"||O==="")throw new Error("No input text");let B=t.M,P,$;return typeof M<"u"&&(B=t.from(M.errorCorrectionLevel,t.M),P=h.from(M.version),$=d.from(M.maskPattern),M.toSJISFunc&&e.setToSJISFunction(M.toSJISFunc)),A(O,P,B,$)},Uh}var ox={},lx={},Hw;function aR(){return Hw||(Hw=1,(function(e){function t(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let o=a.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+a);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const l=parseInt(o.join(""),16);return{r:l>>24&255,g:l>>16&255,b:l>>8&255,a:l&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const l=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,d=o.scale||4;return{width:i,scale:i?4:d,margin:l,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,l){return l.width&&l.width>=o+l.margin*2?l.width/(o+l.margin*2):l.scale},e.getImageWidth=function(o,l){const i=e.getScale(o,l);return Math.floor((o+l.margin*2)*i)},e.qrToImageData=function(o,l,i){const d=l.modules.size,f=l.modules.data,m=e.getScale(d,i),h=Math.floor((d+i.margin*2)*m),g=i.margin*m,b=[i.color.light,i.color.dark];for(let _=0;_<h;_++)for(let k=0;k<h;k++){let N=(_*h+k)*4,y=i.color.light;if(_>=g&&k>=g&&_<h-g&&k<h-g){const w=Math.floor((_-g)/m),E=Math.floor((k-g)/m);y=b[f[w*d+E]?1:0]}o[N++]=y.r,o[N++]=y.g,o[N++]=y.b,o[N]=y.a}}})(lx)),lx}var qw;function ZB(){return qw||(qw=1,(function(e){const t=aR();function a(l,i,d){l.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=d,i.width=d,i.style.height=d+"px",i.style.width=d+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,d,f){let m=f,h=d;typeof m>"u"&&(!d||!d.getContext)&&(m=d,d=void 0),d||(h=o()),m=t.getOptions(m);const g=t.getImageWidth(i.modules.size,m),b=h.getContext("2d"),_=b.createImageData(g,g);return t.qrToImageData(_.data,i,m),a(b,h,g),b.putImageData(_,0,0),h},e.renderToDataURL=function(i,d,f){let m=f;typeof m>"u"&&(!d||!d.getContext)&&(m=d,d=void 0),m||(m={});const h=e.render(i,d,m),g=m.type||"image/png",b=m.rendererOpts||{};return h.toDataURL(g,b.quality)}})(ox)),ox}var ix={},Vw;function JB(){if(Vw)return ix;Vw=1;const e=aR();function t(l,i){const d=l.a/255,f=i+'="'+l.hex+'"';return d<1?f+" "+i+'-opacity="'+d.toFixed(2).slice(1)+'"':f}function a(l,i,d){let f=l+i;return typeof d<"u"&&(f+=" "+d),f}function o(l,i,d){let f="",m=0,h=!1,g=0;for(let b=0;b<l.length;b++){const _=Math.floor(b%i),k=Math.floor(b/i);!_&&!h&&(h=!0),l[b]?(g++,b>0&&_>0&&l[b-1]||(f+=h?a("M",_+d,.5+k+d):a("m",m,0),m=0,h=!1),_+1<i&&l[b+1]||(f+=a("h",g),g=0)):m++}return f}return ix.render=function(i,d,f){const m=e.getOptions(d),h=i.modules.size,g=i.modules.data,b=h+m.margin*2,_=m.color.light.a?"<path "+t(m.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",k="<path "+t(m.color.dark,"stroke")+' d="'+o(g,h,m.margin)+'"/>',N='viewBox="0 0 '+b+" "+b+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(m.width?'width="'+m.width+'" height="'+m.width+'" ':"")+N+' shape-rendering="crispEdges">'+_+k+`</svg>
|
|
813
|
-
`;return typeof f=="function"&&f(null,w),w},ix}var Fw;function e$(){if(Fw)return Bl;Fw=1;const e=zB(),t=WB(),a=ZB(),o=JB();function l(i,d,f,m,h){const g=[].slice.call(arguments,1),b=g.length,_=typeof g[b-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(b<2)throw new Error("Too few arguments provided");b===2?(h=f,f=d,d=m=void 0):b===3&&(d.getContext&&typeof h>"u"?(h=m,m=void 0):(h=m,m=f,f=d,d=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(f=d,d=m=void 0):b===2&&!d.getContext&&(m=f,f=d,d=void 0),new Promise(function(k,N){try{const y=t.create(f,m);k(i(y,d,m))}catch(y){N(y)}})}try{const k=t.create(f,m);h(null,i(k,d,m))}catch(k){h(k)}}return Bl.create=t.create,Bl.toCanvas=l.bind(null,a.render),Bl.toDataURL=l.bind(null,a.renderToDataURL),Bl.toString=l.bind(null,function(i,d,f){return o.render(i,f)}),Bl}var t$=e$();const n$=sb(t$);function s$({value:e,size:t=200}){const[a,o]=x.useState(null);return x.useEffect(()=>{let l=!0;return n$.toDataURL(e,{margin:2,width:t*2,errorCorrectionLevel:"M"}).then(i=>{l&&o(i)}).catch(()=>{l&&o(null)}),()=>{l=!1}},[e,t]),n.jsx("div",{className:"grid place-items-center rounded-lg bg-white p-3",style:{width:t+24,height:t+24},children:a?n.jsx("img",{src:a,width:t,height:t,alt:"QR"}):n.jsx("div",{className:"size-full animate-pulse rounded bg-muted"})})}function a$(e){return e.find(t=>!t.includes("127.0.0.1")&&!t.includes("localhost"))||e[0]||window.location.origin}function r$({open:e,onClose:t,onPaired:a}){const o=Ze(),[l,i]=x.useState(null),[d,f]=x.useState(null),[m,h]=x.useState(0),[g,b]=x.useState(!1),_=x.useRef(null),k=x.useCallback(async()=>{i(null),f(null),b(!1);try{const j=await ci.init();i(j),h(Math.round((j.ttl_ms||9e4)/1e3))}catch(j){j instanceof cu&&j.status===403?f(u("settings.devices_pair_localhost_only")):f(j.message)}},[]);x.useEffect(()=>{e?k():(i(null),f(null),b(!1))},[e,k]),x.useEffect(()=>{if(!l||g||m<=0)return;const j=window.setTimeout(()=>h(S=>S-1),1e3);return()=>window.clearTimeout(j)},[l,m,g]),x.useEffect(()=>{if(!e||!l||g)return;let j=!0;const S=async()=>{try{const R=await ci.status(l.pairing_id);if(!j)return;if(R.status==="confirmed"){b(!0),o.success(u("settings.devices_pair_done")),a(),window.setTimeout(()=>{j&&t()},900);return}if(R.status==="expired"||R.status==="unknown"){h(0);return}}catch{}_.current=window.setTimeout(S,1500)};return _.current=window.setTimeout(S,1500),()=>{j=!1,_.current&&window.clearTimeout(_.current)}},[e,l,g,t,a,o]);const N=!!l&&!g&&m<=0,y=l?a$(l.lan_urls):"",w=l?`${y}/#pair=${l.pairing_id}`:"",E=async(j,S)=>{try{await navigator.clipboard.writeText(j),o.success(S)}catch{o.error(j)}};return n.jsxs(Zt,{open:e,onClose:t,title:u("settings.devices_pair_title"),description:u("settings.devices_pair_desc"),footer:n.jsx(ie,{variant:"secondary",onClick:t,children:u("common.close")}),children:[d&&n.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:d}),!d&&!l&&n.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-muted-fg",children:[n.jsx(_n,{})," ",u("common.loading")]}),!d&&l&&n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx("div",{className:N?"opacity-40":"",children:n.jsx(s$,{value:w,size:196})}),g?n.jsx("p",{className:"text-sm font-medium text-emerald-500",children:u("settings.devices_pair_done")}):N?n.jsxs("div",{className:"flex flex-col items-center gap-2",children:[n.jsx("p",{className:"text-sm text-muted-fg",children:u("settings.devices_pair_expired")}),n.jsx(ie,{variant:"primary",onClick:()=>void k(),children:u("settings.devices_pair_regen")})]}):n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-center text-xs text-muted-fg",children:u("settings.devices_pair_scan")}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-fg",children:[n.jsx(_n,{size:12}),n.jsx("span",{children:u("settings.devices_pair_waiting")}),n.jsxs("span",{className:"tabular-nums",children:["· ",u("settings.devices_pair_expires",{s:m})]})]}),n.jsxs("div",{className:"w-full space-y-3 border-t border-border pt-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("p",{className:"text-xs text-muted-fg",children:u("settings.devices_pair_link")}),n.jsxs("div",{className:"flex items-stretch gap-2",children:[n.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-3 py-2 text-xs",children:w}),n.jsx(qe,{content:u("settings.devices_pair_copy"),children:n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>E(w,u("settings.devices_pair_copied")),children:n.jsx(Ao,{size:14})})})]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("p",{className:"text-xs text-muted-fg",children:u("settings.devices_pair_code")}),n.jsxs("div",{className:"flex items-stretch gap-2",children:[n.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-3 py-2 text-center text-sm",children:l.pairing_id}),n.jsx(qe,{content:u("settings.devices_pair_copy"),children:n.jsx(ie,{size:"sm",variant:"secondary",onClick:()=>E(l.pairing_id,u("settings.devices_pair_copied_code")),children:n.jsx(Ao,{size:14})})})]})]})]})]})]})]})}function o$(){const e=Ze(),{clients:t,isLoading:a,mutate:o}=OB(),[l,i]=x.useState(!1),[d,f]=x.useState(""),m=async g=>{if(confirm(u("settings.devices_revoke_confirm",{id:g})))try{await ci.revoke(g),e.success(u("settings.devices_revoke_success")),o()}catch(b){e.error(b.message)}},h=()=>{const g=d.trim();if(g){Ro(g);try{localStorage.setItem(zn.token,g)}catch{}f(""),e.success(u("settings.token_saved"))}};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Ye,{title:u("settings.devices"),description:u("settings.devices_sub"),action:n.jsxs(ie,{size:"sm",variant:"primary",onClick:()=>i(!0),children:[n.jsx(_M,{size:14})," ",u("settings.devices_pair_btn")]}),children:[a&&n.jsx(rt,{}),!a&&t.length===0&&n.jsx(pt,{children:u("settings.devices_empty")}),t.length>0&&n.jsx("ul",{className:"space-y-2 text-sm",children:t.map(g=>n.jsxs("li",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[n.jsx("span",{className:"font-medium",children:g.label||g.id}),n.jsx(Ve,{tone:g.kind==="web"?"info":g.kind==="deck"?"success":"muted",children:g.kind}),n.jsxs("span",{className:"font-mono text-xs text-muted-fg",children:["…",g.token_suffix]}),n.jsxs("span",{className:"ml-auto text-xs text-muted-fg",children:[u("settings.devices_last_seen")," ",g.last_seen?new Date(g.last_seen).toLocaleString():u("settings.devices_never")]}),n.jsx(ie,{size:"sm",variant:"destructive",onClick:()=>m(g.id),children:u("settings.devices_revoke")})]},g.id))}),n.jsx(r$,{open:l,onClose:()=>i(!1),onPaired:()=>o()})]}),n.jsxs(Ye,{title:u("settings.token"),description:u("settings.token_sub"),children:[n.jsx(ce,{label:u("settings_ui.bearer_label"),children:n.jsx(Te,{type:"password",placeholder:R_()?u("settings.token_active"):u("settings.token_paste"),value:d,onChange:g=>f(g.target.value),className:"font-mono",onKeyDown:g=>{g.key==="Enter"&&h()}})}),n.jsx("div",{className:"mt-2",children:n.jsx(ie,{variant:"primary",onClick:h,children:u("common.save")})})]})]})}const l$=[{key:"daemon",label:"Daemon",description:"~/.apx/config.json. General APX config.",fields:[{path:"port",label:"Port",kind:"number",placeholder:"7430"},{path:"host",label:"Host",placeholder:"127.0.0.1"},{path:"log_level",label:"Log level",placeholder:"info"},{path:"user.language",label:"Language",placeholder:"en"},{path:"user.locale",label:"Locale",placeholder:"en-US"},{path:"user.timezone",label:"Timezone",placeholder:"America/Argentina/Salta"}]},{key:"super-agent",label:"Super-agent",fields:[{path:"super_agent.enabled",label:"Super-agent enabled",kind:"boolean"},{path:"super_agent.model",label:"Model",placeholder:"gemini:gemini-2.5-flash"},{path:"super_agent.permission_mode",label:"Permission mode",kind:"select",options:Cb.map(e=>({value:e,label:e}))},{path:"super_agent.system",label:"Extra prompt",kind:"textarea"}]},{key:"telegram",label:"Telegram",fields:[{path:"telegram.enabled",label:"Polling enabled",kind:"boolean"},{path:"telegram.poll_interval_ms",label:"Poll interval ms",kind:"number",placeholder:"1500"},{path:"telegram.respond_with_engine",label:"Respond with engine",kind:"boolean"},{path:"telegram.route_to_agent",label:"Route to agent",placeholder:"master"},{path:"telegram.channels.0.chat_id",label:"Default chat ID"},{path:"telegram.channels.0.bot_token",label:"Default bot token",kind:"password"}]},{key:"engines",label:"Engines",fields:[{path:"engines.anthropic.api_key",label:"Anthropic API key",kind:"password"},{path:"engines.openai.api_key",label:"OpenAI API key",kind:"password"},{path:"engines.openai.base_url",label:"OpenAI base URL",placeholder:"https://api.openai.com/v1"},{path:"engines.groq.api_key",label:"Groq API key",kind:"password"},{path:"engines.groq.base_url",label:"Groq base URL",placeholder:"https://api.groq.com/openai/v1"},{path:"engines.openrouter.api_key",label:"OpenRouter API key",kind:"password"},{path:"engines.openrouter.base_url",label:"OpenRouter base URL",placeholder:"https://openrouter.ai/api/v1"},{path:"engines.gemini.api_key",label:"Gemini API key",kind:"password"},{path:"engines.ollama.base_url",label:"Ollama URL",placeholder:"http://localhost:11434"}]}];function i$(){const{config:e,isLoading:t,patch:a,mutate:o}=dr();if(t)return n.jsx(rt,{});const l=async i=>{const d={};for(const[f,m]of Object.entries(X_(i)))ps(m)||(d[f]=m);await a(d),o()};return n.jsx(Ye,{title:u("global_config.title"),description:u("settings_ui.global_config_desc"),children:n.jsx(uf,{sections:l$,source:e,jsonTitle:"~/.apx/config.json",jsonDescription:u("settings_ui.global_json_desc"),onSaveFields:async(i,d)=>{await a(i,d),o()},onSaveJson:l})})}function c$(){const e=Ze(),{health:t,isUp:a}=PN(),o=async()=>{try{await ii.reload(),e.success(u("settings.advanced.reload_success"))}catch(l){e.error(l.message)}};return n.jsxs("div",{className:"space-y-6",children:[n.jsx(Ye,{title:u("daemon.version"),action:n.jsx(ie,{size:"sm",onClick:o,children:u("common.reload")}),children:n.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[n.jsx(cx,{label:u("daemon.version"),value:t?.version||"—"}),n.jsx(cx,{label:u("daemon.uptime"),value:t?`${t.uptime_s}s`:"—"}),n.jsx(cx,{label:u("daemon.status"),value:u(a?"daemon.running":"daemon.down"),ok:a})]})}),n.jsx(i$,{})]})}function cx({label:e,value:t,ok:a}){return n.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),n.jsxs("div",{className:"mt-1 flex items-center gap-2 text-base font-medium",children:[a!==void 0&&n.jsx(fu,{ok:a}),n.jsx("span",{children:t})]})]})}function u$(){const{preference:e,set:t}=Nb(),[a,o]=x.useState(S_()),l=i=>{cN(i),o(i),window.location.reload()};return n.jsxs("div",{className:"grid gap-6 xl:grid-cols-2 xl:items-start",children:[n.jsx(Ye,{title:u("settings.appearance"),children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ie,{variant:e==="light"?"primary":"secondary",onClick:()=>t("light"),children:u("settings.light_mode")}),n.jsx(ie,{variant:e==="dark"?"primary":"secondary",onClick:()=>t("dark"),children:u("settings.dark_mode")}),n.jsx(ie,{variant:e==="system"?"primary":"secondary",onClick:()=>t("system"),children:u("settings.system_mode")})]})}),n.jsx(Ye,{title:u("settings.language"),children:n.jsx("div",{className:"flex items-center gap-2",children:uN.map(i=>n.jsx(ie,{variant:a===i.value?"primary":"secondary",onClick:()=>l(i.value),children:i.label},i.value))})})]})}function d$({className:e,...t}){return n.jsx("kbd",{"data-slot":"kbd",className:Ct("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",e),...t})}const Jx=typeof navigator<"u"&&/mac/i.test(navigator.platform||"");function f$(e){return(Jx?{CommandOrControl:"⌘ Cmd",CmdOrCtrl:"⌘ Cmd",Command:"⌘ Cmd",Cmd:"⌘ Cmd",Super:"⌘ Cmd",Meta:"⌘ Cmd",Control:"⌃ Ctrl",Ctrl:"⌃ Ctrl",Option:"⌥ Opt",Alt:"⌥ Opt",Shift:"⇧ Shift"}:{CommandOrControl:"Ctrl",CmdOrCtrl:"Ctrl",Control:"Ctrl",Ctrl:"Ctrl",Command:"Win",Cmd:"Win",Super:"Win",Meta:"Win",Option:"Alt",Alt:"Alt",Shift:"Shift"})[e]??e}function p$(e){return(e||"").split("+").map(t=>t.trim()).filter(Boolean)}function m$(e){const t=e.code;if(/^(Shift|Control|Alt|Meta|OS)(Left|Right)?$/.test(t))return null;let a;if((a=t.match(/^Key([A-Z])$/))||(a=t.match(/^Digit(\d)$/))||(a=t.match(/^Numpad(\d)$/))||(a=t.match(/^(F\d{1,2})$/))||(a=t.match(/^Arrow(Up|Down|Left|Right)$/)))return a[1];const o={Space:"Space",Enter:"Enter",Tab:"Tab",Backspace:"Backspace",Delete:"Delete",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown",Insert:"Insert",Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Backslash:"\\",Semicolon:";",Quote:"'",Comma:",",Period:".",Slash:"/",Backquote:"`"};return o[t]?o[t]:e.key&&e.key.length===1?e.key.toUpperCase():null}function g$(e){const t=m$(e);if(!t)return null;const a=[];(Jx?e.metaKey:e.ctrlKey)&&a.push("CommandOrControl"),Jx&&e.ctrlKey&&a.push("Control"),e.altKey&&a.push("Alt"),e.shiftKey&&a.push("Shift");const o=a.length>0,l=/^F\d{1,2}$/.test(t);return!o&&!l?null:(a.push(t),a.join("+"))}function h$({value:e,onChange:t,disabled:a,className:o,trailing:l}){const[i,d]=x.useState(!1),f=x.useRef(null);x.useEffect(()=>{if(!i)return;const h=g=>{if(g.preventDefault(),g.stopPropagation(),g.key==="Escape"){d(!1);return}const b=g$(g);b&&(t(b),d(!1))};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[i,t]);const m=p$(e);return n.jsxs("div",{className:ge("flex h-9 w-full max-w-md items-center rounded-md border border-border bg-transparent transition",i&&"ring-2 ring-ring",a&&"opacity-50",o),children:[n.jsxs("button",{ref:f,type:"button",disabled:a,onClick:()=>d(h=>!h),onBlur:()=>d(!1),"aria-label":u("modules_ui.desktop_shortcut_record"),className:"flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-l-md px-3 text-sm outline-none hover:bg-muted/40 focus-visible:bg-muted/40",children:[i?n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.desktop_shortcut_recording")}):m.length?n.jsx("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:m.map((h,g)=>n.jsxs("span",{className:"flex items-center gap-1",children:[g>0&&n.jsx("span",{className:"text-xs text-muted-fg",children:"+"}),n.jsx(d$,{className:"h-6 min-w-6 border border-border bg-muted px-1.5 text-[13px] font-semibold text-fg shadow-sm",children:f$(h)})]},g))}):n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.desktop_shortcut_record")}),n.jsx("span",{className:"ml-auto whitespace-nowrap pl-2 text-xs text-muted-fg",children:u(i?"modules_ui.desktop_shortcut_esc":"modules_ui.desktop_shortcut_change")})]}),l?n.jsx("div",{className:"flex h-full items-center border-l border-border px-1",children:l}):null]})}const ql={status:()=>re.get("/desktop/status"),start:()=>re.post("/desktop/start",{}),stop:()=>re.post("/desktop/stop",{}),restart:()=>re.post("/desktop/restart",{}),autostartGet:()=>re.get("/desktop/autostart"),autostartSet:e=>re.post("/desktop/autostart",{enable:e})};function x$(e=30){return re.get(`/messages/global?channel=desktop&limit=${e}`)}function rR({showConfigLink:e=!1}){const t=Ze(),{data:a,isLoading:o,mutate:l}=He("/desktop/status",()=>ql.status(),{refreshInterval:5e3}),i=!!a?.running,[d,f]=x.useState(null),m=async(_,k)=>{f(_);try{await k()}catch(N){t.error(N.message)}finally{f(null),setTimeout(()=>l(),1200)}},h=()=>m("start",async()=>{const _=await ql.start();t.success(_.already?u("modules_ui.desktop_start_already"):u("modules_ui.desktop_start_done"))}),g=()=>m("stop",async()=>{const _=await ql.stop();t.success(_.stopped?u("modules_ui.desktop_stop_done"):u("modules_ui.desktop_stop_none"))}),b=()=>m("restart",async()=>{(await ql.restart()).reloaded>0?t.success(u("modules_ui.desktop_restart_done")):t.info(u("modules_ui.desktop_restart_none"))});return n.jsx(Ye,{title:u("desktop_screen.status_title"),description:u("modules_ui.desktop_status_desc"),action:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ie,{variant:"primary",size:"sm",onClick:h,loading:d==="start",disabled:i||d!==null&&d!=="start",children:u("modules_ui.desktop_start")}),n.jsx(ie,{variant:"secondary",size:"sm",onClick:g,loading:d==="stop",disabled:!i||d!==null&&d!=="stop",children:u("modules_ui.desktop_stop")}),n.jsx(ie,{variant:"secondary",size:"sm",onClick:b,loading:d==="restart",disabled:!i||d!==null&&d!=="restart",title:u("modules_ui.desktop_restart_hint"),children:u("modules_ui.desktop_restart")}),e&&n.jsx(Yf,{to:"/settings/desktop",children:n.jsxs(ie,{size:"sm",variant:"ghost",children:[n.jsx(ep,{size:14})," ",u("desktop_screen.open_config")]})})]}),children:o?n.jsx(rt,{}):n.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[n.jsx(fu,{ok:i}),n.jsx("span",{className:"font-medium",children:u(i?"modules_ui.desktop_running":"modules_ui.desktop_stopped")}),n.jsx("button",{type:"button",onClick:()=>l(),className:"text-xs text-muted-fg underline-offset-2 hover:underline",children:u("modules_ui.desktop_refresh")}),n.jsxs("span",{className:"text-xs text-muted-fg",children:["(",u("modules_ui.desktop_from_terminal")," ",n.jsx(jk,{children:"apx desktop start"})," · ",n.jsx(jk,{children:"apx desktop --debug"}),")"]})]})})}const b$="CommandOrControl+G",_$=()=>[{value:"left",label:u("modules_ui.desktop_pos_left")},{value:"center",label:u("modules_ui.desktop_pos_center")},{value:"right",label:u("modules_ui.desktop_pos_right")}],v$=()=>[{value:"system",label:u("modules_ui.desktop_theme_system")},{value:"light",label:u("modules_ui.desktop_theme_light")},{value:"dark",label:u("modules_ui.desktop_theme_dark")}];function y$(){const e=Ze(),{config:t,isLoading:a,patch:o}=dr(),l=t,i=l.desktop?.shortcut||l.overlay?.shortcut||b$,d=l.desktop?.enabled!==!1,f=l.desktop?.theme||"system",m=l.desktop?.position||"right",{data:h,mutate:g}=He("/desktop/autostart",()=>ql.autostartGet()),[b,_]=x.useState(i),[k,N]=x.useState(!1),[y,w]=x.useState(!1);x.useEffect(()=>_(i),[i]);const E=async()=>{const R=b.trim();if(!(!R||R===i)){N(!0);try{await o({"desktop.shortcut":R}),e.success(u("modules_ui.desktop_shortcut_saved"))}catch(A){e.error(A.message)}finally{N(!1)}}},j=async(R,A,T)=>{N(!0);try{await o({[R]:A}),e.success(T)}catch(O){e.error(O.message)}finally{N(!1)}},S=async R=>{w(!0);try{await ql.autostartSet(R),await g(),e.success(u(R?"modules_ui.desktop_autostart_on":"modules_ui.desktop_autostart_off"))}catch(A){e.error(A.message)}finally{w(!1)}};return n.jsxs("div",{className:"space-y-6","data-testid":"settings-desktop",children:[n.jsx(rR,{}),n.jsx(Ye,{title:u("desktop_screen.autostart_title"),description:u("modules_ui.desktop_autostart_desc"),children:h?n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx(Bt,{checked:h.enabled,onChange:S,disabled:y,label:h.enabled?u("common.enabled"):u("common.disabled")}),n.jsx("span",{className:"text-xs text-muted-fg",children:u("modules_ui.desktop_platform",{platform:h.platform})})]}):n.jsx(rt,{})}),n.jsx(Ye,{title:u("desktop_screen.shortcut_title"),description:u("modules_ui.desktop_shortcut_desc"),children:a?n.jsx(rt,{}):n.jsx(ce,{label:u("modules_ui.desktop_accelerator"),hint:u("modules_ui.desktop_accelerator_hint"),children:n.jsx(h$,{value:b,onChange:_,disabled:k,trailing:n.jsx(ie,{variant:"primary",size:"sm",onClick:E,loading:k,disabled:!b.trim()||b.trim()===i,children:u("common.save")})})})}),n.jsx(Ye,{title:u("desktop_screen.appearance_title"),description:u("modules_ui.desktop_appearance_desc"),children:a?n.jsx(rt,{}):n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[n.jsx(ce,{label:u("modules_ui.desktop_theme"),hint:u("modules_ui.desktop_restart_apply"),children:n.jsx(ut,{value:f,onChange:R=>j("desktop.theme",R,u("modules_ui.desktop_theme_set",{value:R})),options:v$(),disabled:k})}),n.jsx(ce,{label:u("modules_ui.desktop_position"),hint:u("modules_ui.desktop_position_hint"),children:n.jsx(ut,{value:m,onChange:R=>j("desktop.position",R,u("modules_ui.desktop_position_set",{value:R})),options:_$(),disabled:k})})]})}),n.jsx(Ye,{title:u("desktop_screen.activation_title"),description:u("modules_ui.desktop_activation_desc"),children:a?n.jsx(rt,{}):n.jsxs("div",{className:"space-y-3",children:[n.jsx(Bt,{checked:d,onChange:R=>j("desktop.enabled",R,u(R?"modules_ui.desktop_enabled_toast":"modules_ui.desktop_disabled_toast")),disabled:k,label:u(d?"modules_ui.desktop_plugin_on":"modules_ui.desktop_plugin_off")}),n.jsxs("p",{className:"text-xs text-muted-fg",children:[u("modules_ui.desktop_stt_engine")," ",n.jsx(Yf,{to:"/settings/voice",className:"font-medium text-fg underline underline-offset-2",children:u("nav.modules.voice")})," ",u("modules_ui.desktop_stt_engine_suffix")]})]})})]})}function j$({engines:e,order:t,onToggleEnabled:a,onToggleEmotions:o,onReorder:l,onConfigure:i,onRemove:d,onAddNew:f,busy:m}){const h=e.filter(k=>k.id!=="mock"),g=new Map(h.map(k=>[k.id,k])),b=[...t.filter(k=>g.has(k)),...h.map(k=>k.id).filter(k=>!t.includes(k))],_=(k,N)=>{const y=b.indexOf(k),w=y+N;if(y<0||w<0||w>=b.length)return;const E=[...b];[E[y],E[w]]=[E[w],E[y]],l(E)};return n.jsxs("div",{className:"space-y-2",children:[b.map((k,N)=>{const y=g.get(k),w=zf[k],E=y.custom?y.label||k:w?.name||k,j=y.custom?y.note||u("voice_ui.custom_note"):w?.note||"";return n.jsxs("div",{"data-testid":`voice-provider-${k}`,className:ge("flex items-center gap-3 rounded-lg border px-3 py-2.5 border-border",!y.enabled&&"opacity-60"),children:[n.jsxs("div",{className:"flex flex-col",children:[n.jsx("button",{type:"button",onClick:()=>_(k,-1),disabled:m||N===0,"aria-label":u("voice_ui.move_up"),"data-testid":`voice-provider-${k}-up`,className:"text-muted-fg hover:text-fg disabled:opacity-30",children:n.jsx(pb,{className:"size-3.5"})}),n.jsx("button",{type:"button",onClick:()=>_(k,1),disabled:m||N===b.length-1,"aria-label":u("voice_ui.move_down"),"data-testid":`voice-provider-${k}-down`,className:"text-muted-fg hover:text-fg disabled:opacity-30",children:n.jsx(ms,{className:"size-3.5"})})]}),n.jsx(fu,{ok:y.available?!0:y.configured?!1:null}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium",children:E}),y.custom&&n.jsx(Ve,{tone:"info",children:u("voice_ui.badge_custom")}),w?.local&&n.jsx(Ve,{tone:"info",children:u("voice_ui.badge_local")}),y.available?n.jsx(Ve,{tone:"success",children:u("voice_ui.badge_available")}):y.configured?n.jsx(Ve,{tone:"warning",children:u("voice_ui.badge_unavailable")}):n.jsx(Ve,{tone:"muted",children:u("voice_ui.badge_not_configured")})]}),n.jsx("div",{className:"truncate text-xs text-muted-fg",children:j})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[y.emotionsApplicable&&n.jsx("button",{type:"button",onClick:()=>o(k,!y.emotionsOn),disabled:m,title:u("voice_ui.emotions_hint"),"data-testid":`voice-provider-${k}-emotions`,className:ge("rounded-md border px-2 py-1 text-xs font-medium transition-colors disabled:opacity-50",y.emotionsOn?"border-emerald-500/50 bg-emerald-500/10 text-emerald-300":"border-border text-muted-fg hover:text-fg"),children:u("voice_ui.emotions_short")}),n.jsx(Bt,{checked:y.enabled,onChange:S=>a(k,S),disabled:m}),n.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>i(k),"data-testid":`voice-provider-${k}-config`,children:[n.jsx(yM,{className:"size-3.5"})," ",u("voice_ui.configure")]}),y.custom&&n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>d(k),disabled:m,"aria-label":u("voice_ui.remove"),"data-testid":`voice-provider-${k}-remove`,children:n.jsx(vn,{className:"size-3.5"})})]})]},k)}),n.jsxs("button",{type:"button",onClick:f,disabled:m,"data-testid":"voice-provider-add",className:"flex w-full items-center justify-center gap-2 rounded-lg border border-dashed border-border px-3 py-2.5 text-sm text-muted-fg transition-colors hover:border-emerald-500/50 hover:text-fg disabled:opacity-50",children:[n.jsx(Pt,{className:"size-4"})," ",u("voice_ui.add_provider")]})]})}function Nn(e){return typeof e=="string"?e:e==null?"":String(e)}function k$(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}function Gw({on:e,setOn:t,tags:a,setTags:o}){return n.jsxs("div",{className:"rounded-md border border-border/60 p-3 space-y-2",children:[n.jsx(Bt,{checked:e,onChange:t,label:u("voice_ui.emotions_label")}),n.jsx("p",{className:"text-xs text-muted-fg",children:u("voice_ui.emotions_hint")}),e&&n.jsx(ce,{label:u("voice_ui.emotions_tags_label"),hint:u("voice_ui.emotions_tags_hint"),children:n.jsx(Te,{value:a,onChange:l=>o(l.target.value),placeholder:wP.join(", ")})})]})}function w$({open:e,providerId:t,config:a,onClose:o,onSave:l}){const[i,d]=x.useState(!1),[f,m]=x.useState(null),[h,g]=x.useState(""),[b,_]=x.useState({}),[k,N]=x.useState(!1),[y,w]=x.useState(""),[E,j]=x.useState(!1);if(x.useEffect(()=>{if(!e||!t)return;m(null),g("");const D=a||{},L=D.emotions;if(N(!!L?.enabled),w(Array.isArray(L?.tags)?L.tags.join(", "):""),j(!1),t==="__new__"||t.startsWith("custom:")){const V=D;_({label:Nn(V.label),base_url:Nn(V.base_url),model:Nn(V.model),voice:Nn(V.voice),format:Nn(V.format),style:Nn(V.style),temperature:Nn(V.temperature)})}else if(t==="piper"){const V=D;_({bin:Nn(V.bin),model:Nn(V.model),speaker:Nn(V.speaker)})}else if(t==="elevenlabs"){const V=D;_({model:Nn(V.model),voice_id:Nn(V.voice_id),output_format:Nn(V.output_format)})}else if(t==="openai"){const V=D;_({model:Nn(V.model)||"tts-1",voice:Nn(V.voice)||"alloy",format:Nn(V.format)||"mp3"})}else if(t==="gemini"){const V=D;_({model:Nn(V.model),voice:Nn(V.voice)||"Kore",style:Nn(V.style)})}else _({})},[e,t,a]),!t)return null;const S=t==="__new__",R=S||t.startsWith("custom:"),A=zf[t],T=D=>_(L=>({...L,...D})),O=t!=="piper"&&t!=="mock",M=O&&ps(a?.api_key),B=M?u("voice_ui.api_key_set",{suffix:Io(a?.api_key)??""}):u("voice_ui.api_key_label"),P=S?u("voice_ui.new_provider"):R?b.label||t.slice(7):A?.name||t,$=async()=>{d(!0),m(null);try{const D=S?k$(b.label):R?t.slice(7):"";if(R){if(!b.label.trim())throw new Error(u("voice_ui.err_label_required"));if(!b.base_url.trim())throw new Error(u("voice_ui.err_base_url_required"));if(!D)throw new Error(u("voice_ui.err_label_required"))}const L=R?`voice.tts.custom.${D}`:`voice.tts.${t}`,H={},V=[],U=(F,X)=>{X.trim()?H[`${L}.${F}`]=X.trim():V.push(`${L}.${F}`)};if(R?(H[`${L}.label`]=b.label.trim(),H[`${L}.base_url`]=b.base_url.trim(),U("style",b.style),b.temperature.trim()&&!Number.isNaN(Number(b.temperature))?H[`${L}.temperature`]=Number(b.temperature):V.push(`${L}.temperature`),U("model",b.model),U("voice",b.voice)):t==="piper"?(U("bin",b.bin),U("model",b.model),b.speaker.trim()?H[`${L}.speaker`]=b.speaker.trim():V.push(`${L}.speaker`)):t==="elevenlabs"?(U("model",b.model),U("voice_id",b.voice_id),U("output_format",b.output_format)):t==="openai"?(U("model",b.model),U("voice",b.voice),U("format",b.format)):t==="gemini"&&(U("model",b.model),U("voice",b.voice),U("style",b.style)),R||t==="gemini"){H[`${L}.emotions.enabled`]=k;const F=y.split(",").map(X=>X.trim().toLowerCase()).filter(Boolean);F.length?H[`${L}.emotions.tags`]=F:V.push(`${L}.emotions.tags`)}O&&h.trim()&&(H[`${L}.api_key`]=h.trim()),await l({set:H,unset:V}),o()}catch(D){m(D.message||u("voice_ui.err_save"))}finally{d(!1)}};return n.jsx(Zt,{open:e,onClose:o,title:u("voice_screen.configure_provider",{name:P}),description:R?u("voice_ui.custom_desc"):A?.note,size:"md",footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:o,disabled:i,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:$,loading:i,"data-testid":"voice-provider-save",children:u("common.save")})]}),children:n.jsxs("div",{className:"space-y-3",children:[t==="piper"&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("voice_ui.piper_bin_label"),hint:u("voice_ui.piper_bin_hint"),children:n.jsx(Te,{value:b.bin,onChange:D=>T({bin:D.target.value}),placeholder:"piper"})}),n.jsx(ce,{label:u("voice_ui.piper_model_label"),hint:u("voice_ui.piper_model_hint"),children:n.jsx(Te,{value:b.model,onChange:D=>T({model:D.target.value}),placeholder:"/abs/path/voice.onnx"})}),n.jsx(ce,{label:u("voice_ui.piper_speaker_label"),hint:u("voice_ui.piper_speaker_hint"),children:n.jsx(Te,{value:b.speaker,onChange:D=>T({speaker:D.target.value}),placeholder:"0"})})]}),t==="elevenlabs"&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:M?u("voice_ui.api_key_keep_hint"):u("voice_ui.api_key_secret_hint",{env:"ELEVENLABS_API_KEY"}),children:n.jsx(Te,{type:"password",autoComplete:"new-password",value:h,onChange:D=>g(D.target.value),placeholder:B})}),n.jsx(ce,{label:u("voice_ui.model_label"),children:n.jsx(ut,{value:b.model||"",onChange:D=>T({model:D}),options:jP.map(D=>({value:D,label:D})),placeholder:"eleven_multilingual_v2"})}),n.jsx(ce,{label:u("voice_ui.voice_id_label"),hint:u("voice_ui.voice_id_hint"),children:n.jsx(Te,{value:b.voice_id,onChange:D=>T({voice_id:D.target.value}),placeholder:"EXAVITQu4vr4xnSDxMaL"})}),n.jsx(ce,{label:u("voice_ui.output_format_label"),children:n.jsx(Te,{value:b.output_format,onChange:D=>T({output_format:D.target.value}),placeholder:"mp3_44100_128"})})]}),t==="openai"&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:M?u("voice_ui.api_key_keep_hint"):u("voice_ui.api_key_reuse_hint",{engine:"engines.openai.api_key",env:"OPENAI_API_KEY"}),children:n.jsx(Te,{type:"password",autoComplete:"new-password",value:h,onChange:D=>g(D.target.value),placeholder:B})}),n.jsx(ce,{label:u("voice_ui.model_label"),children:n.jsx(ut,{value:b.model||"tts-1",onChange:D=>T({model:D}),options:kP.map(D=>({value:D,label:D}))})}),n.jsx(ce,{label:u("voice_ui.voice_label"),children:n.jsx(ut,{value:b.voice||"alloy",onChange:D=>T({voice:D}),options:vP.map(D=>({value:D,label:D}))})}),n.jsx(ce,{label:u("voice_ui.format_label"),children:n.jsx(ut,{value:b.format||"mp3",onChange:D=>T({format:D}),options:["mp3","opus","aac","flac","wav"].map(D=>({value:D,label:D}))})})]}),R&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("voice_ui.label_label"),hint:u("voice_ui.label_hint"),children:n.jsx(Te,{value:b.label,onChange:D=>T({label:D.target.value}),placeholder:"QVox"})}),n.jsx(ce,{label:u("voice_ui.base_url_req_label"),hint:u("voice_ui.base_url_req_hint"),children:n.jsx(Te,{value:b.base_url,onChange:D=>T({base_url:D.target.value}),placeholder:"http://127.0.0.1:5111/v1"})}),n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:u(M?"voice_ui.api_key_keep_hint":"voice_ui.api_key_optional_hint"),children:n.jsx(Te,{type:"password",autoComplete:"new-password",value:h,onChange:D=>g(D.target.value),placeholder:B})}),n.jsx(ce,{label:u("voice_ui.style_label"),hint:u("voice_ui.openai_style_hint"),children:n.jsx(un,{rows:2,value:b.style||"",onChange:D=>T({style:D.target.value}),placeholder:u("voice_ui.style_ph")})}),n.jsx(ce,{label:u("voice_ui.temperature_label"),hint:u("voice_ui.temperature_hint"),children:n.jsx(Te,{value:b.temperature,onChange:D=>T({temperature:D.target.value}),inputMode:"decimal",placeholder:"0.7"})}),n.jsx(Gw,{on:k,setOn:N,tags:y,setTags:w}),n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>j(D=>!D),className:"text-xs text-muted-fg hover:text-fg",children:[E?"▾ ":"▸ ",u("voice_ui.advanced")]}),E&&n.jsxs("div",{className:"mt-2 space-y-3",children:[n.jsx(ce,{label:u("voice_ui.model_label"),hint:u("voice_ui.custom_model_hint"),children:n.jsx(Te,{value:b.model,onChange:D=>T({model:D.target.value}),placeholder:u("voice_ui.custom_optional_ph")})}),n.jsx(ce,{label:u("voice_ui.voice_label"),hint:u("voice_ui.custom_voice_hint"),children:n.jsx(Te,{value:b.voice,onChange:D=>T({voice:D.target.value}),placeholder:u("voice_ui.custom_optional_ph")})})]})]})]}),t==="gemini"&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:M?u("voice_ui.api_key_keep_hint"):u("voice_ui.api_key_reuse_hint",{engine:"engines.gemini.api_key",env:"GEMINI_API_KEY"}),children:n.jsx(Te,{type:"password",autoComplete:"new-password",value:h,onChange:D=>g(D.target.value),placeholder:B})}),n.jsx(ce,{label:u("voice_ui.model_label"),hint:u("voice_ui.gemini_model_hint"),children:n.jsx(Te,{value:b.model,onChange:D=>T({model:D.target.value}),placeholder:"gemini-2.5-flash-preview-tts"})}),n.jsx(ce,{label:u("voice_ui.voice_label"),children:n.jsx(ut,{value:b.voice||"Kore",onChange:D=>T({voice:D}),options:yP.map(D=>({value:D,label:D}))})}),n.jsx(ce,{label:u("voice_ui.style_label"),hint:u("voice_ui.style_hint"),children:n.jsx(un,{rows:2,value:b.style||"",onChange:D=>T({style:D.target.value}),placeholder:u("voice_ui.style_ph")})}),n.jsx(Gw,{on:k,setOn:N,tags:y,setTags:w})]}),t==="mock"&&n.jsx("p",{className:"text-sm text-muted-fg",children:u("voice_ui.mock_desc")}),f&&n.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:f})]})})}function S$(){const e=x.useRef(null),t=x.useRef(null),[a,o]=x.useState(!1),[l,i]=x.useState(!1),d=x.useCallback(()=>{t.current&&(URL.revokeObjectURL(t.current),t.current=null)},[]);x.useEffect(()=>()=>{e.current&&(e.current.pause(),e.current=null),d()},[d]);const f=x.useCallback(async h=>{i(!0);try{d();const g=await CP(h);t.current=g,e.current||(e.current=new Audio);const b=e.current;b.src=g,b.onended=()=>o(!1),b.onerror=()=>o(!1),await b.play(),o(!0)}finally{i(!1)}},[d]),m=x.useCallback(()=>{e.current&&(e.current.pause(),e.current.currentTime=0),o(!1)},[]);return{play:f,stop:m,playing:a,loading:l}}function C$({engines:e,defaultProvider:t,mode:a}){const o=Ze(),{play:l,stop:i,playing:d,loading:f}=S$(),[m,h]=x.useState(u("voice_ui.test_default_text")),[g,b]=x.useState(""),[_,k]=x.useState(!1),[N,y]=x.useState(null),E=[{value:"",label:a==="single"&&t&&t!=="auto"?u("voice_ui.test_default_engine",{name:zf[t]?.name||t}):u("voice_ui.test_default_chain")},...e.filter(S=>S.id!=="mock").map(S=>({value:S.id,label:S.custom?S.label||S.id:zf[S.id]?.name||S.id,disabled:!S.available}))],j=async()=>{const S=m.trim();if(!S){o.error(u("voice_ui.test_empty_error"));return}k(!0);try{const R=await Df.say({text:S,provider:g||void 0});y(R),await l(R.audio_path)}catch(R){o.error(R.message||u("voice_ui.test_synth_error"))}finally{k(!1)}};return n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("voice_ui.test_engine_label"),hint:u("voice_ui.test_engine_hint"),children:n.jsx(ut,{value:g,onChange:b,options:E})}),n.jsx(ce,{label:u("voice_ui.test_text_label"),children:n.jsx(un,{rows:2,value:m,onChange:S=>h(S.target.value),placeholder:u("voice_ui.test_text_ph"),"data-testid":"voice-test-input"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(ie,{variant:"primary",onClick:j,loading:_,disabled:f,"data-testid":"voice-test-say",children:[n.jsx(EM,{className:"size-4"})," ",u("voice_ui.say_this")]}),d?n.jsxs(ie,{variant:"secondary",onClick:i,"data-testid":"voice-test-stop",children:[n.jsx(wb,{className:"size-4"})," ",u("voice_ui.stop")]}):N?n.jsxs(ie,{variant:"secondary",onClick:()=>l(N.audio_path),loading:f,"data-testid":"voice-test-replay",children:[n.jsx(jb,{className:"size-4"})," ",u("voice_ui.replay")]}):null,N&&n.jsxs("span",{className:"text-xs text-muted-fg",children:[u("voice_ui.engine_result"),": ",n.jsx("strong",{children:N.provider}),N.duration_s?` · ${N.duration_s.toFixed(1)}s`:""]})]})]})}const Yw={metal:{label:"Metal",cls:"text-emerald-400 border-emerald-500/40 bg-emerald-500/10"},cuda:{label:"CUDA",cls:"text-lime-400 border-lime-500/40 bg-lime-500/10"},rocm:{label:"Vulkan / ROCm",cls:"text-orange-400 border-orange-500/40 bg-orange-500/10"},none:{label:"CPU",cls:"text-muted-fg border-border bg-muted"}};function Kw({gpu:e}){const t=Yw[e]??Yw.none;return n.jsx("span",{className:`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[11px] font-medium ${t.cls}`,children:t.label})}function N$(e){return e.backend==="mlx"?"Metal · mlx-whisper":e.backend==="faster"?(e.device==="cuda"?"CUDA":"CPU")+" · faster-whisper":e.backend}const E$=()=>[{value:"auto",label:u("voice_ui.stt_provider_auto")},{value:"local",label:u("voice_ui.stt_provider_local")},{value:"openai",label:u("voice_ui.stt_provider_openai")},{value:"custom",label:u("voice_ui.stt_provider_custom")}],Xw=()=>[{value:"auto",label:u("voice_ui.lang_auto")},{value:"es",label:u("voice_ui.lang_es")},{value:"en",label:u("voice_ui.lang_en")},{value:"pt",label:u("voice_ui.lang_pt")},{value:"fr",label:u("voice_ui.lang_fr")},{value:"it",label:u("voice_ui.lang_it")},{value:"de",label:u("voice_ui.lang_de")}];function R$({config:e,onPatch:t,busy:a}){const[o,l]=x.useState(null);x.useEffect(()=>{let L=!0;return Df.sttHardware().then(H=>{L&&l(H)}).catch(()=>{}),()=>{L=!1}},[]);const i=e.provider||"auto",d=e.local||{},f=e.openai||{},m=e.custom||{},h=d.model||"small",g=d.language||"auto",b=i==="auto"||i==="local",_=(L,H,V)=>{const U=V.trim();U!==(H||"").trim()&&t({[L]:U})},k=(L,H)=>{const V=H.trim();!V||ps(V)||t({[L]:V})},N=L=>ps(L)?u("voice_ui.api_key_set",{suffix:Io(L)??""}):u("voice_ui.api_key_label"),y=d.backend||"auto",w=o?.hardware.gpu||"none",E=y==="auto"?o?.recommended.backend||"faster":y,j=E==="mlx",S=j?"metal":E==="faster"&&w==="cuda"?"cuda":"none",R=()=>{const L=[{value:"auto",label:u("voice_ui.stt_backend_auto")}];return w==="metal"&&L.push({value:"mlx",label:"Metal — mlx-whisper"}),L.push({value:"faster",label:w==="cuda"?"CUDA — faster-whisper":"CPU — faster-whisper"}),L},[A,T]=x.useState([]);x.useEffect(()=>{let L=!0;return Df.sttModels(E).then(H=>{L&&T(H.models)}).catch(()=>{L&&T([])}),()=>{L=!1}},[E]);const O=L=>`${L.id} · ${L.downloaded?"✓ "+L.size:L.size}`,M=()=>A.length?A.map(L=>({value:j?L.repo:L.id,label:O(L)})):SP.map(L=>({value:L,label:L})),B=j?d.mlx_model||o?.recommended.model||"":h,P=j?"transcription.local.mlx_model":"transcription.local.model",$=A.find(L=>(j?L.repo:L.id)===B),D=!!$&&!$.downloaded;return n.jsxs("div",{className:"space-y-3",children:[o&&n.jsxs("div",{className:"rounded-lg border border-border bg-muted px-3 py-2 text-sm",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("span",{className:"text-muted-fg",children:[u("voice_ui.stt_hw_label"),":"]}),n.jsx(Kw,{gpu:o.hardware.gpu}),n.jsx("span",{className:"font-medium text-fg",children:o.hardware.gpuName||o.hardware.platform}),o.hardware.mem_gb?n.jsxs("span",{className:"text-muted-fg",children:["· ",o.hardware.mem_gb," GB",o.hardware.unified_memory?" unified":""]}):null]}),n.jsxs("div",{className:"mt-1 text-xs text-muted-fg",children:[u("voice_ui.stt_hw_recommended"),":"," ",n.jsx("span",{className:"text-fg",children:o.recommended.model})," ","(",N$(o.recommended),")",o.recommended.limited?` — ${u("voice_ui.stt_hw_limited")}`:""]})]}),n.jsx(ce,{label:u("voice_ui.stt_engine_label"),hint:u("voice_ui.stt_engine_hint"),children:n.jsx(ut,{value:i,onChange:L=>t({"transcription.provider":L}),options:E$(),disabled:a,className:"max-w-md"})}),b&&n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("voice_ui.stt_backend_label"),hint:u("voice_ui.stt_backend_hint"),children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ut,{value:y,onChange:L=>t({"transcription.local.backend":L}),options:R(),disabled:a,className:"max-w-xs"}),n.jsx(Kw,{gpu:S})]})}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[n.jsx(ce,{label:u("voice_ui.stt_model_label"),hint:D?u("voice_ui.stt_model_needs_download",{size:$.size}):u("voice_ui.stt_model_hint"),children:n.jsx(ut,{value:B,onChange:L=>t({[P]:L}),options:M(),disabled:a})}),n.jsx(ce,{label:u("voice_ui.stt_language_label"),hint:u("voice_ui.stt_language_hint"),children:n.jsx(ut,{value:g,onChange:L=>t({"transcription.local.language":L}),options:Xw(),disabled:a})})]})]}),i==="openai"&&n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:ps(f.api_key)?u("voice_ui.api_key_keep_hint"):u("voice_ui.api_key_reuse_hint",{engine:"engines.openai.api_key",env:"OPENAI_API_KEY"}),children:n.jsx(Te,{type:"password",autoComplete:"new-password",defaultValue:"",placeholder:N(f.api_key),onBlur:L=>k("transcription.openai.api_key",L.target.value),disabled:a})}),n.jsx(ce,{label:u("voice_ui.stt_openai_model_label"),hint:u("voice_ui.stt_openai_model_hint"),children:n.jsx(Te,{defaultValue:f.model||"",placeholder:"whisper-1",onBlur:L=>_("transcription.openai.model",f.model,L.target.value),disabled:a})})]}),i==="custom"&&n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("voice_ui.stt_custom_baseurl_label"),hint:u("voice_ui.stt_custom_baseurl_hint"),children:n.jsx(Te,{defaultValue:m.base_url||"",placeholder:"http://localhost:8000/v1",onBlur:L=>_("transcription.custom.base_url",m.base_url,L.target.value),disabled:a})}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[n.jsx(ce,{label:u("voice_ui.stt_custom_model_label"),hint:u("voice_ui.stt_custom_model_hint"),children:n.jsx(Te,{defaultValue:m.model||"",placeholder:"mlx-community/whisper-large-v3-turbo",onBlur:L=>_("transcription.custom.model",m.model,L.target.value),disabled:a})}),n.jsx(ce,{label:u("voice_ui.stt_language_label"),hint:u("voice_ui.stt_language_hint"),children:n.jsx(ut,{value:m.language||"auto",onChange:L=>t({"transcription.custom.language":L}),options:Xw(),disabled:a})})]}),n.jsx(ce,{label:u("voice_ui.api_key_label"),hint:u("voice_ui.stt_custom_key_hint"),children:n.jsx(Te,{type:"password",autoComplete:"new-password",defaultValue:"",placeholder:N(m.api_key),onBlur:L=>k("transcription.custom.api_key",L.target.value),disabled:a})})]})]})}function T$(){const e=Ze(),{config:t,isLoading:a,patch:o,mutate:l}=dr(),{data:i,isLoading:d,error:f,mutate:m}=He("/tts/providers",()=>Df.providers()),[h,g]=x.useState(null),[b,_]=x.useState(!1),k=t,N=k.voice?.tts||{},y=k.transcription||{},w=i?.configured_provider||N.provider||"auto",E=i?.mode||N.mode||"chain",j=i?.order||[],S=(i?.engines||[]).map($=>{if(!(!!$.custom||$.id==="gemini"))return $;const L=$.custom?N.custom?.[$.id.slice(7)]:N.gemini;return{...$,emotionsApplicable:!0,emotionsOn:!!L?.emotions?.enabled}}),R=x.useMemo(()=>!h||h==="__new__"?{}:h.startsWith("custom:")?N.custom?.[h.slice(7)]||{}:N[h]||{},[h,N]),A=async($,D)=>{_(!0);try{const L=$.startsWith("custom:")?`voice.tts.custom.${$.slice(7)}.enabled`:`voice.tts.${$}.enabled`;await o({[L]:D}),await m()}catch(L){e.error(L.message)}finally{_(!1)}},T=async($,D)=>{_(!0);try{const L=$.startsWith("custom:")?`voice.tts.custom.${$.slice(7)}.emotions.enabled`:`voice.tts.${$}.emotions.enabled`;await o({[L]:D}),await m(),await l()}catch(L){e.error(L.message)}finally{_(!1)}},O=async $=>{_(!0);try{await o({"voice.tts.order":$}),await m()}catch(D){e.error(D.message)}finally{_(!1)}},M=async({set:$,unset:D})=>{await o($,D.length?D:void 0),await m(),await l(),e.success(u("voice_ui.toast_config_saved"))},B=async $=>{if($.startsWith("custom:")&&window.confirm(u("voice_ui.remove_confirm"))){_(!0);try{const D=$.slice(7);await o({"voice.tts.order":j.filter(L=>L!==$)},[`voice.tts.custom.${D}`]),await m(),await l(),e.success(u("voice_ui.toast_provider_removed"))}catch(D){e.error(D.message)}finally{_(!1)}}},P=async($,D)=>{try{await o($,D),e.success(u("voice_ui.toast_transcription_updated"))}catch(L){e.error(L.message)}};return n.jsxs("div",{"data-testid":"screen-voice",children:[n.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[n.jsx(Ye,{title:u("voice_screen.providers_title"),description:u("voice_ui.providers_desc"),children:d||a?n.jsx(rt,{}):f?n.jsx(pt,{children:u("voice_ui.providers_load_error",{msg:f.message})}):n.jsx(j$,{engines:S,order:j,onToggleEnabled:A,onToggleEmotions:T,onReorder:O,onConfigure:$=>g($),onRemove:B,onAddNew:()=>g("__new__"),busy:b})}),n.jsxs("div",{className:"space-y-6",children:[n.jsx(Ye,{title:u("voice_screen.test_title"),description:u("voice_ui.test_desc"),children:n.jsx(C$,{engines:S,defaultProvider:w,mode:E})}),n.jsx(Ye,{title:u("voice_screen.stt_title"),description:u("voice_ui.stt_desc"),children:a?n.jsx(rt,{}):n.jsx(R$,{config:y,onPatch:P})})]})]}),n.jsx(w$,{open:!!h,providerId:h,config:R,onClose:()=>g(null),onSave:M})]})}function A$(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`}function M$({manifest:e}){const t=e.daemon,a=e.safety;return n.jsxs("div",{"data-testid":"deck-daemon-card",className:"rounded-xl border border-border bg-muted/10 px-4 py-3 text-xs",children:[n.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[n.jsxs("span",{className:"font-semibold text-foreground",children:[t.name," ",n.jsxs("span",{className:"font-normal text-muted-fg",children:["v",t.version]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"size-2 rounded-full bg-emerald-500"}),n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.deck_daemon_active",{uptime:A$(t.uptime_s)})})]})]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsxs("span",{className:"text-muted-fg",children:[t.host,":",t.port]}),n.jsx("span",{className:"text-muted-fg",children:"·"}),n.jsxs("span",{className:"text-muted-fg",children:[u("modules_ui.deck_daemon_started")," ",new Date(t.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),n.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:[a.direct_shell===!1&&n.jsx(Ve,{tone:"success",children:u("modules_ui.deck_safety_no_shell")}),a.arbitrary_commands===!1&&n.jsx(Ve,{tone:"success",children:u("modules_ui.deck_safety_no_arbitrary")}),a.dangerous_actions_require_confirmation&&n.jsx(Ve,{tone:"info",children:u("modules_ui.deck_safety_confirm")})]})]})}function O$(e){return e==="available"?"success":e==="configured"?"info":"muted"}function z$(e){return e==="available"?"activo":e==="configured"?"configurado":e==="disabled"?"deshabilitado":"sin configurar"}function D$(e){return e==="voice"?"warning":e==="plugin"?"info":"muted"}function P$({widget:e,onToggle:t}){const a=e.source==="external",[o,l]=x.useState(!1),i=e.user_enabled===!0,d=async f=>{if(!(!t||o)){l(!0);try{await t(f)}finally{l(!1)}}};return n.jsxs("li",{"data-testid":`deck-widget-${e.id}`,className:ge("flex items-center gap-3 rounded-lg border px-3 py-2.5 text-sm transition-colors",a?"border-border bg-muted/20 hover:border-muted-fg/30":"border-border/50 bg-muted/10"),children:[n.jsx(qe,{content:e.source==="apx"?u("deck_screen.widget_native"):u("deck_screen.widget_external"),children:n.jsx("span",{className:ge("size-2 shrink-0 rounded-full",e.source==="apx"?"bg-emerald-500":"bg-sky-400")})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"font-medium",children:e.title}),n.jsx("span",{className:"ml-2 text-xs text-muted-fg",children:e.desktop})]}),n.jsx(Ve,{tone:D$(e.kind),children:e.kind}),n.jsx(Ve,{tone:O$(e.status),children:z$(e.status)}),a?n.jsx("span",{"data-testid":`deck-widget-toggle-${e.id}`,children:n.jsx(Bt,{checked:i,onChange:d,disabled:o||!t})}):n.jsx("span",{className:"w-9 shrink-0","aria-hidden":!0})]})}function L$({desktop:e,widgets:t,onToggle:a}){return t.length===0?null:n.jsxs("div",{"data-testid":`deck-desktop-${e.id}`,className:"space-y-1.5",children:[n.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-fg",children:e.title}),n.jsx("ul",{className:"space-y-1.5",children:t.map(o=>n.jsx(P$,{widget:o,onToggle:o.source==="external"?l=>a(o.id,l):void 0},o.id))})]})}function I$(){Ze();const{data:e,error:t,isLoading:a,mutate:o}=He("/deck/manifest",()=>jN.manifest(),{refreshInterval:3e4}),l=async(g,b)=>{},i=e?.deck.desktops??[],d=e?.deck.widgets??[],f=i.map(g=>({desktop:g,widgets:d.filter(b=>b.desktop===g.id)})),h=d.filter(g=>g.source==="external").filter(g=>g.user_enabled===!0).length;return n.jsxs("div",{className:"relative min-h-full","data-testid":"screen-deck",children:[n.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6 pointer-events-none select-none blur-[2px] opacity-60","aria-hidden":!0,inert:!0,children:[e&&n.jsx(M$,{manifest:e}),n.jsxs(Ye,{title:u("deck_screen.widgets_title"),description:a?u("modules_ui.deck_loading_manifest"):t?u("modules_ui.deck_manifest_error"):u("modules_ui.deck_widgets_summary",{count:d.length,enabled:h}),action:n.jsx(qe,{content:u("deck_screen.reload_manifest"),children:n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>o(),disabled:a,"aria-label":u("deck_screen.reload_manifest"),children:n.jsx(Ss,{size:14,className:a?"animate-spin":""})})}),children:[a&&n.jsx(rt,{label:u("modules_ui.deck_loading_manifest_full")}),!a&&t&&n.jsxs(pt,{children:[u("modules_ui.deck_manifest_load_failed")," ",n.jsx("button",{type:"button",className:"ml-1 underline",onClick:()=>o(),children:u("modules_ui.deck_retry")})]}),!a&&!t&&d.length===0&&n.jsx(pt,{children:u("modules_ui.deck_no_widgets")}),!a&&!t&&d.length>0&&n.jsx("div",{className:"space-y-5","data-testid":"deck-desktop-list",children:f.filter(g=>g.widgets.length>0).map(g=>n.jsx(L$,{desktop:g.desktop,widgets:g.widgets,onToggle:l},g.desktop.id))})]}),e?.apx&&n.jsx(Ye,{title:u("deck_screen.context_title"),description:u("modules_ui.deck_context_desc"),children:n.jsxs("div",{className:"space-y-2 text-sm","data-testid":"deck-apx-context",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.deck_active_project")}),n.jsx("span",{className:"font-medium",children:e.apx.active_project?e.apx.active_project.name:u("modules_ui.deck_none")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.deck_registered_projects")}),n.jsx("span",{className:"font-medium",children:e.apx.projects.length})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-muted-fg",children:u("modules_ui.deck_active_plugins")}),n.jsx("span",{className:"font-medium",children:Object.keys(e.apx.plugins).join(", ")||"—"})]})]})})]}),n.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center p-6 backdrop-blur-[1px]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-coming-soon-title","data-testid":"deck-coming-soon",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-card/95 p-8 text-center shadow-2xl",children:[n.jsx("div",{className:"mx-auto mb-4 flex size-12 items-center justify-center rounded-full bg-muted",children:n.jsx(HA,{className:"size-6 text-muted-fg"})}),n.jsx("span",{className:"inline-block rounded-full bg-muted px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-fg",children:u("deck_screen.preview_badge")}),n.jsx("h2",{id:"deck-coming-soon-title",className:"mt-3 text-lg font-semibold",children:u("deck_screen.preview_title")}),n.jsx("p",{className:"mt-2 text-sm text-muted-fg",children:u("deck_screen.preview_body")})]})})]})}const B$=[{title:u("settings.account_section"),items:[{key:"identity",label:u("settings.tabs.identity"),icon:Sb}]},{title:u("settings.agents_section"),items:[{key:"super_agent",label:u("settings.tabs.super_agent"),icon:rn},{key:"engines",label:u("settings.tabs.engines"),icon:gb},{key:"memory",label:"Memory (RAG)",icon:F2},{key:"skills",label:u("skills_page.title"),icon:sa}]},{title:u("settings.channels_section"),items:[{key:"telegram",label:u("settings.tabs.telegram"),icon:ja},{key:"devices",label:u("settings.tabs.devices"),icon:wM}]},{title:u("settings.modules_section"),items:[{key:"voice",label:u("nav.modules.voice"),icon:vb},{key:"desktop",label:u("nav.modules.desktop"),icon:yb},{key:"deck",label:u("nav.modules.deck"),icon:lM},{key:"web",label:u("nav.modules.web"),icon:W2}]},{title:u("settings.advanced_section"),items:[{key:"advanced",label:u("settings.tabs.advanced"),icon:kb}]}],$$=new Set(["engines","telegram","memory","skills","web","voice"]),U$={identity:()=>n.jsx(vB,{}),super_agent:()=>n.jsx(yB,{}),engines:()=>n.jsx(xE,{}),memory:()=>n.jsx(wB,{}),skills:()=>n.jsx(NB,{}),telegram:()=>n.jsx(MB,{}),devices:()=>n.jsx(o$,{}),voice:()=>n.jsx(T$,{}),deck:()=>n.jsx(I$,{}),desktop:()=>n.jsx(y$,{}),web:()=>n.jsx(u$,{}),advanced:()=>n.jsx(c$,{})};function H$(){const e=Pn(),t=ss(),a=q$(t.pathname),o=U$[a],{collapsed:l,toggle:i}=C_(zn.sidebarCollapsed+".settings");return n.jsx(GN,{sections:B$,active:a,onChange:d=>e(d==="identity"?"/settings":`/settings/${V$(d)}`),collapsed:l,onToggleCollapse:i,contentClassName:`w-full ${$$.has(a)?"":"mx-auto max-w-3xl"} space-y-6 py-6 pt-3 pr-6 pl-4`,testId:`settings-tab-${a}`,children:n.jsx(o,{})})}function q$(e){switch(e.split("/").filter(Boolean)[1]||"identity"){case"super-agent":return"super_agent";case"engines":return"engines";case"memory":return"memory";case"skills":return"skills";case"telegram":return"telegram";case"devices":return"devices";case"voice":return"voice";case"deck":return"deck";case"desktop":return"desktop";case"web":return"web";case"appearance":return"web";case"config":case"advanced":return"advanced";default:return"identity"}}function V$(e){return e==="super_agent"?"super-agent":e==="advanced"?"config":e}function F$(){const{data:e,isLoading:t,mutate:a}=He("/messages/global?channel=desktop",()=>x$(40),{refreshInterval:8e3});return n.jsx("div",{className:"mx-auto max-w-3xl space-y-6 p-6","data-testid":"screen-desktop",children:n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{children:n.jsx(rR,{showConfigLink:!0})}),n.jsx("div",{children:n.jsx(Ye,{title:u("desktop_screen.last_conv_title"),description:u("modules_ui.desktop_last_conv_desc"),action:n.jsx("button",{type:"button",onClick:()=>a(),className:"text-xs text-muted-fg underline-offset-2 hover:underline",children:u("modules_ui.desktop_refresh")}),children:n.jsx(G$,{messages:e||[],loading:t})})})]})})}function G$({messages:e,loading:t}){const a=x.useMemo(()=>K$(e),[e]);return t?n.jsx(rt,{}):e.length?n.jsx("div",{className:"space-y-3 max-h-[560px] overflow-y-auto pr-1",children:a.slice().reverse().map((o,l)=>n.jsx("div",{className:"rounded-lg border border-border bg-card/40 p-3",children:o.map((i,d)=>n.jsx(Y$,{m:i},d))},l))}):n.jsx(pt,{children:u("modules_ui.desktop_no_messages")})}function Y$({m:e}){const t=e.direction==="in",a=X$(e.ts);return n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2 text-[11px] text-muted-fg",children:[n.jsx("span",{className:"font-semibold",children:u(t?"modules_ui.desktop_you":"modules_ui.desktop_roby")}),n.jsx("span",{children:a})]}),n.jsx("div",{className:"mt-0.5 text-sm leading-snug whitespace-pre-wrap "+(t?"text-muted-fg":"text-fg"),children:(e.body||"").trim()||n.jsx("span",{className:"italic opacity-50",children:u("modules_ui.desktop_empty_msg")})})]})}function K$(e){const t=[];for(const a of e)a.direction==="in"||!t.length?t.push([a]):t[t.length-1].push(a);return t}function X$(e){try{const t=new Date(e);return t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}function Q$(e,t){const a=getComputedStyle(e),o=parseFloat(a.fontSize);return t*o}function W$(e,t){const a=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(a.fontSize);return t*o}function Z$(e){return e/100*window.innerHeight}function J$(e){return e/100*window.innerWidth}function eU(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Mc({groupSize:e,panelElement:t,styleProp:a}){let o;const[l,i]=eU(a);switch(i){case"%":{o=l/100*e;break}case"px":{o=l;break}case"rem":{o=W$(t,l);break}case"em":{o=Q$(t,l);break}case"vh":{o=Z$(l);break}case"vw":{o=J$(l);break}}return o}function ts(e){return parseFloat(e.toFixed(3))}function di({group:e}){const{orientation:t,panels:a}=e;return a.reduce((o,l)=>(o+=t==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,o),0)}function eb(e){const{panels:t}=e,a=di({group:e});return a===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:l,panelConstraints:i}=o;let d=0;if(i.collapsedSize!==void 0){const g=Mc({groupSize:a,panelElement:l,styleProp:i.collapsedSize});d=ts(g/a*100)}let f;if(i.defaultSize!==void 0){const g=Mc({groupSize:a,panelElement:l,styleProp:i.defaultSize});f=ts(g/a*100)}let m=0;if(i.minSize!==void 0){const g=Mc({groupSize:a,panelElement:l,styleProp:i.minSize});m=ts(g/a*100)}let h=100;if(i.maxSize!==void 0){const g=Mc({groupSize:a,panelElement:l,styleProp:i.maxSize});h=ts(g/a*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:d,collapsible:i.collapsible===!0,defaultSize:f,disabled:i.disabled,minSize:m,maxSize:h,panelId:o.id}})}function Ft(e,t="Assertion error"){if(!e)throw Error(t)}function tb(e,t){return Array.from(t).sort(e==="horizontal"?tU:nU)}function tU(e,t){const a=e.element.offsetLeft-t.element.offsetLeft;return a!==0?a:e.element.offsetWidth-t.element.offsetWidth}function nU(e,t){const a=e.element.offsetTop-t.element.offsetTop;return a!==0?a:e.element.offsetHeight-t.element.offsetHeight}function oR(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function lR(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function sU({orientation:e,rects:t,targetRect:a}){const o={x:a.x+a.width/2,y:a.y+a.height/2};let l,i=Number.MAX_VALUE;for(const d of t){const{x:f,y:m}=lR(o,d),h=e==="horizontal"?f:m;h<i&&(i=h,l=d)}return Ft(l,"No rect found"),l}let Jd;function aU(){return Jd===void 0&&(typeof matchMedia=="function"?Jd=!!matchMedia("(pointer:coarse)").matches:Jd=!1),Jd}function iR(e){const{element:t,orientation:a,panels:o,separators:l}=e,i=tb(a,Array.from(t.children).filter(oR).map(N=>({element:N}))).map(({element:N})=>N),d=[];let f=!1,m=!1,h=-1,g=-1,b=0,_,k=[];{let N=-1;for(const y of i)y.hasAttribute("data-panel")&&(N++,y.hasAttribute("data-disabled")||(b++,h===-1&&(h=N),g=N))}if(b>1){let N=-1;for(const y of i)if(y.hasAttribute("data-panel")){N++;const w=o.find(E=>E.element===y);if(w){if(_){const E=_.element.getBoundingClientRect(),j=y.getBoundingClientRect();let S;if(m){const R=a==="horizontal"?new DOMRect(E.right,E.top,0,E.height):new DOMRect(E.left,E.bottom,E.width,0),A=a==="horizontal"?new DOMRect(j.left,j.top,0,j.height):new DOMRect(j.left,j.top,j.width,0);switch(k.length){case 0:{S=[R,A];break}case 1:{const T=k[0],O=sU({orientation:a,rects:[E,j],targetRect:T.element.getBoundingClientRect()});S=[T,O===E?A:R];break}default:{S=k;break}}}else k.length?S=k:S=[a==="horizontal"?new DOMRect(E.right,j.top,j.left-E.right,j.height):new DOMRect(j.left,E.bottom,j.width,j.top-E.bottom)];for(const R of S){let A="width"in R?R:R.element.getBoundingClientRect();const T=aU()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(A.width<T){const M=T-A.width;A=new DOMRect(A.x-M/2,A.y,A.width+M,A.height)}if(A.height<T){const M=T-A.height;A=new DOMRect(A.x,A.y-M/2,A.width,A.height+M)}const O=N<=h||N>g;!f&&!O&&d.push({group:e,groupSize:di({group:e}),panels:[_,w],separator:"width"in R?void 0:R,rect:A}),f=!1}}m=!1,_=w,k=[]}}else if(y.hasAttribute("data-separator")){y.ariaDisabled!==null&&(f=!0);const w=l.find(E=>E.element===y);w?k.push(w):(_=void 0,k=[])}else m=!0}return d}class cR{#e={};addListener(t,a){const o=this.#e[t];return o===void 0?this.#e[t]=[a]:o.includes(a)||o.push(a),()=>{this.removeListener(t,a)}}emit(t,a){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,a);else{let l=!1,i=null;const d=Array.from(o);for(let f=0;f<d.length;f++){const m=d[f];try{m.call(null,a)}catch(h){i===null&&(l=!0,i=h)}}if(l)throw i}}removeAllListeners(){this.#e={}}removeListener(t,a){const o=this.#e[t];if(o!==void 0){const l=o.indexOf(a);l>=0&&o.splice(l,1)}}}let Jl={cursorFlags:0,state:"inactive"};const av=new cR;function Uo(){return Jl}function rU(e){return av.addListener("change",e)}function oU(e){const t=Jl,a={...Jl};a.cursorFlags=e,Jl=a,av.emit("change",{prev:t,next:a})}function ei(e){const t=Jl;Jl=e,av.emit("change",{prev:t,next:e})}const lU=e=>e,ux=()=>{},uR=1,dR=2,fR=4,pR=8,Qw=3,Ww=12;let ef;function Zw(){return ef===void 0&&(ef=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ef=!0)),ef}function iU({cursorFlags:e,groups:t,state:a}){let o=0,l=0;switch(a){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{o++;break}case"vertical":{l++;break}}})}if(!(o===0&&l===0)){switch(a){case"active":{if(e&&Zw()){const i=(e&uR)!==0,d=(e&dR)!==0,f=(e&fR)!==0,m=(e&pR)!==0;if(i)return f?"se-resize":m?"ne-resize":"e-resize";if(d)return f?"sw-resize":m?"nw-resize":"w-resize";if(f)return"s-resize";if(m)return"n-resize"}break}}return Zw()?o>0&&l>0?"move":o>0?"ew-resize":"ns-resize":o>0&&l>0?"grab":o>0?"col-resize":"row-resize"}}const Jw=new WeakMap;function rv(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:a}=Jw.get(e)??{};a===void 0&&(a=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(a):e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]));const o=Uo();switch(o.state){case"active":case"hover":{const l=iU({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(d=>d.group),state:o.state}),i=`*, *:hover {cursor: ${l} !important; }`;if(t===i)return;t=i,l?a.cssRules.length===0?a.insertRule(i):a.replaceSync(i):a.cssRules.length===1&&a.deleteRule(0);break}case"inactive":{t=void 0,a.cssRules.length===1&&a.deleteRule(0);break}}Jw.set(e,{prevStyle:t,styleSheet:a})}let ha=new Map;const mR=new cR;function cU(e){ha=new Map(ha),ha.delete(e)}function e2(e,t){for(const[a]of ha)if(a.id===e)return a}function Fr(e,t){for(const[a,o]of ha)if(a.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Wo(){return ha}function ov(e,t){return mR.addListener("groupChange",a=>{a.group.id===e&&t(a)})}function ir(e,t,a){const o=ha.get(e);ha=new Map(ha),ha.set(e,t),mR.emit("groupChange",{group:e,isUserInteraction:a?.isUserInteraction===!0,prev:o,next:t})}function gR(e){const t=Uo();let a=!1;switch(t.state){case"active":ei({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(rv(e),a=!0,t.hitRegions.forEach(o=>{const l=Fr(o.group.id,!0);ir(o.group,l,{isUserInteraction:!0})}))}return a}function t2(e){e.defaultPrevented||gR(e.currentTarget)}function uU(e,t,a){let o,l={x:1/0,y:1/0};for(const i of t){const d=lR(a,i.rect);switch(e){case"horizontal":{d.x<=l.x&&(o=i,l=d);break}case"vertical":{d.y<=l.y&&(o=i,l=d);break}}}return o?{distance:l,hitRegion:o}:void 0}function dU(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function fU(e,t){if(e===t)throw new Error("Cannot compare node with itself");const a={a:a2(e),b:a2(t)};let o;for(;a.a.at(-1)===a.b.at(-1);)o=a.a.pop(),a.b.pop();Ft(o,"Stacking order can only be calculated for elements with a common ancestor");const l={a:s2(n2(a.a)),b:s2(n2(a.b))};if(l.a===l.b){const i=o.childNodes,d={a:a.a.at(-1),b:a.b.at(-1)};let f=i.length;for(;f--;){const m=i[f];if(m===d.a)return 1;if(m===d.b)return-1}}return Math.sign(l.a-l.b)}const pU=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function mU(e){const t=getComputedStyle(hR(e)??e).display;return t==="flex"||t==="inline-flex"}function gU(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||mU(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||pU.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function n2(e){let t=e.length;for(;t--;){const a=e[t];if(Ft(a,"Missing node"),gU(a))return a}return null}function s2(e){return e&&Number(getComputedStyle(e).zIndex)||0}function a2(e){const t=[];for(;e;)t.push(e),e=hR(e);return t}function hR(e){const{parentNode:t}=e;return dU(t)?t.host:t}function hU(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function xU({groupElement:e,hitRegion:t,pointerEventTarget:a}){if(!oR(a)||a.contains(e)||e.contains(a))return!0;if(fU(a,e)>0){let o=a;for(;o;){if(o.contains(e))return!0;if(hU(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function lv(e,t){const a=[];return t.forEach((o,l)=>{if(l.disabled)return;const i=iR(l),d=uU(l.orientation,i,{x:e.clientX,y:e.clientY});d&&d.distance.x<=0&&d.distance.y<=0&&xU({groupElement:l.element,hitRegion:d.hitRegion.rect,pointerEventTarget:e.target})&&a.push(d.hitRegion)}),a}function bU(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(e[a]!=t[a])return!1;return!0}function Kn(e,t,a=0){return Math.abs(ts(e)-ts(t))<=a}function pa(e,t){return Kn(e,t)?0:e>t?1:-1}function Vl({overrideDisabledPanels:e,panelConstraints:t,prevSize:a,size:o}){const{collapsedSize:l=0,collapsible:i,disabled:d,maxSize:f=100,minSize:m=0}=t;if(d&&!e)return a;if(pa(o,m)<0)if(i){const h=(l+m)/2;pa(o,h)<0?o=l:o=m}else o=m;return o=Math.min(f,o),o=ts(o),o}function Wc({delta:e,initialLayout:t,panelConstraints:a,pivotIndices:o,prevLayout:l,trigger:i}){if(Kn(e,0))return t;const d=i==="imperative-api",f=Object.values(t),m=Object.values(l),h=[...f],[g,b]=o;Ft(g!=null,"Invalid first pivot index"),Ft(b!=null,"Invalid second pivot index");let _=0;switch(i){case"keyboard":{{const y=e<0?b:g,w=a[y];Ft(w,`Panel constraints not found for index ${y}`);const{collapsedSize:E=0,collapsible:j,minSize:S=0}=w;if(j){const R=f[y];if(Ft(R!=null,`Previous layout not found for panel index ${y}`),Kn(R,E)){const A=S-R;pa(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}{const y=e<0?g:b,w=a[y];Ft(w,`No panel constraints found for index ${y}`);const{collapsedSize:E=0,collapsible:j,minSize:S=0}=w;if(j){const R=f[y];if(Ft(R!=null,`Previous layout not found for panel index ${y}`),Kn(R,S)){const A=R-E;pa(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}break}default:{const y=e<0?b:g,w=a[y];Ft(w,`Panel constraints not found for index ${y}`);const E=f[y],{collapsible:j,collapsedSize:S,minSize:R}=w;if(j&&pa(E,R)<0)if(e>0){const A=R-S,T=A/2,O=E+e;pa(O,R)<0&&(e=pa(e,T)<=0?0:A)}else{const A=R-S,T=100-A/2,O=E-e;pa(O,R)<0&&(e=pa(100+e,T)>0?0:-A)}break}}{const y=e<0?1:-1;let w=e<0?b:g,E=0;for(;;){const S=f[w];Ft(S!=null,`Previous layout not found for panel index ${w}`);const R=Vl({overrideDisabledPanels:d,panelConstraints:a[w],prevSize:S,size:100})-S;if(E+=R,w+=y,w<0||w>=a.length)break}const j=Math.min(Math.abs(e),Math.abs(E));e=e<0?0-j:j}{let y=e<0?g:b;for(;y>=0&&y<a.length;){const w=Math.abs(e)-Math.abs(_),E=f[y];Ft(E!=null,`Previous layout not found for panel index ${y}`);const j=E-w,S=Vl({overrideDisabledPanels:d,panelConstraints:a[y],prevSize:E,size:j});if(!Kn(E,S)&&(_+=E-S,h[y]=S,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?y--:y++}}if(bU(m,h))return l;{const y=e<0?b:g,w=f[y];Ft(w!=null,`Previous layout not found for panel index ${y}`);const E=w+_,j=Vl({overrideDisabledPanels:d,panelConstraints:a[y],prevSize:w,size:E});if(h[y]=j,!Kn(j,E)){let S=E-j,R=e<0?b:g;for(;R>=0&&R<a.length;){const A=h[R];Ft(A!=null,`Previous layout not found for panel index ${R}`);const T=A+S,O=Vl({overrideDisabledPanels:d,panelConstraints:a[R],prevSize:A,size:T});if(Kn(A,O)||(S-=O-A,h[R]=O),Kn(S,0))break;e>0?R--:R++}}}const k=Object.values(h).reduce((y,w)=>w+y,0);if(!Kn(k,100,.1))return l;const N=Object.keys(l);return h.reduce((y,w,E)=>(y[N[E]]=w,y),{})}function Ho(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e)if(t[a]===void 0||pa(e[a],t[a])!==0)return!1;return!0}function qo({layout:e,panelConstraints:t}){const a=Object.values(e),o=[...a],l=o.reduce((f,m)=>f+m,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(f=>`${f}%`).join(", ")}`);if(!Kn(l,100)&&o.length>0)for(let f=0;f<t.length;f++){const m=o[f];Ft(m!=null,`No layout data found for index ${f}`);const h=100/l*m;o[f]=h}let i=0;for(let f=0;f<t.length;f++){const m=a[f];Ft(m!=null,`No layout data found for index ${f}`);const h=o[f];Ft(h!=null,`No layout data found for index ${f}`);const g=Vl({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:m,size:h});h!=g&&(i+=h-g,o[f]=g)}if(!Kn(i,0))for(let f=0;f<t.length;f++){const m=o[f];Ft(m!=null,`No layout data found for index ${f}`);const h=m+i,g=Vl({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:m,size:h});if(m!==g&&(i-=g-m,o[f]=g,Kn(i,0)))break}const d=Object.keys(e);return o.reduce((f,m,h)=>(f[d[h]]=m,f),{})}function xR({groupId:e,panelId:t}){const a=()=>{const m=Wo();for(const[h,{defaultLayoutDeferred:g,derivedPanelConstraints:b,layout:_,groupSize:k,separatorToPanels:N}]of m)if(h.id===e)return{defaultLayoutDeferred:g,derivedPanelConstraints:b,group:h,groupSize:k,layout:_,separatorToPanels:N};throw Error(`Group ${e} not found`)},o=()=>{const m=a().derivedPanelConstraints.find(h=>h.panelId===t);if(m!==void 0)return m;throw Error(`Panel constraints not found for Panel ${t}`)},l=()=>{const m=a().group.panels.find(h=>h.id===t);if(m!==void 0)return m;throw Error(`Layout not found for Panel ${t}`)},i=()=>{const m=a().layout[t];if(m!==void 0)return m;throw Error(`Layout not found for Panel ${t}`)},d=({nextSize:m,panels:h,prevLayout:g,derivedPanelConstraints:b})=>{const _=i(),k=h.findIndex(w=>w.id===t),N=k===0,y=k===h.length-1;if(y&&m<_&&(N||h.slice(0,k).every((w,E)=>{const j=b[E];return j?.collapsible&&Kn(j.collapsedSize,g[j.panelId])}))){const w=h.slice(0,k).reduce((E,j)=>E+g[j.id],0);return{...g,[t]:ts(100-w)}}return Wc({delta:y?_-m:m-_,initialLayout:g,panelConstraints:b,pivotIndices:y?[k-1,k]:[k,k+1],prevLayout:g,trigger:"imperative-api"})},f=m=>{const h=i();if(m===h)return;const{defaultLayoutDeferred:g,derivedPanelConstraints:b,group:_,groupSize:k,layout:N,separatorToPanels:y}=a(),w=d({nextSize:m,panels:_.panels,prevLayout:N,derivedPanelConstraints:b}),E=qo({layout:w,panelConstraints:b});Ho(N,E)||ir(_,{defaultLayoutDeferred:g,derivedPanelConstraints:b,groupSize:k,layout:E,separatorToPanels:y})};return{collapse:()=>{const{collapsible:m,collapsedSize:h}=o(),{mutableValues:g}=l(),b=i();m&&b!==h&&(g.expandToSize=b,f(h))},expand:()=>{const{collapsible:m,collapsedSize:h,minSize:g}=o(),{mutableValues:b}=l(),_=i();if(m&&_===h){let k=b.expandToSize??g;k===0&&(k=1),f(k)}},getSize:()=>{const{group:m}=a(),h=i(),{element:g}=l(),b=m.orientation==="horizontal"?g.offsetWidth:g.offsetHeight;return{asPercentage:h,inPixels:b}},isCollapsed:()=>{const{collapsible:m,collapsedSize:h}=o(),g=i();return m&&Kn(h,g)},resize:m=>{const{group:h}=a(),{element:g}=l(),b=di({group:h}),_=Mc({groupSize:b,panelElement:g,styleProp:m}),k=ts(_/b*100);f(k)}}}function r2(e){if(e.defaultPrevented)return;const t=Wo();lv(e,t).forEach(a=>{if(a.separator&&!a.separator.disableDoubleClick){const o=a.panels.find(l=>l.panelConstraints.defaultSize!==void 0);if(o){const l=o.panelConstraints.defaultSize,i=xR({groupId:a.group.id,panelId:o.id});i&&l!==void 0&&(i.resize(l),e.preventDefault())}}})}function df(e){const t=Wo();for(const[a]of t)if(a.separators.some(o=>o.element===e))return a;throw Error("Could not find parent Group for separator element")}function bR({groupId:e}){const t=()=>{const a=Wo();for(const[o,l]of a)if(o.id===e)return{group:o,...l};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:a,layout:o}=t();return a?{}:o},setLayout(a){const{defaultLayoutDeferred:o,derivedPanelConstraints:l,group:i,groupSize:d,layout:f,separatorToPanels:m}=t(),h=qo({layout:a,panelConstraints:l});return o?f:(Ho(f,h)||ir(i,{defaultLayoutDeferred:o,derivedPanelConstraints:l,groupSize:d,layout:h,separatorToPanels:m}),h)}}}function Co(e,t){const a=df(e),o=Fr(a.id,!0),l=a.separators.find(g=>g.element===e);Ft(l,"Matching separator not found");const i=o.separatorToPanels.get(l);Ft(i,"Matching panels not found");const d=i.map(g=>a.panels.indexOf(g)),f=bR({groupId:a.id}).getLayout(),m=Wc({delta:t,initialLayout:f,panelConstraints:o.derivedPanelConstraints,pivotIndices:d,prevLayout:f,trigger:"keyboard"}),h=qo({layout:m,panelConstraints:o.derivedPanelConstraints});Ho(f,h)||ir(a,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:h,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function o2(e){if(e.defaultPrevented)return;const t=e.currentTarget,a=df(t);if(!a.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),a.orientation==="vertical"&&Co(t,5);break}case"ArrowLeft":{e.preventDefault(),a.orientation==="horizontal"&&Co(t,-5);break}case"ArrowRight":{e.preventDefault(),a.orientation==="horizontal"&&Co(t,5);break}case"ArrowUp":{e.preventDefault(),a.orientation==="vertical"&&Co(t,-5);break}case"End":{e.preventDefault(),Co(t,100);break}case"Enter":{e.preventDefault();const o=df(t),l=Fr(o.id,!0),{derivedPanelConstraints:i,layout:d,separatorToPanels:f}=l,m=o.separators.find(_=>_.element===t);Ft(m,"Matching separator not found");const h=f.get(m);Ft(h,"Matching panels not found");const g=h[0],b=i.find(_=>_.panelId===g.id);if(Ft(b,"Panel metadata not found"),b.collapsible){const _=d[g.id],k=b.collapsedSize===_?o.mutableState.expandedPanelSizes[g.id]??b.minSize:b.collapsedSize;Co(t,k-_)}break}case"F6":{e.preventDefault();const o=df(t).separators.map(d=>d.element),l=Array.from(o).findIndex(d=>d===e.currentTarget);Ft(l!==null,"Index not found");const i=e.shiftKey?l>0?l-1:o.length-1:l+1<o.length?l+1:0;o[i].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Co(t,-100);break}}}function l2(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Wo(),a=lv(e,t),o=new Map;let l=!1;a.forEach(i=>{i.separator&&(l||(l=!0,i.separator.element.focus({focusVisible:!1,preventScroll:!0})));const d=t.get(i.group);d&&o.set(i.group,d.layout)}),ei({cursorFlags:0,hitRegions:a,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),a.length&&e.preventDefault()}function _R({document:e,event:t,hitRegions:a,initialLayoutMap:o,mountedGroups:l,pointerDownAtPoint:i,prevCursorFlags:d}){let f=0;a.forEach(h=>{const{group:g,groupSize:b}=h,{orientation:_,panels:k}=g,{disableCursor:N}=g.mutableState;let y=0;i?_==="horizontal"?y=(t.clientX-i.x)/b*100:y=(t.clientY-i.y)/b*100:_==="horizontal"?y=t.clientX<0?-100:100:y=t.clientY<0?-100:100;const w=o.get(g),E=l.get(g);if(!w||!E)return;const{defaultLayoutDeferred:j,derivedPanelConstraints:S,groupSize:R,layout:A,separatorToPanels:T}=E;if(S&&A&&T){const O=Wc({delta:y,initialLayout:w,panelConstraints:S,pivotIndices:h.panels.map(M=>k.indexOf(M)),prevLayout:A,trigger:"mouse-or-touch"});if(Ho(O,A)){if(y!==0&&!N)switch(_){case"horizontal":{f|=y<0?uR:dR;break}case"vertical":{f|=y<0?fR:pR;break}}}else ir(h.group,{defaultLayoutDeferred:j,derivedPanelConstraints:S,groupSize:R,layout:O,separatorToPanels:T})}});let m=0;t.movementX===0?m|=d&Qw:m|=f&Qw,t.movementY===0?m|=d&Ww:m|=f&Ww,oU(m),rv(e)}function i2(e){const t=Wo(),a=Uo();switch(a.state){case"active":_R({document:e.currentTarget,event:e,hitRegions:a.hitRegions,initialLayoutMap:a.initialLayoutMap,mountedGroups:t,prevCursorFlags:a.cursorFlags})}}function c2(e){if(e.defaultPrevented)return;const t=Uo(),a=Wo();switch(t.state){case"active":{if(e.buttons===0){ei({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const l=Fr(o.group.id,!0);ir(o.group,l,{isUserInteraction:!0})});return}for(const o of t.hitRegions)if(o.separator){const{element:l}=o.separator;l.hasPointerCapture?.(e.pointerId)||l.setPointerCapture?.(e.pointerId)}_R({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=lv(e,a);o.length===0?t.state!=="inactive"&&ei({cursorFlags:0,state:"inactive"}):ei({cursorFlags:0,hitRegions:o,state:"hover"}),rv(e.currentTarget);break}}}function u2(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Uo().state){case"hover":ei({cursorFlags:0,state:"inactive"})}}function d2(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||gR(e.currentTarget)&&e.preventDefault()}function f2(e){let t=0,a=0;const o={};for(const i of e)if(i.defaultSize!==void 0){t++;const d=ts(i.defaultSize);a+=d,o[i.panelId]=d}else o[i.panelId]=void 0;const l=e.length-t;if(l!==0){const i=ts((100-a)/l);for(const d of e)d.defaultSize===void 0&&(o[d.panelId]=i)}return o}function _U(e,t,a){if(!a[0])return;const o=e.panels.find(m=>m.element===t);if(!o||!o.onResize)return;const l=di({group:e}),i=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,d=o.mutableValues.prevSize,f={asPercentage:ts(i/l*100),inPixels:i};o.mutableValues.prevSize=f,o.onResize(f,o.id,d)}function vU(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e)if(e[a]!==t[a])return!1;return!0}function yU({group:e,nextGroupSize:t,prevGroupSize:a,prevLayout:o}){if(a<=0||t<=0||a===t)return o;let l=0,i=0,d=!1;const f=new Map,m=[];for(const b of e.panels){const _=o[b.id]??0;switch(b.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{d=!0;const k=_/100*a,N=ts(k/t*100);f.set(b.id,N),l+=N;break}case"preserve-relative-size":default:{m.push(b.id),i+=_;break}}}if(!d||m.length===0)return o;const h=100-l,g={...o};if(f.forEach((b,_)=>{g[_]=b}),i>0)for(const b of m){const _=o[b]??0;g[b]=ts(_/i*h)}else{const b=ts(h/m.length);for(const _ of m)g[_]=b}return g}function jU(e,t){const a=e.map(l=>l.id),o=Object.keys(t);if(a.length!==o.length)return!1;for(const l of a)if(!o.includes(l))return!1;return!0}const $l=new Map;function kU(e){let t=!0;Ft(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const a=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,l=new Set,i=new a(N=>{for(const y of N){const{borderBoxSize:w,target:E}=y;if(E===e.element){if(t){const j=di({group:e});if(j===0)return;const S=Fr(e.id);if(!S)return;const R=eb(e),A=S.defaultLayoutDeferred?f2(R):S.layout,T=yU({group:e,nextGroupSize:j,prevGroupSize:S.groupSize,prevLayout:A}),O=qo({layout:T,panelConstraints:R});if(!S.defaultLayoutDeferred&&Ho(S.layout,O)&&vU(S.derivedPanelConstraints,R)&&S.groupSize===j)return;ir(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:R,groupSize:j,layout:O,separatorToPanels:S.separatorToPanels})}}else _U(e,E,w)}});i.observe(e.element),e.panels.forEach(N=>{Ft(!o.has(N.id),`Panel ids must be unique; id "${N.id}" was used more than once`),o.add(N.id),N.onResize&&i.observe(N.element)});const d=di({group:e}),f=eb(e),m=e.panels.map(({id:N})=>N).join(",");let h=e.mutableState.defaultLayout;h&&(jU(e.panels,h)||(h=void 0));const g=e.mutableState.layouts[m]??h??f2(f),b=qo({layout:g,panelConstraints:f}),_=e.element.ownerDocument;$l.set(_,($l.get(_)??0)+1);const k=new Map;return iR(e).forEach(N=>{N.separator&&k.set(N.separator,N.panels)}),ir(e,{defaultLayoutDeferred:d===0,derivedPanelConstraints:f,groupSize:d,layout:b,separatorToPanels:k}),e.separators.forEach(N=>{Ft(!l.has(N.id),`Separator ids must be unique; id "${N.id}" was used more than once`),l.add(N.id),N.element.addEventListener("keydown",o2)}),$l.get(_)===1&&(_.addEventListener("contextmenu",t2,!0),_.addEventListener("dblclick",r2,!0),_.addEventListener("pointerdown",l2,!0),_.addEventListener("pointerleave",i2),_.addEventListener("pointermove",c2),_.addEventListener("pointerout",u2),_.addEventListener("pointerup",d2,!0)),function(){t=!1,$l.set(_,Math.max(0,($l.get(_)??0)-1)),cU(e),e.separators.forEach(N=>{N.element.removeEventListener("keydown",o2)}),$l.get(_)||(_.removeEventListener("contextmenu",t2,!0),_.removeEventListener("dblclick",r2,!0),_.removeEventListener("pointerdown",l2,!0),_.removeEventListener("pointerleave",i2),_.removeEventListener("pointermove",c2),_.removeEventListener("pointerout",u2),_.removeEventListener("pointerup",d2,!0)),i.disconnect()}}function wU(){const[e,t]=x.useState({}),a=x.useCallback(()=>t({}),[]);return[e,a]}function iv(e){const t=x.useId();return`${e??t}`}const Zo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Bc(e){const t=x.useRef(e);return Zo(()=>{t.current=e},[e]),x.useCallback((...a)=>t.current?.(...a),[t])}function cv(...e){return Bc(t=>{e.forEach(a=>{if(a)switch(typeof a){case"function":{a(t);break}case"object":{a.current=t;break}}})})}function uv(e){const t=x.useRef({...e});return Zo(()=>{for(const a in e)t.current[a]=e[a]},[e]),t.current}const vR=x.createContext(null);function SU(e,t){const a=x.useRef({getLayout:()=>({}),setLayout:lU});x.useImperativeHandle(t,()=>a.current,[]),Zo(()=>{Object.assign(a.current,bR({groupId:e}))})}function nb({children:e,className:t,defaultLayout:a,disableCursor:o,disabled:l,elementRef:i,groupRef:d,id:f,onLayoutChange:m,onLayoutChanged:h,orientation:g="horizontal",resizeTargetMinimumSize:b={coarse:20,fine:10},style:_,...k}){const N=x.useRef({onLayoutChange:{},onLayoutChanged:{}}),y=Bc($=>{Ho(N.current.onLayoutChange,$)||(N.current.onLayoutChange=$,m?.($))}),w=Bc(($,D)=>{Ho(N.current.onLayoutChanged,$)||(N.current.onLayoutChanged=$,h?.($,{isUserInteraction:D}))}),E=iv(f),j=x.useRef(null),[S,R]=wU(),A=x.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:b,separators:[]}),T=cv(j,i);SU(E,d);const O=Bc(($,D)=>{const L=Uo(),H=e2($),V=Fr($);if(V){let U=!1;switch(L.state){case"active":{U=L.hitRegions.some(F=>F.group===H);break}}return{flexGrow:V.layout[D]??1,pointerEvents:U?"none":void 0}}if(a?.[D])return{flexGrow:a?.[D]}}),M=uv({defaultLayout:a,disableCursor:o}),B=x.useMemo(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:O,id:E,orientation:g,registerPanel:$=>{const D=A.current;return D.panels=tb(g,[...D.panels,$]),R(),()=>{D.panels=D.panels.filter(L=>L!==$),R()}},registerSeparator:$=>{const D=A.current;return D.separators=tb(g,[...D.separators,$]),R(),()=>{D.separators=D.separators.filter(L=>L!==$),R()}},updatePanelProps:($,{disabled:D})=>{const L=A.current.panels.find(U=>U.id===$);L&&(L.panelConstraints.disabled=D);const H=e2(E),V=Fr(E);H&&V&&ir(H,{...V,derivedPanelConstraints:eb(H)})},updateSeparatorProps:($,{disabled:D,disableDoubleClick:L})=>{const H=A.current.separators.find(V=>V.id===$);H&&(H.disabled=D,H.disableDoubleClick=L)}}),[O,E,R,g,M]),P=x.useRef(null);return Zo(()=>{const $=j.current;if($===null)return;const D=A.current;let L;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===D.panels.length){L={};for(const Y of D.panels){const I=M.defaultLayout[Y.id];I!==void 0&&(L[Y.id]=I)}}const H={disabled:!!l,element:$,id:E,mutableState:{defaultLayout:L,disableCursor:!!M.disableCursor,expandedPanelSizes:A.current.lastExpandedPanelSizes,layouts:A.current.layouts},orientation:g,panels:D.panels,resizeTargetMinimumSize:D.resizeTargetMinimumSize,separators:D.separators};P.current=H;const V=kU(H),{defaultLayoutDeferred:U,derivedPanelConstraints:F,layout:X}=Fr(H.id,!0);!U&&F.length>0&&(y(X),w(X,!1));const G=ov(E,Y=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:Q,layout:J}=Y.next;if(I||Q.length===0)return;const K=H.panels.map(({id:te})=>te).join(",");H.mutableState.layouts[K]=J,Q.forEach(te=>{if(te.collapsible){const{layout:le}=Y.prev??{};if(le){const W=Kn(te.collapsedSize,J[te.panelId]),ne=Kn(te.collapsedSize,le[te.panelId]);W&&!ne&&(H.mutableState.expandedPanelSizes[te.panelId]=le[te.panelId])}}});const se=Uo().state!=="active";y(J),se&&w(J,Y.isUserInteraction)});return()=>{P.current=null,V(),G()}},[l,E,w,y,g,S,M]),x.useEffect(()=>{const $=P.current;$&&($.mutableState.defaultLayout=a,$.mutableState.disableCursor=!!o)}),n.jsx(vR.Provider,{value:B,children:n.jsx("div",{...k,className:t,"data-group":!0,"data-testid":E,id:E,ref:T,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:e})})}nb.displayName="Group";function dv(){const e=x.useContext(vR);return Ft(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function CU(e,t){const{id:a}=dv(),o=x.useRef({collapse:ux,expand:ux,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:ux});x.useImperativeHandle(t,()=>o.current,[]),Zo(()=>{Object.assign(o.current,xR({groupId:a,panelId:e}))})}function Eo({children:e,className:t,collapsedSize:a="0%",collapsible:o=!1,defaultSize:l,disabled:i,elementRef:d,groupResizeBehavior:f="preserve-relative-size",id:m,maxSize:h="100%",minSize:g="0%",onResize:b,panelRef:_,style:k,...N}){const y=!!m,w=iv(m),E=uv({disabled:i}),j=x.useRef(null),S=cv(j,d),{getPanelStyles:R,id:A,orientation:T,registerPanel:O,updatePanelProps:M}=dv(),B=b!==null,P=Bc((H,V,U)=>{b?.(H,m,U)});Zo(()=>{const H=j.current;if(H!==null){const V={element:H,id:w,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:B?P:void 0,panelConstraints:{groupResizeBehavior:f,collapsedSize:a,collapsible:o,defaultSize:l,disabled:E.disabled,maxSize:h,minSize:g}};return O(V)}},[f,a,o,l,B,w,y,h,g,P,O,E]),x.useEffect(()=>{M(w,{disabled:i})},[i,w,M]),CU(w,_);const $=()=>{const H=R(A,w);if(H)return JSON.stringify(H)},D=x.useSyncExternalStore(H=>ov(A,H),$,$);let L;return D?L=JSON.parse(D):l!==void 0?L={flexGrow:void 0,flexShrink:void 0,flexBasis:l}:L={flexGrow:1},n.jsx("div",{...N,"data-disabled":i||void 0,"data-panel":!0,"data-testid":w,id:w,ref:S,style:{...NU,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...L},children:n.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...k,touchAction:T==="horizontal"?"pan-y":"pan-x"},children:e})})}Eo.displayName="Panel";const NU={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function EU({layout:e,panelConstraints:t,panelId:a,panelIndex:o}){let l,i;const d=e[a],f=t.find(m=>m.panelId===a);if(f){const m=f.maxSize,h=f.collapsible?f.collapsedSize:f.minSize,g=[o,o+1];i=qo({layout:Wc({delta:h-d,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[a],l=qo({layout:Wc({delta:m-d,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[a]}return{valueControls:a,valueMax:l,valueMin:i,valueNow:d}}function fv({children:e,className:t,disabled:a,disableDoubleClick:o,elementRef:l,id:i,style:d,...f}){const m=iv(i),h=uv({disabled:a,disableDoubleClick:o}),[g,b]=x.useState({}),[_,k]=x.useState("inactive"),[N,y]=x.useState(!1),w=x.useRef(null),E=cv(w,l),{disableCursor:j,id:S,orientation:R,registerSeparator:A,updateSeparatorProps:T}=dv(),O=R==="horizontal"?"vertical":"horizontal";Zo(()=>{const P=w.current;if(P!==null){const $={disabled:h.disabled,disableDoubleClick:h.disableDoubleClick,element:P,id:m},D=A($),L=rU(V=>{k(V.next.state!=="inactive"&&V.next.hitRegions.some(U=>U.separator===$)?V.next.state:"inactive")}),H=ov(S,V=>{const{derivedPanelConstraints:U,layout:F,separatorToPanels:X}=V.next,G=X.get($);if(G){const Y=G[0],I=G.indexOf(Y);b(EU({layout:F,panelConstraints:U,panelId:Y.id,panelIndex:I}))}});return()=>{L(),H(),D()}}},[S,m,A,h]),x.useEffect(()=>{T(m,{disabled:a,disableDoubleClick:o})},[a,o,m,T]);let M;a&&!j&&(M="not-allowed");let B;if(a)B="disabled";else switch(_){case"active":{B="active";break}default:N?B="focus":B=_}return n.jsx("div",{...f,"aria-controls":g.valueControls,"aria-disabled":a||void 0,"aria-orientation":O,"aria-valuemax":g.valueMax,"aria-valuemin":g.valueMin,"aria-valuenow":g.valueNow,children:e,className:t,"data-separator":B,"data-testid":m,id:m,onBlur:()=>y(!1),onFocus:()=>y(!0),ref:E,role:"separator",style:{flexBasis:"auto",cursor:M,...d,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:a?void 0:0})}fv.displayName="Separator";function RU({projects:e,value:t,onChange:a,disabled:o}){const l=e.map(i=>{const d=i.path?.split("/").filter(Boolean).pop()||u("modules_ui.code_project_fallback",{id:i.id});return{value:String(i.id),label:i.name||d,icon:WA,description:i.path}});return n.jsx("div",{className:"w-full","data-testid":"code-project-select",children:n.jsx(ut,{value:t,onChange:a,options:l,placeholder:u("modules_ui.code_pick_project_ph"),disabled:o})})}function TU({sessions:e,activeId:t,busy:a,onSelect:o,onCreate:l,onRename:i,onDelete:d}){return n.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-session-list",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:u("code_module.sessions")}),n.jsx(qe,{content:u("code_module.new_session"),children:n.jsxs("button",{type:"button",onClick:l,disabled:a,"data-testid":"code-new-session",className:"flex items-center gap-1 rounded-md border border-border px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",children:[n.jsx(Pt,{className:"size-3"})," ",u("code_module.new_session")]})})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-2",children:e.length===0?n.jsx("div",{className:"p-2",children:n.jsx(pt,{children:u("code_module.no_sessions")})}):n.jsx("ul",{className:"space-y-0.5",children:e.map(f=>n.jsxs("li",{className:"group/item relative",children:[n.jsxs("button",{type:"button",onClick:()=>o(f.id),className:ge("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",f.id===t?"bg-accent text-accent-fg":"text-foreground/80 hover:bg-accent/50"),children:[n.jsx(_b,{className:"mt-0.5 size-3.5 shrink-0 opacity-60"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate font-medium",children:f.title}),n.jsxs("span",{className:"block truncate text-[10px] text-muted-foreground",children:[f.mode," · ",f.messageCount," msg",f.model?` · ${f.model}`:""]})]})]}),n.jsxs("div",{className:"absolute right-1 top-1 hidden items-center gap-0.5 group-hover/item:flex",children:[n.jsx(qe,{content:u("code_module.rename"),children:n.jsx("button",{type:"button",onClick:()=>i(f.id,f.title),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-foreground",children:n.jsx(ya,{className:"size-3"})})}),n.jsx(qe,{content:u("code_module.delete"),children:n.jsx("button",{type:"button",onClick:()=>d(f.id),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-rose-500",children:n.jsx(vn,{className:"size-3"})})})]})]},f.id))})})]})}function AU({mode:e,onChange:t,disabled:a}){const o=(l,i,d,f)=>n.jsx(qe,{content:d,children:n.jsxs("button",{type:"button",disabled:a,"data-testid":`code-mode-${l}`,"aria-pressed":e===l,onClick:()=>t(l),className:ge("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50",e===l?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(f,{className:"size-3.5"})," ",i]})});return n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border border-border bg-muted/60 p-0.5",children:[o("build",u("code_module.mode_build"),u("code_module.mode_build_hint"),nM),o("plan",u("code_module.mode_plan"),u("code_module.mode_plan_hint"),IA)]})}function MU({value:e,onValueChange:t,onSubmit:a,onStop:o,busy:l,disabled:i,mode:d,onModeChange:f,model:m,onModelChange:h}){return n.jsx(J_,{value:e,onValueChange:t,onSubmit:a,onStop:o,busy:l,disabled:i,placeholder:u("code_module.placeholder"),minRows:1,maxRows:6,footer:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(AU,{mode:d,onChange:f,disabled:l}),n.jsx(ev,{value:m,onChange:h,disabled:l})]})})}function dx(e,t){let a=0;for(const o of e.parts||[])o.kind==="text"&&t.text&&(a+=o.text.length),o.kind==="tool"&&t.tool&&(o.args&&(a+=JSON.stringify(o.args).length),o.result!==void 0&&(a+=JSON.stringify(o.result).length));return Math.ceil(a/4)}function OU(e){let t=null,a=0,o=0;for(const d of e)d.role==="user"?a++:o++,d.role==="assistant"&&d.usage&&(t={input:d.usage.input_tokens,output:d.usage.output_tokens,model:d.model});const l=t?.input??0,i=t?.output??0;return{model:t?.model??null,input:l,output:i,total:l+i,hasUsage:!!t,messages:e.length,userMsgs:a,assistantMsgs:o}}function zU(e){let t=0,a=0,o=0;for(const d of e)d.role==="user"?t+=dx(d,{text:!0}):a+=dx(d,{text:!0}),o+=dx(d,{tool:!0});const l=t+a+o||1,i=(d,f)=>({key:d,tokens:f,percent:Math.round(f/l*100)});return[i("user",t),i("assistant",a),i("tool",o)].filter(d=>d.tokens>0)}const p2={user:"bg-emerald-500",assistant:"bg-sky-500",tool:"bg-amber-500"};function Ya({label:e,value:t}){return n.jsxs("div",{className:"flex items-baseline justify-between gap-2 py-0.5",children:[n.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),n.jsx("span",{className:"min-w-0 truncate text-right font-mono text-xs text-foreground",children:t})]})}function m2(e){if(!e)return"";const t=new Date(e),a=o=>String(o).padStart(2,"0");return`${a(t.getDate())} ${t.toLocaleString("es",{month:"short"})} ${t.getFullYear()}, ${a(t.getHours())}:${a(t.getMinutes())}`}function DU({turns:e,session:t}){const a=x.useMemo(()=>OU(e),[e]),o=x.useMemo(()=>zU(e),[e]);return e.length===0?n.jsx("div",{className:"p-3",children:n.jsx(pt,{children:u("code_module.ctx_none")})}):n.jsxs("div",{className:"space-y-1 p-3","data-testid":"code-context-tab",children:[n.jsx(Ya,{label:u("code_module.ctx_model"),value:a.model||u("modules_ui.code_ctx_auto")}),t?.mode&&n.jsx(Ya,{label:u("modules_ui.code_ctx_mode"),value:t.mode}),t?.agentSlug&&n.jsx(Ya,{label:u("modules_ui.code_ctx_agent"),value:t.agentSlug}),n.jsx(Ya,{label:u("code_module.ctx_messages"),value:u("modules_ui.code_ctx_msgs_value",{user:a.userMsgs,assistant:a.assistantMsgs})}),n.jsx(Ya,{label:u("code_module.ctx_input"),value:a.input.toLocaleString()}),n.jsx(Ya,{label:u("code_module.ctx_output"),value:a.output.toLocaleString()}),n.jsx(Ya,{label:u("modules_ui.code_ctx_tokens_total"),value:(a.input+a.output).toLocaleString()}),t?.createdAt&&n.jsx(Ya,{label:u("modules_ui.code_ctx_created"),value:m2(t.createdAt)}),t?.updatedAt&&n.jsx(Ya,{label:u("modules_ui.code_ctx_activity"),value:m2(t.updatedAt)}),n.jsx("hr",{className:"border-border my-2"}),n.jsxs("div",{children:[n.jsx("div",{className:"mb-1 text-[11px] font-semibold text-muted-foreground",children:u("code_module.ctx_breakdown")}),o.length>0?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-muted",children:o.map(l=>n.jsx(qe,{content:`${l.key}: ${l.tokens} (${l.percent}%)`,children:n.jsx("div",{className:p2[l.key],style:{width:`${l.percent}%`}})},l.key))}),n.jsx("ul",{className:"mt-2 space-y-1",children:o.map(l=>n.jsxs("li",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{className:`size-2 rounded-full ${p2[l.key]}`}),n.jsx("span",{className:"flex-1 text-foreground/80",children:u(`code_module.seg_${l.key}`)}),n.jsxs("span",{className:"font-mono text-muted-foreground",children:[l.tokens," · ",l.percent,"%"]})]},l.key))})]}):n.jsx("p",{className:"text-[11px] text-muted-foreground",children:u("code_module.ctx_none")})]})]})}function PU(e){const t=[];for(const a of(e||"").split(`
|
|
814
|
-
`))a.startsWith("diff --git")||a.startsWith("index ")||a.startsWith("--- ")||a.startsWith("+++ ")||a.startsWith("new file")||a.startsWith("deleted file")||a.startsWith("similarity index")||a.startsWith("rename ")||(a.startsWith("@@")?t.push({kind:"hunk",text:a}):a.startsWith("+")?t.push({kind:"add",text:a.slice(1)}):a.startsWith("-")?t.push({kind:"del",text:a.slice(1)}):t.push({kind:"ctx",text:a.replace(/^ /,"")}));for(;t.length&&t[t.length-1].kind==="ctx"&&t[t.length-1].text==="";)t.pop();return t}function LU({patch:e}){const t=x.useMemo(()=>PU(e),[e]);return t.length?n.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-background/60 font-mono text-[11px] leading-relaxed",children:n.jsx("code",{className:"block",children:t.map((a,o)=>n.jsxs("div",{className:ge("px-2 whitespace-pre",a.kind==="add"&&"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",a.kind==="del"&&"bg-rose-500/10 text-rose-600 dark:text-rose-400",a.kind==="hunk"&&"bg-muted/60 text-muted-foreground",a.kind==="ctx"&&"text-foreground/70"),children:[n.jsx("span",{className:"select-none opacity-50",children:a.kind==="add"?"+":a.kind==="del"?"-":" "}),a.text]},o))})}):null}const IU={added:hx,modified:gf,deleted:QA},BU={added:"text-emerald-600 dark:text-emerald-400",modified:"text-amber-600 dark:text-amber-400",deleted:"text-rose-600 dark:text-rose-400"};function $U({file:e}){const[t,a]=x.useState(!1),o=IU[e.status];return n.jsxs("li",{className:"rounded-md border border-border",children:[n.jsxs("button",{type:"button",onClick:()=>a(l=>!l),className:"flex w-full items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-accent/40",children:[n.jsx(Qr,{className:ge("size-3 shrink-0 transition-transform",t&&"rotate-90")}),n.jsx(o,{className:ge("size-3.5 shrink-0",BU[e.status])}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:e.path}),n.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:[e.additions!=null&&n.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["+",e.additions]}),e.deletions!=null&&n.jsxs("span",{className:"ml-1 text-rose-600 dark:text-rose-400",children:["-",e.deletions]})]})]}),t&&n.jsx("div",{className:"border-t border-border p-1.5",children:n.jsx(LU,{patch:e.patch})})]})}function UU({changes:e,loading:t,onRefresh:a}){const o=e?.files||[];return n.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-changes-tab",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[n.jsx("span",{className:"text-[11px] text-muted-foreground",children:o.length>0?u("code_module.changes_files",{n:o.length}):""}),n.jsx(qe,{content:u("code_module.reload"),children:n.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:t?n.jsx(_n,{size:12}):n.jsx(Ss,{className:"size-3"})})})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3",children:e&&!e.git?n.jsx(pt,{children:u("code_module.changes_no_git")}):o.length===0?n.jsx(pt,{children:u("code_module.changes_none")}):n.jsx("ul",{className:"space-y-1.5",children:o.map(l=>n.jsx($U,{file:l},l.path))})})]})}const HU=[{value:"context",icon:Qf,label:"tab_context"},{value:"changes",icon:tM,label:"tab_changes"},{value:"artifacts",icon:gM,label:"tab_artifacts"}];function qU({pid:e,turns:t,changes:a,changesLoading:o,onRefreshChanges:l,session:i,onRunInTerminal:d,onEditArtifact:f}){const[m,h]=x.useState("context"),g=a?.files.length||0;return n.jsxs(zp,{value:m,onValueChange:h,className:"flex h-full flex-col gap-0","data-testid":"code-side-panel",children:[n.jsx("div",{className:"shrink-0 border-b border-border px-2 py-2",children:n.jsx(Dp,{variant:"line",className:"w-full",children:HU.map(({value:b,icon:_,label:k})=>{const N=m===b,y=u(`code_module.${k}`);return n.jsx(qe,{content:y,children:n.jsxs(Hs,{value:b,className:N?"flex-1 min-w-0":"w-8 shrink-0",children:[n.jsx(_,{className:"size-3.5 shrink-0"}),N&&n.jsx("span",{className:"truncate text-xs",children:y}),b==="changes"&&g>0&&n.jsx("span",{className:"ml-0.5 rounded-full bg-muted px-1 text-[10px] text-muted-foreground leading-none py-0.5",children:g})]})},b)})})}),n.jsx(fs,{value:"context",className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(DU,{turns:t,session:i})}),n.jsx(fs,{value:"changes",className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(UU,{changes:a,loading:o,onRefresh:l})}),n.jsx(fs,{value:"artifacts",className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(XE,{pid:e,onRunInTerminal:d,onEditArtifact:f})})]})}function VU(e){const t=[];for(const o of e){const l=o.split("/").filter(Boolean);let i=t,d="";for(let f=0;f<l.length;f++){d=d?`${d}/${l[f]}`:l[f];const m=f===l.length-1;let h=i.find(g=>g.name===l[f]);h||(h={name:l[f],path:d,type:m?"file":"dir",children:m?void 0:[]},i.push(h)),m||(i=h.children)}}const a=o=>(o.forEach(l=>{l.children&&(l.children=a(l.children))}),o.sort((l,i)=>l.type!==i.type?l.type==="dir"?-1:1:l.name.localeCompare(i.name)));return a(t)}function yR({node:e,depth:t,onOpenFile:a,openDirs:o,toggleDir:l}){const i=e.type==="dir",d=i&&o.has(e.path);return n.jsxs("li",{children:[n.jsxs("button",{type:"button",onClick:()=>i?l(e.path):a(e.path),style:{paddingLeft:`${t*12+6}px`},className:ge("flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[11px] rounded transition-colors","hover:bg-accent/40",i?"text-foreground/80":"text-foreground/70"),children:[i?n.jsxs(n.Fragment,{children:[n.jsx(Qr,{className:ge("size-3 shrink-0 transition-transform",d&&"rotate-90")}),d?n.jsx(Fo,{className:"size-3.5 shrink-0 text-amber-400"}):n.jsx(X2,{className:"size-3.5 shrink-0 text-amber-400"})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"size-3 shrink-0"}),n.jsx(Y2,{className:"size-3.5 shrink-0 text-sky-400"})]}),n.jsx("span",{className:"truncate",children:e.name})]}),i&&d&&e.children&&e.children.length>0&&n.jsx("ul",{children:e.children.map(f=>n.jsx(yR,{node:f,depth:t+1,onOpenFile:a,openDirs:o,toggleDir:l},f.path))})]})}function FU({pid:e,projectPath:t,className:a,onOpenFile:o}){const[l,i]=x.useState([]),[d,f]=x.useState(!1),[m,h]=x.useState(!1),[g,b]=x.useState(()=>new Set),_=x.useCallback(async()=>{f(!0);try{const j=(await re.post("/run",{cmd:"find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/.claude/*' | sed 's|^\\./||' | sort | head -500",project:e})).stdout.split(`
|
|
815
|
-
`).map(S=>S.trim()).filter(Boolean);i(j),h(!0)}catch{h(!0)}finally{f(!1)}},[e]);x.useEffect(()=>{b(new Set),_()},[_]);const k=x.useCallback(E=>{b(j=>{const S=new Set(j);return S.has(E)?S.delete(E):S.add(E),S})},[]),N=x.useCallback(()=>{b(new Set)},[]),y=VU(l),w=g.size>0;return n.jsxs("div",{className:ge("flex h-full flex-col",a),"data-testid":"code-file-tree",children:[n.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-3 py-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Archivos"}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx(qe,{content:u("code_module.tree_collapse_all"),children:n.jsx("button",{type:"button",onClick:N,disabled:!w,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40 disabled:hover:bg-transparent",children:n.jsx(zA,{className:"size-3"})})}),n.jsx(qe,{content:u("code_module.reload"),children:n.jsx("button",{type:"button",onClick:()=>void _(),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:d?n.jsx(_n,{size:12}):n.jsx(Ss,{className:"size-3"})})})]})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:m?y.length===0?n.jsx("div",{className:"p-3",children:n.jsx(pt,{children:"Sin archivos"})}):n.jsx("ul",{children:y.map(E=>n.jsx(yR,{node:E,depth:0,onOpenFile:o??(()=>{}),openDirs:g,toggleDir:k},E.path))}):n.jsx("div",{className:"flex justify-center pt-6",children:n.jsx(_n,{size:14})})})]})}function GU({path:e,content:t,loading:a,onSave:o}){const l=typeof o=="function",[i,d]=x.useState(t),[f,m]=x.useState(!1);x.useEffect(()=>{d(t)},[t]);const h=l&&i!==t,g=async()=>{if(!(!o||!h)){m(!0);try{await o(i)}finally{m(!1)}}};return n.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/40","data-testid":"code-file-viewer",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[n.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:[e,h&&n.jsx("span",{className:"ml-1 text-amber-400",children:"•"})]}),l&&n.jsxs(n.Fragment,{children:[n.jsx(qe,{content:u("code_module.discard_changes"),children:n.jsxs("button",{type:"button",onClick:()=>d(t),disabled:!h||f,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40",children:[n.jsx(gi,{className:"size-3"}),"Descartar"]})}),n.jsx(qe,{content:u("code_module.save_shortcut_hint"),children:n.jsxs("button",{type:"button",onClick:()=>void g(),disabled:!h||f,className:ge("inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-medium transition-colors",h&&!f?"bg-emerald-500/15 text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:[f?n.jsx(_n,{size:10}):n.jsx(Jf,{className:"size-3"}),"Guardar"]})})]})]}),a?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(_n,{size:16})}):l?n.jsx("textarea",{value:i,onChange:b=>d(b.target.value),onKeyDown:b=>{(b.metaKey||b.ctrlKey)&&b.key==="s"&&(b.preventDefault(),g())},className:"min-h-0 flex-1 resize-none bg-transparent p-3 font-mono text-[12px] leading-[1.6] text-foreground/90 outline-none",spellCheck:!1}):n.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:n.jsx("table",{className:"w-full border-collapse font-mono text-[12px] leading-[1.6]",children:n.jsx("tbody",{children:t.split(`
|
|
816
|
-
`).map((b,_)=>n.jsxs("tr",{className:"hover:bg-accent/20",children:[n.jsx("td",{className:"w-12 select-none border-r border-border/30 px-3 py-0 text-right align-top text-[10px] text-muted-foreground/40","aria-hidden":"true",children:_+1}),n.jsx("td",{className:"px-4 py-0 align-top text-foreground/90 whitespace-pre",children:b||" "})]},_))})})})]})}function YU({pid:e,className:t,initCmd:a,onClose:o}){const[l,i]=x.useState([]),[d,f]=x.useState(""),[m,h]=x.useState(!1),[g,b]=x.useState([]),[_,k]=x.useState(-1),N=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[l]),x.useEffect(()=>{a&&(f(a),setTimeout(()=>y.current?.focus(),50))},[a]);const w=async j=>{const S=j.trim();if(S){b(R=>[S,...R.slice(0,49)]),k(-1),i(R=>[...R,{type:"cmd",text:`$ ${S}`}]),h(!0);try{const R=await re.post("/run",{cmd:S,project:e});R.stdout&&i(A=>[...A,{type:"out",text:R.stdout}]),R.stderr&&i(A=>[...A,{type:"err",text:R.stderr}])}catch(R){i(A=>[...A,{type:"err",text:String(R.message)}])}finally{h(!1)}}},E=j=>{if(j.key==="Enter")w(d),f("");else if(j.key==="ArrowUp"){j.preventDefault();const S=Math.min(_+1,g.length-1);k(S),f(g[S]??"")}else if(j.key==="ArrowDown"){j.preventDefault();const S=Math.max(_-1,-1);k(S),f(S===-1?"":g[S]??"")}};return n.jsxs("div",{className:ge("flex h-full min-h-0 flex-col bg-card/60",t),"data-testid":"code-terminal",children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1",children:[n.jsx(_a,{className:"size-3 text-muted-foreground"}),n.jsx("span",{className:"flex-1 text-[11px] text-muted-foreground",children:"Terminal"}),n.jsx(qe,{content:u("code_module.terminal_clear"),children:n.jsx("button",{type:"button",onClick:()=>i([]),className:"rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(GA,{className:"size-3"})})}),n.jsx(qe,{content:u("code_module.terminal_close"),children:n.jsx("button",{type:"button",onClick:()=>o?.(),className:"rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.jsx(gs,{className:"size-3"})})})]}),n.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-1 font-mono text-[11px] leading-snug cursor-text",onClick:()=>y.current?.focus(),children:[l.map((j,S)=>n.jsx("div",{className:ge("whitespace-pre-wrap break-all",j.type==="cmd"&&"text-emerald-400",j.type==="err"&&"text-rose-400",j.type==="out"&&"text-foreground/90"),children:j.text},S)),n.jsx("div",{ref:N})]}),n.jsxs("div",{className:"flex shrink-0 items-center border-t border-border px-3 py-1",children:[n.jsx("span",{className:"mr-2 text-[11px] text-emerald-400 font-mono",children:"$"}),n.jsx("input",{ref:y,value:d,onChange:j=>f(j.target.value),onKeyDown:E,disabled:m,placeholder:m?"ejecutando…":"comando…",className:"flex-1 bg-transparent font-mono text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 disabled:opacity-50",spellCheck:!1,autoComplete:"off"})]})]})}const kc="super-agent";function fx(){return n.jsx(fv,{className:"relative z-10 w-px shrink-0 cursor-col-resize bg-border transition-colors hover:bg-primary/50 active:bg-primary/70"})}function KU(){return n.jsx(fv,{className:"relative z-10 h-px shrink-0 cursor-row-resize bg-border transition-colors hover:bg-primary/50 active:bg-primary/70"})}function XU(){const e=Ze(),t=He("/projects",()=>Zn.list()),a=x.useMemo(()=>t.data||[],[t.data]),[o,l]=x.useState(""),[i,d]=x.useState(null),[f,m]=x.useState(kc),[h,g]=x.useState([]),[b,_]=x.useState(""),[k,N]=x.useState(!1),[y,w]=x.useState(!0),[E,j]=x.useState(!0),[S,R]=x.useState(!1),[A,T]=x.useState(""),[O,M]=x.useState(!1),B=x.useRef(null),[P,$]=Vo(),D=x.useRef(!1),[L,H]=x.useState([]),[V,U]=x.useState("chat"),F=x.useCallback(je=>{R(!0),T(je)},[]);x.useEffect(()=>{!o&&a.length&&l(String(a[0].id))},[o,a]);const X=He(o?["code-sessions",o]:null,()=>Ga.sessions.list(o)),G=He(o?["agents",o]:null,()=>an.list(o)),Y=He(o&&i?["code-session",o,i]:null,()=>Ga.sessions.get(o,i)),I=He(o&&i?["code-changes",o,i]:null,()=>Ga.changes(o,i));x.useEffect(()=>{const je=X.data||[];!i&&je.length&&d(je[0].id),i&&je.length&&!je.some(Ie=>Ie.id===i)&&d(je[0]?.id??null)},[X.data,i]),x.useEffect(()=>{Y.data&&m(Y.data.agentSlug||kc)},[Y.data]),x.useEffect(()=>{k||(Y.data?g(Y.data.messages||[]):i||g([]))},[Y.data,i,k]),x.useEffect(()=>()=>B.current?.abort(),[]);const Q=Y.data,J=Q?.mode==="plan"?"plan":"build",K=Q?.model||"",se=je=>{je===o||k||(l(je),d(null),g([]))},te=je=>{k||je===i||(d(je),g([]))},le=async()=>{if(!(!o||k))try{const je=await Ga.sessions.create(o,{title:u("code_module.untitled"),agentSlug:f!==kc?f:null});await X.mutate(),d(je.id),g([])}catch(je){e.error(je.message)}},W=async(je,Ie)=>{const Xe=window.prompt(u("code_module.rename"),Ie);if(!(!Xe||Xe===Ie))try{await Ga.sessions.update(o,je,{title:Xe}),await X.mutate(),je===i&&await Y.mutate()}catch(it){e.error(it.message)}},ne=async je=>{if(!k&&window.confirm(u("code_module.delete_confirm")))try{await Ga.sessions.remove(o,je),je===i&&(d(null),g([])),await X.mutate()}catch(Ie){e.error(Ie.message)}},ve=async je=>{if(m(je),!!i)try{await Ga.sessions.update(o,i,{agentSlug:je!==kc?je:null}),await Promise.all([Y.mutate(),X.mutate()])}catch(Ie){e.error(Ie.message)}},oe=x.useCallback(async je=>{if(i)try{await Ga.sessions.update(o,i,je),await Promise.all([Y.mutate(),X.mutate()])}catch(Ie){e.error(Ie.message)}},[o,i,Y,X,e]),fe=()=>{B.current?.abort(),N(!1)},we=je=>g(Ie=>{const Xe=[...Ie],it=Xe[Xe.length-1];return it&&it.role==="assistant"&&(Xe[Xe.length-1]=je(it)),Xe}),Ce=async je=>{const Ie=(je??b).trim();if(!Ie||k||!o||!i)return;const Xe=new Date().toISOString();g(mt=>[...mt,{role:"user",parts:[{kind:"text",text:Ie}],ts:Xe},{role:"assistant",parts:[],ts:Xe,pending:!0}]),_(""),N(!0);const it=new AbortController;B.current=it;const Qe=mt=>{if(mt.type==="error"){e.error(mt.error||u("modules_ui.code_stream_error"));return}we(Ot=>tv(Ot,mt))};try{await Ga.stream(o,i,{prompt:Ie},Qe,it.signal),we(mt=>({...mt,pending:!1}))}catch(mt){it.signal.aborted?we(Ot=>({...Ot,pending:!1,parts:[...Ot.parts,{kind:"text",text:u("code_module.stopped")}]})):(e.error(mt.message),g(Ot=>Ot.filter((Jt,Wt)=>Wt!==Ot.length-1)))}finally{B.current===it&&(B.current=null),N(!1),Y.mutate(),X.mutate(),I.mutate()}},Le=async je=>{try{await navigator.clipboard.writeText(je),e.info(u("modules_ui.code_copied"))}catch{}},$e=x.useCallback(je=>{U(je),H(Ie=>Ie.some(Xe=>Xe.path===je)?Ie:[...Ie,{path:je,content:"",loading:!0}]),re.post("/run",{cmd:`cat "${je}"`,project:o}).then(Ie=>{const Xe=Ie.stdout||Ie.stderr||u("modules_ui.code_file_empty");H(it=>it.map(Qe=>Qe.path===je?{...Qe,content:Xe,loading:!1}:Qe))}).catch(Ie=>{H(Xe=>Xe.map(it=>it.path===je?{...it,content:u("modules_ui.code_file_error",{msg:Ie.message}),loading:!1}:it))})},[o]),Ee=x.useCallback(je=>{H(Ie=>Ie.filter(Xe=>Xe.path!==je)),U(Ie=>Ie===je?"chat":Ie)},[]),_e=x.useCallback(je=>{const Ie=`artifacts/${je}`;U(Ie),H(Xe=>Xe.some(it=>it.path===Ie)?Xe:[...Xe,{path:Ie,content:"",loading:!0,artifactName:je}]),Ws.read(o,je).then(Xe=>{H(it=>it.map(Qe=>Qe.path===Ie?{...Qe,content:Xe.content,loading:!1}:Qe))}).catch(Xe=>{H(it=>it.map(Qe=>Qe.path===Ie?{...Qe,content:u("modules_ui.code_file_error",{msg:Xe.message}),loading:!1}:Qe))})},[o]);x.useEffect(()=>{if(D.current)return;const je=P.get("pid"),Ie=P.get("cmd"),Xe=P.get("edit");if(!(!je||!Ie&&!Xe)){if(String(o)!==String(je)){l(String(je));return}D.current=!0,Xe&&_e(Xe),Ie&&F(Ie.endsWith(" ")?Ie:Ie+" "),$({},{replace:!0})}},[P,o,_e,F,$]);const xe=x.useCallback(async(je,Ie)=>{const Xe=L.find(it=>it.path===je);if(Xe?.artifactName)try{await Ws.write(o,Xe.artifactName,Ie),H(it=>it.map(Qe=>Qe.path===je?{...Qe,content:Ie}:Qe)),e.info(u("modules_ui.code_saved"))}catch(it){e.error(it.message)}},[L,o,e]),Re=!t.isLoading&&a.length>0,Oe=x.useMemo(()=>{const je=[{value:kc,label:u("modules_ui.code_super_agent"),icon:rn,description:u("modules_ui.code_super_agent_desc")}],Ie=(G.data||[]).map(Xe=>({value:Xe.slug,label:Xe.slug,icon:rn,description:Xe.description||Xe.role||void 0}));return[...je,...Ie]},[G.data]),Pe=x.useMemo(()=>h,[h]),Be=x.useMemo(()=>X.data?.find(je=>je.id===i)?.title||"",[X.data,i]),me=x.useMemo(()=>a.find(je=>String(je.id)===o),[a,o]);CL(Be);const[Se,Ge]=x.useState(null),Ae=k?null:KE(h),ze=Ae&&Ae.turnKey!==Se,tt=je=>{Ce(je)},ot=x.useCallback(()=>w(je=>!je),[]),vt=x.useCallback(()=>M(je=>!je),[]),Mt=x.useCallback(()=>R(je=>!je),[]),lt=x.useCallback(()=>j(je=>!je),[]),Rt=x.useMemo(()=>i?n.jsx("div",{className:"flex items-center gap-0.5",children:[{Icon:sS,open:y,toggle:ot,title:u("modules_ui.code_panel_sessions")},{Icon:bb,open:O,toggle:vt,title:u("modules_ui.code_panel_tree")},{Icon:_a,open:S,toggle:Mt,title:u("modules_ui.code_panel_terminal")},{Icon:hM,open:E,toggle:lt,title:u("modules_ui.code_panel_context")}].map(({Icon:je,open:Ie,toggle:Xe,title:it})=>n.jsx(qe,{content:it,children:n.jsx("button",{type:"button",onClick:Xe,"data-active":Ie,className:"rounded p-1 text-muted-fg transition-colors hover:bg-accent hover:text-accent-fg data-[active=true]:bg-accent data-[active=true]:text-accent-fg",children:n.jsx(je,{className:"size-3.5"})})},it))}):null,[i,y,O,S,E,ot,vt,Mt,lt]);return EL(Rt),n.jsx("div",{className:"flex h-full min-h-0 flex-col","data-testid":"screen-code",children:t.isLoading?n.jsx(rt,{}):Re?n.jsxs(nb,{orientation:"vertical",id:"code-layout-v",className:"min-h-0 flex-1",children:[n.jsx(Eo,{id:"top",defaultSize:S?"55%":"100%",minSize:"20%",children:n.jsxs(nb,{orientation:"horizontal",id:"code-layout",className:"h-full",children:[y&&n.jsxs(n.Fragment,{children:[n.jsx(Eo,{id:"left",defaultSize:"14%",minSize:"8%",children:n.jsxs("aside",{className:"flex h-full flex-col",children:[n.jsx("div",{className:"shrink-0 border-b border-border p-2",children:n.jsx(RU,{projects:a,value:o,onChange:se,disabled:k})}),n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(TU,{sessions:X.data||[],activeId:i,busy:k,onSelect:te,onCreate:le,onRename:W,onDelete:ne})}),n.jsx("div",{className:"shrink-0 border-t border-border p-2",children:n.jsx(ut,{value:f,onChange:ve,options:Oe,disabled:k,showIcon:!0})})]})}),n.jsx(fx,{})]}),O&&n.jsxs(n.Fragment,{children:[n.jsx(Eo,{id:"tree",defaultSize:"13%",minSize:"8%",children:n.jsx("div",{className:"h-full",children:n.jsx(FU,{pid:o,projectPath:me?.path,onOpenFile:$e})})}),n.jsx(fx,{})]}),n.jsx(Eo,{id:"main",defaultSize:"50%",minSize:"20%",children:n.jsxs("div",{className:"flex h-full flex-col",children:[L.length>0&&n.jsxs("div",{className:"flex shrink-0 items-center gap-0 overflow-x-auto border-b border-border",children:[n.jsxs("button",{type:"button",onClick:()=>U("chat"),"data-active":V==="chat",className:"flex shrink-0 items-center gap-1.5 border-r border-border px-3 py-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent/40 data-[active=true]:text-foreground",children:[n.jsx(_b,{className:"size-3 shrink-0"}),u("modules_ui.code_chat_tab")]}),L.map(je=>{const Ie=je.path.split("/").pop()??je.path,Xe=V===je.path;return n.jsxs("div",{"data-active":Xe,className:"group flex shrink-0 items-center gap-1 border-r border-border px-2 py-2 text-[11px] text-muted-foreground transition-colors hover:bg-accent/40 data-[active=true]:text-foreground",children:[n.jsx(qe,{content:je.path,children:n.jsx("button",{type:"button",onClick:()=>U(je.path),className:"min-w-0 max-w-[140px] truncate font-mono",children:Ie})}),n.jsx(qe,{content:u("code_module.close"),children:n.jsx("button",{type:"button",onClick:()=>Ee(je.path),className:"shrink-0 rounded p-0.5 opacity-60 hover:bg-accent hover:opacity-100",children:n.jsx(gs,{className:"size-2.5"})})})]},je.path)})]}),V==="chat"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"code-transcript",children:i?h.length?n.jsx(nv,{msgs:h,onCopy:Le}):n.jsx("div",{className:"grid h-full place-items-center p-6",children:n.jsx(pt,{children:u("code_module.empty_chat")})}):n.jsx("div",{className:"grid h-full place-items-center p-6",children:n.jsx(pt,{children:u("code_module.pick_project")})})}),ze&&Ae&&n.jsx(YE,{turnKey:Ae.turnKey,questions:Ae.questions,onSubmit:tt,onDismiss:()=>Ge(Ae.turnKey),disabled:k})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:(()=>{const je=L.find(Ie=>Ie.path===V);return je?n.jsx(GU,{path:je.path,content:je.content,loading:je.loading,onSave:je.artifactName?Ie=>xe(je.path,Ie):void 0}):null})()}),n.jsx("div",{className:"shrink-0 border-t border-border p-2","data-testid":"code-input",children:n.jsx(MU,{value:b,onValueChange:_,onSubmit:()=>void Ce(),onStop:fe,busy:k,disabled:!i,mode:J,onModeChange:je=>void oe({mode:je}),model:K,onModelChange:je=>void oe({model:je||null})})})]})}),E&&n.jsxs(n.Fragment,{children:[n.jsx(fx,{}),n.jsx(Eo,{id:"right",defaultSize:"22%",minSize:"15%",children:n.jsx("aside",{className:"flex h-full flex-col",children:n.jsx(qU,{pid:o,turns:Pe,changes:I.data,changesLoading:I.isLoading,onRefreshChanges:()=>void I.mutate(),session:Y.data?{title:Y.data.title,mode:Y.data.mode,createdAt:Y.data.createdAt,updatedAt:Y.data.updatedAt,agentSlug:Y.data.agentSlug??null}:null,onRunInTerminal:F,onEditArtifact:_e})})})]})]})}),S&&o&&n.jsxs(n.Fragment,{children:[n.jsx(KU,{}),n.jsx(Eo,{id:"terminal",defaultSize:"45%",minSize:"10%",maxSize:"80%",children:n.jsx(YU,{pid:o,initCmd:A,onClose:Mt,className:"h-full"})})]})]}):n.jsx("div",{className:"grid flex-1 place-items-center",children:n.jsx(pt,{children:u("code_module.no_projects")})})})}function QU({open:e,onClose:t}){const{mutate:a}=_N(),o=Pn(),l=Ze(),[i,d]=x.useState(""),[f,m]=x.useState(!1),[h,g]=x.useState(""),[b,_]=x.useState([]),[k,N]=x.useState(null),[y,w]=x.useState(""),[E,j]=x.useState(!1),[S,R]=x.useState(!1),A=async(M,B=!1)=>{j(!0),w("");try{const P=await Of.dirs(M||"~");g(P.path),d(P.path),N(P.parent),_(P.entries)}catch(P){const $=P.message;w($),B||l.error($)}finally{j(!1)}};x.useEffect(()=>{e||(d(""),m(!1),g(""),_([]),N(null),w(""))},[e]);const T=async()=>{j(!0);try{const M=await Of.pickDir(u("add_project.picker_prompt"));if("cancelled"in M)return;d(M.path);return}catch{m(!0),await A(i||"~")}finally{j(!1)}},O=async()=>{const M=i.trim();if(!M){l.error(u("add_project.path_required"));return}R(!0);try{const B=await Zn.register(M);l.success(u("add_project.registered",{id:B.id})),await a("/projects"),t(),o(`/p/${B.id}`)}catch(B){l.error(B.message)}finally{R(!1)}};return n.jsx(Zt,{open:e,onClose:t,title:u("add_project.title"),description:u("add_project.subtitle"),footer:n.jsxs(n.Fragment,{children:[n.jsx(ie,{variant:"ghost",onClick:t,disabled:S,children:u("common.cancel")}),n.jsx(ie,{variant:"primary",onClick:O,loading:S,children:u("add_project.register")})]}),children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(ce,{label:u("add_project.path_label"),hint:u("add_project.path_hint"),children:n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Te,{autoFocus:!0,placeholder:u("add_project.path_placeholder"),value:i,onChange:M=>d(M.target.value),onKeyDown:M=>{M.key==="Enter"&&O()}}),n.jsxs(ie,{onClick:T,disabled:E,children:[n.jsx(Fl,{size:14})," ",u("add_project.search_btn")]})]})}),f&&n.jsxs("div",{className:"rounded-md border border-border bg-muted/20",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[n.jsx("span",{className:"truncate font-mono text-xs text-muted-fg",children:h||i||"~"}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>A("~"),disabled:E,children:n.jsx(Z2,{size:13})}),n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>k&&A(k),disabled:!k||E,children:".."}),n.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>m(!1),disabled:E,children:n.jsx(gs,{size:13})})]})]}),n.jsxs("div",{className:"max-h-64 overflow-y-auto p-2",children:[E&&n.jsx(rt,{}),!E&&y&&n.jsx(pt,{children:u("add_project.browser_unavailable")}),!E&&!y&&b.length===0&&n.jsx(pt,{children:u("add_project.no_folders")}),!E&&!y&&b.map(M=>n.jsxs("button",{type:"button",onClick:()=>A(M),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent",children:[n.jsx(Fo,{size:14,className:"text-muted-fg"}),n.jsx("span",{className:"truncate",children:M.split("/").pop()}),n.jsx("span",{className:"ml-auto truncate font-mono text-[10px] text-muted-fg",children:M})]},M))]})]})]})})}function WU({onPaired:e}){const[t,a]=x.useState(""),[o,l]=x.useState(ZU()),[i,d]=x.useState(!1),[f,m]=x.useState(null);async function h(){const g=t.trim();if(!g){m(u("pairing.err_required"));return}d(!0),m(null);try{const b=await ci.confirm({pairing_id:g,label:o.trim()||void 0});Ro(b.token);try{localStorage.setItem(zn.token,b.token)}catch{}e()}catch(b){m(JU(b)),d(!1)}}return n.jsx("div",{className:"flex min-h-[100dvh] w-full items-center justify-center overflow-y-auto bg-background p-4 text-foreground",children:n.jsxs("div",{className:"my-auto w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-sm",children:[n.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[n.jsx("div",{className:"grid size-10 place-items-center rounded-lg bg-primary/10 text-primary",children:n.jsx(eS,{size:20})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-base font-semibold",children:u("pairing.title")}),n.jsx("p",{className:"text-xs text-muted-fg",children:u("pairing.subtitle")})]})]}),n.jsxs("ol",{className:"mb-5 space-y-1.5 rounded-lg bg-muted/50 p-3 text-xs text-muted-fg",children:[n.jsx("li",{className:"font-medium text-foreground",children:u("pairing.steps_title")}),n.jsxs("li",{children:["1. ",u("pairing.step_1")]}),n.jsxs("li",{children:["2. ",u("pairing.step_2")]}),n.jsxs("li",{children:["3. ",u("pairing.step_3")]})]}),n.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),h()},children:[n.jsx(ce,{label:u("pairing.code_label"),children:n.jsx(Te,{value:t,onChange:g=>a(g.target.value),placeholder:u("pairing.code_ph"),spellCheck:!1,autoComplete:"off"})}),n.jsx(ce,{label:u("pairing.label_label"),hint:u("pairing.revoke_hint"),children:n.jsx(Te,{value:o,onChange:g=>l(g.target.value),placeholder:u("pairing.label_ph")})}),f&&n.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:f}),n.jsx(ie,{type:"submit",variant:"primary",size:"md",loading:i,className:"w-full justify-center",children:u(i?"pairing.linking":"pairing.submit")})]})]})})}function ZU(){const e=navigator.userAgent;return/iPhone|iPad/.test(e)?"iPhone":/Android/.test(e)?"Android":/Mac/.test(e)?"Mac":/Windows/.test(e)?"Windows PC":/Linux/.test(e)?"Linux":"browser"}function JU(e){if(e instanceof cu){if(e.status===410)return u("pairing.err_expired");if(e.status===404||e.status===409)return u("pairing.err_unknown")}return u("pairing.err_generic")}function eH({...e}){return n.jsx(ON,{"data-slot":"sheet",...e})}function tH({...e}){return n.jsx(MN,{"data-slot":"sheet-portal",...e})}function nH({className:e,...t}){return n.jsx(EN,{"data-slot":"sheet-overlay",className:Ct("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function sH({className:e,children:t,side:a="right",showCloseButton:o=!0,...l}){return n.jsxs(tH,{children:[n.jsx(nH,{}),n.jsxs(AN,{"data-slot":"sheet-content","data-side":a,className:Ct("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...l,children:[t,o&&n.jsxs(Ap,{"data-slot":"sheet-close",render:n.jsx(lr,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[n.jsx(gs,{}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function aH({className:e,...t}){return n.jsx("div",{"data-slot":"sheet-header",className:Ct("flex flex-col gap-0.5 p-4",e),...t})}function rH({className:e,...t}){return n.jsx(zN,{"data-slot":"sheet-title",className:Ct("font-heading text-base font-medium text-foreground",e),...t})}function oH({className:e,...t}){return n.jsx(RN,{"data-slot":"sheet-description",className:Ct("text-sm text-muted-foreground",e),...t})}function lH({value:e,projectPath:t,onPick:a}){const o=iH(e),l=o?cH(e):"",{data:i}=He(o?["/skills",t||""]:null,()=>Us.list(t)),d=i?.skills||[],f=x.useMemo(()=>{const m=l.toLowerCase();return m?d.filter(h=>h.slug.toLowerCase().includes(m)).slice(0,8):d.slice(0,8)},[d,l]);return!o||f.length===0?null:n.jsxs("div",{className:"rounded-xl border border-border bg-popover/95 text-sm shadow-md backdrop-blur",children:[n.jsx("ul",{role:"listbox",className:"max-h-64 overflow-y-auto py-1",children:f.map(m=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>a(m.slug),className:"flex w-full items-start gap-2 px-3 py-1.5 text-left hover:bg-accent hover:text-accent-foreground",children:[n.jsxs("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:["/",m.slug]}),n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:m.description})]})},m.slug))}),n.jsx("div",{className:"border-t border-border px-3 py-1.5 text-[10px] text-muted-foreground",children:"Type a name to filter · click to insert · the skill body will be loaded for this turn."})]})}function iH(e){return!!e.match(/^\s*\/([A-Za-z0-9_-]*)$/)}function cH(e){const t=e.match(/^\s*\/([A-Za-z0-9_-]*)$/);return t?t[1]:""}function uH(){try{const e=localStorage.getItem(zn.robyChat);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(a=>a&&Array.isArray(a.parts)&&!a.pending):[]}catch{return[]}}function dH({open:e,onOpenChange:t}){const a=Ep(),o=Ze(),[l,i]=x.useState(uH),[d,f]=x.useState(""),[m,h]=x.useState(!1),[g,b]=x.useState(""),_=x.useRef(null);x.useEffect(()=>{const j=l.filter(S=>!S.pending);try{j.length?localStorage.setItem(zn.robyChat,JSON.stringify(j)):localStorage.removeItem(zn.robyChat)}catch{}},[l]);const k=()=>{if(!m){i([]),f("");try{localStorage.removeItem(zn.robyChat)}catch{}}};x.useEffect(()=>()=>_.current?.abort(),[]),x.useEffect(()=>{const j=S=>{const R=S.detail?.prompt;typeof R=="string"&&(t(!0),f(R))};return window.addEventListener("apx:roby-prompt",j),()=>window.removeEventListener("apx:roby-prompt",j)},[t]);const N=()=>{_.current?.abort(),h(!1)},y=j=>i(S=>{const R=[...S],A=R[R.length-1];return A?.role==="assistant"&&(R[R.length-1]=j(A)),R}),w=async()=>{const j=d.trim();if(!j||m)return;const S=new Date().toISOString(),R=l.filter(M=>!M.pending).map(M=>({role:M.role,content:Wx(M)}));i(M=>[...M,{role:"user",parts:[{kind:"text",text:j}],ts:S},{role:"assistant",parts:[],ts:S,pending:!0}]),f(""),h(!0);const A=new AbortController;_.current=A;let T=!1;const O=M=>{if(M?.type==="error"){T=!0,o.error(M.error||"error"),i(B=>{const P=[...B],$=P[P.length-1];return $?.role==="assistant"&&$.pending&&P.pop(),P});return}y(B=>tv(B,M))};try{await yN.stream(0,{prompt:j,previousMessages:R,model:g||void 0,channel:"web_sidebar"},O,A.signal),y(M=>({...M,pending:!1}))}catch(M){A.signal.aborted?y(B=>({...B,pending:!1,parts:[...B.parts,{kind:"text",text:u("project.chat.stopped_marker")}]})):T||(o.error(M.message),i(B=>{const P=[...B],$=P[P.length-1];return $?.role==="assistant"&&$.pending&&P.pop(),P}))}finally{_.current===A&&(_.current=null),h(!1)}},E=async j=>{try{await navigator.clipboard.writeText(j),o.info(u("project.chat.copied"))}catch{}};return n.jsx(eH,{open:e,onOpenChange:t,children:n.jsxs(sH,{side:"right",className:"flex w-full flex-col gap-0 p-0 sm:max-w-xl data-[side=right]:sm:max-w-xl",children:[n.jsxs(aH,{className:"pr-12",children:[n.jsxs(rH,{className:"flex items-center gap-2",children:[n.jsx(rn,{size:18})," ",u("superagent.title",{persona:a}),n.jsx("span",{className:"text-xs font-normal text-muted-fg",children:u("superagent.badge")})]}),n.jsx(oH,{children:u("superagent.desc")})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:l.length===0?n.jsx("p",{className:"mt-6 text-center text-sm text-muted-fg",children:u("superagent.empty",{persona:a})}):n.jsx(nv,{msgs:l,onCopy:E})}),n.jsx(GE,{msgs:l}),n.jsxs("div",{className:"border-t border-border p-3",children:[n.jsx("div",{className:"mb-1.5",children:n.jsx(lH,{value:d,onPick:j=>f(`/${j} `)})}),n.jsx(J_,{value:d,onValueChange:f,onSubmit:()=>void w(),onStop:N,busy:m,placeholder:u("superagent.placeholder"),footer:n.jsx(ev,{value:g,onChange:b,disabled:m})}),n.jsx("div",{className:"mt-1.5 flex justify-end",children:n.jsxs(lr,{size:"xs",variant:"ghost",onClick:k,disabled:m||l.length===0,children:[n.jsx(Pt,{className:"size-3"})," ",u("superagent.new_chat")]})})]})]})})}function fH(){const e=navigator.userAgent;return/iPhone|iPad/.test(e)?"iPhone":/Android/.test(e)?"Android":/Mac/.test(e)?"Mac":/Windows/.test(e)?"Windows PC":/Linux/.test(e)?"Linux":"browser"}function pH(){const[e,t]=x.useState({status:"loading"}),[a,o]=x.useState(0),l=x.useCallback(()=>{t({status:"loading"}),o(i=>i+1)},[]);return x.useEffect(()=>{let i=!1;return(async()=>{try{const g=await fetch("/health");if(!g.ok)throw new Error(`HTTP ${g.status}`)}catch(g){i||t({status:"error",reason:String(g)});return}const d=window.location.hash.replace(/^#/,""),f=new URLSearchParams(d),m=f.get("pair");if(m){history.replaceState(null,"",window.location.pathname+window.location.search);try{const g=await ci.confirm({pairing_id:m,label:fH(),kind:"web"});Ro(g.token);try{localStorage.setItem(zn.token,g.token)}catch{}i||t({status:"ok"});return}catch{}}const h=f.get("token");if(h){Ro(h);try{localStorage.setItem(zn.token,h)}catch{}history.replaceState(null,"",window.location.pathname+window.location.search)}else try{const g=localStorage.getItem(zn.token);g&&Ro(g)}catch{}try{const g=await fetch("/admin/web-token");if(g.ok){const b=await g.json();if(b?.token){Ro(b.token);try{localStorage.setItem(zn.token,b.token)}catch{}}}}catch{}if(!R_()){i||t({status:"unpaired"});return}try{await re.get("/projects"),i||t({status:"ok"})}catch(g){if(g instanceof cu&&(g.status===401||g.status===403)){Ro(null);try{localStorage.removeItem(zn.token)}catch{}i||t({status:"unpaired"})}else i||t({status:"error",reason:String(g)})}})(),()=>{i=!0}},[a]),{...e,reload:l}}function mH(){const e=pH();return e.status==="loading"?n.jsx(g2,{text:u("daemon.connecting")}):e.status==="error"?n.jsx(g2,{mood:"sad",text:u("daemon.unreachable"),sub:`${u("daemon.unreachable_hint")}
|
|
817
|
-
|
|
818
|
-
${e.reason}`}):e.status==="unpaired"?n.jsx(WU,{onPaired:e.reload}):n.jsx(xL,{children:n.jsx(T6,{delay:0,children:n.jsx(gH,{})})})}function gH(){const e=Pn(),t=ss(),[a,o]=Vo(),{theme:l,toggle:i}=Nb(),d=a.get("action")==="add-project",[f,m]=x.useState(!1),h=()=>{const b=new URLSearchParams(a);b.delete("action"),o(b,{replace:!0})},g=()=>{const b=new URLSearchParams(a);b.set("action","add-project"),o(b)};return n.jsx(jL,{children:n.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground","data-testid":"app-shell",children:[n.jsx(RP,{onSelect:b=>e(b),onOpenRoby:()=>m(!0),onOpenAddProject:g}),n.jsxs("main",{className:"m-2 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-sm",children:[n.jsx(hH,{onToggleTheme:i,isDark:l==="dark",pathname:t.pathname}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs(P2,{children:[n.jsx(Dt,{path:"/",element:n.jsx(yL,{})}),n.jsx(Dt,{path:"/settings/*",element:n.jsx(H$,{})}),n.jsx(Dt,{path:"/m/desktop/*",element:n.jsx(F$,{})}),n.jsx(Dt,{path:"/m/code/*",element:n.jsx(XU,{})}),n.jsx(Dt,{path:"/p/:pid/*",element:n.jsx(uB,{})}),n.jsx(Dt,{path:"*",element:n.jsx(yH,{})})]})})]}),n.jsx(QU,{open:d,onClose:h}),n.jsx(dH,{open:f,onOpenChange:m})]})})}function hH({onToggleTheme:e,isDark:t,pathname:a}){const{projects:o}=uu(),l=SL(),i=a.split("/").filter(Boolean),d=i[0]==="p"?o.find(N=>String(N.id)===i[1]):void 0,f=i[0]==="settings"?_H(i[1]):i[0]==="p"?vH(i[2]):"",m=i[0]==="p"&&i[1]==="0",h=d?.name||d?.path?.split("/").pop()||u("nav.project"),g=a==="/"?u("topbar.breadcrumb_root"):i[0]==="settings"?[u("topbar.breadcrumb_root"),u("nav.settings"),f].filter(Boolean).join(" › "):i[0]==="m"?[u("topbar.breadcrumb_root"),bH(i[1]),l].filter(Boolean).join(" › "):i[0]==="p"?m?[u("topbar.breadcrumb_root"),u("topbar.breadcrumb_base"),f].filter(Boolean).join(" › "):[u("topbar.breadcrumb_root"),u("topbar.breadcrumb_projects"),h,f].filter(Boolean).join(" › "):u("topbar.breadcrumb_root"),b=a==="/"?"":i[0]==="settings"?u("settings.subtitle"):i[0]==="p"?m?u("base.subtitle"):d?`${kN(d.kind)} · ${d.path}`:"":"",_=kL(),k=NL();return n.jsxs("header",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border/50 px-3",children:[_&&n.jsx($D,{collapsed:_.collapsed,onToggle:_.toggle}),n.jsxs("span",{className:"min-w-0 flex-1 truncate text-[11px] tracking-wide text-muted-fg",children:[g,b&&n.jsxs("span",{className:"text-muted-fg/50",children:[" · ",b]})]}),k,n.jsx(xH,{}),n.jsx(qe,{content:u(t?"topbar.light":"topbar.dark"),children:n.jsx("button",{type:"button","data-testid":"theme-toggle",onClick:e,className:"shrink-0 rounded-md p-1.5 text-muted-fg hover:bg-accent hover:text-accent-fg",children:t?n.jsx(CM,{size:14}):n.jsx(pM,{size:14})})})]})}function xH(){const e=S_(),t=a=>{a!==e&&(cN(a),window.location.reload())};return n.jsxs(y_,{children:[n.jsxs(j_,{"data-testid":"lang-menu",title:u("topbar.lang_toggle"),className:"flex shrink-0 items-center gap-1 rounded-md p-1.5 text-muted-fg hover:bg-accent hover:text-accent-fg",children:[n.jsx(rM,{size:14}),n.jsx("span",{className:"text-[11px] font-medium uppercase",children:e})]}),n.jsx(k_,{align:"end",children:n.jsx(MD,{value:e,onValueChange:a=>t(a),children:uN.map(a=>n.jsx(OD,{value:a.value,children:a.label},a.value))})})]})}function bH(e){switch(e){case"desktop":return u("nav.modules.desktop");case"code":return u("nav.modules.code");default:return e||""}}function _H(e){switch(e){case"super-agent":return u("settings.tabs.super_agent");case"engines":return u("settings.tabs.engines");case"telegram":return u("settings.tabs.telegram");case"devices":return u("settings.tabs.devices");case"voice":return u("nav.modules.voice");case"deck":return u("nav.modules.deck");case"desktop":return u("nav.modules.desktop");case"appearance":return u("settings.appearance");case"config":case"advanced":return u("settings.tabs.advanced");case"identity":default:return e||""}}function vH(e){switch(e){case"chat":return u("project.nav.chat");case"telegram":return u("project.nav.telegram");case"agents":return u("project.nav.agents");case"routines":return u("project.nav.routines");case"tasks":return u("project.nav.tasks");case"mcps":return u("project.nav.mcps");case"artifacts":return u("project.nav.artifacts");case"config":return u("project.nav.config");case"workspaces":return u("base.workspaces_title");case"models":return u("settings.tabs.engines");case"agent-defaults":return u("base.defaults_title");case"sessions":return u("base.sessions_title");case"logs":return u("project.nav.logs");case"memories":return u("project.nav.memories");default:return""}}function g2({text:e,sub:t,mood:a="happy"}){return n.jsx("div",{className:"grid h-screen w-screen place-items-center bg-background text-foreground",children:n.jsxs("div",{className:"flex flex-col items-center text-center",children:[n.jsx(KN,{mood:a,className:"mb-4 text-xs"}),n.jsx("div",{className:"text-foreground",children:e}),t&&n.jsx("pre",{className:"mt-2 max-w-xl whitespace-pre-wrap text-sm text-muted-fg",children:t})]})})}function yH(){const e=Pn();return n.jsx(XN,{testId:"screen-not-found",mood:"confused",title:u("not_found.title"),titleClassName:"text-7xl",message:u("not_found.message"),action:n.jsx(lr,{variant:"outline",onClick:()=>e("/"),children:u("not_found.home")})})}_I();q5.createRoot(document.getElementById("root")).render(n.jsx(Jc.StrictMode,{children:n.jsx(pA,{children:n.jsx(OM,{children:n.jsx(mH,{})})})}));
|
|
819
|
-
//# sourceMappingURL=index-BxYXJEtf.js.map
|