@agentprojectcontext/apx 1.33.1 → 1.34.0
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 +1 -1
- package/skills/apx/SKILL.md +49 -61
- package/src/core/agent/a2a/reply.js +48 -0
- package/src/core/agent/build-agent-system.js +4 -3
- package/src/core/agent/channels/voice-context.js +98 -0
- package/src/core/agent/memory.js +2 -1
- package/src/core/agent/prompt-builder.js +2 -1
- package/src/core/agent/prompts/modes/code-build.md +1 -0
- package/src/core/agent/prompts/modes/code-plan.md +1 -0
- package/src/core/agent/prompts/modes/index.js +28 -0
- package/src/core/agent/skills/loader.js +22 -18
- package/src/core/agent/stream/turn-accumulator.js +73 -0
- package/src/core/agent/suggestions.js +37 -0
- package/src/core/agent/tools/handlers/add-project.js +5 -2
- package/src/core/agent/tools/handlers/call-runtime.js +3 -2
- package/src/core/agent/tools/handlers/transcribe-audio.js +1 -1
- package/src/core/agent/tools/helpers.js +2 -2
- package/src/core/agent/tools/names.js +138 -0
- package/src/core/agent/tools/registry-bridge.js +6 -14
- package/src/core/agent/tools/registry.js +68 -65
- package/src/core/apc/context-copy.js +27 -0
- package/src/core/apc/notes.js +19 -0
- package/src/core/apc/parser.js +12 -5
- package/src/core/apc/paths.js +87 -0
- package/src/core/apc/scaffold.js +82 -76
- package/src/core/apc/skill-sync.js +10 -0
- package/src/{host/daemon/plugins → core/channels}/telegram/dispatch.js +38 -16
- package/src/core/config/index.js +3 -2
- package/src/core/config/redact.js +95 -0
- package/src/core/constants/channels.js +2 -0
- package/src/core/constants/code-modes.js +10 -0
- package/src/core/constants/index.js +1 -0
- package/src/core/deck/manifest.js +186 -0
- package/src/core/engines/catalog.js +83 -0
- package/src/core/{tools → http-tools}/browser.js +0 -1
- package/src/core/{tools → http-tools}/fetch.js +0 -1
- package/src/core/{tools → http-tools}/glob.js +0 -1
- package/src/core/{tools → http-tools}/grep.js +0 -1
- package/src/core/{tools → http-tools}/registry.js +0 -1
- package/src/core/{tools → http-tools}/search.js +0 -1
- package/src/core/i18n/en.js +9 -0
- package/src/core/i18n/es.js +12 -0
- package/src/core/i18n/index.js +54 -0
- package/src/core/i18n/pt.js +9 -0
- package/src/core/identity/telegram.js +2 -1
- package/src/core/mcp/runner.js +272 -14
- package/src/core/mcp/sources.js +3 -2
- package/src/core/routines/index.js +16 -0
- package/src/{host/daemon/routines.js → core/routines/runner.js} +36 -103
- package/src/core/runtime-skills/apc-context/SKILL.md +159 -0
- package/src/core/runtime-skills/apx/SKILL.md +95 -0
- package/src/core/runtime-skills/apx-mcp/SKILL.md +116 -0
- package/src/core/runtime-skills/{claude-code.md → claude-code/SKILL.md} +1 -0
- package/src/core/runtime-skills/{codex-cli.md → codex-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{opencode-cli.md → opencode-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{openrouter.md → openrouter/SKILL.md} +1 -0
- package/src/{host/daemon/env-detect.js → core/runtimes/detect.js} +1 -1
- package/src/core/stores/code-sessions.js +50 -2
- package/src/core/stores/routine-memory.js +1 -1
- package/src/core/stores/sessions-search.js +121 -0
- package/src/core/stores/sessions.js +38 -0
- package/src/core/vars/index.js +14 -0
- package/src/core/vars/interpolate.js +86 -0
- package/src/core/vars/sources.js +151 -0
- package/src/core/voice/audio-decode.js +38 -0
- package/src/core/voice/transcription.js +225 -0
- package/src/host/daemon/api/admin-config.js +5 -82
- package/src/host/daemon/api/agents.js +5 -5
- package/src/host/daemon/api/code.js +17 -169
- package/src/host/daemon/api/config.js +3 -4
- package/src/host/daemon/api/conversations.js +8 -29
- package/src/host/daemon/api/deck.js +37 -404
- package/src/host/daemon/api/engines.js +1 -80
- package/src/host/daemon/api/exec.js +1 -1
- package/src/host/daemon/api/mcps.js +32 -0
- package/src/host/daemon/api/routines.js +1 -1
- package/src/host/daemon/api/runtimes.js +4 -3
- package/src/host/daemon/api/sessions-search.js +24 -140
- package/src/host/daemon/api/sessions.js +12 -30
- package/src/host/daemon/api/shared.js +2 -1
- package/src/host/daemon/api/telegram.js +1 -11
- package/src/host/daemon/api/tools.js +6 -6
- package/src/host/daemon/api/transcribe.js +2 -2
- package/src/host/daemon/api/vars.js +137 -0
- package/src/host/daemon/api/voice.js +13 -290
- package/src/host/daemon/api.js +2 -0
- package/src/host/daemon/db.js +6 -6
- package/src/host/daemon/deck-exec.js +148 -0
- package/src/host/daemon/index.js +3 -3
- package/src/host/daemon/plugins/telegram/index.js +9 -9
- package/src/host/daemon/routines-scheduler.js +64 -0
- package/src/host/daemon/smoke.js +3 -2
- package/src/host/daemon/whisper-server.js +225 -0
- package/src/interfaces/cli/commands/agent.js +3 -2
- package/src/interfaces/cli/commands/command.js +2 -3
- package/src/interfaces/cli/commands/messages.js +6 -2
- package/src/interfaces/cli/commands/pair.js +5 -4
- package/src/interfaces/cli/commands/search.js +1 -1
- package/src/interfaces/cli/commands/sessions.js +3 -2
- package/src/interfaces/cli/commands/skills.js +36 -55
- package/src/interfaces/web/dist/assets/index-DdmSRtsz.css +1 -0
- package/src/interfaces/web/dist/assets/index-M4FspaCH.js +613 -0
- package/src/interfaces/web/dist/assets/index-M4FspaCH.js.map +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +182 -182
- package/src/interfaces/web/src/components/ModelCombobox.tsx +2 -1
- package/src/interfaces/web/src/components/TelegramChannelDialog.tsx +1 -1
- package/src/interfaces/web/src/components/chat/AskAnswersCard.tsx +76 -0
- package/src/interfaces/web/src/components/chat/MessageBubble.tsx +16 -3
- package/src/interfaces/web/src/components/chat/MessageList.tsx +23 -1
- package/src/interfaces/web/src/components/chat/ModelPicker.tsx +3 -1
- package/src/interfaces/web/src/components/code/CodeArtifactsTab.tsx +4 -4
- package/src/interfaces/web/src/components/code/CodeChangesTab.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeFileTree.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeFileViewer.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeTerminal.tsx +3 -2
- package/src/interfaces/web/src/components/config/GlobalConfigEditor.tsx +2 -1
- package/src/interfaces/web/src/components/deck/WidgetRow.tsx +2 -1
- package/src/interfaces/web/src/components/inputs/KeyValueList.tsx +93 -0
- package/src/interfaces/web/src/components/inputs/VarTokenInput.tsx +449 -0
- package/src/interfaces/web/src/components/settings/DefaultRouterCard.tsx +2 -1
- package/src/interfaces/web/src/components/settings/EnginesPanel.tsx +2 -2
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +5 -4
- package/src/interfaces/web/src/components/settings/providers/ProviderCard.tsx +3 -2
- package/src/interfaces/web/src/components/settings/providers/ProviderModal.tsx +3 -2
- package/src/interfaces/web/src/components/ui/chat-input.tsx +5 -4
- package/src/interfaces/web/src/components/ui/sidebar.tsx +3 -2
- package/src/interfaces/web/src/components/voice/VoiceProviderModal.tsx +2 -1
- package/src/interfaces/web/src/constants/index.ts +1 -1
- package/src/interfaces/web/src/i18n/en.ts +174 -7
- package/src/interfaces/web/src/i18n/es.ts +179 -15
- package/src/interfaces/web/src/lib/api/mcps.ts +25 -0
- package/src/interfaces/web/src/lib/api/vars.ts +38 -0
- package/src/interfaces/web/src/lib/api.ts +1 -0
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +8 -31
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +7 -6
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +132 -1
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +549 -104
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/VarsTab.tsx +300 -0
- package/src/interfaces/web/src/types/daemon.ts +5 -0
- package/src/host/daemon/transcription.js +0 -538
- package/src/host/daemon/whisper-transcribe.py +0 -73
- package/src/interfaces/web/dist/assets/index-Aaiw8BZN.css +0 -1
- package/src/interfaces/web/dist/assets/index-DPqtjDjh.js +0 -602
- package/src/interfaces/web/dist/assets/index-DPqtjDjh.js.map +0 -1
- /package/src/{host/daemon → core/apc}/projects-helpers.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/ask.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/helpers.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/media.js +0 -0
- /package/src/core/{tools → http-tools}/index.js +0 -0
- /package/{skills → src/core/runtime-skills}/apx-agency-agents/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-agent/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-mcp-builder/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-project/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-routine/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-runtime/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-sessions/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-skill-builder/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-task/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-telegram/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-voice/SKILL.md +0 -0
- /package/src/{host/daemon/compact.js → core/stores/conversations-compactor.js} +0 -0
- /package/src/{host/daemon → core/stores}/conversations.js +0 -0
- /package/src/{host/daemon → core/util}/thinking.js +0 -0
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
function gN(e,n){for(var s=0;s<n.length;s++){const r=n[s];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const c=Object.getOwnPropertyDescriptor(r,i);c&&Object.defineProperty(e,i,c.get?c:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function s(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(i){if(i.ep)return;i.ep=!0;const c=s(i);fetch(i.href,c)}})();function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Um={exports:{}},Ni={};/**
|
|
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 g1;function hN(){if(g1)return Ni;g1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(r,i,c){var d=null;if(c!==void 0&&(d=""+c),i.key!==void 0&&(d=""+i.key),"key"in i){c={};for(var f in i)f!=="key"&&(c[f]=i[f])}else c=i;return i=c.ref,{$$typeof:e,type:r,key:d,ref:i!==void 0?i:null,props:c}}return Ni.Fragment=n,Ni.jsx=s,Ni.jsxs=s,Ni}var h1;function xN(){return h1||(h1=1,Um.exports=hN()),Um.exports}var o=xN(),Hm={exports:{}},st={};/**
|
|
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 x1;function bN(){if(x1)return st;x1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),y=Symbol.iterator;function S(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function C(U,K,G){this.props=U,this.context=K,this.refs=_,this.updater=G||w}C.prototype.isReactComponent={},C.prototype.setState=function(U,K){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,K,"setState")},C.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function k(){}k.prototype=C.prototype;function R(U,K,G){this.props=U,this.context=K,this.refs=_,this.updater=G||w}var N=R.prototype=new k;N.constructor=R,j(N,C.prototype),N.isPureReactComponent=!0;var A=Array.isArray;function M(){}var O={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function B(U,K,G){var W=G.ref;return{$$typeof:e,type:U,key:K,ref:W!==void 0?W:null,props:G}}function I(U,K){return B(U.type,K,U.props)}function D(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function z(U){var K={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(G){return K[G]})}var H=/\/+/g;function V(U,K){return typeof U=="object"&&U!==null&&U.key!=null?z(""+U.key):K.toString(36)}function Y(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(K){U.status==="pending"&&(U.status="fulfilled",U.value=K)},function(K){U.status==="pending"&&(U.status="rejected",U.reason=K)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function q(U,K,G,W,ie){var re=typeof U;(re==="undefined"||re==="boolean")&&(U=null);var oe=!1;if(U===null)oe=!0;else switch(re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(U.$$typeof){case e:case n:oe=!0;break;case g:return oe=U._init,q(oe(U._payload),K,G,W,ie)}}if(oe)return ie=ie(U),oe=W===""?"."+V(U,0):W,A(ie)?(G="",oe!=null&&(G=oe.replace(H,"$&/")+"/"),q(ie,K,G,"",function(Te){return Te})):ie!=null&&(D(ie)&&(ie=I(ie,G+(ie.key==null||U&&U.key===ie.key?"":(""+ie.key).replace(H,"$&/")+"/")+oe)),K.push(ie)),1;oe=0;var ce=W===""?".":W+":";if(A(U))for(var ee=0;ee<U.length;ee++)W=U[ee],re=ce+V(W,ee),oe+=q(W,K,G,re,ie);else if(ee=S(U),typeof ee=="function")for(U=ee.call(U),ee=0;!(W=U.next()).done;)W=W.value,re=ce+V(W,ee++),oe+=q(W,K,G,re,ie);else if(re==="object"){if(typeof U.then=="function")return q(Y(U),K,G,W,ie);throw K=String(U),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function F(U,K,G){if(U==null)return U;var W=[],ie=0;return q(U,W,"","",function(re){return K.call(G,re,ie++)}),W}function Z(U){if(U._status===-1){var K=U._result;K=K(),K.then(function(G){(U._status===0||U._status===-1)&&(U._status=1,U._result=G)},function(G){(U._status===0||U._status===-1)&&(U._status=2,U._result=G)}),U._status===-1&&(U._status=0,U._result=K)}if(U._status===1)return U._result.default;throw U._result}var $=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},X={map:F,forEach:function(U,K,G){F(U,function(){K.apply(this,arguments)},G)},count:function(U){var K=0;return F(U,function(){K++}),K},toArray:function(U){return F(U,function(K){return K})||[]},only:function(U){if(!D(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return st.Activity=x,st.Children=X,st.Component=C,st.Fragment=s,st.Profiler=i,st.PureComponent=R,st.StrictMode=r,st.Suspense=p,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,st.__COMPILER_RUNTIME={__proto__:null,c:function(U){return O.H.useMemoCache(U)}},st.cache=function(U){return function(){return U.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(U,K,G){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var W=j({},U.props),ie=U.key;if(K!=null)for(re in K.key!==void 0&&(ie=""+K.key),K)!L.call(K,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&K.ref===void 0||(W[re]=K[re]);var re=arguments.length-2;if(re===1)W.children=G;else if(1<re){for(var oe=Array(re),ce=0;ce<re;ce++)oe[ce]=arguments[ce+2];W.children=oe}return B(U.type,ie,W)},st.createContext=function(U){return U={$$typeof:d,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:c,_context:U},U},st.createElement=function(U,K,G){var W,ie={},re=null;if(K!=null)for(W in K.key!==void 0&&(re=""+K.key),K)L.call(K,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ie[W]=K[W]);var oe=arguments.length-2;if(oe===1)ie.children=G;else if(1<oe){for(var ce=Array(oe),ee=0;ee<oe;ee++)ce[ee]=arguments[ee+2];ie.children=ce}if(U&&U.defaultProps)for(W in oe=U.defaultProps,oe)ie[W]===void 0&&(ie[W]=oe[W]);return B(U,re,ie)},st.createRef=function(){return{current:null}},st.forwardRef=function(U){return{$$typeof:f,render:U}},st.isValidElement=D,st.lazy=function(U){return{$$typeof:g,_payload:{_status:-1,_result:U},_init:Z}},st.memo=function(U,K){return{$$typeof:m,type:U,compare:K===void 0?null:K}},st.startTransition=function(U){var K=O.T,G={};O.T=G;try{var W=U(),ie=O.S;ie!==null&&ie(G,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(M,$)}catch(re){$(re)}finally{K!==null&&G.types!==null&&(K.types=G.types),O.T=K}},st.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},st.use=function(U){return O.H.use(U)},st.useActionState=function(U,K,G){return O.H.useActionState(U,K,G)},st.useCallback=function(U,K){return O.H.useCallback(U,K)},st.useContext=function(U){return O.H.useContext(U)},st.useDebugValue=function(){},st.useDeferredValue=function(U,K){return O.H.useDeferredValue(U,K)},st.useEffect=function(U,K){return O.H.useEffect(U,K)},st.useEffectEvent=function(U){return O.H.useEffectEvent(U)},st.useId=function(){return O.H.useId()},st.useImperativeHandle=function(U,K,G){return O.H.useImperativeHandle(U,K,G)},st.useInsertionEffect=function(U,K){return O.H.useInsertionEffect(U,K)},st.useLayoutEffect=function(U,K){return O.H.useLayoutEffect(U,K)},st.useMemo=function(U,K){return O.H.useMemo(U,K)},st.useOptimistic=function(U,K){return O.H.useOptimistic(U,K)},st.useReducer=function(U,K,G){return O.H.useReducer(U,K,G)},st.useRef=function(U){return O.H.useRef(U)},st.useState=function(U){return O.H.useState(U)},st.useSyncExternalStore=function(U,K,G){return O.H.useSyncExternalStore(U,K,G)},st.useTransition=function(){return O.H.useTransition()},st.version="19.2.7",st}var b1;function jc(){return b1||(b1=1,Hm.exports=bN()),Hm.exports}var b=jc();const _c=Vh(b),vN=gN({__proto__:null,default:_c},[b]);var qm={exports:{}},Ri={},Vm={exports:{}},$m={};/**
|
|
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 v1;function yN(){return v1||(v1=1,(function(e){function n(q,F){var Z=q.length;q.push(F);e:for(;0<Z;){var $=Z-1>>>1,X=q[$];if(0<i(X,F))q[$]=F,q[Z]=X,Z=$;else break e}}function s(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var F=q[0],Z=q.pop();if(Z!==F){q[0]=Z;e:for(var $=0,X=q.length,U=X>>>1;$<U;){var K=2*($+1)-1,G=q[K],W=K+1,ie=q[W];if(0>i(G,Z))W<X&&0>i(ie,G)?(q[$]=ie,q[W]=Z,$=W):(q[$]=G,q[K]=Z,$=K);else if(W<X&&0>i(ie,Z))q[$]=ie,q[W]=Z,$=W;else break e}}return F}function i(q,F){var Z=q.sortIndex-F.sortIndex;return Z!==0?Z:q.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],g=1,x=null,y=3,S=!1,w=!1,j=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(q){for(var F=s(m);F!==null;){if(F.callback===null)r(m);else if(F.startTime<=q)r(m),F.sortIndex=F.expirationTime,n(p,F);else break;F=s(m)}}function A(q){if(j=!1,N(q),!w)if(s(p)!==null)w=!0,M||(M=!0,z());else{var F=s(m);F!==null&&Y(A,F.startTime-q)}}var M=!1,O=-1,L=5,B=-1;function I(){return _?!0:!(e.unstable_now()-B<L)}function D(){if(_=!1,M){var q=e.unstable_now();B=q;var F=!0;try{e:{w=!1,j&&(j=!1,k(O),O=-1),S=!0;var Z=y;try{t:{for(N(q),x=s(p);x!==null&&!(x.expirationTime>q&&I());){var $=x.callback;if(typeof $=="function"){x.callback=null,y=x.priorityLevel;var X=$(x.expirationTime<=q);if(q=e.unstable_now(),typeof X=="function"){x.callback=X,N(q),F=!0;break t}x===s(p)&&r(p),N(q)}else r(p);x=s(p)}if(x!==null)F=!0;else{var U=s(m);U!==null&&Y(A,U.startTime-q),F=!1}}break e}finally{x=null,y=Z,S=!1}F=void 0}}finally{F?z():M=!1}}}var z;if(typeof R=="function")z=function(){R(D)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,V=H.port2;H.port1.onmessage=D,z=function(){V.postMessage(null)}}else z=function(){C(D,0)};function Y(q,F){O=C(function(){q(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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(q){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var Z=y;y=F;try{return q()}finally{y=Z}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(q,F){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Z=y;y=q;try{return F()}finally{y=Z}},e.unstable_scheduleCallback=function(q,F,Z){var $=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?$+Z:$):Z=$,q){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=Z+X,q={id:g++,callback:F,priorityLevel:q,startTime:Z,expirationTime:X,sortIndex:-1},Z>$?(q.sortIndex=Z,n(m,q),s(p)===null&&q===s(m)&&(j?(k(O),O=-1):j=!0,Y(A,Z-$))):(q.sortIndex=X,n(p,q),w||S||(w=!0,M||(M=!0,z()))),q},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(q){var F=y;return function(){var Z=y;y=F;try{return q.apply(this,arguments)}finally{y=Z}}}})($m)),$m}var y1;function jN(){return y1||(y1=1,Vm.exports=yN()),Vm.exports}var Gm={exports:{}},Dn={};/**
|
|
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 j1;function _N(){if(j1)return Dn;j1=1;var e=jc();function n(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},i=Symbol.for("react.portal");function c(p,m,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:x==null?null:""+x,children:p,containerInfo:m,implementation:g}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dn.createPortal=function(p,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return c(p,m,null,g)},Dn.flushSync=function(p){var m=d.T,g=r.p;try{if(d.T=null,r.p=2,p)return p()}finally{d.T=m,r.p=g,r.d.f()}},Dn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(p,m))},Dn.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},Dn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var g=m.as,x=f(g,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:y,fetchPriority:S}):g==="script"&&r.d.X(p,{crossOrigin:x,integrity:y,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Dn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(m.as,m.crossOrigin);r.d.M(p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(p)},Dn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,x=f(g,m.crossOrigin);r.d.L(p,g,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Dn.preloadModule=function(p,m){if(typeof p=="string")if(m){var g=f(m.as,m.crossOrigin);r.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(p)},Dn.requestFormReset=function(p){r.d.r(p)},Dn.unstable_batchedUpdates=function(p,m){return p(m)},Dn.useFormState=function(p,m,g){return d.H.useFormState(p,m,g)},Dn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Dn.version="19.2.7",Dn}var _1;function Z_(){if(_1)return Gm.exports;_1=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(n){console.error(n)}}return e(),Gm.exports=_N(),Gm.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 S1;function SN(){if(S1)return Ri;S1=1;var e=jN(),n=jc(),s=Z_();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)a+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,l=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(l=a.return),t=a.return;while(t)}return a.tag===3?l:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(r(188))}function m(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var l=t,u=a;;){var h=l.return;if(h===null)break;var v=h.alternate;if(v===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===l)return p(h),t;if(v===u)return p(h),a;v=v.sibling}throw Error(r(188))}if(l.return!==u.return)l=h,u=v;else{for(var T=!1,P=h.child;P;){if(P===l){T=!0,l=h,u=v;break}if(P===u){T=!0,u=h,l=v;break}P=P.sibling}if(!T){for(P=v.child;P;){if(P===l){T=!0,l=v,u=h;break}if(P===u){T=!0,u=v,l=h;break}P=P.sibling}if(!T)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:a}function g(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=g(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),R=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function z(t){return t===null||typeof t!="object"?null:(t=D&&t[D]||t["@@iterator"],typeof t=="function"?t:null)}var H=Symbol.for("react.client.reference");function V(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===H?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case A:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case R:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case N:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:V(t.type)||"Memo";case L:a=t._payload,t=t._init;try{return V(t(a))}catch{}}return null}var Y=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},$=[],X=-1;function U(t){return{current:t}}function K(t){0>X||(t.current=$[X],$[X]=null,X--)}function G(t,a){X++,$[X]=t.current,t.current=a}var W=U(null),ie=U(null),re=U(null),oe=U(null);function ce(t,a){switch(G(re,a),G(ie,t),G(W,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?I0(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=I0(a),t=B0(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(W),G(W,t)}function ee(){K(W),K(ie),K(re)}function Te(t){t.memoizedState!==null&&G(oe,t);var a=W.current,l=B0(a,t.type);a!==l&&(G(ie,t),G(W,l))}function $e(t){ie.current===t&&(K(W),K(ie)),oe.current===t&&(K(oe),wi._currentValue=Z)}var be,Ce;function Ee(t){if(be===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);be=a&&a[1]||"",Ce=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+be+t+Ce}var Pe=!1;function Ie(t,a){if(!t||Pe)return"";Pe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var se=ue}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(ue){se=ue}t.call(ge.prototype)}}else{try{throw Error()}catch(ue){se=ue}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&se&&typeof ue.stack=="string")return[ue.stack,se.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),T=v[0],P=v[1];if(T&&P){var Q=T.split(`
|
|
44
|
-
`),ae=P.split(`
|
|
45
|
-
`);for(h=u=0;u<Q.length&&!Q[u].includes("DetermineComponentFrameRoot");)u++;for(;h<ae.length&&!ae[h].includes("DetermineComponentFrameRoot");)h++;if(u===Q.length||h===ae.length)for(u=Q.length-1,h=ae.length-1;1<=u&&0<=h&&Q[u]!==ae[h];)h--;for(;1<=u&&0<=h;u--,h--)if(Q[u]!==ae[h]){if(u!==1||h!==1)do if(u--,h--,0>h||Q[u]!==ae[h]){var de=`
|
|
46
|
-
`+Q[u].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=u&&0<=h);break}}}finally{Pe=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Ee(l):""}function xe(t,a){switch(t.tag){case 26:case 27:case 5:return Ee(t.type);case 16:return Ee("Lazy");case 13:return t.child!==a&&a!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ie(t.type,!1);case 11:return Ie(t.type.render,!1);case 1:return Ie(t.type,!0);case 31:return Ee("Activity");default:return""}}function Ae(t){try{var a="",l=null;do a+=xe(t,l),l=t,t=t.return;while(t);return a}catch(u){return`
|
|
47
|
-
Error generating stack: `+u.message+`
|
|
48
|
-
`+u.stack}}var _e=Object.prototype.hasOwnProperty,Be=e.unstable_scheduleCallback,Fe=e.unstable_cancelCallback,Ge=e.unstable_shouldYield,De=e.unstable_requestPaint,ye=e.unstable_now,le=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,we=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,We=e.unstable_LowPriority,jt=e.unstable_IdlePriority,zt=e.log,pe=e.unstable_setDisableYieldValue,ke=null,Ne=null;function qe(t){if(typeof zt=="function"&&pe(t),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(ke,t)}catch{}}var at=Math.clz32?Math.clz32:mt,nn=Math.log,qt=Math.LN2;function mt(t){return t>>>=0,t===0?32:31-(nn(t)/qt|0)|0}var Nt=256,Zt=262144,St=4194304;function an(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ft(t,a,l){var u=t.pendingLanes;if(u===0)return 0;var h=0,v=t.suspendedLanes,T=t.pingedLanes;t=t.warmLanes;var P=u&134217727;return P!==0?(u=P&~v,u!==0?h=an(u):(T&=P,T!==0?h=an(T):l||(l=P&~t,l!==0&&(h=an(l))))):(P=u&~v,P!==0?h=an(P):T!==0?h=an(T):l||(l=u&~t,l!==0&&(h=an(l)))),h===0?0:a!==0&&a!==h&&(a&v)===0&&(v=h&-h,l=a&-a,v>=l||v===32&&(l&4194048)!==0)?a:h}function un(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function On(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Yn(){var t=St;return St<<=1,(St&62914560)===0&&(St=4194304),t}function oa(t){for(var a=[],l=0;31>l;l++)a.push(t);return a}function Xn(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function is(t,a,l,u,h,v){var T=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var P=t.entanglements,Q=t.expirationTimes,ae=t.hiddenUpdates;for(l=T&~l;0<l;){var de=31-at(l),ge=1<<de;P[de]=0,Q[de]=-1;var se=ae[de];if(se!==null)for(ae[de]=null,de=0;de<se.length;de++){var ue=se[de];ue!==null&&(ue.lane&=-536870913)}l&=~ge}u!==0&&zn(t,u,0),v!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=v&~(T&~a))}function zn(t,a,l){t.pendingLanes|=a,t.suspendedLanes&=~a;var u=31-at(a);t.entangledLanes|=a,t.entanglements[u]=t.entanglements[u]|1073741824|l&261930}function la(t,a){var l=t.entangledLanes|=a;for(t=t.entanglements;l;){var u=31-at(l),h=1<<u;h&a|t[u]&a&&(t[u]|=a),l&=~h}}function Da(t,a){var l=a&-a;return l=(l&42)!==0?1:cs(l),(l&(t.suspendedLanes|a))!==0?0:l}function cs(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function it(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Dt(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:i1(t.type))}function Sn(t,a){var l=F.p;try{return F.p=t,a()}finally{F.p=l}}var sn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+sn,mn="__reactProps$"+sn,Mr="__reactContainer$"+sn,Oc="__reactEvents$"+sn,sk="__reactListeners$"+sn,rk="__reactHandles$"+sn,Cb="__reactResources$"+sn,Bl="__reactMarker$"+sn;function Mf(t){delete t[Rt],delete t[mn],delete t[Oc],delete t[sk],delete t[rk]}function So(t){var a=t[Rt];if(a)return a;for(var l=t.parentNode;l;){if(a=l[Mr]||l[Rt]){if(l=a.alternate,a.child!==null||l!==null&&l.child!==null)for(t=F0(t);t!==null;){if(l=t[Rt])return l;t=F0(t)}return a}t=l,l=t.parentNode}return null}function wo(t){if(t=t[Rt]||t[Mr]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function Ul(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Co(t){var a=t[Cb];return a||(a=t[Cb]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function jn(t){t[Bl]=!0}var kb=new Set,Eb={};function Or(t,a){ko(t,a),ko(t+"Capture",a)}function ko(t,a){for(Eb[t]=a,t=0;t<a.length;t++)kb.add(a[t])}var ok=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]*$"),Nb={},Rb={};function lk(t){return _e.call(Rb,t)?!0:_e.call(Nb,t)?!1:ok.test(t)?Rb[t]=!0:(Nb[t]=!0,!1)}function zc(t,a,l){if(lk(a))if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+l)}}function Dc(t,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+l)}}function us(t,a,l,u){if(u===null)t.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(a,l,""+u)}}function va(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Tb(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ik(t,a,l){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,v=u.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return h.call(this)},set:function(T){l=""+T,v.call(this,T)}}),Object.defineProperty(t,a,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(T){l=""+T},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Of(t){if(!t._valueTracker){var a=Tb(t)?"checked":"value";t._valueTracker=ik(t,a,""+t[a])}}function Ab(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var l=a.getValue(),u="";return t&&(u=Tb(t)?t.checked?"true":"false":t.value),t=u,t!==l?(a.setValue(t),!0):!1}function Lc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ck=/[\n"\\]/g;function ya(t){return t.replace(ck,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function zf(t,a,l,u,h,v,T,P){t.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.type=T:t.removeAttribute("type"),a!=null?T==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+va(a)):t.value!==""+va(a)&&(t.value=""+va(a)):T!=="submit"&&T!=="reset"||t.removeAttribute("value"),a!=null?Df(t,T,va(a)):l!=null?Df(t,T,va(l)):u!=null&&t.removeAttribute("value"),h==null&&v!=null&&(t.defaultChecked=!!v),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?t.name=""+va(P):t.removeAttribute("name")}function Mb(t,a,l,u,h,v,T,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),a!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||a!=null)){Of(t);return}l=l!=null?""+va(l):"",a=a!=null?""+va(a):l,P||a===t.value||(t.value=a),t.defaultValue=a}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=P?t.checked:!!u,t.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(t.name=T),Of(t)}function Df(t,a,l){a==="number"&&Lc(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Eo(t,a,l,u){if(t=t.options,a){a={};for(var h=0;h<l.length;h++)a["$"+l[h]]=!0;for(l=0;l<t.length;l++)h=a.hasOwnProperty("$"+t[l].value),t[l].selected!==h&&(t[l].selected=h),h&&u&&(t[l].defaultSelected=!0)}else{for(l=""+va(l),a=null,h=0;h<t.length;h++){if(t[h].value===l){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}a!==null||t[h].disabled||(a=t[h])}a!==null&&(a.selected=!0)}}function Ob(t,a,l){if(a!=null&&(a=""+va(a),a!==t.value&&(t.value=a),l==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=l!=null?""+va(l):""}function zb(t,a,l,u){if(a==null){if(u!=null){if(l!=null)throw Error(r(92));if(Y(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),a=l}l=va(a),t.defaultValue=l,u=t.textContent,u===l&&u!==""&&u!==null&&(t.value=u),Of(t)}function No(t,a){if(a){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=a;return}}t.textContent=a}var uk=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 Db(t,a,l){var u=a.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":u?t.setProperty(a,l):typeof l!="number"||l===0||uk.has(a)?a==="float"?t.cssFloat=l:t[a]=(""+l).trim():t[a]=l+"px"}function Lb(t,a,l){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in a)u=a[h],a.hasOwnProperty(h)&&l[h]!==u&&Db(t,h,u)}else for(var v in a)a.hasOwnProperty(v)&&Db(t,v,a[v])}function Lf(t){if(t.indexOf("-")===-1)return!1;switch(t){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 dk=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"]]),fk=/^[\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 Pc(t){return fk.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ds(){}var Pf=null;function If(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ro=null,To=null;function Pb(t){var a=wo(t);if(a&&(t=a.stateNode)){var l=t[mn]||null;e:switch(t=a.stateNode,a.type){case"input":if(zf(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),a=l.name,l.type==="radio"&&a!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ya(""+a)+'"][type="radio"]'),a=0;a<l.length;a++){var u=l[a];if(u!==t&&u.form===t.form){var h=u[mn]||null;if(!h)throw Error(r(90));zf(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(a=0;a<l.length;a++)u=l[a],u.form===t.form&&Ab(u)}break e;case"textarea":Ob(t,l.value,l.defaultValue);break e;case"select":a=l.value,a!=null&&Eo(t,!!l.multiple,a,!1)}}}var Bf=!1;function Ib(t,a,l){if(Bf)return t(a,l);Bf=!0;try{var u=t(a);return u}finally{if(Bf=!1,(Ro!==null||To!==null)&&(wu(),Ro&&(a=Ro,t=To,To=Ro=null,Pb(a),t)))for(a=0;a<t.length;a++)Pb(t[a])}}function Hl(t,a){var l=t.stateNode;if(l===null)return null;var u=l[mn]||null;if(u===null)return null;l=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,a,typeof l));return l}var fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uf=!1;if(fs)try{var ql={};Object.defineProperty(ql,"passive",{get:function(){Uf=!0}}),window.addEventListener("test",ql,ql),window.removeEventListener("test",ql,ql)}catch{Uf=!1}var Vs=null,Hf=null,Ic=null;function Bb(){if(Ic)return Ic;var t,a=Hf,l=a.length,u,h="value"in Vs?Vs.value:Vs.textContent,v=h.length;for(t=0;t<l&&a[t]===h[t];t++);var T=l-t;for(u=1;u<=T&&a[l-u]===h[v-u];u++);return Ic=h.slice(t,1<u?1-u:void 0)}function Bc(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Uc(){return!0}function Ub(){return!1}function Kn(t){function a(l,u,h,v,T){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var P in t)t.hasOwnProperty(P)&&(l=t[P],this[P]=l?l(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Uc:Ub,this.isPropagationStopped=Ub,this}return x(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Uc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Uc)},persist:function(){},isPersistent:Uc}),a}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hc=Kn(zr),Vl=x({},zr,{view:0,detail:0}),pk=Kn(Vl),qf,Vf,$l,qc=x({},Vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==$l&&($l&&t.type==="mousemove"?(qf=t.screenX-$l.screenX,Vf=t.screenY-$l.screenY):Vf=qf=0,$l=t),qf)},movementY:function(t){return"movementY"in t?t.movementY:Vf}}),Hb=Kn(qc),mk=x({},qc,{dataTransfer:0}),gk=Kn(mk),hk=x({},Vl,{relatedTarget:0}),$f=Kn(hk),xk=x({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),bk=Kn(xk),vk=x({},zr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),yk=Kn(vk),jk=x({},zr,{data:0}),qb=Kn(jk),_k={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sk={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"},wk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ck(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=wk[t])?!!a[t]:!1}function Gf(){return Ck}var kk=x({},Vl,{key:function(t){if(t.key){var a=_k[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Bc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Sk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gf,charCode:function(t){return t.type==="keypress"?Bc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Ek=Kn(kk),Nk=x({},qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vb=Kn(Nk),Rk=x({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gf}),Tk=Kn(Rk),Ak=x({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mk=Kn(Ak),Ok=x({},qc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zk=Kn(Ok),Dk=x({},zr,{newState:0,oldState:0}),Lk=Kn(Dk),Pk=[9,13,27,32],Ff=fs&&"CompositionEvent"in window,Gl=null;fs&&"documentMode"in document&&(Gl=document.documentMode);var Ik=fs&&"TextEvent"in window&&!Gl,$b=fs&&(!Ff||Gl&&8<Gl&&11>=Gl),Gb=" ",Fb=!1;function Yb(t,a){switch(t){case"keyup":return Pk.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xb(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ao=!1;function Bk(t,a){switch(t){case"compositionend":return Xb(a);case"keypress":return a.which!==32?null:(Fb=!0,Gb);case"textInput":return t=a.data,t===Gb&&Fb?null:t;default:return null}}function Uk(t,a){if(Ao)return t==="compositionend"||!Ff&&Yb(t,a)?(t=Bb(),Ic=Hf=Vs=null,Ao=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return $b&&a.locale!=="ko"?null:a.data;default:return null}}var Hk={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 Kb(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Hk[t.type]:a==="textarea"}function Qb(t,a,l,u){Ro?To?To.push(u):To=[u]:Ro=u,a=Au(a,"onChange"),0<a.length&&(l=new Hc("onChange","change",null,l,u),t.push({event:l,listeners:a}))}var Fl=null,Yl=null;function qk(t){M0(t,0)}function Vc(t){var a=Ul(t);if(Ab(a))return t}function Zb(t,a){if(t==="change")return a}var Jb=!1;if(fs){var Yf;if(fs){var Xf="oninput"in document;if(!Xf){var Wb=document.createElement("div");Wb.setAttribute("oninput","return;"),Xf=typeof Wb.oninput=="function"}Yf=Xf}else Yf=!1;Jb=Yf&&(!document.documentMode||9<document.documentMode)}function ev(){Fl&&(Fl.detachEvent("onpropertychange",tv),Yl=Fl=null)}function tv(t){if(t.propertyName==="value"&&Vc(Yl)){var a=[];Qb(a,Yl,t,If(t)),Ib(qk,a)}}function Vk(t,a,l){t==="focusin"?(ev(),Fl=a,Yl=l,Fl.attachEvent("onpropertychange",tv)):t==="focusout"&&ev()}function $k(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vc(Yl)}function Gk(t,a){if(t==="click")return Vc(a)}function Fk(t,a){if(t==="input"||t==="change")return Vc(a)}function Yk(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var ia=typeof Object.is=="function"?Object.is:Yk;function Xl(t,a){if(ia(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var l=Object.keys(t),u=Object.keys(a);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!_e.call(a,h)||!ia(t[h],a[h]))return!1}return!0}function nv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function av(t,a){var l=nv(t);t=0;for(var u;l;){if(l.nodeType===3){if(u=t+l.textContent.length,t<=a&&u>=a)return{node:l,offset:a-t};t=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=nv(l)}}function sv(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?sv(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function rv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Lc(t.document);a instanceof t.HTMLIFrameElement;){try{var l=typeof a.contentWindow.location.href=="string"}catch{l=!1}if(l)t=a.contentWindow;else break;a=Lc(t.document)}return a}function Kf(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var Xk=fs&&"documentMode"in document&&11>=document.documentMode,Mo=null,Qf=null,Kl=null,Zf=!1;function ov(t,a,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Zf||Mo==null||Mo!==Lc(u)||(u=Mo,"selectionStart"in u&&Kf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Kl&&Xl(Kl,u)||(Kl=u,u=Au(Qf,"onSelect"),0<u.length&&(a=new Hc("onSelect","select",null,a,l),t.push({event:a,listeners:u}),a.target=Mo)))}function Dr(t,a){var l={};return l[t.toLowerCase()]=a.toLowerCase(),l["Webkit"+t]="webkit"+a,l["Moz"+t]="moz"+a,l}var Oo={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},Jf={},lv={};fs&&(lv=document.createElement("div").style,"AnimationEvent"in window||(delete Oo.animationend.animation,delete Oo.animationiteration.animation,delete Oo.animationstart.animation),"TransitionEvent"in window||delete Oo.transitionend.transition);function Lr(t){if(Jf[t])return Jf[t];if(!Oo[t])return t;var a=Oo[t],l;for(l in a)if(a.hasOwnProperty(l)&&l in lv)return Jf[t]=a[l];return t}var iv=Lr("animationend"),cv=Lr("animationiteration"),uv=Lr("animationstart"),Kk=Lr("transitionrun"),Qk=Lr("transitionstart"),Zk=Lr("transitioncancel"),dv=Lr("transitionend"),fv=new Map,Wf="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(" ");Wf.push("scrollEnd");function La(t,a){fv.set(t,a),Or(a,[t])}var $c=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ja=[],zo=0,ep=0;function Gc(){for(var t=zo,a=ep=zo=0;a<t;){var l=ja[a];ja[a++]=null;var u=ja[a];ja[a++]=null;var h=ja[a];ja[a++]=null;var v=ja[a];if(ja[a++]=null,u!==null&&h!==null){var T=u.pending;T===null?h.next=h:(h.next=T.next,T.next=h),u.pending=h}v!==0&&pv(l,h,v)}}function Fc(t,a,l,u){ja[zo++]=t,ja[zo++]=a,ja[zo++]=l,ja[zo++]=u,ep|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function tp(t,a,l,u){return Fc(t,a,l,u),Yc(t)}function Pr(t,a){return Fc(t,null,null,a),Yc(t)}function pv(t,a,l){t.lanes|=l;var u=t.alternate;u!==null&&(u.lanes|=l);for(var h=!1,v=t.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(h=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,h&&a!==null&&(h=31-at(l),t=v.hiddenUpdates,u=t[h],u===null?t[h]=[a]:u.push(a),a.lane=l|536870912),v):null}function Yc(t){if(50<xi)throw xi=0,um=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var Do={};function Jk(t,a,l,u){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ca(t,a,l,u){return new Jk(t,a,l,u)}function np(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ps(t,a){var l=t.alternate;return l===null?(l=ca(t.tag,a,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=a,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,a=t.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function mv(t,a){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,a=l.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Xc(t,a,l,u,h,v){var T=0;if(u=t,typeof t=="function")np(t)&&(T=1);else if(typeof t=="string")T=aN(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=ca(31,l,a,h),t.elementType=B,t.lanes=v,t;case j:return Ir(l.children,h,v,a);case _:T=8,h|=24;break;case C:return t=ca(12,l,a,h|2),t.elementType=C,t.lanes=v,t;case A:return t=ca(13,l,a,h),t.elementType=A,t.lanes=v,t;case M:return t=ca(19,l,a,h),t.elementType=M,t.lanes=v,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:T=10;break e;case k:T=9;break e;case N:T=11;break e;case O:T=14;break e;case L:T=16,u=null;break e}T=29,l=Error(r(130,t===null?"null":typeof t,"")),u=null}return a=ca(T,l,a,h),a.elementType=t,a.type=u,a.lanes=v,a}function Ir(t,a,l,u){return t=ca(7,t,u,a),t.lanes=l,t}function ap(t,a,l){return t=ca(6,t,null,a),t.lanes=l,t}function gv(t){var a=ca(18,null,null,0);return a.stateNode=t,a}function sp(t,a,l){return a=ca(4,t.children!==null?t.children:[],t.key,a),a.lanes=l,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var hv=new WeakMap;function _a(t,a){if(typeof t=="object"&&t!==null){var l=hv.get(t);return l!==void 0?l:(a={value:t,source:a,stack:Ae(a)},hv.set(t,a),a)}return{value:t,source:a,stack:Ae(a)}}var Lo=[],Po=0,Kc=null,Ql=0,Sa=[],wa=0,$s=null,Ga=1,Fa="";function ms(t,a){Lo[Po++]=Ql,Lo[Po++]=Kc,Kc=t,Ql=a}function xv(t,a,l){Sa[wa++]=Ga,Sa[wa++]=Fa,Sa[wa++]=$s,$s=t;var u=Ga;t=Fa;var h=32-at(u)-1;u&=~(1<<h),l+=1;var v=32-at(a)+h;if(30<v){var T=h-h%5;v=(u&(1<<T)-1).toString(32),u>>=T,h-=T,Ga=1<<32-at(a)+h|l<<h|u,Fa=v+t}else Ga=1<<v|l<<h|u,Fa=t}function rp(t){t.return!==null&&(ms(t,1),xv(t,1,0))}function op(t){for(;t===Kc;)Kc=Lo[--Po],Lo[Po]=null,Ql=Lo[--Po],Lo[Po]=null;for(;t===$s;)$s=Sa[--wa],Sa[wa]=null,Fa=Sa[--wa],Sa[wa]=null,Ga=Sa[--wa],Sa[wa]=null}function bv(t,a){Sa[wa++]=Ga,Sa[wa++]=Fa,Sa[wa++]=$s,Ga=a.id,Fa=a.overflow,$s=t}var wn=null,Yt=null,_t=!1,Gs=null,Ca=!1,lp=Error(r(519));function Fs(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zl(_a(a,t)),lp}function vv(t){var a=t.stateNode,l=t.type,u=t.memoizedProps;switch(a[Rt]=t,a[mn]=u,l){case"dialog":ht("cancel",a),ht("close",a);break;case"iframe":case"object":case"embed":ht("load",a);break;case"video":case"audio":for(l=0;l<vi.length;l++)ht(vi[l],a);break;case"source":ht("error",a);break;case"img":case"image":case"link":ht("error",a),ht("load",a);break;case"details":ht("toggle",a);break;case"input":ht("invalid",a),Mb(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":ht("invalid",a);break;case"textarea":ht("invalid",a),zb(a,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||a.textContent===""+l||u.suppressHydrationWarning===!0||L0(a.textContent,l)?(u.popover!=null&&(ht("beforetoggle",a),ht("toggle",a)),u.onScroll!=null&&ht("scroll",a),u.onScrollEnd!=null&&ht("scrollend",a),u.onClick!=null&&(a.onclick=ds),a=!0):a=!1,a||Fs(t,!0)}function yv(t){for(wn=t.return;wn;)switch(wn.tag){case 5:case 31:case 13:Ca=!1;return;case 27:case 3:Ca=!0;return;default:wn=wn.return}}function Io(t){if(t!==wn)return!1;if(!_t)return yv(t),_t=!0,!1;var a=t.tag,l;if((l=a!==3&&a!==27)&&((l=a===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Cm(t.type,t.memoizedProps)),l=!l),l&&Yt&&Fs(t),yv(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Yt=G0(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Yt=G0(t)}else a===27?(a=Yt,or(t.type)?(t=Tm,Tm=null,Yt=t):Yt=a):Yt=wn?Ea(t.stateNode.nextSibling):null;return!0}function Br(){Yt=wn=null,_t=!1}function ip(){var t=Gs;return t!==null&&(Wn===null?Wn=t:Wn.push.apply(Wn,t),Gs=null),t}function Zl(t){Gs===null?Gs=[t]:Gs.push(t)}var cp=U(null),Ur=null,gs=null;function Ys(t,a,l){G(cp,a._currentValue),a._currentValue=l}function hs(t){t._currentValue=cp.current,K(cp)}function up(t,a,l){for(;t!==null;){var u=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),t===l)break;t=t.return}}function dp(t,a,l,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var v=h.dependencies;if(v!==null){var T=h.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=h;for(var Q=0;Q<a.length;Q++)if(P.context===a[Q]){v.lanes|=l,P=v.alternate,P!==null&&(P.lanes|=l),up(v.return,l,t),u||(T=null);break e}v=P.next}}else if(h.tag===18){if(T=h.return,T===null)throw Error(r(341));T.lanes|=l,v=T.alternate,v!==null&&(v.lanes|=l),up(T,l,t),T=null}else T=h.child;if(T!==null)T.return=h;else for(T=h;T!==null;){if(T===t){T=null;break}if(h=T.sibling,h!==null){h.return=T.return,T=h;break}T=T.return}h=T}}function Bo(t,a,l,u){t=null;for(var h=a,v=!1;h!==null;){if(!v){if((h.flags&524288)!==0)v=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var T=h.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var P=h.type;ia(h.pendingProps.value,T.value)||(t!==null?t.push(P):t=[P])}}else if(h===oe.current){if(T=h.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(wi):t=[wi])}h=h.return}t!==null&&dp(a,t,l,u),a.flags|=262144}function Qc(t){for(t=t.firstContext;t!==null;){if(!ia(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hr(t){Ur=t,gs=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return jv(Ur,t)}function Zc(t,a){return Ur===null&&Hr(t),jv(t,a)}function jv(t,a){var l=a._currentValue;if(a={context:a,memoizedValue:l,next:null},gs===null){if(t===null)throw Error(r(308));gs=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else gs=gs.next=a;return l}var Wk=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(l,u){t.push(u)}};this.abort=function(){a.aborted=!0,t.forEach(function(l){return l()})}},eE=e.unstable_scheduleCallback,tE=e.unstable_NormalPriority,gn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fp(){return{controller:new Wk,data:new Map,refCount:0}}function Jl(t){t.refCount--,t.refCount===0&&eE(tE,function(){t.controller.abort()})}var Wl=null,pp=0,Uo=0,Ho=null;function nE(t,a){if(Wl===null){var l=Wl=[];pp=0,Uo=hm(),Ho={status:"pending",value:void 0,then:function(u){l.push(u)}}}return pp++,a.then(_v,_v),a}function _v(){if(--pp===0&&Wl!==null){Ho!==null&&(Ho.status="fulfilled");var t=Wl;Wl=null,Uo=0,Ho=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function aE(t,a){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return t.then(function(){u.status="fulfilled",u.value=a;for(var h=0;h<l.length;h++)(0,l[h])(a)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var Sv=q.S;q.S=function(t,a){o0=ye(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&nE(t,a),Sv!==null&&Sv(t,a)};var qr=U(null);function mp(){var t=qr.current;return t!==null?t:Vt.pooledCache}function Jc(t,a){a===null?G(qr,qr.current):G(qr,a.pool)}function wv(){var t=mp();return t===null?null:{parent:gn._currentValue,pool:t}}var qo=Error(r(460)),gp=Error(r(474)),Wc=Error(r(542)),eu={then:function(){}};function Cv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function kv(t,a,l){switch(l=t[l],l===void 0?t.push(a):l!==a&&(a.then(ds,ds),a=l),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Nv(t),t;default:if(typeof a.status=="string")a.then(ds,ds);else{if(t=Vt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(u){if(a.status==="pending"){var h=a;h.status="fulfilled",h.value=u}},function(u){if(a.status==="pending"){var h=a;h.status="rejected",h.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Nv(t),t}throw $r=a,qo}}function Vr(t){try{var a=t._init;return a(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?($r=l,qo):l}}var $r=null;function Ev(){if($r===null)throw Error(r(459));var t=$r;return $r=null,t}function Nv(t){if(t===qo||t===Wc)throw Error(r(483))}var Vo=null,ei=0;function tu(t){var a=ei;return ei+=1,Vo===null&&(Vo=[]),kv(Vo,t,a)}function ti(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function nu(t,a){throw a.$$typeof===y?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Rv(t){function a(te,J){if(t){var ne=te.deletions;ne===null?(te.deletions=[J],te.flags|=16):ne.push(J)}}function l(te,J){if(!t)return null;for(;J!==null;)a(te,J),J=J.sibling;return null}function u(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function h(te,J){return te=ps(te,J),te.index=0,te.sibling=null,te}function v(te,J,ne){return te.index=ne,t?(ne=te.alternate,ne!==null?(ne=ne.index,ne<J?(te.flags|=67108866,J):ne):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function T(te){return t&&te.alternate===null&&(te.flags|=67108866),te}function P(te,J,ne,me){return J===null||J.tag!==6?(J=ap(ne,te.mode,me),J.return=te,J):(J=h(J,ne),J.return=te,J)}function Q(te,J,ne,me){var Ke=ne.type;return Ke===j?de(te,J,ne.props.children,me,ne.key):J!==null&&(J.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===L&&Vr(Ke)===J.type)?(J=h(J,ne.props),ti(J,ne),J.return=te,J):(J=Xc(ne.type,ne.key,ne.props,null,te.mode,me),ti(J,ne),J.return=te,J)}function ae(te,J,ne,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=sp(ne,te.mode,me),J.return=te,J):(J=h(J,ne.children||[]),J.return=te,J)}function de(te,J,ne,me,Ke){return J===null||J.tag!==7?(J=Ir(ne,te.mode,me,Ke),J.return=te,J):(J=h(J,ne),J.return=te,J)}function ge(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=ap(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case S:return ne=Xc(J.type,J.key,J.props,null,te.mode,ne),ti(ne,J),ne.return=te,ne;case w:return J=sp(J,te.mode,ne),J.return=te,J;case L:return J=Vr(J),ge(te,J,ne)}if(Y(J)||z(J))return J=Ir(J,te.mode,ne,null),J.return=te,J;if(typeof J.then=="function")return ge(te,tu(J),ne);if(J.$$typeof===R)return ge(te,Zc(te,J),ne);nu(te,J)}return null}function se(te,J,ne,me){var Ke=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ke!==null?null:P(te,J,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ke?Q(te,J,ne,me):null;case w:return ne.key===Ke?ae(te,J,ne,me):null;case L:return ne=Vr(ne),se(te,J,ne,me)}if(Y(ne)||z(ne))return Ke!==null?null:de(te,J,ne,me,null);if(typeof ne.then=="function")return se(te,J,tu(ne),me);if(ne.$$typeof===R)return se(te,J,Zc(te,ne),me);nu(te,ne)}return null}function ue(te,J,ne,me,Ke){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return te=te.get(ne)||null,P(J,te,""+me,Ke);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return te=te.get(me.key===null?ne:me.key)||null,Q(J,te,me,Ke);case w:return te=te.get(me.key===null?ne:me.key)||null,ae(J,te,me,Ke);case L:return me=Vr(me),ue(te,J,ne,me,Ke)}if(Y(me)||z(me))return te=te.get(ne)||null,de(J,te,me,Ke,null);if(typeof me.then=="function")return ue(te,J,ne,tu(me),Ke);if(me.$$typeof===R)return ue(te,J,ne,Zc(J,me),Ke);nu(J,me)}return null}function He(te,J,ne,me){for(var Ke=null,wt=null,Ve=J,ct=J=0,bt=null;Ve!==null&&ct<ne.length;ct++){Ve.index>ct?(bt=Ve,Ve=null):bt=Ve.sibling;var Ct=se(te,Ve,ne[ct],me);if(Ct===null){Ve===null&&(Ve=bt);break}t&&Ve&&Ct.alternate===null&&a(te,Ve),J=v(Ct,J,ct),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct,Ve=bt}if(ct===ne.length)return l(te,Ve),_t&&ms(te,ct),Ke;if(Ve===null){for(;ct<ne.length;ct++)Ve=ge(te,ne[ct],me),Ve!==null&&(J=v(Ve,J,ct),wt===null?Ke=Ve:wt.sibling=Ve,wt=Ve);return _t&&ms(te,ct),Ke}for(Ve=u(Ve);ct<ne.length;ct++)bt=ue(Ve,te,ct,ne[ct],me),bt!==null&&(t&&bt.alternate!==null&&Ve.delete(bt.key===null?ct:bt.key),J=v(bt,J,ct),wt===null?Ke=bt:wt.sibling=bt,wt=bt);return t&&Ve.forEach(function(dr){return a(te,dr)}),_t&&ms(te,ct),Ke}function et(te,J,ne,me){if(ne==null)throw Error(r(151));for(var Ke=null,wt=null,Ve=J,ct=J=0,bt=null,Ct=ne.next();Ve!==null&&!Ct.done;ct++,Ct=ne.next()){Ve.index>ct?(bt=Ve,Ve=null):bt=Ve.sibling;var dr=se(te,Ve,Ct.value,me);if(dr===null){Ve===null&&(Ve=bt);break}t&&Ve&&dr.alternate===null&&a(te,Ve),J=v(dr,J,ct),wt===null?Ke=dr:wt.sibling=dr,wt=dr,Ve=bt}if(Ct.done)return l(te,Ve),_t&&ms(te,ct),Ke;if(Ve===null){for(;!Ct.done;ct++,Ct=ne.next())Ct=ge(te,Ct.value,me),Ct!==null&&(J=v(Ct,J,ct),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct);return _t&&ms(te,ct),Ke}for(Ve=u(Ve);!Ct.done;ct++,Ct=ne.next())Ct=ue(Ve,te,ct,Ct.value,me),Ct!==null&&(t&&Ct.alternate!==null&&Ve.delete(Ct.key===null?ct:Ct.key),J=v(Ct,J,ct),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct);return t&&Ve.forEach(function(mN){return a(te,mN)}),_t&&ms(te,ct),Ke}function It(te,J,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===j&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:e:{for(var Ke=ne.key;J!==null;){if(J.key===Ke){if(Ke=ne.type,Ke===j){if(J.tag===7){l(te,J.sibling),me=h(J,ne.props.children),me.return=te,te=me;break e}}else if(J.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===L&&Vr(Ke)===J.type){l(te,J.sibling),me=h(J,ne.props),ti(me,ne),me.return=te,te=me;break e}l(te,J);break}else a(te,J);J=J.sibling}ne.type===j?(me=Ir(ne.props.children,te.mode,me,ne.key),me.return=te,te=me):(me=Xc(ne.type,ne.key,ne.props,null,te.mode,me),ti(me,ne),me.return=te,te=me)}return T(te);case w:e:{for(Ke=ne.key;J!==null;){if(J.key===Ke)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){l(te,J.sibling),me=h(J,ne.children||[]),me.return=te,te=me;break e}else{l(te,J);break}else a(te,J);J=J.sibling}me=sp(ne,te.mode,me),me.return=te,te=me}return T(te);case L:return ne=Vr(ne),It(te,J,ne,me)}if(Y(ne))return He(te,J,ne,me);if(z(ne)){if(Ke=z(ne),typeof Ke!="function")throw Error(r(150));return ne=Ke.call(ne),et(te,J,ne,me)}if(typeof ne.then=="function")return It(te,J,tu(ne),me);if(ne.$$typeof===R)return It(te,J,Zc(te,ne),me);nu(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,J!==null&&J.tag===6?(l(te,J.sibling),me=h(J,ne),me.return=te,te=me):(l(te,J),me=ap(ne,te.mode,me),me.return=te,te=me),T(te)):l(te,J)}return function(te,J,ne,me){try{ei=0;var Ke=It(te,J,ne,me);return Vo=null,Ke}catch(Ve){if(Ve===qo||Ve===Wc)throw Ve;var wt=ca(29,Ve,null,te.mode);return wt.lanes=me,wt.return=te,wt}finally{}}}var Gr=Rv(!0),Tv=Rv(!1),Xs=!1;function hp(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xp(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ks(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qs(t,a,l){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Et&2)!==0){var h=u.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),u.pending=a,a=Yc(t),pv(t,null,l),a}return Fc(t,u,a,l),Yc(t)}function ni(t,a,l){if(a=a.updateQueue,a!==null&&(a=a.shared,(l&4194048)!==0)){var u=a.lanes;u&=t.pendingLanes,l|=u,a.lanes=l,la(t,l)}}function bp(t,a){var l=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?h=v=T:v=v.next=T,l=l.next}while(l!==null);v===null?h=v=a:v=v.next=a}else h=v=a;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=a:t.next=a,l.lastBaseUpdate=a}var vp=!1;function ai(){if(vp){var t=Ho;if(t!==null)throw t}}function si(t,a,l,u){vp=!1;var h=t.updateQueue;Xs=!1;var v=h.firstBaseUpdate,T=h.lastBaseUpdate,P=h.shared.pending;if(P!==null){h.shared.pending=null;var Q=P,ae=Q.next;Q.next=null,T===null?v=ae:T.next=ae,T=Q;var de=t.alternate;de!==null&&(de=de.updateQueue,P=de.lastBaseUpdate,P!==T&&(P===null?de.firstBaseUpdate=ae:P.next=ae,de.lastBaseUpdate=Q))}if(v!==null){var ge=h.baseState;T=0,de=ae=Q=null,P=v;do{var se=P.lane&-536870913,ue=se!==P.lane;if(ue?(xt&se)===se:(u&se)===se){se!==0&&se===Uo&&(vp=!0),de!==null&&(de=de.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var He=t,et=P;se=a;var It=l;switch(et.tag){case 1:if(He=et.payload,typeof He=="function"){ge=He.call(It,ge,se);break e}ge=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=et.payload,se=typeof He=="function"?He.call(It,ge,se):He,se==null)break e;ge=x({},ge,se);break e;case 2:Xs=!0}}se=P.callback,se!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=h.callbacks,ue===null?h.callbacks=[se]:ue.push(se))}else ue={lane:se,tag:P.tag,payload:P.payload,callback:P.callback,next:null},de===null?(ae=de=ue,Q=ge):de=de.next=ue,T|=se;if(P=P.next,P===null){if(P=h.shared.pending,P===null)break;ue=P,P=ue.next,ue.next=null,h.lastBaseUpdate=ue,h.shared.pending=null}}while(!0);de===null&&(Q=ge),h.baseState=Q,h.firstBaseUpdate=ae,h.lastBaseUpdate=de,v===null&&(h.shared.lanes=0),tr|=T,t.lanes=T,t.memoizedState=ge}}function Av(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Mv(t,a){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Av(l[t],a)}var $o=U(null),au=U(0);function Ov(t,a){t=Cs,G(au,t),G($o,a),Cs=t|a.baseLanes}function yp(){G(au,Cs),G($o,$o.current)}function jp(){Cs=au.current,K($o),K(au)}var ua=U(null),ka=null;function Zs(t){var a=t.alternate;G(dn,dn.current&1),G(ua,t),ka===null&&(a===null||$o.current!==null||a.memoizedState!==null)&&(ka=t)}function _p(t){G(dn,dn.current),G(ua,t),ka===null&&(ka=t)}function zv(t){t.tag===22?(G(dn,dn.current),G(ua,t),ka===null&&(ka=t)):Js()}function Js(){G(dn,dn.current),G(ua,ua.current)}function da(t){K(ua),ka===t&&(ka=null),K(dn)}var dn=U(0);function su(t){for(var a=t;a!==null;){if(a.tag===13){var l=a.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Nm(l)||Rm(l)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var xs=0,rt=null,Lt=null,hn=null,ru=!1,Go=!1,Fr=!1,ou=0,ri=0,Fo=null,sE=0;function rn(){throw Error(r(321))}function Sp(t,a){if(a===null)return!1;for(var l=0;l<a.length&&l<t.length;l++)if(!ia(t[l],a[l]))return!1;return!0}function wp(t,a,l,u,h,v){return xs=v,rt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,q.H=t===null||t.memoizedState===null?xy:Bp,Fr=!1,v=l(u,h),Fr=!1,Go&&(v=Lv(a,l,u,h)),Dv(t),v}function Dv(t){q.H=ii;var a=Lt!==null&&Lt.next!==null;if(xs=0,hn=Lt=rt=null,ru=!1,ri=0,Fo=null,a)throw Error(r(300));t===null||xn||(t=t.dependencies,t!==null&&Qc(t)&&(xn=!0))}function Lv(t,a,l,u){rt=t;var h=0;do{if(Go&&(Fo=null),ri=0,Go=!1,25<=h)throw Error(r(301));if(h+=1,hn=Lt=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}q.H=by,v=a(l,u)}while(Go);return v}function rE(){var t=q.H,a=t.useState()[0];return a=typeof a.then=="function"?oi(a):a,t=t.useState()[0],(Lt!==null?Lt.memoizedState:null)!==t&&(rt.flags|=1024),a}function Cp(){var t=ou!==0;return ou=0,t}function kp(t,a,l){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~l}function Ep(t){if(ru){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}ru=!1}xs=0,hn=Lt=rt=null,Go=!1,ri=ou=0,Fo=null}function qn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?rt.memoizedState=hn=t:hn=hn.next=t,hn}function fn(){if(Lt===null){var t=rt.alternate;t=t!==null?t.memoizedState:null}else t=Lt.next;var a=hn===null?rt.memoizedState:hn.next;if(a!==null)hn=a,Lt=t;else{if(t===null)throw rt.alternate===null?Error(r(467)):Error(r(310));Lt=t,t={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},hn===null?rt.memoizedState=hn=t:hn=hn.next=t}return hn}function lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function oi(t){var a=ri;return ri+=1,Fo===null&&(Fo=[]),t=kv(Fo,t,a),a=rt,(hn===null?a.memoizedState:hn.next)===null&&(a=a.alternate,q.H=a===null||a.memoizedState===null?xy:Bp),t}function iu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return oi(t);if(t.$$typeof===R)return Cn(t)}throw Error(r(438,String(t)))}function Np(t){var a=null,l=rt.updateQueue;if(l!==null&&(a=l.memoCache),a==null){var u=rt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(h){return h.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),l===null&&(l=lu(),rt.updateQueue=l),l.memoCache=a,l=a.data[a.index],l===void 0)for(l=a.data[a.index]=Array(t),u=0;u<t;u++)l[u]=I;return a.index++,l}function bs(t,a){return typeof a=="function"?a(t):a}function cu(t){var a=fn();return Rp(a,Lt,t)}function Rp(t,a,l){var u=t.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var h=t.baseQueue,v=u.pending;if(v!==null){if(h!==null){var T=h.next;h.next=v.next,v.next=T}a.baseQueue=h=v,u.pending=null}if(v=t.baseState,h===null)t.memoizedState=v;else{a=h.next;var P=T=null,Q=null,ae=a,de=!1;do{var ge=ae.lane&-536870913;if(ge!==ae.lane?(xt&ge)===ge:(xs&ge)===ge){var se=ae.revertLane;if(se===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ge===Uo&&(de=!0);else if((xs&se)===se){ae=ae.next,se===Uo&&(de=!0);continue}else ge={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=ge,T=v):Q=Q.next=ge,rt.lanes|=se,tr|=se;ge=ae.action,Fr&&l(v,ge),v=ae.hasEagerState?ae.eagerState:l(v,ge)}else se={lane:ge,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=se,T=v):Q=Q.next=se,rt.lanes|=ge,tr|=ge;ae=ae.next}while(ae!==null&&ae!==a);if(Q===null?T=v:Q.next=P,!ia(v,t.memoizedState)&&(xn=!0,de&&(l=Ho,l!==null)))throw l;t.memoizedState=v,t.baseState=T,t.baseQueue=Q,u.lastRenderedState=v}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Tp(t){var a=fn(),l=a.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var u=l.dispatch,h=l.pending,v=a.memoizedState;if(h!==null){l.pending=null;var T=h=h.next;do v=t(v,T.action),T=T.next;while(T!==h);ia(v,a.memoizedState)||(xn=!0),a.memoizedState=v,a.baseQueue===null&&(a.baseState=v),l.lastRenderedState=v}return[v,u]}function Pv(t,a,l){var u=rt,h=fn(),v=_t;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=a();var T=!ia((Lt||h).memoizedState,l);if(T&&(h.memoizedState=l,xn=!0),h=h.queue,Op(Uv.bind(null,u,h,t),[t]),h.getSnapshot!==a||T||hn!==null&&hn.memoizedState.tag&1){if(u.flags|=2048,Yo(9,{destroy:void 0},Bv.bind(null,u,h,l,a),null),Vt===null)throw Error(r(349));v||(xs&127)!==0||Iv(u,a,l)}return l}function Iv(t,a,l){t.flags|=16384,t={getSnapshot:a,value:l},a=rt.updateQueue,a===null?(a=lu(),rt.updateQueue=a,a.stores=[t]):(l=a.stores,l===null?a.stores=[t]:l.push(t))}function Bv(t,a,l,u){a.value=l,a.getSnapshot=u,Hv(a)&&qv(t)}function Uv(t,a,l){return l(function(){Hv(a)&&qv(t)})}function Hv(t){var a=t.getSnapshot;t=t.value;try{var l=a();return!ia(t,l)}catch{return!0}}function qv(t){var a=Pr(t,2);a!==null&&ea(a,t,2)}function Ap(t){var a=qn();if(typeof t=="function"){var l=t;if(t=l(),Fr){qe(!0);try{l()}finally{qe(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:t},a}function Vv(t,a,l,u){return t.baseState=l,Rp(t,Lt,typeof u=="function"?u:bs)}function oE(t,a,l,u,h){if(fu(t))throw Error(r(485));if(t=a.action,t!==null){var v={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};q.T!==null?l(!0):v.isTransition=!1,u(v),l=a.pending,l===null?(v.next=a.pending=v,$v(a,v)):(v.next=l.next,a.pending=l.next=v)}}function $v(t,a){var l=a.action,u=a.payload,h=t.state;if(a.isTransition){var v=q.T,T={};q.T=T;try{var P=l(h,u),Q=q.S;Q!==null&&Q(T,P),Gv(t,a,P)}catch(ae){Mp(t,a,ae)}finally{v!==null&&T.types!==null&&(v.types=T.types),q.T=v}}else try{v=l(h,u),Gv(t,a,v)}catch(ae){Mp(t,a,ae)}}function Gv(t,a,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Fv(t,a,u)},function(u){return Mp(t,a,u)}):Fv(t,a,l)}function Fv(t,a,l){a.status="fulfilled",a.value=l,Yv(a),t.state=l,a=t.pending,a!==null&&(l=a.next,l===a?t.pending=null:(l=l.next,a.next=l,$v(t,l)))}function Mp(t,a,l){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=l,Yv(a),a=a.next;while(a!==u)}t.action=null}function Yv(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function Xv(t,a){return a}function Kv(t,a){if(_t){var l=Vt.formState;if(l!==null){e:{var u=rt;if(_t){if(Yt){t:{for(var h=Yt,v=Ca;h.nodeType!==8;){if(!v){h=null;break t}if(h=Ea(h.nextSibling),h===null){h=null;break t}}v=h.data,h=v==="F!"||v==="F"?h:null}if(h){Yt=Ea(h.nextSibling),u=h.data==="F!";break e}}Fs(u)}u=!1}u&&(a=l[0])}}return l=qn(),l.memoizedState=l.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xv,lastRenderedState:a},l.queue=u,l=my.bind(null,rt,u),u.dispatch=l,u=Ap(!1),v=Ip.bind(null,rt,!1,u.queue),u=qn(),h={state:a,dispatch:null,action:t,pending:null},u.queue=h,l=oE.bind(null,rt,h,v,l),h.dispatch=l,u.memoizedState=t,[a,l,!1]}function Qv(t){var a=fn();return Zv(a,Lt,t)}function Zv(t,a,l){if(a=Rp(t,a,Xv)[0],t=cu(bs)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=oi(a)}catch(T){throw T===qo?Wc:T}else u=a;a=fn();var h=a.queue,v=h.dispatch;return l!==a.memoizedState&&(rt.flags|=2048,Yo(9,{destroy:void 0},lE.bind(null,h,l),null)),[u,v,t]}function lE(t,a){t.action=a}function Jv(t){var a=fn(),l=Lt;if(l!==null)return Zv(a,l,t);fn(),a=a.memoizedState,l=fn();var u=l.queue.dispatch;return l.memoizedState=t,[a,u,!1]}function Yo(t,a,l,u){return t={tag:t,create:l,deps:u,inst:a,next:null},a=rt.updateQueue,a===null&&(a=lu(),rt.updateQueue=a),l=a.lastEffect,l===null?a.lastEffect=t.next=t:(u=l.next,l.next=t,t.next=u,a.lastEffect=t),t}function Wv(){return fn().memoizedState}function uu(t,a,l,u){var h=qn();rt.flags|=t,h.memoizedState=Yo(1|a,{destroy:void 0},l,u===void 0?null:u)}function du(t,a,l,u){var h=fn();u=u===void 0?null:u;var v=h.memoizedState.inst;Lt!==null&&u!==null&&Sp(u,Lt.memoizedState.deps)?h.memoizedState=Yo(a,v,l,u):(rt.flags|=t,h.memoizedState=Yo(1|a,v,l,u))}function ey(t,a){uu(8390656,8,t,a)}function Op(t,a){du(2048,8,t,a)}function iE(t){rt.flags|=4;var a=rt.updateQueue;if(a===null)a=lu(),rt.updateQueue=a,a.events=[t];else{var l=a.events;l===null?a.events=[t]:l.push(t)}}function ty(t){var a=fn().memoizedState;return iE({ref:a,nextImpl:t}),function(){if((Et&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function ny(t,a){return du(4,2,t,a)}function ay(t,a){return du(4,4,t,a)}function sy(t,a){if(typeof a=="function"){t=t();var l=a(t);return function(){typeof l=="function"?l():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function ry(t,a,l){l=l!=null?l.concat([t]):null,du(4,4,sy.bind(null,a,t),l)}function zp(){}function oy(t,a){var l=fn();a=a===void 0?null:a;var u=l.memoizedState;return a!==null&&Sp(a,u[1])?u[0]:(l.memoizedState=[t,a],t)}function ly(t,a){var l=fn();a=a===void 0?null:a;var u=l.memoizedState;if(a!==null&&Sp(a,u[1]))return u[0];if(u=t(),Fr){qe(!0);try{t()}finally{qe(!1)}}return l.memoizedState=[u,a],u}function Dp(t,a,l){return l===void 0||(xs&1073741824)!==0&&(xt&261930)===0?t.memoizedState=a:(t.memoizedState=l,t=i0(),rt.lanes|=t,tr|=t,l)}function iy(t,a,l,u){return ia(l,a)?l:$o.current!==null?(t=Dp(t,l,u),ia(t,a)||(xn=!0),t):(xs&42)===0||(xs&1073741824)!==0&&(xt&261930)===0?(xn=!0,t.memoizedState=l):(t=i0(),rt.lanes|=t,tr|=t,a)}function cy(t,a,l,u,h){var v=F.p;F.p=v!==0&&8>v?v:8;var T=q.T,P={};q.T=P,Ip(t,!1,a,l);try{var Q=h(),ae=q.S;if(ae!==null&&ae(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var de=aE(Q,u);li(t,a,de,ma(t))}else li(t,a,u,ma(t))}catch(ge){li(t,a,{then:function(){},status:"rejected",reason:ge},ma())}finally{F.p=v,T!==null&&P.types!==null&&(T.types=P.types),q.T=T}}function cE(){}function Lp(t,a,l,u){if(t.tag!==5)throw Error(r(476));var h=uy(t).queue;cy(t,h,a,Z,l===null?cE:function(){return dy(t),l(u)})}function uy(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:Z},next:null};var l={};return a.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:l},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function dy(t){var a=uy(t);a.next===null&&(a=t.alternate.memoizedState),li(t,a.next.queue,{},ma())}function Pp(){return Cn(wi)}function fy(){return fn().memoizedState}function py(){return fn().memoizedState}function uE(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var l=ma();t=Ks(l);var u=Qs(a,t,l);u!==null&&(ea(u,a,l),ni(u,a,l)),a={cache:fp()},t.payload=a;return}a=a.return}}function dE(t,a,l){var u=ma();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fu(t)?gy(a,l):(l=tp(t,a,l,u),l!==null&&(ea(l,t,u),hy(l,a,u)))}function my(t,a,l){var u=ma();li(t,a,l,u)}function li(t,a,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(fu(t))gy(a,h);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=a.lastRenderedReducer,v!==null))try{var T=a.lastRenderedState,P=v(T,l);if(h.hasEagerState=!0,h.eagerState=P,ia(P,T))return Fc(t,a,h,0),Vt===null&&Gc(),!1}catch{}finally{}if(l=tp(t,a,h,u),l!==null)return ea(l,t,u),hy(l,a,u),!0}return!1}function Ip(t,a,l,u){if(u={lane:2,revertLane:hm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},fu(t)){if(a)throw Error(r(479))}else a=tp(t,l,u,2),a!==null&&ea(a,t,2)}function fu(t){var a=t.alternate;return t===rt||a!==null&&a===rt}function gy(t,a){Go=ru=!0;var l=t.pending;l===null?a.next=a:(a.next=l.next,l.next=a),t.pending=a}function hy(t,a,l){if((l&4194048)!==0){var u=a.lanes;u&=t.pendingLanes,l|=u,a.lanes=l,la(t,l)}}var ii={readContext:Cn,use:iu,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useLayoutEffect:rn,useInsertionEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useSyncExternalStore:rn,useId:rn,useHostTransitionStatus:rn,useFormState:rn,useActionState:rn,useOptimistic:rn,useMemoCache:rn,useCacheRefresh:rn};ii.useEffectEvent=rn;var xy={readContext:Cn,use:iu,useCallback:function(t,a){return qn().memoizedState=[t,a===void 0?null:a],t},useContext:Cn,useEffect:ey,useImperativeHandle:function(t,a,l){l=l!=null?l.concat([t]):null,uu(4194308,4,sy.bind(null,a,t),l)},useLayoutEffect:function(t,a){return uu(4194308,4,t,a)},useInsertionEffect:function(t,a){uu(4,2,t,a)},useMemo:function(t,a){var l=qn();a=a===void 0?null:a;var u=t();if(Fr){qe(!0);try{t()}finally{qe(!1)}}return l.memoizedState=[u,a],u},useReducer:function(t,a,l){var u=qn();if(l!==void 0){var h=l(a);if(Fr){qe(!0);try{l(a)}finally{qe(!1)}}}else h=a;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=dE.bind(null,rt,t),[u.memoizedState,t]},useRef:function(t){var a=qn();return t={current:t},a.memoizedState=t},useState:function(t){t=Ap(t);var a=t.queue,l=my.bind(null,rt,a);return a.dispatch=l,[t.memoizedState,l]},useDebugValue:zp,useDeferredValue:function(t,a){var l=qn();return Dp(l,t,a)},useTransition:function(){var t=Ap(!1);return t=cy.bind(null,rt,t.queue,!0,!1),qn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,l){var u=rt,h=qn();if(_t){if(l===void 0)throw Error(r(407));l=l()}else{if(l=a(),Vt===null)throw Error(r(349));(xt&127)!==0||Iv(u,a,l)}h.memoizedState=l;var v={value:l,getSnapshot:a};return h.queue=v,ey(Uv.bind(null,u,v,t),[t]),u.flags|=2048,Yo(9,{destroy:void 0},Bv.bind(null,u,v,l,a),null),l},useId:function(){var t=qn(),a=Vt.identifierPrefix;if(_t){var l=Fa,u=Ga;l=(u&~(1<<32-at(u)-1)).toString(32)+l,a="_"+a+"R_"+l,l=ou++,0<l&&(a+="H"+l.toString(32)),a+="_"}else l=sE++,a="_"+a+"r_"+l.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Pp,useFormState:Kv,useActionState:Kv,useOptimistic:function(t){var a=qn();a.memoizedState=a.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=l,a=Ip.bind(null,rt,!0,l),l.dispatch=a,[t,a]},useMemoCache:Np,useCacheRefresh:function(){return qn().memoizedState=uE.bind(null,rt)},useEffectEvent:function(t){var a=qn(),l={impl:t};return a.memoizedState=l,function(){if((Et&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Bp={readContext:Cn,use:iu,useCallback:oy,useContext:Cn,useEffect:Op,useImperativeHandle:ry,useInsertionEffect:ny,useLayoutEffect:ay,useMemo:ly,useReducer:cu,useRef:Wv,useState:function(){return cu(bs)},useDebugValue:zp,useDeferredValue:function(t,a){var l=fn();return iy(l,Lt.memoizedState,t,a)},useTransition:function(){var t=cu(bs)[0],a=fn().memoizedState;return[typeof t=="boolean"?t:oi(t),a]},useSyncExternalStore:Pv,useId:fy,useHostTransitionStatus:Pp,useFormState:Qv,useActionState:Qv,useOptimistic:function(t,a){var l=fn();return Vv(l,Lt,t,a)},useMemoCache:Np,useCacheRefresh:py};Bp.useEffectEvent=ty;var by={readContext:Cn,use:iu,useCallback:oy,useContext:Cn,useEffect:Op,useImperativeHandle:ry,useInsertionEffect:ny,useLayoutEffect:ay,useMemo:ly,useReducer:Tp,useRef:Wv,useState:function(){return Tp(bs)},useDebugValue:zp,useDeferredValue:function(t,a){var l=fn();return Lt===null?Dp(l,t,a):iy(l,Lt.memoizedState,t,a)},useTransition:function(){var t=Tp(bs)[0],a=fn().memoizedState;return[typeof t=="boolean"?t:oi(t),a]},useSyncExternalStore:Pv,useId:fy,useHostTransitionStatus:Pp,useFormState:Jv,useActionState:Jv,useOptimistic:function(t,a){var l=fn();return Lt!==null?Vv(l,Lt,t,a):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Np,useCacheRefresh:py};by.useEffectEvent=ty;function Up(t,a,l,u){a=t.memoizedState,l=l(u,a),l=l==null?a:x({},a,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Hp={enqueueSetState:function(t,a,l){t=t._reactInternals;var u=ma(),h=Ks(u);h.payload=a,l!=null&&(h.callback=l),a=Qs(t,h,u),a!==null&&(ea(a,t,u),ni(a,t,u))},enqueueReplaceState:function(t,a,l){t=t._reactInternals;var u=ma(),h=Ks(u);h.tag=1,h.payload=a,l!=null&&(h.callback=l),a=Qs(t,h,u),a!==null&&(ea(a,t,u),ni(a,t,u))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var l=ma(),u=Ks(l);u.tag=2,a!=null&&(u.callback=a),a=Qs(t,u,l),a!==null&&(ea(a,t,l),ni(a,t,l))}};function vy(t,a,l,u,h,v,T){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,v,T):a.prototype&&a.prototype.isPureReactComponent?!Xl(l,u)||!Xl(h,v):!0}function yy(t,a,l,u){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(l,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(l,u),a.state!==t&&Hp.enqueueReplaceState(a,a.state,null)}function Yr(t,a){var l=a;if("ref"in a){l={};for(var u in a)u!=="ref"&&(l[u]=a[u])}if(t=t.defaultProps){l===a&&(l=x({},l));for(var h in t)l[h]===void 0&&(l[h]=t[h])}return l}function jy(t){$c(t)}function _y(t){console.error(t)}function Sy(t){$c(t)}function pu(t,a){try{var l=t.onUncaughtError;l(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function wy(t,a,l){try{var u=t.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function qp(t,a,l){return l=Ks(l),l.tag=3,l.payload={element:null},l.callback=function(){pu(t,a)},l}function Cy(t){return t=Ks(t),t.tag=3,t}function ky(t,a,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var v=u.value;t.payload=function(){return h(v)},t.callback=function(){wy(a,l,u)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(t.callback=function(){wy(a,l,u),typeof h!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var P=u.stack;this.componentDidCatch(u.value,{componentStack:P!==null?P:""})})}function fE(t,a,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=l.alternate,a!==null&&Bo(a,l,h,!0),l=ua.current,l!==null){switch(l.tag){case 31:case 13:return ka===null?Cu():l.alternate===null&&on===0&&(on=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===eu?l.flags|=16384:(a=l.updateQueue,a===null?l.updateQueue=new Set([u]):a.add(u),pm(t,u,h)),!1;case 22:return l.flags|=65536,u===eu?l.flags|=16384:(a=l.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=a):(l=a.retryQueue,l===null?a.retryQueue=new Set([u]):l.add(u)),pm(t,u,h)),!1}throw Error(r(435,l.tag))}return pm(t,u,h),Cu(),!1}if(_t)return a=ua.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=h,u!==lp&&(t=Error(r(422),{cause:u}),Zl(_a(t,l)))):(u!==lp&&(a=Error(r(423),{cause:u}),Zl(_a(a,l))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=_a(u,l),h=qp(t.stateNode,u,h),bp(t,h),on!==4&&(on=2)),!1;var v=Error(r(520),{cause:u});if(v=_a(v,l),hi===null?hi=[v]:hi.push(v),on!==4&&(on=2),a===null)return!0;u=_a(u,l),l=a;do{switch(l.tag){case 3:return l.flags|=65536,t=h&-h,l.lanes|=t,t=qp(l.stateNode,u,t),bp(l,t),!1;case 1:if(a=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(nr===null||!nr.has(v))))return l.flags|=65536,h&=-h,l.lanes|=h,h=Cy(h),ky(h,t,l,u),bp(l,h),!1}l=l.return}while(l!==null);return!1}var Vp=Error(r(461)),xn=!1;function kn(t,a,l,u){a.child=t===null?Tv(a,null,l,u):Gr(a,t.child,l,u)}function Ey(t,a,l,u,h){l=l.render;var v=a.ref;if("ref"in u){var T={};for(var P in u)P!=="ref"&&(T[P]=u[P])}else T=u;return Hr(a),u=wp(t,a,l,T,v,h),P=Cp(),t!==null&&!xn?(kp(t,a,h),vs(t,a,h)):(_t&&P&&rp(a),a.flags|=1,kn(t,a,u,h),a.child)}function Ny(t,a,l,u,h){if(t===null){var v=l.type;return typeof v=="function"&&!np(v)&&v.defaultProps===void 0&&l.compare===null?(a.tag=15,a.type=v,Ry(t,a,v,u,h)):(t=Xc(l.type,null,u,a,a.mode,h),t.ref=a.ref,t.return=a,a.child=t)}if(v=t.child,!Zp(t,h)){var T=v.memoizedProps;if(l=l.compare,l=l!==null?l:Xl,l(T,u)&&t.ref===a.ref)return vs(t,a,h)}return a.flags|=1,t=ps(v,u),t.ref=a.ref,t.return=a,a.child=t}function Ry(t,a,l,u,h){if(t!==null){var v=t.memoizedProps;if(Xl(v,u)&&t.ref===a.ref)if(xn=!1,a.pendingProps=u=v,Zp(t,h))(t.flags&131072)!==0&&(xn=!0);else return a.lanes=t.lanes,vs(t,a,h)}return $p(t,a,l,u,h)}function Ty(t,a,l,u){var h=u.children,v=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,t!==null){for(u=a.child=t.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~v}else u=0,a.child=null;return Ay(t,a,v,l,u)}if((l&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Jc(a,v!==null?v.cachePool:null),v!==null?Ov(a,v):yp(),zv(a);else return u=a.lanes=536870912,Ay(t,a,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(Jc(a,v.cachePool),Ov(a,v),Js(),a.memoizedState=null):(t!==null&&Jc(a,null),yp(),Js());return kn(t,a,h,l),a.child}function ci(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Ay(t,a,l,u,h){var v=mp();return v=v===null?null:{parent:gn._currentValue,pool:v},a.memoizedState={baseLanes:l,cachePool:v},t!==null&&Jc(a,null),yp(),zv(a),t!==null&&Bo(t,a,u,!0),a.childLanes=h,null}function mu(t,a){return a=hu({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function My(t,a,l){return Gr(a,t.child,null,l),t=mu(a,a.pendingProps),t.flags|=2,da(a),a.memoizedState=null,t}function pE(t,a,l){var u=a.pendingProps,h=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(_t){if(u.mode==="hidden")return t=mu(a,u),a.lanes=536870912,ci(null,t);if(_p(a),(t=Yt)?(t=$0(t,Ca),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:$s!==null?{id:Ga,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},l=gv(t),l.return=a,a.child=l,wn=a,Yt=null)):t=null,t===null)throw Fs(a);return a.lanes=536870912,null}return mu(a,u)}var v=t.memoizedState;if(v!==null){var T=v.dehydrated;if(_p(a),h)if(a.flags&256)a.flags&=-257,a=My(t,a,l);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(xn||Bo(t,a,l,!1),h=(l&t.childLanes)!==0,xn||h){if(u=Vt,u!==null&&(T=Da(u,l),T!==0&&T!==v.retryLane))throw v.retryLane=T,Pr(t,T),ea(u,t,T),Vp;Cu(),a=My(t,a,l)}else t=v.treeContext,Yt=Ea(T.nextSibling),wn=a,_t=!0,Gs=null,Ca=!1,t!==null&&bv(a,t),a=mu(a,u),a.flags|=4096;return a}return t=ps(t.child,{mode:u.mode,children:u.children}),t.ref=a.ref,a.child=t,t.return=a,t}function gu(t,a){var l=a.ref;if(l===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(a.flags|=4194816)}}function $p(t,a,l,u,h){return Hr(a),l=wp(t,a,l,u,void 0,h),u=Cp(),t!==null&&!xn?(kp(t,a,h),vs(t,a,h)):(_t&&u&&rp(a),a.flags|=1,kn(t,a,l,h),a.child)}function Oy(t,a,l,u,h,v){return Hr(a),a.updateQueue=null,l=Lv(a,u,l,h),Dv(t),u=Cp(),t!==null&&!xn?(kp(t,a,v),vs(t,a,v)):(_t&&u&&rp(a),a.flags|=1,kn(t,a,l,v),a.child)}function zy(t,a,l,u,h){if(Hr(a),a.stateNode===null){var v=Do,T=l.contextType;typeof T=="object"&&T!==null&&(v=Cn(T)),v=new l(u,v),a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Hp,a.stateNode=v,v._reactInternals=a,v=a.stateNode,v.props=u,v.state=a.memoizedState,v.refs={},hp(a),T=l.contextType,v.context=typeof T=="object"&&T!==null?Cn(T):Do,v.state=a.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(Up(a,l,T,u),v.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&Hp.enqueueReplaceState(v,v.state,null),si(a,u,v,h),ai(),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(t===null){v=a.stateNode;var P=a.memoizedProps,Q=Yr(l,P);v.props=Q;var ae=v.context,de=l.contextType;T=Do,typeof de=="object"&&de!==null&&(T=Cn(de));var ge=l.getDerivedStateFromProps;de=typeof ge=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=a.pendingProps!==P,de||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||ae!==T)&&yy(a,v,u,T),Xs=!1;var se=a.memoizedState;v.state=se,si(a,u,v,h),ai(),ae=a.memoizedState,P||se!==ae||Xs?(typeof ge=="function"&&(Up(a,l,ge,u),ae=a.memoizedState),(Q=Xs||vy(a,l,Q,u,se,ae,T))?(de||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(a.flags|=4194308)):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=ae),v.props=u,v.state=ae,v.context=T,u=Q):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{v=a.stateNode,xp(t,a),T=a.memoizedProps,de=Yr(l,T),v.props=de,ge=a.pendingProps,se=v.context,ae=l.contextType,Q=Do,typeof ae=="object"&&ae!==null&&(Q=Cn(ae)),P=l.getDerivedStateFromProps,(ae=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==ge||se!==Q)&&yy(a,v,u,Q),Xs=!1,se=a.memoizedState,v.state=se,si(a,u,v,h),ai();var ue=a.memoizedState;T!==ge||se!==ue||Xs||t!==null&&t.dependencies!==null&&Qc(t.dependencies)?(typeof P=="function"&&(Up(a,l,P,u),ue=a.memoizedState),(de=Xs||vy(a,l,de,u,se,ue,Q)||t!==null&&t.dependencies!==null&&Qc(t.dependencies))?(ae||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ue,Q),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ue,Q)),typeof v.componentDidUpdate=="function"&&(a.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===t.memoizedProps&&se===t.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&se===t.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ue),v.props=u,v.state=ue,v.context=Q,u=de):(typeof v.componentDidUpdate!="function"||T===t.memoizedProps&&se===t.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&se===t.memoizedState||(a.flags|=1024),u=!1)}return v=u,gu(t,a),u=(a.flags&128)!==0,v||u?(v=a.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),a.flags|=1,t!==null&&u?(a.child=Gr(a,t.child,null,h),a.child=Gr(a,null,l,h)):kn(t,a,l,h),a.memoizedState=v.state,t=a.child):t=vs(t,a,h),t}function Dy(t,a,l,u){return Br(),a.flags|=256,kn(t,a,l,u),a.child}var Gp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fp(t){return{baseLanes:t,cachePool:wv()}}function Yp(t,a,l){return t=t!==null?t.childLanes&~l:0,a&&(t|=pa),t}function Ly(t,a,l){var u=a.pendingProps,h=!1,v=(a.flags&128)!==0,T;if((T=v)||(T=t!==null&&t.memoizedState===null?!1:(dn.current&2)!==0),T&&(h=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,t===null){if(_t){if(h?Zs(a):Js(),(t=Yt)?(t=$0(t,Ca),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:$s!==null?{id:Ga,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},l=gv(t),l.return=a,a.child=l,wn=a,Yt=null)):t=null,t===null)throw Fs(a);return Rm(t)?a.lanes=32:a.lanes=536870912,null}var P=u.children;return u=u.fallback,h?(Js(),h=a.mode,P=hu({mode:"hidden",children:P},h),u=Ir(u,h,l,null),P.return=a,u.return=a,P.sibling=u,a.child=P,u=a.child,u.memoizedState=Fp(l),u.childLanes=Yp(t,T,l),a.memoizedState=Gp,ci(null,u)):(Zs(a),Xp(a,P))}var Q=t.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(v)a.flags&256?(Zs(a),a.flags&=-257,a=Kp(t,a,l)):a.memoizedState!==null?(Js(),a.child=t.child,a.flags|=128,a=null):(Js(),P=u.fallback,h=a.mode,u=hu({mode:"visible",children:u.children},h),P=Ir(P,h,l,null),P.flags|=2,u.return=a,P.return=a,u.sibling=P,a.child=u,Gr(a,t.child,null,l),u=a.child,u.memoizedState=Fp(l),u.childLanes=Yp(t,T,l),a.memoizedState=Gp,a=ci(null,u));else if(Zs(a),Rm(P)){if(T=P.nextSibling&&P.nextSibling.dataset,T)var ae=T.dgst;T=ae,u=Error(r(419)),u.stack="",u.digest=T,Zl({value:u,source:null,stack:null}),a=Kp(t,a,l)}else if(xn||Bo(t,a,l,!1),T=(l&t.childLanes)!==0,xn||T){if(T=Vt,T!==null&&(u=Da(T,l),u!==0&&u!==Q.retryLane))throw Q.retryLane=u,Pr(t,u),ea(T,t,u),Vp;Nm(P)||Cu(),a=Kp(t,a,l)}else Nm(P)?(a.flags|=192,a.child=t.child,a=null):(t=Q.treeContext,Yt=Ea(P.nextSibling),wn=a,_t=!0,Gs=null,Ca=!1,t!==null&&bv(a,t),a=Xp(a,u.children),a.flags|=4096);return a}return h?(Js(),P=u.fallback,h=a.mode,Q=t.child,ae=Q.sibling,u=ps(Q,{mode:"hidden",children:u.children}),u.subtreeFlags=Q.subtreeFlags&65011712,ae!==null?P=ps(ae,P):(P=Ir(P,h,l,null),P.flags|=2),P.return=a,u.return=a,u.sibling=P,a.child=u,ci(null,u),u=a.child,P=t.child.memoizedState,P===null?P=Fp(l):(h=P.cachePool,h!==null?(Q=gn._currentValue,h=h.parent!==Q?{parent:Q,pool:Q}:h):h=wv(),P={baseLanes:P.baseLanes|l,cachePool:h}),u.memoizedState=P,u.childLanes=Yp(t,T,l),a.memoizedState=Gp,ci(t.child,u)):(Zs(a),l=t.child,t=l.sibling,l=ps(l,{mode:"visible",children:u.children}),l.return=a,l.sibling=null,t!==null&&(T=a.deletions,T===null?(a.deletions=[t],a.flags|=16):T.push(t)),a.child=l,a.memoizedState=null,l)}function Xp(t,a){return a=hu({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function hu(t,a){return t=ca(22,t,null,a),t.lanes=0,t}function Kp(t,a,l){return Gr(a,t.child,null,l),t=Xp(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Py(t,a,l){t.lanes|=a;var u=t.alternate;u!==null&&(u.lanes|=a),up(t.return,a,l)}function Qp(t,a,l,u,h,v){var T=t.memoizedState;T===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:v}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=l,T.tailMode=h,T.treeForkCount=v)}function Iy(t,a,l){var u=a.pendingProps,h=u.revealOrder,v=u.tail;u=u.children;var T=dn.current,P=(T&2)!==0;if(P?(T=T&1|2,a.flags|=128):T&=1,G(dn,T),kn(t,a,u,l),u=_t?Ql:0,!P&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Py(t,l,a);else if(t.tag===19)Py(t,l,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(l=a.child,h=null;l!==null;)t=l.alternate,t!==null&&su(t)===null&&(h=l),l=l.sibling;l=h,l===null?(h=a.child,a.child=null):(h=l.sibling,l.sibling=null),Qp(a,!1,h,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=a.child,a.child=null;h!==null;){if(t=h.alternate,t!==null&&su(t)===null){a.child=h;break}t=h.sibling,h.sibling=l,l=h,h=t}Qp(a,!0,l,null,v,u);break;case"together":Qp(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function vs(t,a,l){if(t!==null&&(a.dependencies=t.dependencies),tr|=a.lanes,(l&a.childLanes)===0)if(t!==null){if(Bo(t,a,l,!1),(l&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,l=ps(t,t.pendingProps),a.child=l,l.return=a;t.sibling!==null;)t=t.sibling,l=l.sibling=ps(t,t.pendingProps),l.return=a;l.sibling=null}return a.child}function Zp(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Qc(t)))}function mE(t,a,l){switch(a.tag){case 3:ce(a,a.stateNode.containerInfo),Ys(a,gn,t.memoizedState.cache),Br();break;case 27:case 5:Te(a);break;case 4:ce(a,a.stateNode.containerInfo);break;case 10:Ys(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,_p(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(Zs(a),a.flags|=128,null):(l&a.child.childLanes)!==0?Ly(t,a,l):(Zs(a),t=vs(t,a,l),t!==null?t.sibling:null);Zs(a);break;case 19:var h=(t.flags&128)!==0;if(u=(l&a.childLanes)!==0,u||(Bo(t,a,l,!1),u=(l&a.childLanes)!==0),h){if(u)return Iy(t,a,l);a.flags|=128}if(h=a.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),G(dn,dn.current),u)break;return null;case 22:return a.lanes=0,Ty(t,a,l,a.pendingProps);case 24:Ys(a,gn,t.memoizedState.cache)}return vs(t,a,l)}function By(t,a,l){if(t!==null)if(t.memoizedProps!==a.pendingProps)xn=!0;else{if(!Zp(t,l)&&(a.flags&128)===0)return xn=!1,mE(t,a,l);xn=(t.flags&131072)!==0}else xn=!1,_t&&(a.flags&1048576)!==0&&xv(a,Ql,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(t=Vr(a.elementType),a.type=t,typeof t=="function")np(t)?(u=Yr(t,u),a.tag=1,a=zy(null,a,t,u,l)):(a.tag=0,a=$p(null,a,t,u,l));else{if(t!=null){var h=t.$$typeof;if(h===N){a.tag=11,a=Ey(null,a,t,u,l);break e}else if(h===O){a.tag=14,a=Ny(null,a,t,u,l);break e}}throw a=V(t)||t,Error(r(306,a,""))}}return a;case 0:return $p(t,a,a.type,a.pendingProps,l);case 1:return u=a.type,h=Yr(u,a.pendingProps),zy(t,a,u,h,l);case 3:e:{if(ce(a,a.stateNode.containerInfo),t===null)throw Error(r(387));u=a.pendingProps;var v=a.memoizedState;h=v.element,xp(t,a),si(a,u,null,l);var T=a.memoizedState;if(u=T.cache,Ys(a,gn,u),u!==v.cache&&dp(a,[gn],l,!0),ai(),u=T.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=v,a.memoizedState=v,a.flags&256){a=Dy(t,a,u,l);break e}else if(u!==h){h=_a(Error(r(424)),a),Zl(h),a=Dy(t,a,u,l);break e}else{switch(t=a.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Yt=Ea(t.firstChild),wn=a,_t=!0,Gs=null,Ca=!0,l=Tv(a,null,u,l),a.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Br(),u===h){a=vs(t,a,l);break e}kn(t,a,u,l)}a=a.child}return a;case 26:return gu(t,a),t===null?(l=Q0(a.type,null,a.pendingProps,null))?a.memoizedState=l:_t||(l=a.type,t=a.pendingProps,u=Mu(re.current).createElement(l),u[Rt]=a,u[mn]=t,En(u,l,t),jn(u),a.stateNode=u):a.memoizedState=Q0(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Te(a),t===null&&_t&&(u=a.stateNode=Y0(a.type,a.pendingProps,re.current),wn=a,Ca=!0,h=Yt,or(a.type)?(Tm=h,Yt=Ea(u.firstChild)):Yt=h),kn(t,a,a.pendingProps.children,l),gu(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&_t&&((h=u=Yt)&&(u=$E(u,a.type,a.pendingProps,Ca),u!==null?(a.stateNode=u,wn=a,Yt=Ea(u.firstChild),Ca=!1,h=!0):h=!1),h||Fs(a)),Te(a),h=a.type,v=a.pendingProps,T=t!==null?t.memoizedProps:null,u=v.children,Cm(h,v)?u=null:T!==null&&Cm(h,T)&&(a.flags|=32),a.memoizedState!==null&&(h=wp(t,a,rE,null,null,l),wi._currentValue=h),gu(t,a),kn(t,a,u,l),a.child;case 6:return t===null&&_t&&((t=l=Yt)&&(l=GE(l,a.pendingProps,Ca),l!==null?(a.stateNode=l,wn=a,Yt=null,t=!0):t=!1),t||Fs(a)),null;case 13:return Ly(t,a,l);case 4:return ce(a,a.stateNode.containerInfo),u=a.pendingProps,t===null?a.child=Gr(a,null,u,l):kn(t,a,u,l),a.child;case 11:return Ey(t,a,a.type,a.pendingProps,l);case 7:return kn(t,a,a.pendingProps,l),a.child;case 8:return kn(t,a,a.pendingProps.children,l),a.child;case 12:return kn(t,a,a.pendingProps.children,l),a.child;case 10:return u=a.pendingProps,Ys(a,a.type,u.value),kn(t,a,u.children,l),a.child;case 9:return h=a.type._context,u=a.pendingProps.children,Hr(a),h=Cn(h),u=u(h),a.flags|=1,kn(t,a,u,l),a.child;case 14:return Ny(t,a,a.type,a.pendingProps,l);case 15:return Ry(t,a,a.type,a.pendingProps,l);case 19:return Iy(t,a,l);case 31:return pE(t,a,l);case 22:return Ty(t,a,l,a.pendingProps);case 24:return Hr(a),u=Cn(gn),t===null?(h=mp(),h===null&&(h=Vt,v=fp(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=l),h=v),a.memoizedState={parent:u,cache:h},hp(a),Ys(a,gn,h)):((t.lanes&l)!==0&&(xp(t,a),si(a,null,null,l),ai()),h=t.memoizedState,v=a.memoizedState,h.parent!==u?(h={parent:u,cache:u},a.memoizedState=h,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=h),Ys(a,gn,u)):(u=v.cache,Ys(a,gn,u),u!==h.cache&&dp(a,[gn],l,!0))),kn(t,a,a.pendingProps.children,l),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ys(t){t.flags|=4}function Jp(t,a,l,u,h){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(f0())t.flags|=8192;else throw $r=eu,gp}else t.flags&=-16777217}function Uy(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!t1(a))if(f0())t.flags|=8192;else throw $r=eu,gp}function xu(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Yn():536870912,t.lanes|=a,Zo|=a)}function ui(t,a){if(!_t)switch(t.tailMode){case"hidden":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Xt(t){var a=t.alternate!==null&&t.alternate.child===t.child,l=0,u=0;if(a)for(var h=t.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=l,a}function gE(t,a,l){var u=a.pendingProps;switch(op(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(a),null;case 1:return Xt(a),null;case 3:return l=a.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),hs(gn),ee(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Io(a)?ys(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,ip())),Xt(a),null;case 26:var h=a.type,v=a.memoizedState;return t===null?(ys(a),v!==null?(Xt(a),Uy(a,v)):(Xt(a),Jp(a,h,null,u,l))):v?v!==t.memoizedState?(ys(a),Xt(a),Uy(a,v)):(Xt(a),a.flags&=-16777217):(t=t.memoizedProps,t!==u&&ys(a),Xt(a),Jp(a,h,t,u,l)),null;case 27:if($e(a),l=re.current,h=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&ys(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Xt(a),null}t=W.current,Io(a)?vv(a):(t=Y0(h,u,l),a.stateNode=t,ys(a))}return Xt(a),null;case 5:if($e(a),h=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&ys(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Xt(a),null}if(v=W.current,Io(a))vv(a);else{var T=Mu(re.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?T.createElement(h,{is:u.is}):T.createElement(h)}}v[Rt]=a,v[mn]=u;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===a)break e;for(;T.sibling===null;){if(T.return===null||T.return===a)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}a.stateNode=v;e:switch(En(v,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ys(a)}}return Xt(a),Jp(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,l),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==u&&ys(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(t=re.current,Io(a)){if(t=a.stateNode,l=a.memoizedProps,u=null,h=wn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[Rt]=a,t=!!(t.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||L0(t.nodeValue,l)),t||Fs(a,!0)}else t=Mu(t).createTextNode(u),t[Rt]=a,a.stateNode=t}return Xt(a),null;case 31:if(l=a.memoizedState,t===null||t.memoizedState!==null){if(u=Io(a),l!==null){if(t===null){if(!u)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Rt]=a}else Br(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Xt(a),t=!1}else l=ip(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return a.flags&256?(da(a),a):(da(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Xt(a),null;case 13:if(u=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Io(a),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[Rt]=a}else Br(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Xt(a),h=!1}else h=ip(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(da(a),a):(da(a),null)}return da(a),(a.flags&128)!==0?(a.lanes=l,a):(l=u!==null,t=t!==null&&t.memoizedState!==null,l&&(u=a.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==h&&(u.flags|=2048)),l!==t&&l&&(a.child.flags|=8192),xu(a,a.updateQueue),Xt(a),null);case 4:return ee(),t===null&&ym(a.stateNode.containerInfo),Xt(a),null;case 10:return hs(a.type),Xt(a),null;case 19:if(K(dn),u=a.memoizedState,u===null)return Xt(a),null;if(h=(a.flags&128)!==0,v=u.rendering,v===null)if(h)ui(u,!1);else{if(on!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(v=su(t),v!==null){for(a.flags|=128,ui(u,!1),t=v.updateQueue,a.updateQueue=t,xu(a,t),a.subtreeFlags=0,t=l,l=a.child;l!==null;)mv(l,t),l=l.sibling;return G(dn,dn.current&1|2),_t&&ms(a,u.treeForkCount),a.child}t=t.sibling}u.tail!==null&&ye()>_u&&(a.flags|=128,h=!0,ui(u,!1),a.lanes=4194304)}else{if(!h)if(t=su(v),t!==null){if(a.flags|=128,h=!0,t=t.updateQueue,a.updateQueue=t,xu(a,t),ui(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!_t)return Xt(a),null}else 2*ye()-u.renderingStartTime>_u&&l!==536870912&&(a.flags|=128,h=!0,ui(u,!1),a.lanes=4194304);u.isBackwards?(v.sibling=a.child,a.child=v):(t=u.last,t!==null?t.sibling=v:a.child=v,u.last=v)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ye(),t.sibling=null,l=dn.current,G(dn,h?l&1|2:l&1),_t&&ms(a,u.treeForkCount),t):(Xt(a),null);case 22:case 23:return da(a),jp(),u=a.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(l&536870912)!==0&&(a.flags&128)===0&&(Xt(a),a.subtreeFlags&6&&(a.flags|=8192)):Xt(a),l=a.updateQueue,l!==null&&xu(a,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==l&&(a.flags|=2048),t!==null&&K(qr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),hs(gn),Xt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function hE(t,a){switch(op(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return hs(gn),ee(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return $e(a),null;case 31:if(a.memoizedState!==null){if(da(a),a.alternate===null)throw Error(r(340));Br()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(da(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Br()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return K(dn),null;case 4:return ee(),null;case 10:return hs(a.type),null;case 22:case 23:return da(a),jp(),t!==null&&K(qr),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return hs(gn),null;case 25:return null;default:return null}}function Hy(t,a){switch(op(a),a.tag){case 3:hs(gn),ee();break;case 26:case 27:case 5:$e(a);break;case 4:ee();break;case 31:a.memoizedState!==null&&da(a);break;case 13:da(a);break;case 19:K(dn);break;case 10:hs(a.type);break;case 22:case 23:da(a),jp(),t!==null&&K(qr);break;case 24:hs(gn)}}function di(t,a){try{var l=a.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&t)===t){u=void 0;var v=l.create,T=l.inst;u=v(),T.destroy=u}l=l.next}while(l!==h)}}catch(P){At(a,a.return,P)}}function Ws(t,a,l){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next;u=v;do{if((u.tag&t)===t){var T=u.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,h=a;var Q=l,ae=P;try{ae()}catch(de){At(h,Q,de)}}}u=u.next}while(u!==v)}}catch(de){At(a,a.return,de)}}function qy(t){var a=t.updateQueue;if(a!==null){var l=t.stateNode;try{Mv(a,l)}catch(u){At(t,t.return,u)}}}function Vy(t,a,l){l.props=Yr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(u){At(t,a,u)}}function fi(t,a){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof l=="function"?t.refCleanup=l(u):l.current=u}}catch(h){At(t,a,h)}}function Ya(t,a){var l=t.ref,u=t.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){At(t,a,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){At(t,a,h)}else l.current=null}function $y(t){var a=t.type,l=t.memoizedProps,u=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){At(t,t.return,h)}}function Wp(t,a,l){try{var u=t.stateNode;IE(u,t.type,l,a),u[mn]=a}catch(h){At(t,t.return,h)}}function Gy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&or(t.type)||t.tag===4}function em(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&or(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function tm(t,a,l){var u=t.tag;if(u===5||u===6)t=t.stateNode,a?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,a):(a=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,a.appendChild(t),l=l._reactRootContainer,l!=null||a.onclick!==null||(a.onclick=ds));else if(u!==4&&(u===27&&or(t.type)&&(l=t.stateNode,a=null),t=t.child,t!==null))for(tm(t,a,l),t=t.sibling;t!==null;)tm(t,a,l),t=t.sibling}function bu(t,a,l){var u=t.tag;if(u===5||u===6)t=t.stateNode,a?l.insertBefore(t,a):l.appendChild(t);else if(u!==4&&(u===27&&or(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(bu(t,a,l),t=t.sibling;t!==null;)bu(t,a,l),t=t.sibling}function Fy(t){var a=t.stateNode,l=t.memoizedProps;try{for(var u=t.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);En(a,u,l),a[Rt]=t,a[mn]=l}catch(v){At(t,t.return,v)}}var js=!1,bn=!1,nm=!1,Yy=typeof WeakSet=="function"?WeakSet:Set,_n=null;function xE(t,a){if(t=t.containerInfo,Sm=Bu,t=rv(t),Kf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var T=0,P=-1,Q=-1,ae=0,de=0,ge=t,se=null;t:for(;;){for(var ue;ge!==l||h!==0&&ge.nodeType!==3||(P=T+h),ge!==v||u!==0&&ge.nodeType!==3||(Q=T+u),ge.nodeType===3&&(T+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)se=ge,ge=ue;for(;;){if(ge===t)break t;if(se===l&&++ae===h&&(P=T),se===v&&++de===u&&(Q=T),(ue=ge.nextSibling)!==null)break;ge=se,se=ge.parentNode}ge=ue}l=P===-1||Q===-1?null:{start:P,end:Q}}else l=null}l=l||{start:0,end:0}}else l=null;for(wm={focusedElem:t,selectionRange:l},Bu=!1,_n=a;_n!==null;)if(a=_n,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,_n=t;else for(;_n!==null;){switch(a=_n,v=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)h=t[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&v!==null){t=void 0,l=a,h=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var He=Yr(l.type,h);t=u.getSnapshotBeforeUpdate(He,v),u.__reactInternalSnapshotBeforeUpdate=t}catch(et){At(l,l.return,et)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,l=t.nodeType,l===9)Em(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Em(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=a.sibling,t!==null){t.return=a.return,_n=t;break}_n=a.return}}function Xy(t,a,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Ss(t,l),u&4&&di(5,l);break;case 1:if(Ss(t,l),u&4)if(t=l.stateNode,a===null)try{t.componentDidMount()}catch(T){At(l,l.return,T)}else{var h=Yr(l.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(h,a,t.__reactInternalSnapshotBeforeUpdate)}catch(T){At(l,l.return,T)}}u&64&&qy(l),u&512&&fi(l,l.return);break;case 3:if(Ss(t,l),u&64&&(t=l.updateQueue,t!==null)){if(a=null,l.child!==null)switch(l.child.tag){case 27:case 5:a=l.child.stateNode;break;case 1:a=l.child.stateNode}try{Mv(t,a)}catch(T){At(l,l.return,T)}}break;case 27:a===null&&u&4&&Fy(l);case 26:case 5:Ss(t,l),a===null&&u&4&&$y(l),u&512&&fi(l,l.return);break;case 12:Ss(t,l);break;case 31:Ss(t,l),u&4&&Zy(t,l);break;case 13:Ss(t,l),u&4&&Jy(t,l),u&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=kE.bind(null,l),FE(t,l))));break;case 22:if(u=l.memoizedState!==null||js,!u){a=a!==null&&a.memoizedState!==null||bn,h=js;var v=bn;js=u,(bn=a)&&!v?ws(t,l,(l.subtreeFlags&8772)!==0):Ss(t,l),js=h,bn=v}break;case 30:break;default:Ss(t,l)}}function Ky(t){var a=t.alternate;a!==null&&(t.alternate=null,Ky(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Mf(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Jt=null,Qn=!1;function _s(t,a,l){for(l=l.child;l!==null;)Qy(t,a,l),l=l.sibling}function Qy(t,a,l){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(ke,l)}catch{}switch(l.tag){case 26:bn||Ya(l,a),_s(t,a,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:bn||Ya(l,a);var u=Jt,h=Qn;or(l.type)&&(Jt=l.stateNode,Qn=!1),_s(t,a,l),ji(l.stateNode),Jt=u,Qn=h;break;case 5:bn||Ya(l,a);case 6:if(u=Jt,h=Qn,Jt=null,_s(t,a,l),Jt=u,Qn=h,Jt!==null)if(Qn)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(l.stateNode)}catch(v){At(l,a,v)}else try{Jt.removeChild(l.stateNode)}catch(v){At(l,a,v)}break;case 18:Jt!==null&&(Qn?(t=Jt,q0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),rl(t)):q0(Jt,l.stateNode));break;case 4:u=Jt,h=Qn,Jt=l.stateNode.containerInfo,Qn=!0,_s(t,a,l),Jt=u,Qn=h;break;case 0:case 11:case 14:case 15:Ws(2,l,a),bn||Ws(4,l,a),_s(t,a,l);break;case 1:bn||(Ya(l,a),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Vy(l,a,u)),_s(t,a,l);break;case 21:_s(t,a,l);break;case 22:bn=(u=bn)||l.memoizedState!==null,_s(t,a,l),bn=u;break;default:_s(t,a,l)}}function Zy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{rl(t)}catch(l){At(a,a.return,l)}}}function Jy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{rl(t)}catch(l){At(a,a.return,l)}}function bE(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new Yy),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new Yy),a;default:throw Error(r(435,t.tag))}}function vu(t,a){var l=bE(t);a.forEach(function(u){if(!l.has(u)){l.add(u);var h=EE.bind(null,t,u);u.then(h,h)}})}function Zn(t,a){var l=a.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],v=t,T=a,P=T;e:for(;P!==null;){switch(P.tag){case 27:if(or(P.type)){Jt=P.stateNode,Qn=!1;break e}break;case 5:Jt=P.stateNode,Qn=!1;break e;case 3:case 4:Jt=P.stateNode.containerInfo,Qn=!0;break e}P=P.return}if(Jt===null)throw Error(r(160));Qy(v,T,h),Jt=null,Qn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Wy(a,t),a=a.sibling}var Pa=null;function Wy(t,a){var l=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Zn(a,t),Jn(t),u&4&&(Ws(3,t,t.return),di(3,t),Ws(5,t,t.return));break;case 1:Zn(a,t),Jn(t),u&512&&(bn||l===null||Ya(l,l.return)),u&64&&js&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=Pa;if(Zn(a,t),Jn(t),u&512&&(bn||l===null||Ya(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=t.memoizedState,l===null)if(u===null)if(t.stateNode===null){e:{u=t.type,l=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":v=h.getElementsByTagName("title")[0],(!v||v[Bl]||v[Rt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=h.createElement(u),h.head.insertBefore(v,h.querySelector("head > title"))),En(v,u,l),v[Rt]=t,jn(v),u=v;break e;case"link":var T=W0("link","href",h).get(u+(l.href||""));if(T){for(var P=0;P<T.length;P++)if(v=T[P],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(P,1);break t}}v=h.createElement(u),En(v,u,l),h.head.appendChild(v);break;case"meta":if(T=W0("meta","content",h).get(u+(l.content||""))){for(P=0;P<T.length;P++)if(v=T[P],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(P,1);break t}}v=h.createElement(u),En(v,u,l),h.head.appendChild(v);break;default:throw Error(r(468,u))}v[Rt]=t,jn(v),u=v}t.stateNode=u}else e1(h,t.type,t.stateNode);else t.stateNode=J0(h,u,t.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?e1(h,t.type,t.stateNode):J0(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Wp(t,t.memoizedProps,l.memoizedProps)}break;case 27:Zn(a,t),Jn(t),u&512&&(bn||l===null||Ya(l,l.return)),l!==null&&u&4&&Wp(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Zn(a,t),Jn(t),u&512&&(bn||l===null||Ya(l,l.return)),t.flags&32){h=t.stateNode;try{No(h,"")}catch(He){At(t,t.return,He)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,Wp(t,h,l!==null?l.memoizedProps:h)),u&1024&&(nm=!0);break;case 6:if(Zn(a,t),Jn(t),u&4){if(t.stateNode===null)throw Error(r(162));u=t.memoizedProps,l=t.stateNode;try{l.nodeValue=u}catch(He){At(t,t.return,He)}}break;case 3:if(Du=null,h=Pa,Pa=Ou(a.containerInfo),Zn(a,t),Pa=h,Jn(t),u&4&&l!==null&&l.memoizedState.isDehydrated)try{rl(a.containerInfo)}catch(He){At(t,t.return,He)}nm&&(nm=!1,e0(t));break;case 4:u=Pa,Pa=Ou(t.stateNode.containerInfo),Zn(a,t),Jn(t),Pa=u;break;case 12:Zn(a,t),Jn(t);break;case 31:Zn(a,t),Jn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,vu(t,u)));break;case 13:Zn(a,t),Jn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ju=ye()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,vu(t,u)));break;case 22:h=t.memoizedState!==null;var Q=l!==null&&l.memoizedState!==null,ae=js,de=bn;if(js=ae||h,bn=de||Q,Zn(a,t),bn=de,js=ae,Jn(t),u&8192)e:for(a=t.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,h&&(l===null||Q||js||bn||Xr(t)),l=null,a=t;;){if(a.tag===5||a.tag===26){if(l===null){Q=l=a;try{if(v=Q.stateNode,h)T=v.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{P=Q.stateNode;var ge=Q.memoizedProps.style,se=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;P.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(He){At(Q,Q.return,He)}}}else if(a.tag===6){if(l===null){Q=a;try{Q.stateNode.nodeValue=h?"":Q.memoizedProps}catch(He){At(Q,Q.return,He)}}}else if(a.tag===18){if(l===null){Q=a;try{var ue=Q.stateNode;h?V0(ue,!0):V0(Q.stateNode,!1)}catch(He){At(Q,Q.return,He)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;l===a&&(l=null),a=a.return}l===a&&(l=null),a.sibling.return=a.return,a=a.sibling}u&4&&(u=t.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,vu(t,l))));break;case 19:Zn(a,t),Jn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,vu(t,u)));break;case 30:break;case 21:break;default:Zn(a,t),Jn(t)}}function Jn(t){var a=t.flags;if(a&2){try{for(var l,u=t.return;u!==null;){if(Gy(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,v=em(t);bu(t,v,h);break;case 5:var T=l.stateNode;l.flags&32&&(No(T,""),l.flags&=-33);var P=em(t);bu(t,P,T);break;case 3:case 4:var Q=l.stateNode.containerInfo,ae=em(t);tm(t,ae,Q);break;default:throw Error(r(161))}}catch(de){At(t,t.return,de)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function e0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;e0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function Ss(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Xy(t,a.alternate,a),a=a.sibling}function Xr(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ws(4,a,a.return),Xr(a);break;case 1:Ya(a,a.return);var l=a.stateNode;typeof l.componentWillUnmount=="function"&&Vy(a,a.return,l),Xr(a);break;case 27:ji(a.stateNode);case 26:case 5:Ya(a,a.return),Xr(a);break;case 22:a.memoizedState===null&&Xr(a);break;case 30:Xr(a);break;default:Xr(a)}t=t.sibling}}function ws(t,a,l){for(l=l&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,h=t,v=a,T=v.flags;switch(v.tag){case 0:case 11:case 15:ws(h,v,l),di(4,v);break;case 1:if(ws(h,v,l),u=v,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ae){At(u,u.return,ae)}if(u=v,h=u.updateQueue,h!==null){var P=u.stateNode;try{var Q=h.shared.hiddenCallbacks;if(Q!==null)for(h.shared.hiddenCallbacks=null,h=0;h<Q.length;h++)Av(Q[h],P)}catch(ae){At(u,u.return,ae)}}l&&T&64&&qy(v),fi(v,v.return);break;case 27:Fy(v);case 26:case 5:ws(h,v,l),l&&u===null&&T&4&&$y(v),fi(v,v.return);break;case 12:ws(h,v,l);break;case 31:ws(h,v,l),l&&T&4&&Zy(h,v);break;case 13:ws(h,v,l),l&&T&4&&Jy(h,v);break;case 22:v.memoizedState===null&&ws(h,v,l),fi(v,v.return);break;case 30:break;default:ws(h,v,l)}a=a.sibling}}function am(t,a){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Jl(l))}function sm(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Jl(t))}function Ia(t,a,l,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)t0(t,a,l,u),a=a.sibling}function t0(t,a,l,u){var h=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(t,a,l,u),h&2048&&di(9,a);break;case 1:Ia(t,a,l,u);break;case 3:Ia(t,a,l,u),h&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Jl(t)));break;case 12:if(h&2048){Ia(t,a,l,u),t=a.stateNode;try{var v=a.memoizedProps,T=v.id,P=v.onPostCommit;typeof P=="function"&&P(T,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Q){At(a,a.return,Q)}}else Ia(t,a,l,u);break;case 31:Ia(t,a,l,u);break;case 13:Ia(t,a,l,u);break;case 23:break;case 22:v=a.stateNode,T=a.alternate,a.memoizedState!==null?v._visibility&2?Ia(t,a,l,u):pi(t,a):v._visibility&2?Ia(t,a,l,u):(v._visibility|=2,Xo(t,a,l,u,(a.subtreeFlags&10256)!==0||!1)),h&2048&&am(T,a);break;case 24:Ia(t,a,l,u),h&2048&&sm(a.alternate,a);break;default:Ia(t,a,l,u)}}function Xo(t,a,l,u,h){for(h=h&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var v=t,T=a,P=l,Q=u,ae=T.flags;switch(T.tag){case 0:case 11:case 15:Xo(v,T,P,Q,h),di(8,T);break;case 23:break;case 22:var de=T.stateNode;T.memoizedState!==null?de._visibility&2?Xo(v,T,P,Q,h):pi(v,T):(de._visibility|=2,Xo(v,T,P,Q,h)),h&&ae&2048&&am(T.alternate,T);break;case 24:Xo(v,T,P,Q,h),h&&ae&2048&&sm(T.alternate,T);break;default:Xo(v,T,P,Q,h)}a=a.sibling}}function pi(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var l=t,u=a,h=u.flags;switch(u.tag){case 22:pi(l,u),h&2048&&am(u.alternate,u);break;case 24:pi(l,u),h&2048&&sm(u.alternate,u);break;default:pi(l,u)}a=a.sibling}}var mi=8192;function Ko(t,a,l){if(t.subtreeFlags&mi)for(t=t.child;t!==null;)n0(t,a,l),t=t.sibling}function n0(t,a,l){switch(t.tag){case 26:Ko(t,a,l),t.flags&mi&&t.memoizedState!==null&&sN(l,Pa,t.memoizedState,t.memoizedProps);break;case 5:Ko(t,a,l);break;case 3:case 4:var u=Pa;Pa=Ou(t.stateNode.containerInfo),Ko(t,a,l),Pa=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=mi,mi=16777216,Ko(t,a,l),mi=u):Ko(t,a,l));break;default:Ko(t,a,l)}}function a0(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function gi(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var l=0;l<a.length;l++){var u=a[l];_n=u,r0(u,t)}a0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)s0(t),t=t.sibling}function s0(t){switch(t.tag){case 0:case 11:case 15:gi(t),t.flags&2048&&Ws(9,t,t.return);break;case 3:gi(t);break;case 12:gi(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,yu(t)):gi(t);break;default:gi(t)}}function yu(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var l=0;l<a.length;l++){var u=a[l];_n=u,r0(u,t)}a0(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ws(8,a,a.return),yu(a);break;case 22:l=a.stateNode,l._visibility&2&&(l._visibility&=-3,yu(a));break;default:yu(a)}t=t.sibling}}function r0(t,a){for(;_n!==null;){var l=_n;switch(l.tag){case 0:case 11:case 15:Ws(8,l,a);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Jl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,_n=u;else e:for(l=t;_n!==null;){u=_n;var h=u.sibling,v=u.return;if(Ky(u),u===l){_n=null;break e}if(h!==null){h.return=v,_n=h;break e}_n=v}}}var vE={getCacheForType:function(t){var a=Cn(gn),l=a.data.get(t);return l===void 0&&(l=t(),a.data.set(t,l)),l},cacheSignal:function(){return Cn(gn).controller.signal}},yE=typeof WeakMap=="function"?WeakMap:Map,Et=0,Vt=null,gt=null,xt=0,Tt=0,fa=null,er=!1,Qo=!1,rm=!1,Cs=0,on=0,tr=0,Kr=0,om=0,pa=0,Zo=0,hi=null,Wn=null,lm=!1,ju=0,o0=0,_u=1/0,Su=null,nr=null,yn=0,ar=null,Jo=null,ks=0,im=0,cm=null,l0=null,xi=0,um=null;function ma(){return(Et&2)!==0&&xt!==0?xt&-xt:q.T!==null?hm():Dt()}function i0(){if(pa===0)if((xt&536870912)===0||_t){var t=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),pa=t}else pa=536870912;return t=ua.current,t!==null&&(t.flags|=32),pa}function ea(t,a,l){(t===Vt&&(Tt===2||Tt===9)||t.cancelPendingCommit!==null)&&(Wo(t,0),sr(t,xt,pa,!1)),Xn(t,l),((Et&2)===0||t!==Vt)&&(t===Vt&&((Et&2)===0&&(Kr|=l),on===4&&sr(t,xt,pa,!1)),Xa(t))}function c0(t,a,l){if((Et&6)!==0)throw Error(r(327));var u=!l&&(a&127)===0&&(a&t.expiredLanes)===0||un(t,a),h=u?SE(t,a):fm(t,a,!0),v=u;do{if(h===0){Qo&&!u&&sr(t,a,0,!1);break}else{if(l=t.current.alternate,v&&!jE(l)){h=fm(t,a,!1),v=!1;continue}if(h===2){if(v=a,t.errorRecoveryDisabledLanes&v)var T=0;else T=t.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var P=t;h=hi;var Q=P.current.memoizedState.isDehydrated;if(Q&&(Wo(P,T).flags|=256),T=fm(P,T,!1),T!==2){if(rm&&!Q){P.errorRecoveryDisabledLanes|=v,Kr|=v,h=4;break e}v=Wn,Wn=h,v!==null&&(Wn===null?Wn=v:Wn.push.apply(Wn,v))}h=T}if(v=!1,h!==2)continue}}if(h===1){Wo(t,0),sr(t,a,0,!0);break}e:{switch(u=t,v=h,v){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:sr(u,a,pa,!er);break e;case 2:Wn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(h=ju+300-ye(),10<h)){if(sr(u,a,pa,!er),Ft(u,0,!0)!==0)break e;ks=a,u.timeoutHandle=U0(u0.bind(null,u,l,Wn,Su,lm,a,pa,Kr,Zo,er,v,"Throttled",-0,0),h);break e}u0(u,l,Wn,Su,lm,a,pa,Kr,Zo,er,v,null,-0,0)}}break}while(!0);Xa(t)}function u0(t,a,l,u,h,v,T,P,Q,ae,de,ge,se,ue){if(t.timeoutHandle=-1,ge=a.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ds},n0(a,v,ge);var He=(v&62914560)===v?ju-ye():(v&4194048)===v?o0-ye():0;if(He=rN(ge,He),He!==null){ks=v,t.cancelPendingCommit=He(b0.bind(null,t,a,v,l,u,h,T,P,Q,de,ge,null,se,ue)),sr(t,v,T,!ae);return}}b0(t,a,v,l,u,h,T,P,Q)}function jE(t){for(var a=t;;){var l=a.tag;if((l===0||l===11||l===15)&&a.flags&16384&&(l=a.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],v=h.getSnapshot;h=h.value;try{if(!ia(v(),h))return!1}catch{return!1}}if(l=a.child,a.subtreeFlags&16384&&l!==null)l.return=a,a=l;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function sr(t,a,l,u){a&=~om,a&=~Kr,t.suspendedLanes|=a,t.pingedLanes&=~a,u&&(t.warmLanes|=a),u=t.expirationTimes;for(var h=a;0<h;){var v=31-at(h),T=1<<v;u[v]=-1,h&=~T}l!==0&&zn(t,l,a)}function wu(){return(Et&6)===0?(bi(0),!1):!0}function dm(){if(gt!==null){if(Tt===0)var t=gt.return;else t=gt,gs=Ur=null,Ep(t),Vo=null,ei=0,t=gt;for(;t!==null;)Hy(t.alternate,t),t=t.return;gt=null}}function Wo(t,a){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,HE(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),ks=0,dm(),Vt=t,gt=l=ps(t.current,null),xt=a,Tt=0,fa=null,er=!1,Qo=un(t,a),rm=!1,Zo=pa=om=Kr=tr=on=0,Wn=hi=null,lm=!1,(a&8)!==0&&(a|=a&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=a;0<u;){var h=31-at(u),v=1<<h;a|=t[h],u&=~v}return Cs=a,Gc(),l}function d0(t,a){rt=null,q.H=ii,a===qo||a===Wc?(a=Ev(),Tt=3):a===gp?(a=Ev(),Tt=4):Tt=a===Vp?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fa=a,gt===null&&(on=1,pu(t,_a(a,t.current)))}function f0(){var t=ua.current;return t===null?!0:(xt&4194048)===xt?ka===null:(xt&62914560)===xt||(xt&536870912)!==0?t===ka:!1}function p0(){var t=q.H;return q.H=ii,t===null?ii:t}function m0(){var t=q.A;return q.A=vE,t}function Cu(){on=4,er||(xt&4194048)!==xt&&ua.current!==null||(Qo=!0),(tr&134217727)===0&&(Kr&134217727)===0||Vt===null||sr(Vt,xt,pa,!1)}function fm(t,a,l){var u=Et;Et|=2;var h=p0(),v=m0();(Vt!==t||xt!==a)&&(Su=null,Wo(t,a)),a=!1;var T=on;e:do try{if(Tt!==0&>!==null){var P=gt,Q=fa;switch(Tt){case 8:dm(),T=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(a=!0);var ae=Tt;if(Tt=0,fa=null,el(t,P,Q,ae),l&&Qo){T=0;break e}break;default:ae=Tt,Tt=0,fa=null,el(t,P,Q,ae)}}_E(),T=on;break}catch(de){d0(t,de)}while(!0);return a&&t.shellSuspendCounter++,gs=Ur=null,Et=u,q.H=h,q.A=v,gt===null&&(Vt=null,xt=0,Gc()),T}function _E(){for(;gt!==null;)g0(gt)}function SE(t,a){var l=Et;Et|=2;var u=p0(),h=m0();Vt!==t||xt!==a?(Su=null,_u=ye()+500,Wo(t,a)):Qo=un(t,a);e:do try{if(Tt!==0&>!==null){a=gt;var v=fa;t:switch(Tt){case 1:Tt=0,fa=null,el(t,a,v,1);break;case 2:case 9:if(Cv(v)){Tt=0,fa=null,h0(a);break}a=function(){Tt!==2&&Tt!==9||Vt!==t||(Tt=7),Xa(t)},v.then(a,a);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:Cv(v)?(Tt=0,fa=null,h0(a)):(Tt=0,fa=null,el(t,a,v,7));break;case 5:var T=null;switch(gt.tag){case 26:T=gt.memoizedState;case 5:case 27:var P=gt;if(T?t1(T):P.stateNode.complete){Tt=0,fa=null;var Q=P.sibling;if(Q!==null)gt=Q;else{var ae=P.return;ae!==null?(gt=ae,ku(ae)):gt=null}break t}}Tt=0,fa=null,el(t,a,v,5);break;case 6:Tt=0,fa=null,el(t,a,v,6);break;case 8:dm(),on=6;break e;default:throw Error(r(462))}}wE();break}catch(de){d0(t,de)}while(!0);return gs=Ur=null,q.H=u,q.A=h,Et=l,gt!==null?0:(Vt=null,xt=0,Gc(),on)}function wE(){for(;gt!==null&&!Ge();)g0(gt)}function g0(t){var a=By(t.alternate,t,Cs);t.memoizedProps=t.pendingProps,a===null?ku(t):gt=a}function h0(t){var a=t,l=a.alternate;switch(a.tag){case 15:case 0:a=Oy(l,a,a.pendingProps,a.type,void 0,xt);break;case 11:a=Oy(l,a,a.pendingProps,a.type.render,a.ref,xt);break;case 5:Ep(a);default:Hy(l,a),a=gt=mv(a,Cs),a=By(l,a,Cs)}t.memoizedProps=t.pendingProps,a===null?ku(t):gt=a}function el(t,a,l,u){gs=Ur=null,Ep(a),Vo=null,ei=0;var h=a.return;try{if(fE(t,h,a,l,xt)){on=1,pu(t,_a(l,t.current)),gt=null;return}}catch(v){if(h!==null)throw gt=h,v;on=1,pu(t,_a(l,t.current)),gt=null;return}a.flags&32768?(_t||u===1?t=!0:Qo||(xt&536870912)!==0?t=!1:(er=t=!0,(u===2||u===9||u===3||u===6)&&(u=ua.current,u!==null&&u.tag===13&&(u.flags|=16384))),x0(a,t)):ku(a)}function ku(t){var a=t;do{if((a.flags&32768)!==0){x0(a,er);return}t=a.return;var l=gE(a.alternate,a,Cs);if(l!==null){gt=l;return}if(a=a.sibling,a!==null){gt=a;return}gt=a=t}while(a!==null);on===0&&(on=5)}function x0(t,a){do{var l=hE(t.alternate,t);if(l!==null){l.flags&=32767,gt=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!a&&(t=t.sibling,t!==null)){gt=t;return}gt=t=l}while(t!==null);on=6,gt=null}function b0(t,a,l,u,h,v,T,P,Q){t.cancelPendingCommit=null;do Eu();while(yn!==0);if((Et&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(v=a.lanes|a.childLanes,v|=ep,is(t,l,v,T,P,Q),t===Vt&&(gt=Vt=null,xt=0),Jo=a,ar=t,ks=l,im=v,cm=h,l0=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,NE(Ue,function(){return S0(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=q.T,q.T=null,h=F.p,F.p=2,T=Et,Et|=4;try{xE(t,a,l)}finally{Et=T,F.p=h,q.T=u}}yn=1,v0(),y0(),j0()}}function v0(){if(yn===1){yn=0;var t=ar,a=Jo,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=q.T,q.T=null;var u=F.p;F.p=2;var h=Et;Et|=4;try{Wy(a,t);var v=wm,T=rv(t.containerInfo),P=v.focusedElem,Q=v.selectionRange;if(T!==P&&P&&P.ownerDocument&&sv(P.ownerDocument.documentElement,P)){if(Q!==null&&Kf(P)){var ae=Q.start,de=Q.end;if(de===void 0&&(de=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(de,P.value.length);else{var ge=P.ownerDocument||document,se=ge&&ge.defaultView||window;if(se.getSelection){var ue=se.getSelection(),He=P.textContent.length,et=Math.min(Q.start,He),It=Q.end===void 0?et:Math.min(Q.end,He);!ue.extend&&et>It&&(T=It,It=et,et=T);var te=av(P,et),J=av(P,It);if(te&&J&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==J.node||ue.focusOffset!==J.offset)){var ne=ge.createRange();ne.setStart(te.node,te.offset),ue.removeAllRanges(),et>It?(ue.addRange(ne),ue.extend(J.node,J.offset)):(ne.setEnd(J.node,J.offset),ue.addRange(ne))}}}}for(ge=[],ue=P;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ge.length;P++){var me=ge[P];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Bu=!!Sm,wm=Sm=null}finally{Et=h,F.p=u,q.T=l}}t.current=a,yn=2}}function y0(){if(yn===2){yn=0;var t=ar,a=Jo,l=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||l){l=q.T,q.T=null;var u=F.p;F.p=2;var h=Et;Et|=4;try{Xy(t,a.alternate,a)}finally{Et=h,F.p=u,q.T=l}}yn=3}}function j0(){if(yn===4||yn===3){yn=0,De();var t=ar,a=Jo,l=ks,u=l0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?yn=5:(yn=0,Jo=ar=null,_0(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(nr=null),it(l),a=a.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(ke,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=q.T,h=F.p,F.p=2,q.T=null;try{for(var v=t.onRecoverableError,T=0;T<u.length;T++){var P=u[T];v(P.value,{componentStack:P.stack})}}finally{q.T=a,F.p=h}}(ks&3)!==0&&Eu(),Xa(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===um?xi++:(xi=0,um=t):xi=0,bi(0)}}function _0(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Jl(a)))}function Eu(){return v0(),y0(),j0(),S0()}function S0(){if(yn!==5)return!1;var t=ar,a=im;im=0;var l=it(ks),u=q.T,h=F.p;try{F.p=32>l?32:l,q.T=null,l=cm,cm=null;var v=ar,T=ks;if(yn=0,Jo=ar=null,ks=0,(Et&6)!==0)throw Error(r(331));var P=Et;if(Et|=4,s0(v.current),t0(v,v.current,T,l),Et=P,bi(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(ke,v)}catch{}return!0}finally{F.p=h,q.T=u,_0(t,a)}}function w0(t,a,l){a=_a(l,a),a=qp(t.stateNode,a,2),t=Qs(t,a,2),t!==null&&(Xn(t,2),Xa(t))}function At(t,a,l){if(t.tag===3)w0(t,t,l);else for(;a!==null;){if(a.tag===3){w0(a,t,l);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(nr===null||!nr.has(u))){t=_a(l,t),l=Cy(2),u=Qs(a,l,2),u!==null&&(ky(l,u,a,t),Xn(u,2),Xa(u));break}}a=a.return}}function pm(t,a,l){var u=t.pingCache;if(u===null){u=t.pingCache=new yE;var h=new Set;u.set(a,h)}else h=u.get(a),h===void 0&&(h=new Set,u.set(a,h));h.has(l)||(rm=!0,h.add(l),t=CE.bind(null,t,a,l),a.then(t,t))}function CE(t,a,l){var u=t.pingCache;u!==null&&u.delete(a),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Vt===t&&(xt&l)===l&&(on===4||on===3&&(xt&62914560)===xt&&300>ye()-ju?(Et&2)===0&&Wo(t,0):om|=l,Zo===xt&&(Zo=0)),Xa(t)}function C0(t,a){a===0&&(a=Yn()),t=Pr(t,a),t!==null&&(Xn(t,a),Xa(t))}function kE(t){var a=t.memoizedState,l=0;a!==null&&(l=a.retryLane),C0(t,l)}function EE(t,a){var l=0;switch(t.tag){case 31:case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(a),C0(t,l)}function NE(t,a){return Be(t,a)}var Nu=null,tl=null,mm=!1,Ru=!1,gm=!1,rr=0;function Xa(t){t!==tl&&t.next===null&&(tl===null?Nu=tl=t:tl=tl.next=t),Ru=!0,mm||(mm=!0,TE())}function bi(t,a){if(!gm&&Ru){gm=!0;do for(var l=!1,u=Nu;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var v=0;else{var T=u.suspendedLanes,P=u.pingedLanes;v=(1<<31-at(42|t)+1)-1,v&=h&~(T&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,R0(u,v))}else v=xt,v=Ft(u,u===Vt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||un(u,v)||(l=!0,R0(u,v));u=u.next}while(l);gm=!1}}function RE(){k0()}function k0(){Ru=mm=!1;var t=0;rr!==0&&UE()&&(t=rr);for(var a=ye(),l=null,u=Nu;u!==null;){var h=u.next,v=E0(u,a);v===0?(u.next=null,l===null?Nu=h:l.next=h,h===null&&(tl=l)):(l=u,(t!==0||(v&3)!==0)&&(Ru=!0)),u=h}yn!==0&&yn!==5||bi(t),rr!==0&&(rr=0)}function E0(t,a){for(var l=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var T=31-at(v),P=1<<T,Q=h[T];Q===-1?((P&l)===0||(P&u)!==0)&&(h[T]=On(P,a)):Q<=a&&(t.expiredLanes|=P),v&=~P}if(a=Vt,l=xt,l=Ft(t,t===a?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,l===0||t===a&&(Tt===2||Tt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Fe(u),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||un(t,l)){if(a=l&-l,a===t.callbackPriority)return a;switch(u!==null&&Fe(u),it(l)){case 2:case 8:l=we;break;case 32:l=Ue;break;case 268435456:l=jt;break;default:l=Ue}return u=N0.bind(null,t),l=Be(l,u),t.callbackPriority=a,t.callbackNode=l,a}return u!==null&&u!==null&&Fe(u),t.callbackPriority=2,t.callbackNode=null,2}function N0(t,a){if(yn!==0&&yn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Eu()&&t.callbackNode!==l)return null;var u=xt;return u=Ft(t,t===Vt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(c0(t,u,a),E0(t,ye()),t.callbackNode!=null&&t.callbackNode===l?N0.bind(null,t):null)}function R0(t,a){if(Eu())return null;c0(t,a,!0)}function TE(){qE(function(){(Et&6)!==0?Be(je,RE):k0()})}function hm(){if(rr===0){var t=Uo;t===0&&(t=Nt,Nt<<=1,(Nt&261888)===0&&(Nt=256)),rr=t}return rr}function T0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Pc(""+t)}function A0(t,a){var l=a.ownerDocument.createElement("input");return l.name=a.name,l.value=a.value,t.id&&l.setAttribute("form",t.id),a.parentNode.insertBefore(l,a),t=new FormData(t),l.parentNode.removeChild(l),t}function AE(t,a,l,u,h){if(a==="submit"&&l&&l.stateNode===h){var v=T0((h[mn]||null).action),T=u.submitter;T&&(a=(a=T[mn]||null)?T0(a.formAction):T.getAttribute("formAction"),a!==null&&(v=a,T=null));var P=new Hc("action","action",null,u,h);t.push({event:P,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(rr!==0){var Q=T?A0(h,T):new FormData(h);Lp(l,{pending:!0,data:Q,method:h.method,action:v},null,Q)}}else typeof v=="function"&&(P.preventDefault(),Q=T?A0(h,T):new FormData(h),Lp(l,{pending:!0,data:Q,method:h.method,action:v},v,Q))},currentTarget:h}]})}}for(var xm=0;xm<Wf.length;xm++){var bm=Wf[xm],ME=bm.toLowerCase(),OE=bm[0].toUpperCase()+bm.slice(1);La(ME,"on"+OE)}La(iv,"onAnimationEnd"),La(cv,"onAnimationIteration"),La(uv,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(Kk,"onTransitionRun"),La(Qk,"onTransitionStart"),La(Zk,"onTransitionCancel"),La(dv,"onTransitionEnd"),ko("onMouseEnter",["mouseout","mouseover"]),ko("onMouseLeave",["mouseout","mouseover"]),ko("onPointerEnter",["pointerout","pointerover"]),ko("onPointerLeave",["pointerout","pointerover"]),Or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Or("onBeforeInput",["compositionend","keypress","textInput","paste"]),Or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vi="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(" "),zE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vi));function M0(t,a){a=(a&4)!==0;for(var l=0;l<t.length;l++){var u=t[l],h=u.event;u=u.listeners;e:{var v=void 0;if(a)for(var T=u.length-1;0<=T;T--){var P=u[T],Q=P.instance,ae=P.currentTarget;if(P=P.listener,Q!==v&&h.isPropagationStopped())break e;v=P,h.currentTarget=ae;try{v(h)}catch(de){$c(de)}h.currentTarget=null,v=Q}else for(T=0;T<u.length;T++){if(P=u[T],Q=P.instance,ae=P.currentTarget,P=P.listener,Q!==v&&h.isPropagationStopped())break e;v=P,h.currentTarget=ae;try{v(h)}catch(de){$c(de)}h.currentTarget=null,v=Q}}}}function ht(t,a){var l=a[Oc];l===void 0&&(l=a[Oc]=new Set);var u=t+"__bubble";l.has(u)||(O0(a,t,2,!1),l.add(u))}function vm(t,a,l){var u=0;a&&(u|=4),O0(l,t,u,a)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function ym(t){if(!t[Tu]){t[Tu]=!0,kb.forEach(function(l){l!=="selectionchange"&&(zE.has(l)||vm(l,!1,t),vm(l,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Tu]||(a[Tu]=!0,vm("selectionchange",!1,a))}}function O0(t,a,l,u){switch(i1(a)){case 2:var h=iN;break;case 8:h=cN;break;default:h=Dm}l=h.bind(null,a,l,t),h=void 0,!Uf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(a,l,{capture:!0,passive:h}):t.addEventListener(a,l,!0):h!==void 0?t.addEventListener(a,l,{passive:h}):t.addEventListener(a,l,!1)}function jm(t,a,l,u,h){var v=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var T=u.tag;if(T===3||T===4){var P=u.stateNode.containerInfo;if(P===h)break;if(T===4)for(T=u.return;T!==null;){var Q=T.tag;if((Q===3||Q===4)&&T.stateNode.containerInfo===h)return;T=T.return}for(;P!==null;){if(T=So(P),T===null)return;if(Q=T.tag,Q===5||Q===6||Q===26||Q===27){u=v=T;continue e}P=P.parentNode}}u=u.return}Ib(function(){var ae=v,de=If(l),ge=[];e:{var se=fv.get(t);if(se!==void 0){var ue=Hc,He=t;switch(t){case"keypress":if(Bc(l)===0)break e;case"keydown":case"keyup":ue=Ek;break;case"focusin":He="focus",ue=$f;break;case"focusout":He="blur",ue=$f;break;case"beforeblur":case"afterblur":ue=$f;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Hb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=gk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Tk;break;case iv:case cv:case uv:ue=bk;break;case dv:ue=Mk;break;case"scroll":case"scrollend":ue=pk;break;case"wheel":ue=zk;break;case"copy":case"cut":case"paste":ue=yk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Vb;break;case"toggle":case"beforetoggle":ue=Lk}var et=(a&4)!==0,It=!et&&(t==="scroll"||t==="scrollend"),te=et?se!==null?se+"Capture":null:se;et=[];for(var J=ae,ne;J!==null;){var me=J;if(ne=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ne===null||te===null||(me=Hl(J,te),me!=null&&et.push(yi(J,me,ne))),It)break;J=J.return}0<et.length&&(se=new ue(se,He,null,l,de),ge.push({event:se,listeners:et}))}}if((a&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",se&&l!==Pf&&(He=l.relatedTarget||l.fromElement)&&(So(He)||He[Mr]))break e;if((ue||se)&&(se=de.window===de?de:(se=de.ownerDocument)?se.defaultView||se.parentWindow:window,ue?(He=l.relatedTarget||l.toElement,ue=ae,He=He?So(He):null,He!==null&&(It=c(He),et=He.tag,He!==It||et!==5&&et!==27&&et!==6)&&(He=null)):(ue=null,He=ae),ue!==He)){if(et=Hb,me="onMouseLeave",te="onMouseEnter",J="mouse",(t==="pointerout"||t==="pointerover")&&(et=Vb,me="onPointerLeave",te="onPointerEnter",J="pointer"),It=ue==null?se:Ul(ue),ne=He==null?se:Ul(He),se=new et(me,J+"leave",ue,l,de),se.target=It,se.relatedTarget=ne,me=null,So(de)===ae&&(et=new et(te,J+"enter",He,l,de),et.target=ne,et.relatedTarget=It,me=et),It=me,ue&&He)t:{for(et=DE,te=ue,J=He,ne=0,me=te;me;me=et(me))ne++;me=0;for(var Ke=J;Ke;Ke=et(Ke))me++;for(;0<ne-me;)te=et(te),ne--;for(;0<me-ne;)J=et(J),me--;for(;ne--;){if(te===J||J!==null&&te===J.alternate){et=te;break t}te=et(te),J=et(J)}et=null}else et=null;ue!==null&&z0(ge,se,ue,et,!1),He!==null&&It!==null&&z0(ge,It,He,et,!0)}}e:{if(se=ae?Ul(ae):window,ue=se.nodeName&&se.nodeName.toLowerCase(),ue==="select"||ue==="input"&&se.type==="file")var wt=Zb;else if(Kb(se))if(Jb)wt=Fk;else{wt=$k;var Ve=Vk}else ue=se.nodeName,!ue||ue.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ae&&Lf(ae.elementType)&&(wt=Zb):wt=Gk;if(wt&&(wt=wt(t,ae))){Qb(ge,wt,l,de);break e}Ve&&Ve(t,se,ae),t==="focusout"&&ae&&se.type==="number"&&ae.memoizedProps.value!=null&&Df(se,"number",se.value)}switch(Ve=ae?Ul(ae):window,t){case"focusin":(Kb(Ve)||Ve.contentEditable==="true")&&(Mo=Ve,Qf=ae,Kl=null);break;case"focusout":Kl=Qf=Mo=null;break;case"mousedown":Zf=!0;break;case"contextmenu":case"mouseup":case"dragend":Zf=!1,ov(ge,l,de);break;case"selectionchange":if(Xk)break;case"keydown":case"keyup":ov(ge,l,de)}var ct;if(Ff)e:{switch(t){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Ao?Yb(t,l)&&(bt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(bt="onCompositionStart");bt&&($b&&l.locale!=="ko"&&(Ao||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Ao&&(ct=Bb()):(Vs=de,Hf="value"in Vs?Vs.value:Vs.textContent,Ao=!0)),Ve=Au(ae,bt),0<Ve.length&&(bt=new qb(bt,t,null,l,de),ge.push({event:bt,listeners:Ve}),ct?bt.data=ct:(ct=Xb(l),ct!==null&&(bt.data=ct)))),(ct=Ik?Bk(t,l):Uk(t,l))&&(bt=Au(ae,"onBeforeInput"),0<bt.length&&(Ve=new qb("onBeforeInput","beforeinput",null,l,de),ge.push({event:Ve,listeners:bt}),Ve.data=ct)),AE(ge,t,ae,l,de)}M0(ge,a)})}function yi(t,a,l){return{instance:t,listener:a,currentTarget:l}}function Au(t,a){for(var l=a+"Capture",u=[];t!==null;){var h=t,v=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||v===null||(h=Hl(t,l),h!=null&&u.unshift(yi(t,h,v)),h=Hl(t,a),h!=null&&u.push(yi(t,h,v))),t.tag===3)return u;t=t.return}return[]}function DE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function z0(t,a,l,u,h){for(var v=a._reactName,T=[];l!==null&&l!==u;){var P=l,Q=P.alternate,ae=P.stateNode;if(P=P.tag,Q!==null&&Q===u)break;P!==5&&P!==26&&P!==27||ae===null||(Q=ae,h?(ae=Hl(l,v),ae!=null&&T.unshift(yi(l,ae,Q))):h||(ae=Hl(l,v),ae!=null&&T.push(yi(l,ae,Q)))),l=l.return}T.length!==0&&t.push({event:a,listeners:T})}var LE=/\r\n?/g,PE=/\u0000|\uFFFD/g;function D0(t){return(typeof t=="string"?t:""+t).replace(LE,`
|
|
49
|
-
`).replace(PE,"")}function L0(t,a){return a=D0(a),D0(t)===a}function Pt(t,a,l,u,h,v){switch(l){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||No(t,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&No(t,""+u);break;case"className":Dc(t,"class",u);break;case"tabIndex":Dc(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Dc(t,l,u);break;case"style":Lb(t,u,v);break;case"data":if(a!=="object"){Dc(t,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||l!=="href")){t.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=Pc(""+u),t.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(l,"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 v=="function"&&(l==="formAction"?(a!=="input"&&Pt(t,a,"name",h.name,h,null),Pt(t,a,"formEncType",h.formEncType,h,null),Pt(t,a,"formMethod",h.formMethod,h,null),Pt(t,a,"formTarget",h.formTarget,h,null)):(Pt(t,a,"encType",h.encType,h,null),Pt(t,a,"method",h.method,h,null),Pt(t,a,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=Pc(""+u),t.setAttribute(l,u);break;case"onClick":u!=null&&(t.onclick=ds);break;case"onScroll":u!=null&&ht("scroll",t);break;case"onScrollEnd":u!=null&&ht("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}l=Pc(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,""+u):t.removeAttribute(l);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":u===!0?t.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,u):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(l,u):t.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(l):t.setAttribute(l,u);break;case"popover":ht("beforetoggle",t),ht("toggle",t),zc(t,"popover",u);break;case"xlinkActuate":us(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":us(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":us(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":us(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":us(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":us(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":us(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":us(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":us(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":zc(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=dk.get(l)||l,zc(t,l,u))}}function _m(t,a,l,u,h,v){switch(l){case"style":Lb(t,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof u=="string"?No(t,u):(typeof u=="number"||typeof u=="bigint")&&No(t,""+u);break;case"onScroll":u!=null&&ht("scroll",t);break;case"onScrollEnd":u!=null&&ht("scrollend",t);break;case"onClick":u!=null&&(t.onclick=ds);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Eb.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),a=l.slice(2,h?l.length-7:void 0),v=t[mn]||null,v=v!=null?v[l]:null,typeof v=="function"&&t.removeEventListener(a,v,h),typeof u=="function")){typeof v!="function"&&v!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(a,u,h);break e}l in t?t[l]=u:u===!0?t.setAttribute(l,""):zc(t,l,u)}}}function En(t,a,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",t),ht("load",t);var u=!1,h=!1,v;for(v in l)if(l.hasOwnProperty(v)){var T=l[v];if(T!=null)switch(v){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Pt(t,a,v,T,l,null)}}h&&Pt(t,a,"srcSet",l.srcSet,l,null),u&&Pt(t,a,"src",l.src,l,null);return;case"input":ht("invalid",t);var P=v=T=h=null,Q=null,ae=null;for(u in l)if(l.hasOwnProperty(u)){var de=l[u];if(de!=null)switch(u){case"name":h=de;break;case"type":T=de;break;case"checked":Q=de;break;case"defaultChecked":ae=de;break;case"value":v=de;break;case"defaultValue":P=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,a));break;default:Pt(t,a,u,de,l,null)}}Mb(t,v,P,Q,ae,T,h,!1);return;case"select":ht("invalid",t),u=T=v=null;for(h in l)if(l.hasOwnProperty(h)&&(P=l[h],P!=null))switch(h){case"value":v=P;break;case"defaultValue":T=P;break;case"multiple":u=P;default:Pt(t,a,h,P,l,null)}a=v,l=T,t.multiple=!!u,a!=null?Eo(t,!!u,a,!1):l!=null&&Eo(t,!!u,l,!0);return;case"textarea":ht("invalid",t),v=h=u=null;for(T in l)if(l.hasOwnProperty(T)&&(P=l[T],P!=null))switch(T){case"value":u=P;break;case"defaultValue":h=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:Pt(t,a,T,P,l,null)}zb(t,u,h,v);return;case"option":for(Q in l)if(l.hasOwnProperty(Q)&&(u=l[Q],u!=null))switch(Q){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Pt(t,a,Q,u,l,null)}return;case"dialog":ht("beforetoggle",t),ht("toggle",t),ht("cancel",t),ht("close",t);break;case"iframe":case"object":ht("load",t);break;case"video":case"audio":for(u=0;u<vi.length;u++)ht(vi[u],t);break;case"image":ht("error",t),ht("load",t);break;case"details":ht("toggle",t);break;case"embed":case"source":case"link":ht("error",t),ht("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in l)if(l.hasOwnProperty(ae)&&(u=l[ae],u!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Pt(t,a,ae,u,l,null)}return;default:if(Lf(a)){for(de in l)l.hasOwnProperty(de)&&(u=l[de],u!==void 0&&_m(t,a,de,u,l,void 0));return}}for(P in l)l.hasOwnProperty(P)&&(u=l[P],u!=null&&Pt(t,a,P,u,l,null))}function IE(t,a,l,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,v=null,T=null,P=null,Q=null,ae=null,de=null;for(ue in l){var ge=l[ue];if(l.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":Q=ge;default:u.hasOwnProperty(ue)||Pt(t,a,ue,null,u,ge)}}for(var se in u){var ue=u[se];if(ge=l[se],u.hasOwnProperty(se)&&(ue!=null||ge!=null))switch(se){case"type":v=ue;break;case"name":h=ue;break;case"checked":ae=ue;break;case"defaultChecked":de=ue;break;case"value":T=ue;break;case"defaultValue":P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,a));break;default:ue!==ge&&Pt(t,a,se,ue,u,ge)}}zf(t,T,P,Q,ae,de,v,h);return;case"select":ue=T=P=se=null;for(v in l)if(Q=l[v],l.hasOwnProperty(v)&&Q!=null)switch(v){case"value":break;case"multiple":ue=Q;default:u.hasOwnProperty(v)||Pt(t,a,v,null,u,Q)}for(h in u)if(v=u[h],Q=l[h],u.hasOwnProperty(h)&&(v!=null||Q!=null))switch(h){case"value":se=v;break;case"defaultValue":P=v;break;case"multiple":T=v;default:v!==Q&&Pt(t,a,h,v,u,Q)}a=P,l=T,u=ue,se!=null?Eo(t,!!l,se,!1):!!u!=!!l&&(a!=null?Eo(t,!!l,a,!0):Eo(t,!!l,l?[]:"",!1));return;case"textarea":ue=se=null;for(P in l)if(h=l[P],l.hasOwnProperty(P)&&h!=null&&!u.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Pt(t,a,P,null,u,h)}for(T in u)if(h=u[T],v=l[T],u.hasOwnProperty(T)&&(h!=null||v!=null))switch(T){case"value":se=h;break;case"defaultValue":ue=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==v&&Pt(t,a,T,h,u,v)}Ob(t,se,ue);return;case"option":for(var He in l)if(se=l[He],l.hasOwnProperty(He)&&se!=null&&!u.hasOwnProperty(He))switch(He){case"selected":t.selected=!1;break;default:Pt(t,a,He,null,u,se)}for(Q in u)if(se=u[Q],ue=l[Q],u.hasOwnProperty(Q)&&se!==ue&&(se!=null||ue!=null))switch(Q){case"selected":t.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Pt(t,a,Q,se,u,ue)}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 et in l)se=l[et],l.hasOwnProperty(et)&&se!=null&&!u.hasOwnProperty(et)&&Pt(t,a,et,null,u,se);for(ae in u)if(se=u[ae],ue=l[ae],u.hasOwnProperty(ae)&&se!==ue&&(se!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,a));break;default:Pt(t,a,ae,se,u,ue)}return;default:if(Lf(a)){for(var It in l)se=l[It],l.hasOwnProperty(It)&&se!==void 0&&!u.hasOwnProperty(It)&&_m(t,a,It,void 0,u,se);for(de in u)se=u[de],ue=l[de],!u.hasOwnProperty(de)||se===ue||se===void 0&&ue===void 0||_m(t,a,de,se,u,ue);return}}for(var te in l)se=l[te],l.hasOwnProperty(te)&&se!=null&&!u.hasOwnProperty(te)&&Pt(t,a,te,null,u,se);for(ge in u)se=u[ge],ue=l[ge],!u.hasOwnProperty(ge)||se===ue||se==null&&ue==null||Pt(t,a,ge,se,u,ue)}function P0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],v=h.transferSize,T=h.initiatorType,P=h.duration;if(v&&P&&P0(T)){for(T=0,P=h.responseEnd,u+=1;u<l.length;u++){var Q=l[u],ae=Q.startTime;if(ae>P)break;var de=Q.transferSize,ge=Q.initiatorType;de&&P0(ge)&&(Q=Q.responseEnd,T+=de*(Q<P?1:(P-ae)/(Q-ae)))}if(--u,a+=8*(v+T)/(h.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Sm=null,wm=null;function Mu(t){return t.nodeType===9?t:t.ownerDocument}function I0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function B0(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Cm(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var km=null;function UE(){var t=window.event;return t&&t.type==="popstate"?t===km?!1:(km=t,!0):(km=null,!1)}var U0=typeof setTimeout=="function"?setTimeout:void 0,HE=typeof clearTimeout=="function"?clearTimeout:void 0,H0=typeof Promise=="function"?Promise:void 0,qE=typeof queueMicrotask=="function"?queueMicrotask:typeof H0<"u"?function(t){return H0.resolve(null).then(t).catch(VE)}:U0;function VE(t){setTimeout(function(){throw t})}function or(t){return t==="head"}function q0(t,a){var l=a,u=0;do{var h=l.nextSibling;if(t.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){t.removeChild(h),rl(a);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")ji(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,ji(l);for(var v=l.firstChild;v;){var T=v.nextSibling,P=v.nodeName;v[Bl]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=T}}else l==="body"&&ji(t.ownerDocument.body);l=h}while(l);rl(a)}function V0(t,a){var l=t;t=0;do{var u=l.nextSibling;if(l.nodeType===1?a?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(a?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=u}while(l)}function Em(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var l=a;switch(a=a.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Em(l),Mf(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function $E(t,a,l,u){for(;t.nodeType===1;){var h=l;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Bl])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var v=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=Ea(t.nextSibling),t===null)break}return null}function GE(t,a,l){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ea(t.nextSibling),t===null))return null;return t}function $0(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Ea(t.nextSibling),t===null))return null;return t}function Nm(t){return t.data==="$?"||t.data==="$~"}function Rm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function FE(t,a){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||l.readyState!=="loading")a();else{var u=function(){a(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function Ea(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Tm=null;function G0(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(a===0)return Ea(t.nextSibling);a--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||a++}t=t.nextSibling}return null}function F0(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(a===0)return t;a--}else l!=="/$"&&l!=="/&"||a++}t=t.previousSibling}return null}function Y0(t,a,l){switch(a=Mu(l),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function ji(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Mf(t)}var Na=new Map,X0=new Set;function Ou(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Es=F.d;F.d={f:YE,r:XE,D:KE,C:QE,L:ZE,m:JE,X:eN,S:WE,M:tN};function YE(){var t=Es.f(),a=wu();return t||a}function XE(t){var a=wo(t);a!==null&&a.tag===5&&a.type==="form"?dy(a):Es.r(t)}var nl=typeof document>"u"?null:document;function K0(t,a,l){var u=nl;if(u&&typeof a=="string"&&a){var h=ya(a);h='link[rel="'+t+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),X0.has(h)||(X0.add(h),t={rel:t,crossOrigin:l,href:a},u.querySelector(h)===null&&(a=u.createElement("link"),En(a,"link",t),jn(a),u.head.appendChild(a)))}}function KE(t){Es.D(t),K0("dns-prefetch",t,null)}function QE(t,a){Es.C(t,a),K0("preconnect",t,a)}function ZE(t,a,l){Es.L(t,a,l);var u=nl;if(u&&t&&a){var h='link[rel="preload"][as="'+ya(a)+'"]';a==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+ya(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+ya(l.imageSizes)+'"]')):h+='[href="'+ya(t)+'"]';var v=h;switch(a){case"style":v=al(t);break;case"script":v=sl(t)}Na.has(v)||(t=x({rel:"preload",href:a==="image"&&l&&l.imageSrcSet?void 0:t,as:a},l),Na.set(v,t),u.querySelector(h)!==null||a==="style"&&u.querySelector(_i(v))||a==="script"&&u.querySelector(Si(v))||(a=u.createElement("link"),En(a,"link",t),jn(a),u.head.appendChild(a)))}}function JE(t,a){Es.m(t,a);var l=nl;if(l&&t){var u=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+ya(u)+'"][href="'+ya(t)+'"]',v=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=sl(t)}if(!Na.has(v)&&(t=x({rel:"modulepreload",href:t},a),Na.set(v,t),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Si(v)))return}u=l.createElement("link"),En(u,"link",t),jn(u),l.head.appendChild(u)}}}function WE(t,a,l){Es.S(t,a,l);var u=nl;if(u&&t){var h=Co(u).hoistableStyles,v=al(t);a=a||"default";var T=h.get(v);if(!T){var P={loading:0,preload:null};if(T=u.querySelector(_i(v)))P.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},l),(l=Na.get(v))&&Am(t,l);var Q=T=u.createElement("link");jn(Q),En(Q,"link",t),Q._p=new Promise(function(ae,de){Q.onload=ae,Q.onerror=de}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,zu(T,a,u)}T={type:"stylesheet",instance:T,count:1,state:P},h.set(v,T)}}}function eN(t,a){Es.X(t,a);var l=nl;if(l&&t){var u=Co(l).hoistableScripts,h=sl(t),v=u.get(h);v||(v=l.querySelector(Si(h)),v||(t=x({src:t,async:!0},a),(a=Na.get(h))&&Mm(t,a),v=l.createElement("script"),jn(v),En(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(h,v))}}function tN(t,a){Es.M(t,a);var l=nl;if(l&&t){var u=Co(l).hoistableScripts,h=sl(t),v=u.get(h);v||(v=l.querySelector(Si(h)),v||(t=x({src:t,async:!0,type:"module"},a),(a=Na.get(h))&&Mm(t,a),v=l.createElement("script"),jn(v),En(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(h,v))}}function Q0(t,a,l,u){var h=(h=re.current)?Ou(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(a=al(l.href),l=Co(h).hoistableStyles,u=l.get(a),u||(u={type:"style",instance:null,count:0,state:null},l.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=al(l.href);var v=Co(h).hoistableStyles,T=v.get(t);if(T||(h=h.ownerDocument||h,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,T),(v=h.querySelector(_i(t)))&&!v._p&&(T.instance=v,T.state.loading=5),Na.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Na.set(t,l),v||nN(h,t,l,T.state))),a&&u===null)throw Error(r(528,""));return T}if(a&&u!==null)throw Error(r(529,""));return null;case"script":return a=l.async,l=l.src,typeof l=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=sl(l),l=Co(h).hoistableScripts,u=l.get(a),u||(u={type:"script",instance:null,count:0,state:null},l.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function al(t){return'href="'+ya(t)+'"'}function _i(t){return'link[rel="stylesheet"]['+t+"]"}function Z0(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function nN(t,a,l,u){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=t.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),En(a,"link",l),jn(a),t.head.appendChild(a))}function sl(t){return'[src="'+ya(t)+'"]'}function Si(t){return"script[async]"+t}function J0(t,a,l){if(a.count++,a.instance===null)switch(a.type){case"style":var u=t.querySelector('style[data-href~="'+ya(l.href)+'"]');if(u)return a.instance=u,jn(u),u;var h=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),jn(u),En(u,"style",h),zu(u,l.precedence,t),a.instance=u;case"stylesheet":h=al(l.href);var v=t.querySelector(_i(h));if(v)return a.state.loading|=4,a.instance=v,jn(v),v;u=Z0(l),(h=Na.get(h))&&Am(u,h),v=(t.ownerDocument||t).createElement("link"),jn(v);var T=v;return T._p=new Promise(function(P,Q){T.onload=P,T.onerror=Q}),En(v,"link",u),a.state.loading|=4,zu(v,l.precedence,t),a.instance=v;case"script":return v=sl(l.src),(h=t.querySelector(Si(v)))?(a.instance=h,jn(h),h):(u=l,(h=Na.get(v))&&(u=x({},l),Mm(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),jn(h),En(h,"link",u),t.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,zu(u,l.precedence,t));return a.instance}function zu(t,a,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,v=h,T=0;T<u.length;T++){var P=u[T];if(P.dataset.precedence===a)v=P;else if(v!==h)break}v?v.parentNode.insertBefore(t,v.nextSibling):(a=l.nodeType===9?l.head:l,a.insertBefore(t,a.firstChild))}function Am(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Mm(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var Du=null;function W0(t,a,l){if(Du===null){var u=new Map,h=Du=new Map;h.set(l,u)}else h=Du,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(t))return u;for(u.set(t,null),l=l.getElementsByTagName(t),h=0;h<l.length;h++){var v=l[h];if(!(v[Bl]||v[Rt]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(a)||"";T=t+T;var P=u.get(T);P?P.push(v):u.set(T,[v])}}return u}function e1(t,a,l){t=t.ownerDocument||t,t.head.insertBefore(l,a==="title"?t.querySelector("head > title"):null)}function aN(t,a,l){if(l===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return t=a.disabled,typeof a.precedence=="string"&&t==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function t1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function sN(t,a,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=al(u.href),v=a.querySelector(_i(h));if(v){a=v._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Lu.bind(t),a.then(t,t)),l.state.loading|=4,l.instance=v,jn(v);return}v=a.ownerDocument||a,u=Z0(u),(h=Na.get(h))&&Am(u,h),v=v.createElement("link"),jn(v);var T=v;T._p=new Promise(function(P,Q){T.onload=P,T.onerror=Q}),En(v,"link",u),l.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Lu.bind(t),a.addEventListener("load",l),a.addEventListener("error",l))}}var Om=0;function rN(t,a){return t.stylesheets&&t.count===0&&Iu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var u=setTimeout(function(){if(t.stylesheets&&Iu(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+a);0<t.imgBytes&&Om===0&&(Om=62500*BE());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Iu(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>Om?50:800)+a);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Iu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Pu=null;function Iu(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Pu=new Map,a.forEach(oN,t),Pu=null,Lu.call(t))}function oN(t,a){if(!(a.state.loading&4)){var l=Pu.get(t);if(l)var u=l.get(null);else{l=new Map,Pu.set(t,l);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<h.length;v++){var T=h[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),u=T)}u&&l.set(null,u)}h=a.instance,T=h.getAttribute("data-precedence"),v=l.get(T)||u,v===u&&l.set(null,h),l.set(T,h),this.count++,u=Lu.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),v?v.parentNode.insertBefore(h,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),a.state.loading|=4}}var wi={$$typeof:R,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function lN(t,a,l,u,h,v,T,P,Q){this.tag=1,this.containerInfo=t,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=oa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oa(0),this.hiddenUpdates=oa(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function n1(t,a,l,u,h,v,T,P,Q,ae,de,ge){return t=new lN(t,a,l,T,Q,ae,de,ge,P),a=1,v===!0&&(a|=24),v=ca(3,null,null,a),t.current=v,v.stateNode=t,a=fp(),a.refCount++,t.pooledCache=a,a.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:a},hp(v),t}function a1(t){return t?(t=Do,t):Do}function s1(t,a,l,u,h,v){h=a1(h),u.context===null?u.context=h:u.pendingContext=h,u=Ks(a),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Qs(t,u,a),l!==null&&(ea(l,t,a),ni(l,t,a))}function r1(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<a?l:a}}function zm(t,a){r1(t,a),(t=t.alternate)&&r1(t,a)}function o1(t){if(t.tag===13||t.tag===31){var a=Pr(t,67108864);a!==null&&ea(a,t,67108864),zm(t,67108864)}}function l1(t){if(t.tag===13||t.tag===31){var a=ma();a=cs(a);var l=Pr(t,a);l!==null&&ea(l,t,a),zm(t,a)}}var Bu=!0;function iN(t,a,l,u){var h=q.T;q.T=null;var v=F.p;try{F.p=2,Dm(t,a,l,u)}finally{F.p=v,q.T=h}}function cN(t,a,l,u){var h=q.T;q.T=null;var v=F.p;try{F.p=8,Dm(t,a,l,u)}finally{F.p=v,q.T=h}}function Dm(t,a,l,u){if(Bu){var h=Lm(u);if(h===null)jm(t,a,u,Uu,l),c1(t,u);else if(dN(h,t,a,l,u))u.stopPropagation();else if(c1(t,u),a&4&&-1<uN.indexOf(t)){for(;h!==null;){var v=wo(h);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=an(v.pendingLanes);if(T!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var Q=1<<31-at(T);P.entanglements[1]|=Q,T&=~Q}Xa(v),(Et&6)===0&&(_u=ye()+500,bi(0))}}break;case 31:case 13:P=Pr(v,2),P!==null&&ea(P,v,2),wu(),zm(v,2)}if(v=Lm(u),v===null&&jm(t,a,u,Uu,l),v===h)break;h=v}h!==null&&u.stopPropagation()}else jm(t,a,u,null,l)}}function Lm(t){return t=If(t),Pm(t)}var Uu=null;function Pm(t){if(Uu=null,t=So(t),t!==null){var a=c(t);if(a===null)t=null;else{var l=a.tag;if(l===13){if(t=d(a),t!==null)return t;t=null}else if(l===31){if(t=f(a),t!==null)return t;t=null}else if(l===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Uu=t,null}function i1(t){switch(t){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(le()){case je:return 2;case we:return 8;case Ue:case We:return 32;case jt:return 268435456;default:return 32}default:return 32}}var Im=!1,lr=null,ir=null,cr=null,Ci=new Map,ki=new Map,ur=[],uN="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 c1(t,a){switch(t){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":cr=null;break;case"pointerover":case"pointerout":Ci.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(a.pointerId)}}function Ei(t,a,l,u,h,v){return t===null||t.nativeEvent!==v?(t={blockedOn:a,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[h]},a!==null&&(a=wo(a),a!==null&&o1(a)),t):(t.eventSystemFlags|=u,a=t.targetContainers,h!==null&&a.indexOf(h)===-1&&a.push(h),t)}function dN(t,a,l,u,h){switch(a){case"focusin":return lr=Ei(lr,t,a,l,u,h),!0;case"dragenter":return ir=Ei(ir,t,a,l,u,h),!0;case"mouseover":return cr=Ei(cr,t,a,l,u,h),!0;case"pointerover":var v=h.pointerId;return Ci.set(v,Ei(Ci.get(v)||null,t,a,l,u,h)),!0;case"gotpointercapture":return v=h.pointerId,ki.set(v,Ei(ki.get(v)||null,t,a,l,u,h)),!0}return!1}function u1(t){var a=So(t.target);if(a!==null){var l=c(a);if(l!==null){if(a=l.tag,a===13){if(a=d(l),a!==null){t.blockedOn=a,Sn(t.priority,function(){l1(l)});return}}else if(a===31){if(a=f(l),a!==null){t.blockedOn=a,Sn(t.priority,function(){l1(l)});return}}else if(a===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Hu(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var l=Lm(t.nativeEvent);if(l===null){l=t.nativeEvent;var u=new l.constructor(l.type,l);Pf=u,l.target.dispatchEvent(u),Pf=null}else return a=wo(l),a!==null&&o1(a),t.blockedOn=l,!1;a.shift()}return!0}function d1(t,a,l){Hu(t)&&l.delete(a)}function fN(){Im=!1,lr!==null&&Hu(lr)&&(lr=null),ir!==null&&Hu(ir)&&(ir=null),cr!==null&&Hu(cr)&&(cr=null),Ci.forEach(d1),ki.forEach(d1)}function qu(t,a){t.blockedOn===a&&(t.blockedOn=null,Im||(Im=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fN)))}var Vu=null;function f1(t){Vu!==t&&(Vu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vu===t&&(Vu=null);for(var a=0;a<t.length;a+=3){var l=t[a],u=t[a+1],h=t[a+2];if(typeof u!="function"){if(Pm(u||l)===null)continue;break}var v=wo(l);v!==null&&(t.splice(a,3),a-=3,Lp(v,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function rl(t){function a(Q){return qu(Q,t)}lr!==null&&qu(lr,t),ir!==null&&qu(ir,t),cr!==null&&qu(cr,t),Ci.forEach(a),ki.forEach(a);for(var l=0;l<ur.length;l++){var u=ur[l];u.blockedOn===t&&(u.blockedOn=null)}for(;0<ur.length&&(l=ur[0],l.blockedOn===null);)u1(l),l.blockedOn===null&&ur.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],v=l[u+1],T=h[mn]||null;if(typeof v=="function")T||f1(l);else if(T){var P=null;if(v&&v.hasAttribute("formAction")){if(h=v,T=v[mn]||null)P=T.formAction;else if(Pm(h)!==null)continue}else P=T.action;typeof P=="function"?l[u+1]=P:(l.splice(u,3),u-=3),f1(l)}}}function p1(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return h=T})},focusReset:"manual",scroll:"manual"})}function a(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),h!==null&&(h(),h=null)}}}function Bm(t){this._internalRoot=t}$u.prototype.render=Bm.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var l=a.current,u=ma();s1(l,u,t,a,null,null)},$u.prototype.unmount=Bm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;s1(t.current,2,null,t,null,null),wu(),a[Mr]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var a=Dt();t={blockedOn:null,target:t,priority:a};for(var l=0;l<ur.length&&a!==0&&a<ur[l].priority;l++);ur.splice(l,0,t),l===0&&u1(t)}};var m1=n.version;if(m1!=="19.2.7")throw Error(r(527,m1,"19.2.7"));F.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(a),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var pN={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gu.isDisabled&&Gu.supportsFiber)try{ke=Gu.inject(pN),Ne=Gu}catch{}}return Ri.createRoot=function(t,a){if(!i(t))throw Error(r(299));var l=!1,u="",h=jy,v=_y,T=Sy;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=n1(t,1,!1,null,null,l,u,null,h,v,T,p1),t[Mr]=a.current,ym(t),new Bm(a)},Ri.hydrateRoot=function(t,a,l){if(!i(t))throw Error(r(299));var u=!1,h="",v=jy,T=_y,P=Sy,Q=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError),l.formState!==void 0&&(Q=l.formState)),a=n1(t,1,!0,a,l??null,u,h,Q,v,T,P,p1),a.context=a1(null),l=a.current,u=ma(),u=cs(u),h=Ks(u),h.callback=null,Qs(l,h,u),l=u,a.current.lanes=l,Xn(a,l),Xa(a),t[Mr]=a.current,ym(t),new $u(a)},Ri.version="19.2.7",Ri}var w1;function wN(){if(w1)return qm.exports;w1=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(n){console.error(n)}}return e(),qm.exports=SN(),qm.exports}var CN=wN();const kN=Vh(CN);/**
|
|
50
|
-
* react-router v7.17.0
|
|
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 C1="popstate";function k1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function EN(e={}){function n(r,i){let c=i.state?.masked,{pathname:d,search:f,hash:p}=c||r.location;return ah("",{pathname:d,search:f,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",c?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function s(r,i){return typeof i=="string"?i:cc(i)}return RN(n,s,null,e)}function tn(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function qa(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function NN(){return Math.random().toString(36).substring(2,10)}function E1(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ah(e,n,s=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Rl(n):n,state:s,key:n&&n.key||r||NN(),mask:i}}function cc({pathname:e="/",search:n="",hash:s=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(e+=s.charAt(0)==="#"?s:"#"+s),e}function Rl(e){let n={};if(e){let s=e.indexOf("#");s>=0&&(n.hash=e.substring(s),e=e.substring(0,s));let r=e.indexOf("?");r>=0&&(n.search=e.substring(r),e=e.substring(0,r)),e&&(n.pathname=e)}return n}function RN(e,n,s,r={}){let{window:i=document.defaultView,v5Compat:c=!1}=r,d=i.history,f="POP",p=null,m=g();m==null&&(m=0,d.replaceState({...d.state,idx:m},""));function g(){return(d.state||{idx:null}).idx}function x(){f="POP";let _=g(),C=_==null?null:_-m;m=_,p&&p({action:f,location:j.location,delta:C})}function y(_,C){f="PUSH";let k=k1(_)?_:ah(j.location,_,C);m=g()+1;let R=E1(k,m),N=j.createHref(k.mask||k);try{d.pushState(R,"",N)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(N)}c&&p&&p({action:f,location:j.location,delta:1})}function S(_,C){f="REPLACE";let k=k1(_)?_:ah(j.location,_,C);m=g();let R=E1(k,m),N=j.createHref(k.mask||k);d.replaceState(R,"",N),c&&p&&p({action:f,location:j.location,delta:0})}function w(_){return TN(i,_)}let j={get action(){return f},get location(){return e(i,d)},listen(_){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(C1,x),p=_,()=>{i.removeEventListener(C1,x),p=null}},createHref(_){return n(i,_)},createURL:w,encodeLocation(_){let C=w(_);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:y,replace:S,go(_){return d.go(_)}};return j}function TN(e,n,s=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),tn(r,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:cc(n);return i=i.replace(/ $/,"%20"),!s&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function J_(e,n,s="/"){return AN(e,n,s,!1)}function AN(e,n,s,r,i){let c=typeof n=="string"?Rl(n):n,d=Ls(c.pathname||"/",s);if(d==null)return null;let f=MN(e),p=null,m=$N(d);for(let g=0;p==null&&g<f.length;++g)p=qN(f[g],m,r);return p}function MN(e){let n=W_(e);return ON(n),n}function W_(e,n=[],s=[],r="",i=!1){let c=(d,f,p=i,m)=>{let g={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&p)return;tn(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let x=Ha([r,g.relativePath]),y=s.concat(g);d.children&&d.children.length>0&&(tn(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),W_(d.children,n,y,x,p)),!(d.path==null&&!d.index)&&n.push({path:x,score:UN(x,d.index),routesMeta:y})};return e.forEach((d,f)=>{if(d.path===""||!d.path?.includes("?"))c(d,f);else for(let p of eS(d.path))c(d,f,!0,p)}),n}function eS(e){let n=e.split("/");if(n.length===0)return[];let[s,...r]=n,i=s.endsWith("?"),c=s.replace(/\?$/,"");if(r.length===0)return i?[c,""]:[c];let d=eS(r.join("/")),f=[];return f.push(...d.map(p=>p===""?c:[c,p].join("/"))),i&&f.push(...d),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function ON(e){e.sort((n,s)=>n.score!==s.score?s.score-n.score:HN(n.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}var zN=/^:[\w-]+$/,DN=3,LN=2,PN=1,IN=10,BN=-2,N1=e=>e==="*";function UN(e,n){let s=e.split("/"),r=s.length;return s.some(N1)&&(r+=BN),n&&(r+=LN),s.filter(i=>!N1(i)).reduce((i,c)=>i+(zN.test(c)?DN:c===""?PN:IN),r)}function HN(e,n){return e.length===n.length&&e.slice(0,-1).every((r,i)=>r===n[i])?e[e.length-1]-n[n.length-1]:0}function qN(e,n,s=!1){let{routesMeta:r}=e,i={},c="/",d=[];for(let f=0;f<r.length;++f){let p=r[f],m=f===r.length-1,g=c==="/"?n:n.slice(c.length)||"/",x=Cd({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},g),y=p.route;if(!x&&m&&s&&!r[r.length-1].route.index&&(x=Cd({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!x)return null;Object.assign(i,x.params),d.push({params:i,pathname:Ha([c,x.pathname]),pathnameBase:XN(Ha([c,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(c=Ha([c,x.pathnameBase]))}return d}function Cd(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[s,r]=VN(e.path,e.caseSensitive,e.end),i=n.match(s);if(!i)return null;let c=i[0],d=c.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:x},y)=>{if(g==="*"){let w=f[y]||"";d=c.slice(0,c.length-w.length).replace(/(.)\/+$/,"$1")}const S=f[y];return x&&!S?m[g]=void 0:m[g]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:d,pattern:e}}function VN(e,n=!1,s=!0){qa(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,p,m,g)=>{if(r.push({paramName:f,isOptional:p!=null}),p){let x=g.charAt(m+d.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),r]}function $N(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return qa(!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 (${n}).`),e}}function Ls(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let s=n.endsWith("/")?n.length-1:n.length,r=e.charAt(s);return r&&r!=="/"?null:e.slice(s)||"/"}var GN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function FN(e,n="/"){let{pathname:s,search:r="",hash:i=""}=typeof e=="string"?Rl(e):e,c;return s?(s=nS(s),s.startsWith("/")?c=R1(s.substring(1),"/"):c=R1(s,n)):c=n,{pathname:c,search:KN(r),hash:QN(i)}}function R1(e,n){let s=kd(n).split("/");return e.split("/").forEach(i=>{i===".."?s.length>1&&s.pop():i!=="."&&s.push(i)}),s.length>1?s.join("/"):"/"}function Fm(e,n,s,r){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function YN(e){return e.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function tS(e){let n=YN(e);return n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase)}function $h(e,n,s,r=!1){let i;typeof e=="string"?i=Rl(e):(i={...e},tn(!i.pathname||!i.pathname.includes("?"),Fm("?","pathname","search",i)),tn(!i.pathname||!i.pathname.includes("#"),Fm("#","pathname","hash",i)),tn(!i.search||!i.search.includes("#"),Fm("#","search","hash",i)));let c=e===""||i.pathname==="",d=c?"/":i.pathname,f;if(d==null)f=s;else{let x=n.length-1;if(!r&&d.startsWith("..")){let y=d.split("/");for(;y[0]==="..";)y.shift(),x-=1;i.pathname=y.join("/")}f=x>=0?n[x]:"/"}let p=FN(i,f),m=d&&d!=="/"&&d.endsWith("/"),g=(c||d===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var nS=e=>e.replace(/\/\/+/g,"/"),Ha=e=>nS(e.join("/")),kd=e=>e.replace(/\/+$/,""),XN=e=>kd(e).replace(/^\/*/,"/"),KN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ZN=class{constructor(e,n,s,r=!1){this.status=e,this.statusText=n||"",this.internal=r,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function JN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function WN(e){let n=e.map(s=>s.route.path).filter(Boolean);return Ha(n)||"/"}var aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sS(e,n){let s=e;if(typeof s!="string"||!GN.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let r=s,i=!1;if(aS)try{let c=new URL(window.location.href),d=s.startsWith("//")?new URL(c.protocol+s):new URL(s),f=Ls(d.pathname,n);d.origin===c.origin&&f!=null?s=f+d.search+d.hash:i=!0}catch{qa(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var rS=["POST","PUT","PATCH","DELETE"];new Set(rS);var eR=["GET",...rS];new Set(eR);var Tl=b.createContext(null);Tl.displayName="DataRouter";var Jd=b.createContext(null);Jd.displayName="DataRouterState";var oS=b.createContext(!1);function tR(){return b.useContext(oS)}var lS=b.createContext({isTransitioning:!1});lS.displayName="ViewTransition";var nR=b.createContext(new Map);nR.displayName="Fetchers";var aR=b.createContext(null);aR.displayName="Await";var za=b.createContext(null);za.displayName="Navigation";var Sc=b.createContext(null);Sc.displayName="Location";var as=b.createContext({outlet:null,matches:[],isDataRoute:!1});as.displayName="Route";var Gh=b.createContext(null);Gh.displayName="RouteError";var iS="REACT_ROUTER_ERROR",sR="REDIRECT",rR="ROUTE_ERROR_RESPONSE";function oR(e){if(e.startsWith(`${iS}:${sR}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function lR(e){if(e.startsWith(`${iS}:${rR}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new ZN(n.status,n.statusText,n.data)}catch{}}function iR(e,{relative:n}={}){tn(wc(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:r}=b.useContext(za),{hash:i,pathname:c,search:d}=Cc(e,{relative:n}),f=c;return s!=="/"&&(f=c==="/"?s:Ha([s,c])),r.createHref({pathname:f,search:d,hash:i})}function wc(){return b.useContext(Sc)!=null}function ra(){return tn(wc(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Sc).location}var cS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uS(e){b.useContext(za).static||b.useLayoutEffect(e)}function $a(){let{isDataRoute:e}=b.useContext(as);return e?jR():cR()}function cR(){tn(wc(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Tl),{basename:n,navigator:s}=b.useContext(za),{matches:r}=b.useContext(as),{pathname:i}=ra(),c=JSON.stringify(tS(r)),d=b.useRef(!1);return uS(()=>{d.current=!0}),b.useCallback((p,m={})=>{if(qa(d.current,cS),!d.current)return;if(typeof p=="number"){s.go(p);return}let g=$h(p,JSON.parse(c),i,m.relative==="path");e==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:Ha([n,g.pathname])),(m.replace?s.replace:s.push)(g,m.state,m)},[n,s,c,i,e])}b.createContext(null);function dS(){let{matches:e}=b.useContext(as);return e[e.length-1]?.params??{}}function Cc(e,{relative:n}={}){let{matches:s}=b.useContext(as),{pathname:r}=ra(),i=JSON.stringify(tS(s));return b.useMemo(()=>$h(e,JSON.parse(i),r,n==="path"),[e,i,r,n])}function uR(e,n){return fS(e,n)}function fS(e,n,s){tn(wc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(za),{matches:i}=b.useContext(as),c=i[i.length-1],d=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let _=m&&m.path||"";mS(f,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) 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="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=ra(),x;if(n){let _=typeof n=="string"?Rl(n):n;tn(p==="/"||_.pathname?.startsWith(p),`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 "${p}" but pathname "${_.pathname}" was given in the \`location\` prop.`),x=_}else x=g;let y=x.pathname||"/",S=y;if(p!=="/"){let _=p.replace(/^\//,"").split("/");S="/"+y.replace(/^\//,"").split("/").slice(_.length).join("/")}let w=s&&s.state.matches.length?s.state.matches.map(_=>Object.assign(_,{route:s.manifest[_.route.id]||_.route})):J_(e,{pathname:S});qa(m||w!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),qa(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 j=gR(w&&w.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Ha([p,r.encodeLocation?r.encodeLocation(_.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?p:Ha([p,r.encodeLocation?r.encodeLocation(_.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),i,s);return n&&j?b.createElement(Sc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},j):j}function dR(){let e=yR(),n=JN(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),s=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},c={padding:"2px 4px",backgroundColor:r},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:c},"ErrorBoundary")," or"," ",b.createElement("code",{style:c},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},n),s?b.createElement("pre",{style:i},s):null,d)}var fR=b.createElement(dR,null),pS=class extends b.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):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 s=lR(e.digest);s&&(e=s)}let n=e!==void 0?b.createElement(as.Provider,{value:this.props.routeContext},b.createElement(Gh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(pR,{error:e},n):n}};pS.contextType=oS;var Ym=new WeakMap;function pR({children:e,error:n}){let{basename:s}=b.useContext(za);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let r=oR(n.digest);if(r){let i=Ym.get(n);if(i)throw i;let c=sS(r.location,s);if(aS&&!Ym.get(n))if(c.isExternal||r.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:r.replace}));throw Ym.set(n,d),d}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function mR({routeContext:e,match:n,children:s}){let r=b.useContext(Tl);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(as.Provider,{value:e},s)}function gR(e,n=[],s){let r=s?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,c=r?.errors;if(c!=null){let g=i.findIndex(x=>x.route.id&&c?.[x.route.id]!==void 0);tn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let d=!1,f=-1;if(s&&r){d=r.renderFallback;for(let g=0;g<i.length;g++){let x=i[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(f=g),x.route.id){let{loaderData:y,errors:S}=r,w=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!S||S[x.route.id]===void 0);if(x.route.lazy||w){s.isStatic&&(d=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let p=s?.onError,m=r&&p?(g,x)=>{p(g,{location:r.location,params:r.matches?.[0]?.params??{},pattern:WN(r.matches),errorInfo:x})}:void 0;return i.reduceRight((g,x,y)=>{let S,w=!1,j=null,_=null;r&&(S=c&&x.route.id?c[x.route.id]:void 0,j=x.route.errorElement||fR,d&&(f<0&&y===0?(mS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,_=null):f===y&&(w=!0,_=x.route.hydrateFallbackElement||null)));let C=n.concat(i.slice(0,y+1)),k=()=>{let R;return S?R=j:w?R=_:x.route.Component?R=b.createElement(x.route.Component,null):x.route.element?R=x.route.element:R=g,b.createElement(mR,{match:x,routeContext:{outlet:g,matches:C,isDataRoute:r!=null},children:R})};return r&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?b.createElement(pS,{location:r.location,revalidation:r.revalidation,component:j,error:S,children:k(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:m}):k()},null)}function Fh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hR(e){let n=b.useContext(Tl);return tn(n,Fh(e)),n}function xR(e){let n=b.useContext(Jd);return tn(n,Fh(e)),n}function bR(e){let n=b.useContext(as);return tn(n,Fh(e)),n}function Yh(e){let n=bR(e),s=n.matches[n.matches.length-1];return tn(s.route.id,`${e} can only be used on routes that contain a unique "id"`),s.route.id}function vR(){return Yh("useRouteId")}function yR(){let e=b.useContext(Gh),n=xR("useRouteError"),s=Yh("useRouteError");return e!==void 0?e:n.errors?.[s]}function jR(){let{router:e}=hR("useNavigate"),n=Yh("useNavigate"),s=b.useRef(!1);return uS(()=>{s.current=!0}),b.useCallback(async(i,c={})=>{qa(s.current,cS),s.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:n,...c}))},[e,n])}var T1={};function mS(e,n,s){!n&&!T1[e]&&(T1[e]=!0,qa(!1,s))}b.memo(_R);function _R({routes:e,manifest:n,future:s,state:r,isStatic:i,onError:c}){return fS(e,void 0,{manifest:n,state:r,isStatic:i,onError:c})}function Gt(e){tn(!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 SR({basename:e="/",children:n=null,location:s,navigationType:r="POP",navigator:i,static:c=!1,useTransitions:d}){tn(!wc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:f,navigator:i,static:c,useTransitions:d,future:{}}),[f,i,c,d]);typeof s=="string"&&(s=Rl(s));let{pathname:m="/",search:g="",hash:x="",state:y=null,key:S="default",mask:w}=s,j=b.useMemo(()=>{let _=Ls(m,f);return _==null?null:{location:{pathname:_,search:g,hash:x,state:y,key:S,mask:w},navigationType:r}},[f,m,g,x,y,S,r,w]);return qa(j!=null,`<Router basename="${f}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:b.createElement(za.Provider,{value:p},b.createElement(Sc.Provider,{children:n,value:j}))}function gS({children:e,location:n}){return uR(sh(e),n)}function sh(e,n=[]){let s=[];return b.Children.forEach(e,(r,i)=>{if(!b.isValidElement(r))return;let c=[...n,i];if(r.type===b.Fragment){s.push.apply(s,sh(r.props.children,c));return}tn(r.type===Gt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),tn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let d={id:r.props.id||c.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(d.children=sh(r.props.children,c)),s.push(d)}),s}var gd="get",hd="application/x-www-form-urlencoded";function Wd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wR(e){return Wd(e)&&e.tagName.toLowerCase()==="button"}function CR(e){return Wd(e)&&e.tagName.toLowerCase()==="form"}function kR(e){return Wd(e)&&e.tagName.toLowerCase()==="input"}function ER(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NR(e,n){return e.button===0&&(!n||n==="_self")&&!ER(e)}function rh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,s)=>{let r=e[s];return n.concat(Array.isArray(r)?r.map(i=>[s,i]):[[s,r]])},[]))}function RR(e,n){let s=rh(e);return n&&n.forEach((r,i)=>{s.has(i)||n.getAll(i).forEach(c=>{s.append(i,c)})}),s}var Fu=null;function TR(){if(Fu===null)try{new FormData(document.createElement("form"),0),Fu=!1}catch{Fu=!0}return Fu}var AR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xm(e){return e!=null&&!AR.has(e)?(qa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hd}"`),null):e}function MR(e,n){let s,r,i,c,d;if(CR(e)){let f=e.getAttribute("action");r=f?Ls(f,n):null,s=e.getAttribute("method")||gd,i=Xm(e.getAttribute("enctype"))||hd,c=new FormData(e)}else if(wR(e)||kR(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 p=e.getAttribute("formaction")||f.getAttribute("action");if(r=p?Ls(p,n):null,s=e.getAttribute("formmethod")||f.getAttribute("method")||gd,i=Xm(e.getAttribute("formenctype"))||Xm(f.getAttribute("enctype"))||hd,c=new FormData(f,e),!TR()){let{name:m,type:g,value:x}=e;if(g==="image"){let y=m?`${m}.`:"";c.append(`${y}x`,"0"),c.append(`${y}y`,"0")}else m&&c.append(m,x)}}else{if(Wd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=gd,r=null,i=hd,d=e}return c&&i==="text/plain"&&(d=c,c=void 0),{action:r,method:s.toLowerCase(),encType:i,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xh(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function hS(e,n,s,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:n&&Ls(i.pathname,n)==="/"?i.pathname=`${kd(n)}/_root.${r}`:i.pathname=`${kd(i.pathname)}.${r}`,i}async function OR(e,n){if(e.id in n)return n[e.id];try{let s=await import(e.module);return n[e.id]=s,s}catch(s){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zR(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 DR(e,n,s){let r=await Promise.all(e.map(async i=>{let c=n.routes[i.route.id];if(c){let d=await OR(c,s);return d.links?d.links():[]}return[]}));return BR(r.flat(1).filter(zR).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function A1(e,n,s,r,i,c){let d=(p,m)=>s[m]?p.route.id!==s[m].route.id:!0,f=(p,m)=>s[m].pathname!==p.pathname||s[m].route.path?.endsWith("*")&&s[m].params["*"]!==p.params["*"];return c==="assets"?n.filter((p,m)=>d(p,m)||f(p,m)):c==="data"?n.filter((p,m)=>{let g=r.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(d(p,m)||f(p,m))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function LR(e,n,{includeHydrateFallback:s}={}){return PR(e.map(r=>{let i=n.routes[r.route.id];if(!i)return[];let c=[i.module];return i.clientActionModule&&(c=c.concat(i.clientActionModule)),i.clientLoaderModule&&(c=c.concat(i.clientLoaderModule)),s&&i.hydrateFallbackModule&&(c=c.concat(i.hydrateFallbackModule)),i.imports&&(c=c.concat(i.imports)),c}).flat(1))}function PR(e){return[...new Set(e)]}function IR(e){let n={},s=Object.keys(e).sort();for(let r of s)n[r]=e[r];return n}function BR(e,n){let s=new Set;return new Set(n),e.reduce((r,i)=>{let c=JSON.stringify(IR(i));return s.has(c)||(s.add(c),r.push({key:c,link:i})),r},[])}function Kh(){let e=b.useContext(Tl);return Xh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function UR(){let e=b.useContext(Jd);return Xh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qh=b.createContext(void 0);Qh.displayName="FrameworkContext";function Zh(){let e=b.useContext(Qh);return Xh(e,"You must render this element inside a <HydratedRouter> element"),e}function HR(e,n){let s=b.useContext(Qh),[r,i]=b.useState(!1),[c,d]=b.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=n,y=b.useRef(null);b.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let j=C=>{C.forEach(k=>{d(k.isIntersecting)})},_=new IntersectionObserver(j,{threshold:.5});return y.current&&_.observe(y.current),()=>{_.disconnect()}}},[e]),b.useEffect(()=>{if(r){let j=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(j)}}},[r]);let S=()=>{i(!0)},w=()=>{i(!1),d(!1)};return s?e!=="intent"?[c,y,{}]:[c,y,{onFocus:Ti(f,S),onBlur:Ti(p,w),onMouseEnter:Ti(m,S),onMouseLeave:Ti(g,w),onTouchStart:Ti(x,S)}]:[!1,y,{}]}function Ti(e,n){return s=>{e&&e(s),s.defaultPrevented||n(s)}}function qR({page:e,...n}){let s=tR(),{router:r}=Kh(),i=b.useMemo(()=>J_(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?s?b.createElement($R,{page:e,matches:i,...n}):b.createElement(GR,{page:e,matches:i,...n}):null}function VR(e){let{manifest:n,routeModules:s}=Zh(),[r,i]=b.useState([]);return b.useEffect(()=>{let c=!1;return DR(e,n,s).then(d=>{c||i(d)}),()=>{c=!0}},[e,n,s]),r}function $R({page:e,matches:n,...s}){let r=ra(),{future:i}=Zh(),{basename:c}=Kh(),d=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let f=hS(e,c,i.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let g of n)typeof g.route.shouldRevalidate=="function"?p=!0:m.push(g.route.id);return p&&m.length>0&&f.searchParams.set("_routes",m.join(",")),[f.pathname+f.search]},[c,i.v8_trailingSlashAwareDataRequests,e,r,n]);return b.createElement(b.Fragment,null,d.map(f=>b.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...s})))}function GR({page:e,matches:n,...s}){let r=ra(),{future:i,manifest:c,routeModules:d}=Zh(),{basename:f}=Kh(),{loaderData:p,matches:m}=UR(),g=b.useMemo(()=>A1(e,n,m,c,r,"data"),[e,n,m,c,r]),x=b.useMemo(()=>A1(e,n,m,c,r,"assets"),[e,n,m,c,r]),y=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,_=!1;if(n.forEach(k=>{let R=c.routes[k.route.id];!R||!R.hasLoader||(!g.some(N=>N.route.id===k.route.id)&&k.route.id in p&&d[k.route.id]?.shouldRevalidate||R.hasClientLoader?_=!0:j.add(k.route.id))}),j.size===0)return[];let C=hS(e,f,i.v8_trailingSlashAwareDataRequests,"data");return _&&j.size>0&&C.searchParams.set("_routes",n.filter(k=>j.has(k.route.id)).map(k=>k.route.id).join(",")),[C.pathname+C.search]},[f,i.v8_trailingSlashAwareDataRequests,p,r,c,g,n,e,d]),S=b.useMemo(()=>LR(x,c),[x,c]),w=VR(x);return b.createElement(b.Fragment,null,y.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...s})),S.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...s})),w.map(({key:j,link:_})=>b.createElement("link",{key:j,nonce:s.nonce,..._,crossOrigin:_.crossOrigin??s.crossOrigin})))}function FR(...e){return n=>{e.forEach(s=>{typeof s=="function"?s(n):s!=null&&(s.current=n)})}}var YR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{YR&&(window.__reactRouterVersion="7.17.0")}catch{}function XR({basename:e,children:n,useTransitions:s,window:r}){let i=b.useRef();i.current==null&&(i.current=EN({window:r,v5Compat:!0}));let c=i.current,[d,f]=b.useState({action:c.action,location:c.location}),p=b.useCallback(m=>{s===!1?f(m):b.startTransition(()=>f(m))},[s]);return b.useLayoutEffect(()=>c.listen(p),[c,p]),b.createElement(SR,{basename:e,children:n,location:d.location,navigationType:d.action,navigator:c,useTransitions:s})}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jh=b.forwardRef(function({onClick:n,discover:s="render",prefetch:r="none",relative:i,reloadDocument:c,replace:d,mask:f,state:p,target:m,to:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S,...w},j){let{basename:_,navigator:C,useTransitions:k}=b.useContext(za),R=typeof g=="string"&&xS.test(g),N=sS(g,_);g=N.to;let A=iR(g,{relative:i}),M=ra(),O=null;if(f){let Y=$h(f,[],M.mask?M.mask.pathname:"/",!0);_!=="/"&&(Y.pathname=Y.pathname==="/"?_:Ha([_,Y.pathname])),O=C.createHref(Y)}let[L,B,I]=HR(r,w),D=ZR(g,{replace:d,mask:f,state:p,target:m,preventScrollReset:x,relative:i,viewTransition:y,defaultShouldRevalidate:S,useTransitions:k});function z(Y){n&&n(Y),Y.defaultPrevented||D(Y)}let H=!(N.isExternal||c),V=b.createElement("a",{...w,...I,href:(H?O:void 0)||N.absoluteURL||A,onClick:H?z:n,ref:FR(j,B),target:m,"data-discover":!R&&s==="render"?"true":void 0});return L&&!R?b.createElement(b.Fragment,null,V,b.createElement(qR,{page:A})):V});Jh.displayName="Link";var bS=b.forwardRef(function({"aria-current":n="page",caseSensitive:s=!1,className:r="",end:i=!1,style:c,to:d,viewTransition:f,children:p,...m},g){let x=Cc(d,{relative:m.relative}),y=ra(),S=b.useContext(Jd),{navigator:w,basename:j}=b.useContext(za),_=S!=null&&nT(x)&&f===!0,C=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,k=y.pathname,R=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;s||(k=k.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&j&&(R=Ls(R,j)||R);const N=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let A=k===C||!i&&k.startsWith(C)&&k.charAt(N)==="/",M=R!=null&&(R===C||!i&&R.startsWith(C)&&R.charAt(C.length)==="/"),O={isActive:A,isPending:M,isTransitioning:_},L=A?n:void 0,B;typeof r=="function"?B=r(O):B=[r,A?"active":null,M?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let I=typeof c=="function"?c(O):c;return b.createElement(Jh,{...m,"aria-current":L,className:B,ref:g,style:I,to:d,viewTransition:f},typeof p=="function"?p(O):p)});bS.displayName="NavLink";var KR=b.forwardRef(({discover:e="render",fetcherKey:n,navigate:s,reloadDocument:r,replace:i,state:c,method:d=gd,action:f,onSubmit:p,relative:m,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:y,...S},w)=>{let{useTransitions:j}=b.useContext(za),_=eT(),C=tT(f,{relative:m}),k=d.toLowerCase()==="get"?"get":"post",R=typeof f=="string"&&xS.test(f),N=A=>{if(p&&p(A),A.defaultPrevented)return;A.preventDefault();let M=A.nativeEvent.submitter,O=M?.getAttribute("formmethod")||d,L=()=>_(M||A.currentTarget,{fetcherKey:n,method:O,navigate:s,replace:i,state:c,relative:m,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:y});j&&s!==!1?b.startTransition(()=>L()):L()};return b.createElement("form",{ref:w,method:k,action:C,onSubmit:r?p:N,...S,"data-discover":!R&&e==="render"?"true":void 0})});KR.displayName="Form";function QR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vS(e){let n=b.useContext(Tl);return tn(n,QR(e)),n}function ZR(e,{target:n,replace:s,mask:r,state:i,preventScrollReset:c,relative:d,viewTransition:f,defaultShouldRevalidate:p,useTransitions:m}={}){let g=$a(),x=ra(),y=Cc(e,{relative:d});return b.useCallback(S=>{if(NR(S,n)){S.preventDefault();let w=s!==void 0?s:cc(x)===cc(y),j=()=>g(e,{replace:w,mask:r,state:i,preventScrollReset:c,relative:d,viewTransition:f,defaultShouldRevalidate:p});m?b.startTransition(()=>j()):j()}},[x,g,y,s,r,i,n,e,c,d,f,p,m])}function yS(e){qa(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 n=b.useRef(rh(e)),s=b.useRef(!1),r=ra(),i=b.useMemo(()=>RR(r.search,s.current?null:n.current),[r.search]),c=$a(),d=b.useCallback((f,p)=>{const m=rh(typeof f=="function"?f(new URLSearchParams(i)):f);s.current=!0,c("?"+m,p)},[c,i]);return[i,d]}var JR=0,WR=()=>`__${String(++JR)}__`;function eT(){let{router:e}=vS("useSubmit"),{basename:n}=b.useContext(za),s=vR(),r=e.fetch,i=e.navigate;return b.useCallback(async(c,d={})=>{let{action:f,method:p,encType:m,formData:g,body:x}=MR(c,n);if(d.navigate===!1){let y=d.fetcherKey||WR();await r(y,s,d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:x,formMethod:d.method||p,formEncType:d.encType||m,flushSync:d.flushSync})}else await i(d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:g,body:x,formMethod:d.method||p,formEncType:d.encType||m,replace:d.replace,state:d.state,fromRouteId:s,flushSync:d.flushSync,viewTransition:d.viewTransition})},[r,i,n,s])}function tT(e,{relative:n}={}){let{basename:s}=b.useContext(za),r=b.useContext(as);tn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),c={...Cc(e||".",{relative:n})},d=ra();if(e==null){c.search=d.search;let f=new URLSearchParams(c.search),p=f.getAll("index");if(p.some(g=>g==="")){f.delete("index"),p.filter(x=>x).forEach(x=>f.append("index",x));let g=f.toString();c.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(c.pathname=c.pathname==="/"?s:Ha([s,c.pathname])),cc(c)}function nT(e,{relative:n}={}){let s=b.useContext(lS);tn(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=vS("useViewTransitionState"),i=Cc(e,{relative:n});if(!s.isTransitioning)return!1;let c=Ls(s.currentLocation.pathname,r)||s.currentLocation.pathname,d=Ls(s.nextLocation.pathname,r)||s.nextLocation.pathname;return Cd(i.pathname,d)!=null||Cd(i.pathname,c)!=null}var Cr=Z_();/**
|
|
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 aT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jS=(...e)=>e.filter((n,s,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===s).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 sT={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 rT=b.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:i="",children:c,iconNode:d,...f},p)=>b.createElement("svg",{ref:p,...sT,width:n,height:n,stroke:e,strokeWidth:r?Number(s)*24/Number(n):s,className:jS("lucide",i),...f},[...d.map(([m,g])=>b.createElement(m,g)),...Array.isArray(c)?c:[c]]));/**
|
|
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 Se=(e,n)=>{const s=b.forwardRef(({className:r,...i},c)=>b.createElement(rT,{ref:c,iconNode:n,className:jS(`lucide-${aT(e)}`,r),...i}));return s.displayName=`${e}`,s};/**
|
|
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 _S=Se("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 SS=Se("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 oT=Se("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 wS=Se("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 CS=Se("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 lT=Se("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 vn=Se("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"}]]);/**
|
|
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 iT=Se("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"}]]);/**
|
|
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 cT=Se("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"}]]);/**
|
|
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 Ed=Se("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"}]]);/**
|
|
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 uc=Se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 ho=Se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 ef=Se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 kS=Se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 uT=Se("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
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 ES=Se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 dT=Se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 fT=Se("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"}]]);/**
|
|
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 pT=Se("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 Nd=Se("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"}]]);/**
|
|
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 mT=Se("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
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 gT=Se("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
|
|
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 Wh=Se("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"}]]);/**
|
|
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 Ps=Se("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"}]]);/**
|
|
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 NS=Se("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"}]]);/**
|
|
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 hT=Se("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"}]]);/**
|
|
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 ex=Se("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"}]]);/**
|
|
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 xT=Se("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"}]]);/**
|
|
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 Rd=Se("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"}]]);/**
|
|
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 bT=Se("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"}]]);/**
|
|
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 vT=Se("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"}]]);/**
|
|
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 yT=Se("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"}]]);/**
|
|
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 jT=Se("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"}]]);/**
|
|
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 _T=Se("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"}]]);/**
|
|
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 ST=Se("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"}]]);/**
|
|
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 wT=Se("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"}]]);/**
|
|
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 RS=Se("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"}]]);/**
|
|
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 TS=Se("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"}]]);/**
|
|
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 AS=Se("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"}]]);/**
|
|
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 CT=Se("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"}]]);/**
|
|
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 tf=Se("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 kT=Se("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"}]]);/**
|
|
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 tx=Se("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"}]]);/**
|
|
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 ET=Se("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"}]]);/**
|
|
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 NT=Se("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"}]]);/**
|
|
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 bl=Se("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"}]]);/**
|
|
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 RT=Se("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"}]]);/**
|
|
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 TT=Se("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"}]]);/**
|
|
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 AT=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 MT=Se("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"}]]);/**
|
|
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 OT=Se("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"}]]);/**
|
|
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 zT=Se("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"}]]);/**
|
|
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 DT=Se("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"}]]);/**
|
|
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 LT=Se("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"}]]);/**
|
|
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 nf=Se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 PT=Se("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"}]]);/**
|
|
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 MS=Se("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"}]]);/**
|
|
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 ec=Se("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"}]]);/**
|
|
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 IT=Se("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"}]]);/**
|
|
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 BT=Se("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"}]]);/**
|
|
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 UT=Se("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 HT=Se("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"}]]);/**
|
|
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 qT=Se("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
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 OS=Se("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 VT=Se("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 af=Se("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"}]]);/**
|
|
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 nx=Se("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 $T=Se("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"}]]);/**
|
|
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 An=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 oh=Se("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"}]]);/**
|
|
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 GT=Se("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"}]]);/**
|
|
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 kr=Se("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"}]]);/**
|
|
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 ax=Se("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"}]]);/**
|
|
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 sf=Se("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"}]]);/**
|
|
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 lh=Se("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"}]]);/**
|
|
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 xd=Se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 ss=Se("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"}]]);/**
|
|
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 zS=Se("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"}]]);/**
|
|
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 FT=Se("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"}]]);/**
|
|
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 Td=Se("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"}]]);/**
|
|
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 YT=Se("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
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 Al=Se("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"}]]);/**
|
|
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 XT=Se("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"}]]);/**
|
|
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 DS=Se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 KT=Se("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"}]]);/**
|
|
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 oo=Se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 rs=Se("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"}]]);/**
|
|
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 LS=Se("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"}]]);/**
|
|
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 QT=Se("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"}]]);/**
|
|
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 PS=Se("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"}]]);/**
|
|
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 ZT=Se("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"}]]);/**
|
|
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 Ml=Se("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"}]]);/**
|
|
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 xo=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 dc=Se("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"}]]),rf={health:5e3,projects:15e3,telegramStatus:8e3,pairList:12e3},Nn={theme:"apx.theme",token:"apx.token",sidebarCollapsed:"apx.sidebar.collapsed",language:"apx.lang",robyChat:"apx.roby.chat"},sx=["total","automatico","permiso"],M1=["sky","violet","emerald","amber","rose","indigo","teal","fuchsia"],JT={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 WT(){if(typeof window>"u")return"dark";const e=localStorage.getItem(Nn.theme);return e==="light"||e==="dark"?e:document.documentElement.classList.contains("dark")?"dark":"light"}const IS=b.createContext(null);function eA({children:e}){const[n,s]=b.useState(WT);b.useEffect(()=>{document.documentElement.classList.toggle("dark",n==="dark");try{localStorage.setItem(Nn.theme,n)}catch{}},[n]);const r=b.useCallback(()=>{s(c=>c==="dark"?"light":"dark")},[]),i=b.useMemo(()=>({theme:n,toggle:r,set:s}),[n,r]);return o.jsx(IS.Provider,{value:i,children:e})}function rx(){const e=b.useContext(IS);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const tA=1367/458,nA=735/1016;function aA({size:e=32,title:n="APX",variant:s="icon"}){const{theme:r}=rx(),i=JT[s][r];if(s==="full"){const c=e,d=Math.round(e*tA);return o.jsx("img",{src:i,alt:n,width:d,height:c,className:"block object-contain",draggable:!1})}if(s==="vertical"){const c=e,d=Math.round(e/nA);return o.jsx("img",{src:i,alt:n,width:c,height:d,className:"block object-contain",draggable:!1})}return o.jsx("img",{src:i,alt:n,width:e,height:e,className:"block object-contain",draggable:!1})}function BS(e){var n,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(s=BS(e[n]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function ox(){for(var e,n,s=0,r="",i=arguments.length;s<i;s++)(e=arguments[s])&&(n=BS(e))&&(r&&(r+=" "),r+=n);return r}const lx="-",sA=e=>{const n=oA(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{const f=d.split(lx);return f[0]===""&&f.length!==1&&f.shift(),US(f,n)||rA(d)},getConflictingClassGroupIds:(d,f)=>{const p=s[d]||[];return f&&r[d]?[...p,...r[d]]:p}}},US=(e,n)=>{if(e.length===0)return n.classGroupId;const s=e[0],r=n.nextPart.get(s),i=r?US(e.slice(1),r):void 0;if(i)return i;if(n.validators.length===0)return;const c=e.join(lx);return n.validators.find(({validator:d})=>d(c))?.classGroupId},O1=/^\[(.+)\]$/,rA=e=>{if(O1.test(e)){const n=O1.exec(e)[1],s=n?.substring(0,n.indexOf(":"));if(s)return"arbitrary.."+s}},oA=e=>{const{theme:n,prefix:s}=e,r={nextPart:new Map,validators:[]};return iA(Object.entries(e.classGroups),s).forEach(([c,d])=>{ih(d,r,c,n)}),r},ih=(e,n,s,r)=>{e.forEach(i=>{if(typeof i=="string"){const c=i===""?n:z1(n,i);c.classGroupId=s;return}if(typeof i=="function"){if(lA(i)){ih(i(r),n,s,r);return}n.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([c,d])=>{ih(d,z1(n,c),s,r)})})},z1=(e,n)=>{let s=e;return n.split(lx).forEach(r=>{s.nextPart.has(r)||s.nextPart.set(r,{nextPart:new Map,validators:[]}),s=s.nextPart.get(r)}),s},lA=e=>e.isThemeGetter,iA=(e,n)=>n?e.map(([s,r])=>{const i=r.map(c=>typeof c=="string"?n+c:typeof c=="object"?Object.fromEntries(Object.entries(c).map(([d,f])=>[n+d,f])):c);return[s,i]}):e,cA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,s=new Map,r=new Map;const i=(c,d)=>{s.set(c,d),n++,n>e&&(n=0,r=s,s=new Map)};return{get(c){let d=s.get(c);if(d!==void 0)return d;if((d=r.get(c))!==void 0)return i(c,d),d},set(c,d){s.has(c)?s.set(c,d):i(c,d)}}},HS="!",uA=e=>{const{separator:n,experimentalParseClassName:s}=e,r=n.length===1,i=n[0],c=n.length,d=f=>{const p=[];let m=0,g=0,x;for(let _=0;_<f.length;_++){let C=f[_];if(m===0){if(C===i&&(r||f.slice(_,_+c)===n)){p.push(f.slice(g,_)),g=_+c;continue}if(C==="/"){x=_;continue}}C==="["?m++:C==="]"&&m--}const y=p.length===0?f:f.substring(g),S=y.startsWith(HS),w=S?y.substring(1):y,j=x&&x>g?x-g:void 0;return{modifiers:p,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:j}};return s?f=>s({className:f,parseClassName:d}):d},dA=e=>{if(e.length<=1)return e;const n=[];let s=[];return e.forEach(r=>{r[0]==="["?(n.push(...s.sort(),r),s=[]):s.push(r)}),n.push(...s.sort()),n},fA=e=>({cache:cA(e.cacheSize),parseClassName:uA(e),...sA(e)}),pA=/\s+/,mA=(e,n)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:i}=n,c=[],d=e.trim().split(pA);let f="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:S}=s(m);let w=!!S,j=r(w?y.substring(0,S):y);if(!j){if(!w){f=m+(f.length>0?" "+f:f);continue}if(j=r(y),!j){f=m+(f.length>0?" "+f:f);continue}w=!1}const _=dA(g).join(":"),C=x?_+HS:_,k=C+j;if(c.includes(k))continue;c.push(k);const R=i(j,w);for(let N=0;N<R.length;++N){const A=R[N];c.push(C+A)}f=m+(f.length>0?" "+f:f)}return f};function gA(){let e=0,n,s,r="";for(;e<arguments.length;)(n=arguments[e++])&&(s=qS(n))&&(r&&(r+=" "),r+=s);return r}const qS=e=>{if(typeof e=="string")return e;let n,s="";for(let r=0;r<e.length;r++)e[r]&&(n=qS(e[r]))&&(s&&(s+=" "),s+=n);return s};function hA(e,...n){let s,r,i,c=d;function d(p){const m=n.reduce((g,x)=>x(g),e());return s=fA(m),r=s.cache.get,i=s.cache.set,c=f,f(p)}function f(p){const m=r(p);if(m)return m;const g=mA(p,s);return i(p,g),g}return function(){return c(gA.apply(null,arguments))}}const Kt=e=>{const n=s=>s[e]||[];return n.isThemeGetter=!0,n},VS=/^\[(?:([a-z-]+):)?(.+)\]$/i,xA=/^\d+\/\d+$/,bA=new Set(["px","full","screen"]),vA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yA=/\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$/,jA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=e=>fl(e)||bA.has(e)||xA.test(e),fr=e=>Ol(e,"length",AA),fl=e=>!!e&&!Number.isNaN(Number(e)),Km=e=>Ol(e,"number",fl),Ai=e=>!!e&&Number.isInteger(Number(e)),wA=e=>e.endsWith("%")&&fl(e.slice(0,-1)),ut=e=>VS.test(e),pr=e=>vA.test(e),CA=new Set(["length","size","percentage"]),kA=e=>Ol(e,CA,$S),EA=e=>Ol(e,"position",$S),NA=new Set(["image","url"]),RA=e=>Ol(e,NA,OA),TA=e=>Ol(e,"",MA),Mi=()=>!0,Ol=(e,n,s)=>{const r=VS.exec(e);return r?r[1]?typeof n=="string"?r[1]===n:n.has(r[1]):s(r[2]):!1},AA=e=>yA.test(e)&&!jA.test(e),$S=()=>!1,MA=e=>_A.test(e),OA=e=>SA.test(e),zA=()=>{const e=Kt("colors"),n=Kt("spacing"),s=Kt("blur"),r=Kt("brightness"),i=Kt("borderColor"),c=Kt("borderRadius"),d=Kt("borderSpacing"),f=Kt("borderWidth"),p=Kt("contrast"),m=Kt("grayscale"),g=Kt("hueRotate"),x=Kt("invert"),y=Kt("gap"),S=Kt("gradientColorStops"),w=Kt("gradientColorStopPositions"),j=Kt("inset"),_=Kt("margin"),C=Kt("opacity"),k=Kt("padding"),R=Kt("saturate"),N=Kt("scale"),A=Kt("sepia"),M=Kt("skew"),O=Kt("space"),L=Kt("translate"),B=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ut,n],z=()=>[ut,n],H=()=>["",Ns,fr],V=()=>["auto",fl,ut],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["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"],Z=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",ut],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[fl,ut];return{cacheSize:500,separator:":",theme:{colors:[Mi],spacing:[Ns,fr],blur:["none","",pr,ut],brightness:U(),borderColor:[e],borderRadius:["none","","full",pr,ut],borderSpacing:z(),borderWidth:H(),contrast:U(),grayscale:$(),hueRotate:U(),invert:$(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[wA,fr],inset:D(),margin:D(),opacity:U(),padding:z(),saturate:U(),scale:U(),sepia:$(),skew:U(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[pr]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...Y(),ut]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ai,ut]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Ai,ut]}],"grid-cols":[{"grid-cols":[Mi]}],"col-start-end":[{col:["auto",{span:["full",Ai,ut]},ut]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[Mi]}],"row-start-end":[{row:["auto",{span:[Ai,ut]},ut]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"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",ut,n]}],"min-w":[{"min-w":[ut,n,"min","max","fit"]}],"max-w":[{"max-w":[ut,n,"none","full","min","max","fit","prose",{screen:[pr]},pr]}],h:[{h:[ut,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,n,"auto","min","max","fit"]}],"font-size":[{text:["base",pr,fr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Km]}],"font-family":[{font:[Mi]}],"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",ut]}],"line-clamp":[{"line-clamp":["none",fl,Km]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ns,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ns,fr]}],"underline-offset":[{"underline-offset":["auto",Ns,ut]}],"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:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],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",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),EA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},RA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[c]}],"rounded-s":[{"rounded-s":[c]}],"rounded-e":[{"rounded-e":[c]}],"rounded-t":[{"rounded-t":[c]}],"rounded-r":[{"rounded-r":[c]}],"rounded-b":[{"rounded-b":[c]}],"rounded-l":[{"rounded-l":[c]}],"rounded-ss":[{"rounded-ss":[c]}],"rounded-se":[{"rounded-se":[c]}],"rounded-ee":[{"rounded-ee":[c]}],"rounded-es":[{"rounded-es":[c]}],"rounded-tl":[{"rounded-tl":[c]}],"rounded-tr":[{"rounded-tr":[c]}],"rounded-br":[{"rounded-br":[c]}],"rounded-bl":[{"rounded-bl":[c]}],"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":[C]}],"border-style":[{border:[...q(),"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":[C]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Ns,ut]}],"outline-w":[{outline:[Ns,fr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Ns,fr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pr,TA]}],"shadow-color":[{shadow:[Mi]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[r]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",pr,ut]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[x]}],saturate:[{saturate:[R]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"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",ut]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ai,ut]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],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",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ns,fr,Km]}],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"]}}},GS=hA(zA);function Oe(...e){return GS(ox(e))}const D1={};function xa(e,n){const s=b.useRef(D1);return s.current===D1&&(s.current=e(n)),s}const ch=[];let uh;function DA(){return uh}function LA(e){ch.push(e)}function FS(e){const n=(s,r)=>{const i=xa(IA).current;let c;try{uh=i;for(const d of ch)d.before(i);c=e(s,r);for(const d of ch)d.after(i);i.didInitialize=!0}finally{uh=void 0}return c};return n.displayName=e.displayName||e.name,n}function PA(e){return b.forwardRef(FS(e))}function IA(){return{didInitialize:!1}}function ix(e){const n=b.useRef(!0);n.current&&(n.current=!1,e())}const BA=()=>{},Me=typeof document<"u"?b.useLayoutEffect:BA;function UA(e,n){return function(r,...i){const c=new URL(e);return c.searchParams.set("code",r.toString()),i.forEach(d=>c.searchParams.append("args[]",d)),`${n} error #${r}; visit ${c} for the full message.`}}const Mn=UA("https://base-ui.com/production-error","Base UI"),YS=b.createContext(void 0);function kc(e){const n=b.useContext(YS);if(n===void 0&&!e)throw new Error(Mn(72));return n}const HA=[];function cx(e){b.useEffect(e,HA)}const Oi=0;class Va{static create(){return new Va}currentId=Oi;start(n,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Oi,s()},n)}isStarted(){return this.currentId!==Oi}clear=()=>{this.currentId!==Oi&&(clearTimeout(this.currentId),this.currentId=Oi)};disposeEffect=()=>this.clear}function na(){const e=xa(Va.create).current;return cx(e.disposeEffect),e}const zl=typeof navigator<"u",Qm=VA(),XS=GA(),KS=$A(),ux=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),QS=Qm.platform==="MacIntel"&&Qm.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Qm.platform),ZS=zl&&/apple/i.test(navigator.vendor),dh=zl&&/android/i.test(XS)||/android/i.test(KS),qA=zl&&XS.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,JS=KS.includes("jsdom/");function VA(){if(!zl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function $A(){if(!zl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:n,version:s})=>`${n}/${s}`).join(" "):navigator.userAgent}function GA(){if(!zl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}function ga(e){e.preventDefault(),e.stopPropagation()}function FA(e){return"nativeEvent"in e}function dx(e){return e.pointerType===""&&e.isTrusted?!0:dh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function WS(e){return JS?!1:!dh&&e.width===0&&e.height===0||dh&&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 lo(e,n){const s=["mouse","pen"];return n||s.push("",void 0),s.includes(e)}function YA(e){const n=e.type;return n==="click"||n==="mousedown"||n==="keydown"||n==="keyup"}function of(){return typeof window<"u"}function Hn(e){return fx(e)?(e.nodeName||"").toLowerCase():"#document"}function Qt(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function os(e){var n;return(n=(fx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function fx(e){return of()?e instanceof Node||e instanceof Qt(e).Node:!1}function ft(e){return of()?e instanceof Element||e instanceof Qt(e).Element:!1}function $t(e){return of()?e instanceof HTMLElement||e instanceof Qt(e).HTMLElement:!1}function vl(e){return!of()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qt(e).ShadowRoot}function Er(e){const{overflow:n,overflowX:s,overflowY:r,display:i}=sa(e);return/auto|scroll|overlay|hidden|clip/.test(n+r+s)&&i!=="inline"&&i!=="contents"}function XA(e){return/^(table|td|th)$/.test(Hn(e))}function lf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const KA=/transform|translate|scale|rotate|perspective|filter/,QA=/paint|layout|strict|content/,Qr=e=>!!e&&e!=="none";let Zm;function px(e){const n=ft(e)?sa(e):e;return Qr(n.transform)||Qr(n.translate)||Qr(n.scale)||Qr(n.rotate)||Qr(n.perspective)||!cf()&&(Qr(n.backdropFilter)||Qr(n.filter))||KA.test(n.willChange||"")||QA.test(n.contain||"")}function ZA(e){let n=Is(e);for(;$t(n)&&!zs(n);){if(px(n))return n;if(lf(n))return null;n=Is(n)}return null}function cf(){return Zm==null&&(Zm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zm}function zs(e){return/^(html|body|#document)$/.test(Hn(e))}function sa(e){return Qt(e).getComputedStyle(e)}function uf(e){return ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Is(e){if(Hn(e)==="html")return e;const n=e.assignedSlot||e.parentNode||vl(e)&&e.host||os(e);return vl(n)?n.host:n}function ew(e){const n=Is(e);return zs(n)?e.ownerDocument?e.ownerDocument.body:e.body:$t(n)&&Er(n)?n:ew(n)}function fc(e,n,s){var r;n===void 0&&(n=[]),s===void 0&&(s=!0);const i=ew(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),d=Qt(i);if(c){const f=fh(d);return n.concat(d,d.visualViewport||[],Er(i)?i:[],f&&s?fc(f):[])}else return n.concat(i,fc(i,[],s))}function fh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ph="data-base-ui-focusable",tw="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",vr="ArrowLeft",yr="ArrowRight",mx="ArrowUp",Ec="ArrowDown";function Pn(e){let n=e.activeElement;for(;n?.shadowRoot?.activeElement!=null;)n=n.shadowRoot.activeElement;return n}function Qe(e,n){if(!e||!n)return!1;const s=n.getRootNode?.();if(e.contains(n))return!0;if(s&&vl(s)){let r=n;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Rn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ad(e,n){if(!ft(e))return!1;const s=e;if(n.hasElement(s))return!s.hasAttribute("data-trigger-disabled");for(const[,r]of n.entries())if(Qe(r,s))return!r.hasAttribute("data-trigger-disabled");return!1}function Jm(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const s=e;return s.target!=null&&n.contains(s.target)}function JA(e){return e.matches("html,body")}function df(e){return $t(e)&&e.matches(tw)}function WA(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${tw}`)!=null}function mh(e){return e?e.getAttribute("role")==="combobox"&&df(e):!1}function eM(e){if(!e||JS)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Md(e){return e?e.hasAttribute(ph)?e:e.querySelector(`[${ph}]`)||e:null}function tM(e,n){return n!=null&&!lo(n)?0:typeof e=="function"?e():e}function Od(e,n,s){const r=tM(e,s);return typeof r=="number"?r:r?.[n]}function L1(e){return typeof e=="function"?e():e}function nw(e,n){return n||e==="click"||e==="mousedown"}function nM(e){return e?.includes("mouse")&&e!=="mousedown"}function Bn(){}const pc=Object.freeze([]),ln=Object.freeze({}),Bs="none",mc="trigger-press",Vn="trigger-hover",bd="trigger-focus",gx="outside-press",Wm="item-press",aM="close-press",ff="focus-out",hx="escape-key",P1="list-navigation",sM="cancel-open",aw="disabled",I1="missing",B1="initial",sw="imperative-action",rM="window-resize";function ot(e,n,s,r){let i=!1,c=!1;const d=r??ln;return{reason:e,event:n??new Event("base-ui"),cancel(){i=!0},allowPropagation(){c=!0},get isCanceled(){return i},get isPropagationAllowed(){return c},trigger:s,...d}}const rw=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Va,currentIdRef:{current:null},currentContextRef:{current:null}});function oM(e){const{children:n,delay:s,timeoutMs:r=0}=e,i=b.useRef(s),c=b.useRef(s),d=b.useRef(null),f=b.useRef(null),p=na();return o.jsx(rw.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:c,currentIdRef:d,timeoutMs:r,currentContextRef:f,timeout:p}),[r,p]),children:n})}function lM(e,n={open:!1}){const{open:s}=n,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),c=b.useContext(rw),{currentIdRef:d,delayRef:f,timeoutMs:p,initialDelayRef:m,currentContextRef:g,hasProvider:x,timeout:y}=c,[S,w]=b.useState(!1);return Me(()=>{function j(){w(!1),g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,f.current=m.current}if(d.current&&!s&&d.current===i){if(w(!1),p){const _=i;return y.start(p,()=>{r.select("open")||d.current&&d.current!==_||j()}),()=>{y.clear()}}j()}},[s,i,d,f,p,m,g,y,r]),Me(()=>{if(!s)return;const j=g.current,_=d.current;y.clear(),g.current={onOpenChange:r.setOpen,setIsInstantPhase:w},d.current=i,f.current={open:0,close:Od(m.current,"close")},_!==null&&_!==i?(w(!0),j?.setIsInstantPhase(!0),j?.onOpenChange(!1,ot(Bs))):(w(!1),j?.setIsInstantPhase(!1))},[s,i,r,d,f,m,g,y]),Me(()=>()=>{g.current=null},[g]),b.useMemo(()=>({hasProvider:x,delayRef:f,isInstantPhase:S}),[x,f,S])}function pt(e,n,s,r){return e.addEventListener(n,s,r),()=>{e.removeEventListener(n,s,r)}}function ts(...e){return()=>{for(let n=0;n<e.length;n+=1){const s=e[n];s&&s()}}}function Us(e,n,s,r){const i=xa(ow).current;return cM(i,e,n,s,r)&&lw(i,[e,n,s,r]),i.callback}function iM(e){const n=xa(ow).current;return uM(n,e)&&lw(n,e),n.callback}function ow(){return{callback:null,cleanup:null,refs:[]}}function cM(e,n,s,r,i){return e.refs[0]!==n||e.refs[1]!==s||e.refs[2]!==r||e.refs[3]!==i}function uM(e,n){return e.refs.length!==n.length||e.refs.some((s,r)=>s!==n[r])}function lw(e,n){if(e.refs=n,n.every(s=>s==null)){e.callback=null;return}e.callback=s=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),s!=null){const r=Array(n.length).fill(null);for(let i=0;i<n.length;i+=1){const c=n[i];if(c!=null)switch(typeof c){case"function":{const d=c(s);typeof d=="function"&&(r[i]=d);break}case"object":{c.current=s;break}}}e.cleanup=()=>{for(let i=0;i<n.length;i+=1){const c=n[i];if(c!=null)switch(typeof c){case"function":{const d=r[i];typeof d=="function"?d():c(null);break}case"object":{c.current=null;break}}}}}}}function pn(e){const n=xa(dM,e).current;return n.next=e,Me(n.effect),n}function dM(e){const n={current:e,next:e,effect:()=>{n.current=n.next}};return n}const xx={...vN},eg=xx.useInsertionEffect,fM=eg&&eg!==xx.useLayoutEffect?eg:e=>e();function Le(e){const n=xa(pM).current;return n.next=e,fM(n.effect),n.trampoline}function pM(){const e={next:void 0,callback:mM,trampoline:(...n)=>e.callback?.(...n),effect:()=>{e.callback=e.next}};return e}function mM(){}const Yu=null;class gM{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=n=>{this.isScheduled=!1;const s=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<s.length;i+=1)s[i]?.(n)};request(n){const s=this.nextId;return this.nextId+=1,this.callbacks.push(n),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(n){const s=n-this.startId;s<0||s>=this.callbacks.length||(this.callbacks[s]=null,this.callbacksCount-=1)}}const Xu=new gM;class Za{static create(){return new Za}static request(n){return Xu.request(n)}static cancel(n){return Xu.cancel(n)}currentId=Yu;request(n){this.cancel(),this.currentId=Xu.request(()=>{this.currentId=Yu,n()})}cancel=()=>{this.currentId!==Yu&&(Xu.cancel(this.currentId),this.currentId=Yu)};disposeEffect=()=>this.cancel}function yl(){const e=xa(Za.create).current;return cx(e.disposeEffect),e}function yt(e){return e?.ownerDocument||document}const iw={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},bx={...iw,position:"fixed",top:0,left:0},cw={...iw,position:"absolute"},zd=b.forwardRef(function(n,s){const[r,i]=b.useState();Me(()=>{ZS&&i("button")},[]);const c={tabIndex:0,role:r};return o.jsx("span",{...n,ref:s,style:bx,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})}),hM=["top","right","bottom","left"],jl=Math.min,ha=Math.max,Dd=Math.round,to=Math.floor,ns=e=>({x:e,y:e}),xM={left:"right",right:"left",bottom:"top",top:"bottom"};function gh(e,n,s){return ha(e,jl(n,s))}function Hs(e,n){return typeof e=="function"?e(n):e}function aa(e){return e.split("-")[0]}function Nr(e){return e.split("-")[1]}function vx(e){return e==="x"?"y":"x"}function yx(e){return e==="y"?"height":"width"}function Ta(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function jx(e){return vx(Ta(e))}function bM(e,n,s){s===void 0&&(s=!1);const r=Nr(e),i=jx(e),c=yx(i);let d=i==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(d=Ld(d)),[d,Ld(d)]}function vM(e){const n=Ld(e);return[hh(e),n,hh(n)]}function hh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const U1=["left","right"],H1=["right","left"],yM=["top","bottom"],jM=["bottom","top"];function _M(e,n,s){switch(e){case"top":case"bottom":return s?n?H1:U1:n?U1:H1;case"left":case"right":return n?yM:jM;default:return[]}}function SM(e,n,s,r){const i=Nr(e);let c=_M(aa(e),s==="start",r);return i&&(c=c.map(d=>d+"-"+i),n&&(c=c.concat(c.map(hh)))),c}function Ld(e){const n=aa(e);return xM[n]+e.slice(n.length)}function wM(e){return{top:0,right:0,bottom:0,left:0,...e}}function uw(e){return typeof e!="number"?wM(e):{top:e,right:e,bottom:e,left:e}}function gc(e){const{x:n,y:s,width:r,height:i}=e;return{width:r,height:i,top:s,left:n,right:n+r,bottom:s+i,x:n,y:s}}function Ku(e,n,s){return Math.floor(e/n)!==s}function hc(e,n){return n<0||n>=e.length}function vd(e,n){return Ln(e.current,{disabledIndices:n})}function xh(e,n){return Ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function Ln(e,{startingIndex:n=-1,decrement:s=!1,disabledIndices:r,amount:i=1}={}){let c=n;do c+=s?-i:i;while(c>=0&&c<=e.length-1&&Ds(e,c,r));return c}function dw(e,{event:n,orientation:s,loopFocus:r,onLoop:i,rtl:c,cols:d,disabledIndices:f,minIndex:p,maxIndex:m,prevIndex:g,stopEvent:x=!1}){let y=g,S;if(n.key===mx?S="up":n.key===Ec&&(S="down"),S){const w=[],j=[];let _=!1,C=0;{let B=null,I=-1;e.forEach((D,z)=>{if(D==null)return;C+=1;const H=D.closest('[role="row"]');H&&(_=!0),(H!==B||I===-1)&&(B=H,I+=1,w[I]=[]),w[I].push(z),j[z]=I})}let k=!1,R=0;if(_)for(const B of w){const I=B.length;I>R&&(R=I),I!==d&&(k=!0)}const N=k&&C<e.length,A=R||d,M=B=>{if(!k||g===-1)return;const I=j[g];if(I==null)return;const D=w[I].indexOf(g),z=B==="up"?-1:1;for(let H=I+z,V=0;V<w.length;V+=1,H+=z){if(H<0||H>=w.length){if(!r||N)return;if(H=H<0?w.length-1:0,i){const q=Math.min(D,w[H].length-1),F=w[H][q]??w[H][0],Z=i(n,g,F);H=j[Z]??H}}const Y=w[H];for(let q=Math.min(D,Y.length-1);q>=0;q-=1){const F=Y[q];if(!Ds(e,F,f))return F}}},O=B=>{if(!N||g===-1)return;const I=g%A,D=B==="up"?-A:A,z=m-m%A,H=to(m/A)+1;for(let V=g-I+D,Y=0;Y<H;Y+=1,V+=D){if(V<0||V>m){if(!r)return;V=V<0?z:0}const q=Math.min(V+A-1,m);for(let F=Math.min(V+I,q);F>=V;F-=1)if(!Ds(e,F,f))return F}};x&&ga(n);const L=M(S)??O(S);if(L!==void 0)y=L;else if(g===-1)y=S==="up"?m:p;else if(y=Ln(e,{startingIndex:g,amount:A,decrement:S==="up",disabledIndices:f}),r){if(S==="up"&&(g-A<p||y<0)){const B=g%A,I=m%A,D=m-(I-B);I===B?y=m:y=I>B?D:D-A,i&&(y=i(n,g,y))}S==="down"&&g+A>m&&(y=Ln(e,{startingIndex:g%A-A,amount:A,disabledIndices:f}),i&&(y=i(n,g,y)))}hc(e,y)&&(y=g)}if(s==="both"){const w=to(g/d);n.key===(c?vr:yr)&&(x&&ga(n),g%d!==d-1?(y=Ln(e,{startingIndex:g,disabledIndices:f}),r&&Ku(y,d,w)&&(y=Ln(e,{startingIndex:g-g%d-1,disabledIndices:f}),i&&(y=i(n,g,y)))):r&&(y=Ln(e,{startingIndex:g-g%d-1,disabledIndices:f}),i&&(y=i(n,g,y))),Ku(y,d,w)&&(y=g)),n.key===(c?yr:vr)&&(x&&ga(n),g%d!==0?(y=Ln(e,{startingIndex:g,decrement:!0,disabledIndices:f}),r&&Ku(y,d,w)&&(y=Ln(e,{startingIndex:g+(d-g%d),decrement:!0,disabledIndices:f}),i&&(y=i(n,g,y)))):r&&(y=Ln(e,{startingIndex:g+(d-g%d),decrement:!0,disabledIndices:f}),i&&(y=i(n,g,y))),Ku(y,d,w)&&(y=g));const j=to(m/d)===w;hc(e,y)&&(r&&j?(y=n.key===(c?yr:vr)?m:Ln(e,{startingIndex:g-g%d-1,disabledIndices:f}),i&&(y=i(n,g,y))):y=g)}return y}function fw(e,n,s){const r=[];let i=0;return e.forEach(({width:c,height:d},f)=>{let p=!1;for(s&&(i=0);!p;){const m=[];for(let g=0;g<c;g+=1)for(let x=0;x<d;x+=1)m.push(i+g+x*n);i%n+c<=n&&m.every(g=>r[g]==null)?(m.forEach(g=>{r[g]=f}),p=!0):i+=1}}),[...r]}function pw(e,n,s,r,i){if(e===-1)return-1;const c=s.indexOf(e),d=n[e];switch(i){case"tl":return c;case"tr":return d?c+d.width-1:c;case"bl":return d?c+(d.height-1)*r:c;case"br":return s.lastIndexOf(e);default:return-1}}function mw(e,n){return n.flatMap((s,r)=>e.includes(s)?[r]:[])}function Ds(e,n,s){if(typeof s=="function"?s(n):s?.includes(n)??!1)return!0;const i=e[n];return i?pf(i)?!s&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function CM(e){return e.visibility==="hidden"||e.visibility==="collapse"}function pf(e,n=e?sa(e):null){return!e||!e.isConnected||!n||CM(n)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():n.display!=="none"&&n.display!=="contents"}const kM='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function EM(e){const n=e.assignedSlot;if(n)return n;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return vl(s)?s.host:null}function bh(e){for(const n of Array.from(e.children))if(Hn(n)==="summary")return n;return null}function NM(e,n){const s=bh(n);return!!s&&(e===s||Qe(s,e))}function gw(e){const n=e?Hn(e):"";return e!=null&&e.matches(kM)&&(n!=="summary"||e.parentElement!=null&&Hn(e.parentElement)==="details"&&bh(e.parentElement)===e)&&(n!=="details"||bh(e)==null)&&(n!=="input"||e.type!=="hidden")}function hw(e){if(!gw(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let n=e;n;n=EM(n)){const s=n!==e,r=Hn(n)==="slot";if(n.hasAttribute("inert")||s&&Hn(n)==="details"&&!n.open&&!NM(e,n)||n.hasAttribute("hidden")||!r&&!RM(n,s))return!1}return!0}function RM(e,n){const s=sa(e);return n?s.display!=="none":pf(e,s)}function xw(e){const n=e.tabIndex;if(n<0){const s=Hn(e);if(s==="details"||s==="audio"||s==="video"||$t(e)&&e.isContentEditable)return 0}return n}function tg(e){if(Hn(e)!=="input")return null;const n=e;return n.type==="radio"&&n.name!==""?n:null}function TM(e,n){const s=tg(e);if(!s)return!0;const r=n.find(i=>{const c=tg(i);return c?.name===s.name&&c.form===s.form&&c.checked});return r?r===s:n.find(i=>{const c=tg(i);return c?.name===s.name&&c.form===s.form})===s}function bw(e){if($t(e)&&Hn(e)==="slot"){const n=e.assignedElements({flatten:!0});if(n.length>0)return n}return $t(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function vw(e,n){bw(e).forEach(s=>{gw(s)&&n.push(s),vw(s,n)})}function yw(e,n,s){bw(e).forEach(r=>{$t(r)&&r.matches(n)&&s.push(r),yw(r,n,s)})}function _x(e){return hw(e)&&xw(e)>=0}function jw(e){const n=[];return vw(e,n),n.filter(hw)}function mf(e){const n=jw(e);return n.filter(s=>xw(s)>=0&&TM(s,n))}function _w(e,n){const s=mf(e),r=s.length;if(r===0)return;const i=Pn(yt(e)),c=s.indexOf(i),d=c===-1?n===1?0:r-1:c+n;return s[d]}function Sw(e){return _w(yt(e).body,1)||e}function ww(e){return _w(yt(e).body,-1)||e}function tc(e,n){const s=n||e.currentTarget,r=e.relatedTarget;return!r||!Qe(s,r)}function AM(e){mf(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function q1(e){const n=[];yw(e,"[data-tabindex]",n),n.forEach(s=>{const r=s.dataset.tabindex;delete s.dataset.tabindex,r?s.setAttribute("tabindex",r):s.removeAttribute("tabindex")})}function Sr(e,n,s=!0){return e.filter(i=>i.parentId===n).flatMap(i=>[...!s||i.context?.open?[i]:[],...Sr(e,i.id,s)])}function V1(e,n){let s=[],r=e.find(i=>i.id===n)?.parentId;for(;r;){const i=e.find(c=>c.id===r);r=i?.parentId,i&&(s=s.concat(i))}return s}function xc(e){return`data-base-ui-${e}`}let Qu=0;function yd(e,n={}){const{preventScroll:s=!1,sync:r=!1,shouldFocus:i}=n;cancelAnimationFrame(Qu);function c(){i&&!i()||e?.focus({preventScroll:s})}if(r)return c(),Bn;const d=requestAnimationFrame(c);return Qu=d,()=>{Qu===d&&(cancelAnimationFrame(d),Qu=0)}}const ng={inert:new WeakMap,"aria-hidden":new WeakMap},$1="data-base-ui-inert",vh={inert:new WeakSet,"aria-hidden":new WeakSet};let zi=new WeakMap,ag=0;function MM(e){return vh[e]}function Cw(e){return e?vl(e)?e.host:Cw(e.parentNode):null}const sg=(e,n)=>n.map(s=>{if(e.contains(s))return s;const r=Cw(s);return e.contains(r)?r:null}).filter(s=>s!=null),G1=e=>{const n=new Set;return e.forEach(s=>{let r=s;for(;r&&!n.has(r);)n.add(r),r=r.parentNode}),n},F1=(e,n,s)=>{const r=[],i=c=>{!c||s.has(c)||Array.from(c.children).forEach(d=>{Hn(d)!=="script"&&(n.has(d)?i(d):r.push(d))})};return i(e),r};function OM(e,n,s,r,{mark:i=!0,markerIgnoreElements:c=[]}){const d=r?"inert":s?"aria-hidden":null;let f=null,p=null;const m=sg(n,e),g=i?sg(n,c):[],x=new Set(g),y=i?F1(n,G1(m),new Set(m)).filter(j=>!x.has(j)):[],S=[],w=[];if(d){const j=ng[d],_=MM(d);p=_,f=j;const C=sg(n,Array.from(n.querySelectorAll("[aria-live]"))),k=m.concat(C);F1(n,G1(k),new Set(k)).forEach(N=>{const A=N.getAttribute(d),M=A!==null&&A!=="false",O=(j.get(N)||0)+1;j.set(N,O),S.push(N),O===1&&M&&_.add(N),M||N.setAttribute(d,d==="inert"?"":"true")})}return i&&y.forEach(j=>{const _=(zi.get(j)||0)+1;zi.set(j,_),w.push(j),_===1&&j.setAttribute($1,"")}),ag+=1,()=>{f&&S.forEach(j=>{const C=(f.get(j)||0)-1;f.set(j,C),C||(!p?.has(j)&&d&&j.removeAttribute(d),p?.delete(j))}),i&&w.forEach(j=>{const _=(zi.get(j)||0)-1;zi.set(j,_),_||j.removeAttribute($1)}),ag-=1,ag||(ng.inert=new WeakMap,ng["aria-hidden"]=new WeakMap,vh.inert=new WeakSet,vh["aria-hidden"]=new WeakSet,zi=new WeakMap)}}function Y1(e,n={}){const{ariaHidden:s=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:c=[]}=n,d=yt(e[0]).body;return OM(e,d,s,r,{mark:i,markerIgnoreElements:c})}let X1=0;function zM(e,n="mui"){const[s,r]=b.useState(e),i=e||s;return b.useEffect(()=>{s==null&&(X1+=1,r(`${n}-${X1}`))},[s,n]),i}const K1=xx.useId;function gf(e,n){if(K1!==void 0){const s=K1();return e??(n?`${n}-${s}`:s)}return zM(e,n)}const DM=parseInt(b.version,10);function Sx(e){return DM>=e}function Q1(e){if(!b.isValidElement(e))return null;const n=e,s=n.props;return(Sx(19)?s?.ref:n.ref)??null}function yh(e,n){if(e&&!n)return e;if(!e&&n)return n;if(e||n)return{...e,...n}}function LM(e,n){const s={};for(const r in e){const i=e[r];if(n?.hasOwnProperty(r)){const c=n[r](i);c!=null&&Object.assign(s,c);continue}i===!0?s[`data-${r.toLowerCase()}`]="":i&&(s[`data-${r.toLowerCase()}`]=i.toString())}return s}function PM(e,n){return typeof e=="function"?e(n):e}function IM(e,n){return typeof e=="function"?e(n):e}const wx={};function Ma(e,n,s,r,i){if(!s&&!r&&!i&&!e)return Pd(n);let c=Pd(e);return n&&(c=Yi(c,n)),s&&(c=Yi(c,s)),r&&(c=Yi(c,r)),i&&(c=Yi(c,i)),c}function BM(e){if(e.length===0)return wx;if(e.length===1)return Pd(e[0]);let n=Pd(e[0]);for(let s=1;s<e.length;s+=1)n=Yi(n,e[s]);return n}function Pd(e){return Cx(e)?{...Ew(e,wx)}:UM(e)}function Yi(e,n){return Cx(n)?Ew(n,e):HM(e,n)}function UM(e){const n={...e};for(const s in n){const r=n[s];kw(s,r)&&(n[s]=Nw(r))}return n}function HM(e,n){if(!n)return e;for(const s in n){const r=n[s];switch(s){case"style":{e[s]=yh(e.style,r);break}case"className":{e[s]=Rw(e.className,r);break}default:kw(s,r)?e[s]=qM(e[s],r):e[s]=r}}return e}function kw(e,n){const s=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return s===111&&r===110&&i>=65&&i<=90&&(typeof n=="function"||typeof n>"u")}function Cx(e){return typeof e=="function"}function Ew(e,n){return Cx(e)?e(n):e??wx}function qM(e,n){return n?e?(...s)=>{const r=s[0];if(Tw(r)){const c=r;Id(c);const d=n(...s);return c.baseUIHandlerPrevented||e?.(...s),d}const i=n(...s);return e?.(...s),i}:Nw(n):e}function Nw(e){return e&&((...n)=>{const s=n[0];return Tw(s)&&Id(s),e(...n)})}function Id(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Rw(e,n){return n?e?n+" "+e:n:e}function Tw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ht(e,n,s={}){const r=n.render,i=VM(n,s);if(s.enabled===!1)return null;const c=s.state??ln;return FM(e,r,i,c)}function VM(e,n={}){const{className:s,style:r,render:i}=e,{state:c=ln,ref:d,props:f,stateAttributesMapping:p,enabled:m=!0}=n,g=m?PM(s,c):void 0,x=m?IM(r,c):void 0,y=m?LM(c,p):ln,S=m&&f?$M(f):void 0,w=m?yh(y,S)??{}:ln;return typeof document<"u"&&(m?Array.isArray(d)?w.ref=iM([w.ref,Q1(i),...d]):w.ref=Us(w.ref,Q1(i),d):Us(null,null)),m?(g!==void 0&&(w.className=Rw(w.className,g)),x!==void 0&&(w.style=yh(w.style,x)),w):ln}function $M(e){return Array.isArray(e)?BM(e):Ma(void 0,e)}const GM=Symbol.for("react.lazy");function FM(e,n,s,r){if(n){if(typeof n=="function")return n(s,r);const i=Ma(s,n.props);i.ref=s.ref;let c=n;return c?.$$typeof===GM&&(c=b.Children.toArray(n)[0]),b.cloneElement(c,i)}if(e&&typeof e=="string")return YM(e,s);throw new Error(Mn(8))}function YM(e,n){return e==="button"?b.createElement("button",{type:"button",...n,key:n.key}):e==="img"?b.createElement("img",{alt:"",...n,key:n.key}):b.createElement(e,n)}const XM={style:{transition:"none"}},KM="data-base-ui-click-trigger",QM={fallbackAxisSide:"none"},ZM={fallbackAxisSide:"end"},JM={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Aw=b.createContext(null),Mw=()=>b.useContext(Aw),WM=xc("portal");function Ow(e={}){const{ref:n,container:s,componentProps:r=ln,elementProps:i}=e,c=gf(),f=Mw()?.portalNode,[p,m]=b.useState(null),[g,x]=b.useState(null),y=Le(_=>{_!==null&&x(_)}),S=b.useRef(null);Me(()=>{if(s===null){S.current&&(S.current=null,x(null),m(null));return}if(c==null)return;const _=(s&&(fx(s)?s:s.current))??f??document.body;if(_==null){S.current&&(S.current=null,x(null),m(null));return}S.current!==_&&(S.current=_,x(null),m(_))},[s,f,c]);const w=Ht("div",r,{ref:[n,y],props:[{id:c,[WM]:""},i]});return{portalNode:g,portalSubtree:p&&w?Cr.createPortal(w,p):null}}const zw=b.forwardRef(function(n,s){const{render:r,className:i,style:c,children:d,container:f,renderGuards:p,...m}=n,{portalNode:g,portalSubtree:x}=Ow({container:f,ref:s,componentProps:n,elementProps:m}),y=b.useRef(null),S=b.useRef(null),w=b.useRef(null),j=b.useRef(null),[_,C]=b.useState(null),k=b.useRef(!1),R=_?.modal,N=_?.open,A=typeof p=="boolean"?p:!!_&&!_.modal&&_.open&&!!g;b.useEffect(()=>{if(!g||R)return;function O(L){g&&L.relatedTarget&&tc(L)&&(L.type==="focusin"?k.current&&(q1(g),k.current=!1):(AM(g),k.current=!0))}return ts(pt(g,"focusin",O,!0),pt(g,"focusout",O,!0))},[g,R]),b.useEffect(()=>{!g||N!==!1||(q1(g),k.current=!1)},[N,g]);const M=b.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:S,beforeInsideRef:w,afterInsideRef:j,portalNode:g,setFocusManagerState:C}),[g]);return o.jsxs(b.Fragment,{children:[x,o.jsxs(Aw.Provider,{value:M,children:[A&&g&&o.jsx(zd,{"data-type":"outside",ref:y,onFocus:O=>{if(tc(O,g))w.current?.focus();else{const L=_?_.domReference:null;ww(L)?.focus()}}}),A&&g&&o.jsx("span",{"aria-owns":g.id,style:JM}),g&&Cr.createPortal(d,g),A&&g&&o.jsx(zd,{"data-type":"outside",ref:S,onFocus:O=>{if(tc(O,g))j.current?.focus();else{const L=_?_.domReference:null;Sw(L)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,ot(ff,O.nativeEvent))}}})]})]})});function e3(){const e=new Map;return{emit(n,s){e.get(n)?.forEach(r=>r(s))},on(n,s){e.has(n)||e.set(n,new Set),e.get(n).add(s)},off(n,s){e.get(n)?.delete(s)}}}const t3=b.createContext(null),n3=b.createContext(null),hf=()=>b.useContext(t3)?.id||null,Dl=e=>{const n=b.useContext(n3);return e??n};function As(e){return e==null?e:"current"in e?e.current:e}function a3(e,n){const s=Qt(Rn(e));return e instanceof s.KeyboardEvent?"keyboard":e instanceof s.FocusEvent?n||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof s.MouseEvent?n||(e.detail===0?"keyboard":"mouse"):""}const Z1=20;let xr=[];function kx(){xr=xr.filter(e=>e.deref()?.isConnected)}function s3(e){kx(),e&&Hn(e)!=="body"&&(xr.push(new WeakRef(e)),xr.length>Z1&&(xr=xr.slice(-Z1)))}function rg(){return kx(),xr[xr.length-1]?.deref()}function r3(e){return e?_x(e)?e:mf(e)[0]||e:null}function J1(e,n){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!n.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=jw(e).filter(c=>{const d=c.getAttribute("data-tabindex")||"";return _x(c)||c.hasAttribute("data-tabindex")&&!d.startsWith("-")}),i=e.getAttribute("tabindex");n.current.includes("floating")||r.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Dw(e){const{context:n,children:s,disabled:r=!1,initialFocus:i=!0,returnFocus:c=!0,restoreFocus:d=!1,modal:f=!0,closeOnFocusOut:p=!0,openInteractionType:m="",nextFocusableElement:g,previousFocusableElement:x,beforeContentFocusGuardRef:y,externalTree:S,getInsideElements:w}=e,j="rootStore"in n?n.rootStore:n,_=j.useState("open"),C=j.useState("domReferenceElement"),k=j.useState("floatingElement"),{events:R,dataRef:N}=j.context,A=Le(()=>N.current.floatingContext?.nodeId),M=i===!1,O=mh(C)&&M,L=b.useRef(["content"]),B=pn(i),I=pn(c),D=pn(m),z=Dl(S),H=Mw(),V=b.useRef(!1),Y=b.useRef(!1),q=b.useRef(!1),F=b.useRef(null),Z=b.useRef(""),$=b.useRef(""),X=b.useRef(null),U=b.useRef(null),K=Us(X,y,H?.beforeInsideRef),G=Us(U,H?.afterInsideRef),W=na(),ie=na(),re=yl(),oe=H!=null,ce=Md(k),ee=Le((be=ce)=>be?mf(be):[]),Te=Le(()=>w?.().filter(be=>be!=null)??[]);b.useEffect(()=>{if(r||!f)return;function be(Ee){Ee.key==="Tab"&&Qe(ce,Pn(yt(ce)))&&ee().length===0&&!O&&ga(Ee)}const Ce=yt(ce);return pt(Ce,"keydown",be)},[r,ce,f,O,ee]),b.useEffect(()=>{if(r||!_)return;const be=yt(ce);function Ce(){q.current=!1}function Ee(Ie){const xe=Rn(Ie),Ae=Te(),_e=Qe(k,xe)||Qe(C,xe)||Qe(H?.portalNode,xe)||Ae.some(Be=>Be===xe||Qe(Be,xe));q.current=!_e,$.current=Ie.pointerType||"keyboard",xe?.closest(`[${KM}]`)&&(Y.current=!0)}function Pe(){$.current="keyboard"}return ts(pt(be,"pointerdown",Ee,!0),pt(be,"pointerup",Ce,!0),pt(be,"pointercancel",Ce,!0),pt(be,"keydown",Pe,!0))},[r,k,C,ce,_,H,Te]),b.useEffect(()=>{if(r||!p)return;const be=yt(ce);function Ce(){Y.current=!0,ie.start(0,()=>{Y.current=!1})}function Ee(Ae){const _e=Rn(Ae);_x(_e)&&(F.current=_e)}function Pe(Ae){const _e=Ae.relatedTarget,Be=Ae.currentTarget,Fe=Rn(Ae);queueMicrotask(()=>{const Ge=A(),De=j.context.triggerElements,ye=Te(),le=_e?.hasAttribute(xc("focus-guard"))&&[X.current,U.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,As(x),As(g)].includes(_e),je=!(Qe(C,_e)||Qe(k,_e)||Qe(_e,k)||Qe(H?.portalNode,_e)||ye.some(we=>we===_e||Qe(we,_e))||_e!=null&&De.hasElement(_e)||De.hasMatchingElement(we=>Qe(we,_e))||le||z&&(Sr(z.nodesRef.current,Ge).find(we=>Qe(we.context?.elements.floating,_e)||Qe(we.context?.elements.domReference,_e))||V1(z.nodesRef.current,Ge).find(we=>[we.context?.elements.floating,Md(we.context?.elements.floating)].includes(_e)||we.context?.elements.domReference===_e)));if(Be===C&&ce&&J1(ce,L),d&&Be!==C&&!pf(Fe)&&Pn(be)===be.body){if($t(ce)&&(ce.focus(),d==="popup")){re.request(()=>{ce.focus()});return}const we=ee(),Ue=F.current,We=(Ue&&we.includes(Ue)?Ue:null)||we[we.length-1]||ce;$t(We)&&We.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(O||!f)&&_e&&je&&!Y.current&&(O||_e!==rg())&&(V.current=!0,j.setOpen(!1,ot(ff,Ae)))})}function Ie(){q.current||(N.current.insideReactTree=!0,W.start(0,()=>{N.current.insideReactTree=!1}))}const xe=$t(C)?C:null;if(!(!k&&!xe))return ts(xe&&pt(xe,"focusout",Pe),xe&&pt(xe,"pointerdown",Ce),k&&pt(k,"focusin",Ee),k&&pt(k,"focusout",Pe),k&&H&&pt(k,"focusout",Ie,!0))},[r,C,k,ce,f,z,H,j,p,d,ee,O,A,L,N,W,ie,re,g,x,Te]),b.useEffect(()=>{if(r||!k||!_)return;const be=Array.from(H?.portalNode?.querySelectorAll(`[${xc("portal")}]`)||[]),Ee=(z?V1(z.nodesRef.current,A()):[]).find(Be=>mh(Be.context?.elements.domReference||null))?.context?.elements.domReference,Ie=[...[k,...be,X.current,U.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...Te()],Ee,As(x),As(g),O?C:null].filter(Be=>Be!=null),xe=Y1(Ie,{ariaHidden:f||O,mark:!1}),Ae=[k,...be].filter(Be=>Be!=null),_e=Y1(Ae);return()=>{_e(),xe()}},[_,r,C,k,f,H,O,z,A,g,x,Te]),Me(()=>{if(!_||r||!$t(ce))return;const be=yt(ce),Ce=Pn(be);queueMicrotask(()=>{const Ee=B.current,Pe=typeof Ee=="function"?Ee(D.current||""):Ee;if(Pe===void 0||Pe===!1||Qe(ce,Ce))return;let xe=null;const Ae=()=>(xe==null&&(xe=ee(ce)),xe[0]||ce);let _e;Pe===!0||Pe===null?_e=Ae():_e=As(Pe),_e=_e||Ae();const Be=Qe(ce,Pn(be));yd(_e,{preventScroll:_e===ce,shouldFocus(){if(Be)return!0;const Fe=Pn(be);return!(Fe!==_e&&Qe(ce,Fe))}})})},[r,_,ce,ee,B,D]),Me(()=>{if(r||!ce)return;const be=yt(ce),Ce=Pn(be);s3(Ce);function Ee(Ie){if(Ie.open||(Z.current=a3(Ie.nativeEvent,$.current)),Ie.reason===Vn&&Ie.nativeEvent.type==="mouseleave"&&(V.current=!0),Ie.reason===gx)if(Ie.nested)V.current=!1;else if(dx(Ie.nativeEvent)||WS(Ie.nativeEvent))V.current=!1;else{let xe=!1;yt(ce).createElement("div").focus({get preventScroll(){return xe=!0,!1}}),xe?V.current=!1:V.current=!0}}R.on("openchange",Ee);function Pe(){const Ie=I.current;let xe=typeof Ie=="function"?Ie(Z.current):Ie;if(xe===void 0||xe===!1)return null;if(xe===null&&(xe=!0),typeof xe=="boolean")return C?.isConnected?C:rg()||null;const Ae=C?.isConnected?C:rg();return As(xe)||Ae||null}return()=>{R.off("openchange",Ee);const Ie=Pn(be),xe=Te(),Ae=Qe(k,Ie)||xe.some(Fe=>Fe===Ie||Qe(Fe,Ie))||z&&Sr(z.nodesRef.current,A(),!1).some(Fe=>Qe(Fe.context?.elements.floating,Ie)),_e=I.current,Be=Pe();queueMicrotask(()=>{const Fe=r3(Be),Ge=typeof _e!="boolean";_e&&!V.current&&$t(Fe)&&(!(!Ge&&Fe!==Ie&&Ie!==be.body)||Ae)&&Fe.focus({preventScroll:!0}),V.current=!1})}},[r,k,ce,I,R,z,C,A,Te]),Me(()=>{if(!ux||_||!k)return;const be=Pn(yt(k));!$t(be)||!df(be)||Qe(k,be)&&be.blur()},[_,k]),Me(()=>{if(!(r||!H))return H.setFocusManagerState({modal:f,closeOnFocusOut:p,open:_,onOpenChange:j.setOpen,domReference:C}),()=>{H.setFocusManagerState(null)}},[r,H,f,_,j,p,C]),Me(()=>{if(!(r||!ce))return J1(ce,L),()=>{queueMicrotask(kx)}},[r,ce,L]);const $e=!r&&(f?!O:!0)&&(oe||f);return o.jsxs(b.Fragment,{children:[$e&&o.jsx(zd,{"data-type":"inside",ref:K,onFocus:be=>{if(f){const Ce=ee();yd(Ce[Ce.length-1])}else H?.portalNode&&(V.current=!1,tc(be,H.portalNode)?Sw(C)?.focus():As(x??H.beforeOutsideRef)?.focus())}}),s,$e&&o.jsx(zd,{"data-type":"inside",ref:G,onFocus:be=>{f?yd(ee()[0]):H?.portalNode&&(p&&(V.current=!0),tc(be,H.portalNode)?ww(C)?.focus():As(g??H.afterOutsideRef)?.focus())}})]})}function o3(e,n={}){const{enabled:s=!0,event:r="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:f=0,reason:p=mc}=n,m="rootStore"in e?e.rootStore:e,g=m.context.dataRef,x=b.useRef(void 0),y=yl(),S=na(),w=b.useMemo(()=>{function j(C,k,R,N){const A=ot(p,k,R);C&&N==="touch"&&f>0?S.start(f,()=>{m.setOpen(!0,A)}):m.setOpen(C,A)}function _(C,k,R){const N=g.current.openEvent,A=m.select("domReferenceElement")!==k;return C&&A||!C||!i?!0:N&&d?!R(N.type):!1}return{onPointerDown(C){x.current=C.pointerType},onMouseDown(C){const k=x.current,R=C.nativeEvent,N=m.select("open");if(C.button!==0||r==="click"||lo(k,!0)&&c)return;const A=_(N,C.currentTarget,L=>L==="click"||L==="mousedown"),M=Rn(R);if(df(M)){j(A,R,M,k);return}const O=C.currentTarget;y.request(()=>{j(A,R,O,k)})},onClick(C){if(r==="mousedown-only")return;const k=x.current;if(r==="mousedown"&&k){x.current=void 0;return}if(lo(k,!0)&&c)return;const R=m.select("open"),N=_(R,C.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");j(N,C.nativeEvent,C.currentTarget,k)},onKeyDown(){x.current=void 0}}},[g,r,c,p,m,d,i,y,S,f]);return b.useMemo(()=>s?{reference:w}:ln,[s,w])}function l3(e,n){let s=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const c=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=n.axis==="x"||n.axis==="both",f=n.axis==="y"||n.axis==="both",p=["mouseenter","mousemove"].includes(n.dataRef.current.openEvent?.type||"")&&n.pointerType!=="touch";let m=c.width,g=c.height,x=c.x,y=c.y;return s==null&&n.x&&d&&(s=c.x-n.x),r==null&&n.y&&f&&(r=c.y-n.y),x-=s||0,y-=r||0,m=0,g=0,!i||p?(m=n.axis==="y"?c.width:0,g=n.axis==="x"?c.height:0,x=d&&n.x!=null?n.x:x,y=f&&n.y!=null?n.y:y):i&&!p&&(g=n.axis==="x"?c.height:g,m=n.axis==="y"?c.width:m),i=!0,{width:m,height:g,x,y,top:y,right:x+m,bottom:y+g,left:x}}}}function W1(e){return e!=null&&e.clientX!=null}function i3(e,n={}){const{enabled:s=!0,axis:r="both"}=n,i="rootStore"in e?e.rootStore:e,c=i.useState("open"),d=i.useState("floatingElement"),f=i.useState("domReferenceElement"),p=i.context.dataRef,m=b.useRef(!1),g=b.useRef(null),[x,y]=b.useState(),[S,w]=b.useState([]),j=Le(N=>{i.set("positionReference",N)}),_=Le((N,A,M)=>{m.current||p.current.openEvent&&!W1(p.current.openEvent)||i.set("positionReference",l3(M??f,{x:N,y:A,axis:r,dataRef:p,pointerType:x}))}),C=Le(N=>{c?g.current||(_(N.clientX,N.clientY,N.currentTarget),w([])):_(N.clientX,N.clientY,N.currentTarget)}),k=lo(x)?d:c;b.useEffect(()=>{if(!s){j(f);return}if(!k)return;function N(){g.current?.(),g.current=null}const A=Qt(d);function M(O){const L=Rn(O);Qe(d,L)?N():_(O.clientX,O.clientY)}return!p.current.openEvent||W1(p.current.openEvent)?g.current=pt(A,"mousemove",M):j(f),N},[k,s,d,p,f,i,_,j,S]),b.useEffect(()=>()=>{i.set("positionReference",null)},[i]),b.useEffect(()=>{s&&!d&&(m.current=!1)},[s,d]),b.useEffect(()=>{!s&&c&&(m.current=!0)},[s,c]);const R=b.useMemo(()=>{function N(A){y(A.pointerType)}return{onPointerDown:N,onPointerEnter:N,onMouseMove:C,onMouseEnter:C}},[C]);return b.useMemo(()=>s?{reference:R,trigger:R}:{},[s,R])}const c3={intentional:"onClick",sloppy:"onPointerDown"};function u3(){return!1}function d3(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Ex(e,n={}){const{enabled:s=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:c="sloppy",referencePress:d=u3,referencePressEvent:f="sloppy",bubbles:p,externalTree:m}=n,g="rootStore"in e?e.rootStore:e,x=g.useState("open"),y=g.useState("floatingElement"),{dataRef:S}=g.context,w=Dl(m),j=Le(typeof i=="function"?i:()=>!1),_=typeof i=="function"?j:i,C=_!==!1,k=Le(()=>c),{escapeKey:R,outsidePress:N}=d3(p),A=b.useRef(!1),M=b.useRef(!1),O=b.useRef(!1),L=b.useRef(!1),B=b.useRef(""),I=b.useRef(null),D=na(),z=na(),H=Le(()=>{z.clear(),S.current.insideReactTree=!1}),V=Le(G=>{const W=S.current.floatingContext?.nodeId;return(w?Sr(w.nodesRef.current,W):[]).some(re=>re.context?.open&&!re.context.dataRef.current[G])}),Y=Le(G=>Jm(G,g.select("floatingElement"))||Jm(G,g.select("domReferenceElement"))),q=Le(G=>{d()&&g.setOpen(!1,ot(mc,G.nativeEvent))}),F=Le(G=>{if(!x||!s||!r||G.key!=="Escape"||L.current||!R&&V("__escapeKeyBubbles"))return;const W=FA(G)?G.nativeEvent:G,ie=ot(hx,W);g.setOpen(!1,ie),ie.isCanceled||G.preventDefault(),!R&&!ie.isPropagationAllowed&&G.stopPropagation()}),Z=Le(()=>{S.current.insideReactTree=!0,z.start(0,H)}),$=Le(G=>{if(!x||!s||G.button!==0)return;const W=Rn(G.nativeEvent);Qe(g.select("floatingElement"),W)&&(A.current||(A.current=!0,M.current=!1))}),X=Le(G=>{!x||!s||(G.defaultPrevented||G.nativeEvent.defaultPrevented)&&A.current&&(M.current=!0)});b.useEffect(()=>{if(!x||!s)return;S.current.__escapeKeyBubbles=R,S.current.__outsidePressBubbles=N;const G=new Va,W=new Va;function ie(){G.clear(),L.current=!0}function re(){G.start(cf()?5:0,()=>{L.current=!1})}function oe(){O.current=!0,W.start(0,()=>{O.current=!1})}function ce(){A.current=!1,M.current=!1}function ee(){const le=B.current,je=le==="pen"||!le?"mouse":le,we=k(),Ue=typeof we=="function"?we():we;return typeof Ue=="string"?Ue:Ue[je]}function Te(le){const je=ee();return je==="intentional"&&le.type!=="click"||je==="sloppy"&&le.type==="click"}function $e(le){const je=S.current.floatingContext?.nodeId,we=w&&Sr(w.nodesRef.current,je).some(Ue=>Jm(le,Ue.context?.elements.floating));return Y(le)||we}function be(le){if(Te(le)){le.type!=="click"&&!Y(le)&&(W.clear(),O.current=!1),H();return}if(S.current.insideReactTree){H();return}const je=Rn(le),we=`[${xc("inert")}]`,Ue=ft(je)?je.getRootNode():null,We=Array.from((vl(Ue)?Ue:yt(g.select("floatingElement"))).querySelectorAll(we)),jt=g.context.triggerElements;if(je&&(jt.hasElement(je)||jt.hasMatchingElement(pe=>Qe(pe,je))))return;let zt=ft(je)?je:null;for(;zt&&!zs(zt);){const pe=Is(zt);if(zs(pe)||!ft(pe))break;zt=pe}if(!(We.length&&ft(je)&&!JA(je)&&!Qe(je,g.select("floatingElement"))&&We.every(pe=>!Qe(zt,pe)))){if($t(je)&&!("touches"in le)){const pe=zs(je),ke=sa(je),Ne=/auto|scroll/,qe=pe||Ne.test(ke.overflowX),at=pe||Ne.test(ke.overflowY),nn=qe&&je.clientWidth>0&&je.scrollWidth>je.clientWidth,qt=at&&je.clientHeight>0&&je.scrollHeight>je.clientHeight,mt=ke.direction==="rtl",Nt=qt&&(mt?le.offsetX<=je.offsetWidth-je.clientWidth:le.offsetX>je.clientWidth),Zt=nn&&le.offsetY>je.clientHeight;if(Nt||Zt)return}if(!$e(le)){if(ee()==="intentional"&&O.current){W.clear(),O.current=!1;return}typeof _=="function"&&!_(le)||V("__outsidePressBubbles")||(g.setOpen(!1,ot(gx,le)),H())}}}function Ce(le){ee()!=="sloppy"||le.pointerType==="touch"||!g.select("open")||!s||Y(le)||be(le)}function Ee(le){if(ee()!=="sloppy"||!g.select("open")||!s||Y(le))return;const je=le.touches[0];je&&(I.current={startTime:Date.now(),startX:je.clientX,startY:je.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Pe(le,je){const we=Rn(le);if(!we)return;const Ue=pt(we,le.type,()=>{je(le),Ue()})}function Ie(le){B.current="touch",Pe(le,Ee)}function xe(le){D.clear(),le.type==="pointerdown"&&(B.current=le.pointerType),!(le.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Pe(le,je=>{je.type==="pointerdown"?Ce(je):be(je)})}function Ae(le){if(!A.current)return;const je=M.current;if(ce(),ee()==="intentional"){if(le.type==="pointercancel"){je&&oe();return}if(!$e(le)){if(je){oe();return}typeof _=="function"&&!_(le)||(W.clear(),O.current=!0,H())}}}function _e(le){if(ee()!=="sloppy"||!I.current||Y(le))return;const je=le.touches[0];if(!je)return;const we=Math.abs(je.clientX-I.current.startX),Ue=Math.abs(je.clientY-I.current.startY),We=Math.sqrt(we*we+Ue*Ue);We>5&&(I.current.dismissOnTouchEnd=!0),We>10&&(be(le),D.clear(),I.current=null)}function Be(le){Pe(le,_e)}function Fe(le){ee()!=="sloppy"||!I.current||Y(le)||(I.current.dismissOnTouchEnd&&be(le),D.clear(),I.current=null)}function Ge(le){Pe(le,Fe)}const De=yt(y),ye=ts(r&&ts(pt(De,"keydown",F),pt(De,"compositionstart",ie),pt(De,"compositionend",re)),C&&ts(pt(De,"click",xe,!0),pt(De,"pointerdown",xe,!0),pt(De,"pointerup",Ae,!0),pt(De,"pointercancel",Ae,!0),pt(De,"mousedown",xe,!0),pt(De,"mouseup",Ae,!0),pt(De,"touchstart",Ie,!0),pt(De,"touchmove",Be,!0),pt(De,"touchend",Ge,!0)));return()=>{ye(),G.clear(),W.clear(),ce(),O.current=!1}},[S,y,r,C,_,x,s,R,N,F,H,k,V,Y,w,g,D]),b.useEffect(H,[_,H]);const U=b.useMemo(()=>({onKeyDown:F,[c3[f]]:q,...f!=="intentional"&&{onClick:q}}),[F,q,f]),K=b.useMemo(()=>({onKeyDown:F,onPointerDown:X,onMouseDown:X,onClickCapture:Z,onMouseDownCapture(G){Z(),$(G)},onPointerDownCapture(G){Z(),$(G)},onMouseUpCapture:Z,onTouchEndCapture:Z,onTouchMoveCapture:Z}),[F,Z,$,X]);return b.useMemo(()=>s?{reference:U,floating:K,trigger:U}:{},[s,U,K])}function ej(e,n,s){let{reference:r,floating:i}=e;const c=Ta(n),d=jx(n),f=yx(d),p=aa(n),m=c==="y",g=r.x+r.width/2-i.width/2,x=r.y+r.height/2-i.height/2,y=r[f]/2-i[f]/2;let S;switch(p){case"top":S={x:g,y:r.y-i.height};break;case"bottom":S={x:g,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:x};break;case"left":S={x:r.x-i.width,y:x};break;default:S={x:r.x,y:r.y}}switch(Nr(n)){case"start":S[d]-=y*(s&&m?-1:1);break;case"end":S[d]+=y*(s&&m?-1:1);break}return S}async function f3(e,n){var s;n===void 0&&(n={});const{x:r,y:i,platform:c,rects:d,elements:f,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:x="floating",altBoundary:y=!1,padding:S=0}=Hs(n,e),w=uw(S),_=f[y?x==="floating"?"reference":"floating":x],C=gc(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(_)))==null||s?_:_.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:g,strategy:p})),k=x==="floating"?{x:r,y:i,width:d.floating.width,height:d.floating.height}:d.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),N=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},A=gc(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:R,strategy:p}):k);return{top:(C.top-A.top+w.top)/N.y,bottom:(A.bottom-C.bottom+w.bottom)/N.y,left:(C.left-A.left+w.left)/N.x,right:(A.right-C.right+w.right)/N.x}}const p3=50,m3=async(e,n,s)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:d}=s,f=d.detectOverflow?d:{...d,detectOverflow:f3},p=await(d.isRTL==null?void 0:d.isRTL(n));let m=await d.getElementRects({reference:e,floating:n,strategy:i}),{x:g,y:x}=ej(m,r,p),y=r,S=0;const w={};for(let j=0;j<c.length;j++){const _=c[j];if(!_)continue;const{name:C,fn:k}=_,{x:R,y:N,data:A,reset:M}=await k({x:g,y:x,initialPlacement:r,placement:y,strategy:i,middlewareData:w,rects:m,platform:f,elements:{reference:e,floating:n}});g=R??g,x=N??x,w[C]={...w[C],...A},M&&S<p3&&(S++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(m=M.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:i}):M.rects),{x:g,y:x}=ej(m,y,p)),j=-1)}return{x:g,y:x,placement:y,strategy:i,middlewareData:w}},g3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var s,r;const{placement:i,middlewareData:c,rects:d,initialPlacement:f,platform:p,elements:m}=n,{mainAxis:g=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:j=!0,..._}=Hs(e,n);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const C=aa(i),k=Ta(f),R=aa(f)===f,N=await(p.isRTL==null?void 0:p.isRTL(m.floating)),A=y||(R||!j?[Ld(f)]:vM(f)),M=w!=="none";!y&&M&&A.push(...SM(f,j,w,N));const O=[f,...A],L=await p.detectOverflow(n,_),B=[];let I=((r=c.flip)==null?void 0:r.overflows)||[];if(g&&B.push(L[C]),x){const V=bM(i,d,N);B.push(L[V[0]],L[V[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(V=>V<=0)){var D,z;const V=(((D=c.flip)==null?void 0:D.index)||0)+1,Y=O[V];if(Y&&(!(x==="alignment"?k!==Ta(Y):!1)||I.every(Z=>Ta(Z.placement)===k?Z.overflows[0]>0:!0)))return{data:{index:V,overflows:I},reset:{placement:Y}};let q=(z=I.filter(F=>F.overflows[0]<=0).sort((F,Z)=>F.overflows[1]-Z.overflows[1])[0])==null?void 0:z.placement;if(!q)switch(S){case"bestFit":{var H;const F=(H=I.filter(Z=>{if(M){const $=Ta(Z.placement);return $===k||$==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter($=>$>0).reduce(($,X)=>$+X,0)]).sort((Z,$)=>Z[1]-$[1])[0])==null?void 0:H[0];F&&(q=F);break}case"initialPlacement":q=f;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function tj(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function nj(e){return hM.some(n=>e[n]>=0)}const h3=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:s,platform:r}=n,{strategy:i="referenceHidden",...c}=Hs(e,n);switch(i){case"referenceHidden":{const d=await r.detectOverflow(n,{...c,elementContext:"reference"}),f=tj(d,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:nj(f)}}}case"escaped":{const d=await r.detectOverflow(n,{...c,altBoundary:!0}),f=tj(d,s.floating);return{data:{escapedOffsets:f,escaped:nj(f)}}}default:return{}}}}},Lw=new Set(["left","top"]);async function x3(e,n){const{placement:s,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),d=aa(s),f=Nr(s),p=Ta(s)==="y",m=Lw.has(d)?-1:1,g=c&&p?-1:1,x=Hs(n,e);let{mainAxis:y,crossAxis:S,alignmentAxis:w}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return f&&typeof w=="number"&&(S=f==="end"?w*-1:w),p?{x:S*g,y:y*m}:{x:y*m,y:S*g}}const b3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var s,r;const{x:i,y:c,placement:d,middlewareData:f}=n,p=await x3(n,e);return d===((s=f.offset)==null?void 0:s.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+p.x,y:c+p.y,data:{...p,placement:d}}}}},v3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:s,y:r,placement:i,platform:c}=n,{mainAxis:d=!0,crossAxis:f=!1,limiter:p={fn:C=>{let{x:k,y:R}=C;return{x:k,y:R}}},...m}=Hs(e,n),g={x:s,y:r},x=await c.detectOverflow(n,m),y=Ta(aa(i)),S=vx(y);let w=g[S],j=g[y];if(d){const C=S==="y"?"top":"left",k=S==="y"?"bottom":"right",R=w+x[C],N=w-x[k];w=gh(R,w,N)}if(f){const C=y==="y"?"top":"left",k=y==="y"?"bottom":"right",R=j+x[C],N=j-x[k];j=gh(R,j,N)}const _=p.fn({...n,[S]:w,[y]:j});return{..._,data:{x:_.x-s,y:_.y-r,enabled:{[S]:d,[y]:f}}}}}},y3=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:s,y:r,placement:i,rects:c,middlewareData:d}=n,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=Hs(e,n),g={x:s,y:r},x=Ta(i),y=vx(x);let S=g[y],w=g[x];const j=Hs(f,n),_=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(p){const R=y==="y"?"height":"width",N=c.reference[y]-c.floating[R]+_.mainAxis,A=c.reference[y]+c.reference[R]-_.mainAxis;S<N?S=N:S>A&&(S=A)}if(m){var C,k;const R=y==="y"?"width":"height",N=Lw.has(aa(i)),A=c.reference[x]-c.floating[R]+(N&&((C=d.offset)==null?void 0:C[x])||0)+(N?0:_.crossAxis),M=c.reference[x]+c.reference[R]+(N?0:((k=d.offset)==null?void 0:k[x])||0)-(N?_.crossAxis:0);w<A?w=A:w>M&&(w=M)}return{[y]:S,[x]:w}}}},j3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var s,r;const{placement:i,rects:c,platform:d,elements:f}=n,{apply:p=()=>{},...m}=Hs(e,n),g=await d.detectOverflow(n,m),x=aa(i),y=Nr(i),S=Ta(i)==="y",{width:w,height:j}=c.floating;let _,C;x==="top"||x==="bottom"?(_=x,C=y===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(C=x,_=y==="end"?"top":"bottom");const k=j-g.top-g.bottom,R=w-g.left-g.right,N=jl(j-g[_],k),A=jl(w-g[C],R),M=!n.middlewareData.shift;let O=N,L=A;if((s=n.middlewareData.shift)!=null&&s.enabled.x&&(L=R),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(O=k),M&&!y){const I=ha(g.left,0),D=ha(g.right,0),z=ha(g.top,0),H=ha(g.bottom,0);S?L=w-2*(I!==0||D!==0?I+D:ha(g.left,g.right)):O=j-2*(z!==0||H!==0?z+H:ha(g.top,g.bottom))}await p({...n,availableWidth:L,availableHeight:O});const B=await d.getDimensions(f.floating);return w!==B.width||j!==B.height?{reset:{rects:!0}}:{}}}};function Pw(e){const n=sa(e);let s=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const i=$t(e),c=i?e.offsetWidth:s,d=i?e.offsetHeight:r,f=Dd(s)!==c||Dd(r)!==d;return f&&(s=c,r=d),{width:s,height:r,$:f}}function Nx(e){return ft(e)?e:e.contextElement}function pl(e){const n=Nx(e);if(!$t(n))return ns(1);const s=n.getBoundingClientRect(),{width:r,height:i,$:c}=Pw(n);let d=(c?Dd(s.width):s.width)/r,f=(c?Dd(s.height):s.height)/i;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const _3=ns(0);function Iw(e){const n=Qt(e);return!cf()||!n.visualViewport?_3:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function S3(e,n,s){return n===void 0&&(n=!1),!s||n&&s!==Qt(e)?!1:n}function io(e,n,s,r){n===void 0&&(n=!1),s===void 0&&(s=!1);const i=e.getBoundingClientRect(),c=Nx(e);let d=ns(1);n&&(r?ft(r)&&(d=pl(r)):d=pl(e));const f=S3(c,s,r)?Iw(c):ns(0);let p=(i.left+f.x)/d.x,m=(i.top+f.y)/d.y,g=i.width/d.x,x=i.height/d.y;if(c){const y=Qt(c),S=r&&ft(r)?Qt(r):r;let w=y,j=fh(w);for(;j&&r&&S!==w;){const _=pl(j),C=j.getBoundingClientRect(),k=sa(j),R=C.left+(j.clientLeft+parseFloat(k.paddingLeft))*_.x,N=C.top+(j.clientTop+parseFloat(k.paddingTop))*_.y;p*=_.x,m*=_.y,g*=_.x,x*=_.y,p+=R,m+=N,w=Qt(j),j=fh(w)}}return gc({width:g,height:x,x:p,y:m})}function xf(e,n){const s=uf(e).scrollLeft;return n?n.left+s:io(os(e)).left+s}function Bw(e,n){const s=e.getBoundingClientRect(),r=s.left+n.scrollLeft-xf(e,s),i=s.top+n.scrollTop;return{x:r,y:i}}function w3(e){let{elements:n,rect:s,offsetParent:r,strategy:i}=e;const c=i==="fixed",d=os(r),f=n?lf(n.floating):!1;if(r===d||f&&c)return s;let p={scrollLeft:0,scrollTop:0},m=ns(1);const g=ns(0),x=$t(r);if((x||!x&&!c)&&((Hn(r)!=="body"||Er(d))&&(p=uf(r)),x)){const S=io(r);m=pl(r),g.x=S.x+r.clientLeft,g.y=S.y+r.clientTop}const y=d&&!x&&!c?Bw(d,p):ns(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-p.scrollLeft*m.x+g.x+y.x,y:s.y*m.y-p.scrollTop*m.y+g.y+y.y}}function C3(e){return Array.from(e.getClientRects())}function k3(e){const n=os(e),s=uf(e),r=e.ownerDocument.body,i=ha(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),c=ha(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let d=-s.scrollLeft+xf(e);const f=-s.scrollTop;return sa(r).direction==="rtl"&&(d+=ha(n.clientWidth,r.clientWidth)-i),{width:i,height:c,x:d,y:f}}const aj=25;function E3(e,n){const s=Qt(e),r=os(e),i=s.visualViewport;let c=r.clientWidth,d=r.clientHeight,f=0,p=0;if(i){c=i.width,d=i.height;const g=cf();(!g||g&&n==="fixed")&&(f=i.offsetLeft,p=i.offsetTop)}const m=xf(r);if(m<=0){const g=r.ownerDocument,x=g.body,y=getComputedStyle(x),S=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-x.clientWidth-S);w<=aj&&(c-=w)}else m<=aj&&(c+=m);return{width:c,height:d,x:f,y:p}}function N3(e,n){const s=io(e,!0,n==="fixed"),r=s.top+e.clientTop,i=s.left+e.clientLeft,c=$t(e)?pl(e):ns(1),d=e.clientWidth*c.x,f=e.clientHeight*c.y,p=i*c.x,m=r*c.y;return{width:d,height:f,x:p,y:m}}function sj(e,n,s){let r;if(n==="viewport")r=E3(e,s);else if(n==="document")r=k3(os(e));else if(ft(n))r=N3(n,s);else{const i=Iw(e);r={x:n.x-i.x,y:n.y-i.y,width:n.width,height:n.height}}return gc(r)}function Uw(e,n){const s=Is(e);return s===n||!ft(s)||zs(s)?!1:sa(s).position==="fixed"||Uw(s,n)}function R3(e,n){const s=n.get(e);if(s)return s;let r=fc(e,[],!1).filter(f=>ft(f)&&Hn(f)!=="body"),i=null;const c=sa(e).position==="fixed";let d=c?Is(e):e;for(;ft(d)&&!zs(d);){const f=sa(d),p=px(d);!p&&f.position==="fixed"&&(i=null),(c?!p&&!i:!p&&f.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Er(d)&&!p&&Uw(e,d))?r=r.filter(g=>g!==d):i=f,d=Is(d)}return n.set(e,r),r}function T3(e){let{element:n,boundary:s,rootBoundary:r,strategy:i}=e;const d=[...s==="clippingAncestors"?lf(n)?[]:R3(n,this._c):[].concat(s),r],f=sj(n,d[0],i);let p=f.top,m=f.right,g=f.bottom,x=f.left;for(let y=1;y<d.length;y++){const S=sj(n,d[y],i);p=ha(S.top,p),m=jl(S.right,m),g=jl(S.bottom,g),x=ha(S.left,x)}return{width:m-x,height:g-p,x,y:p}}function A3(e){const{width:n,height:s}=Pw(e);return{width:n,height:s}}function M3(e,n,s){const r=$t(n),i=os(n),c=s==="fixed",d=io(e,!0,c,n);let f={scrollLeft:0,scrollTop:0};const p=ns(0);function m(){p.x=xf(i)}if(r||!r&&!c)if((Hn(n)!=="body"||Er(i))&&(f=uf(n)),r){const S=io(n,!0,c,n);p.x=S.x+n.clientLeft,p.y=S.y+n.clientTop}else i&&m();c&&!r&&i&&m();const g=i&&!r&&!c?Bw(i,f):ns(0),x=d.left+f.scrollLeft-p.x-g.x,y=d.top+f.scrollTop-p.y-g.y;return{x,y,width:d.width,height:d.height}}function og(e){return sa(e).position==="static"}function rj(e,n){if(!$t(e)||sa(e).position==="fixed")return null;if(n)return n(e);let s=e.offsetParent;return os(e)===s&&(s=s.ownerDocument.body),s}function Hw(e,n){const s=Qt(e);if(lf(e))return s;if(!$t(e)){let i=Is(e);for(;i&&!zs(i);){if(ft(i)&&!og(i))return i;i=Is(i)}return s}let r=rj(e,n);for(;r&&XA(r)&&og(r);)r=rj(r,n);return r&&zs(r)&&og(r)&&!px(r)?s:r||ZA(e)||s}const O3=async function(e){const n=this.getOffsetParent||Hw,s=this.getDimensions,r=await s(e.floating);return{reference:M3(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z3(e){return sa(e).direction==="rtl"}const qw={convertOffsetParentRelativeRectToViewportRelativeRect:w3,getDocumentElement:os,getClippingRect:T3,getOffsetParent:Hw,getElementRects:O3,getClientRects:C3,getDimensions:A3,getScale:pl,isElement:ft,isRTL:z3};function Vw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function D3(e,n){let s=null,r;const i=os(e);function c(){var f;clearTimeout(r),(f=s)==null||f.disconnect(),s=null}function d(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),c();const m=e.getBoundingClientRect(),{left:g,top:x,width:y,height:S}=m;if(f||n(),!y||!S)return;const w=to(x),j=to(i.clientWidth-(g+y)),_=to(i.clientHeight-(x+S)),C=to(g),R={rootMargin:-w+"px "+-j+"px "+-_+"px "+-C+"px",threshold:ha(0,jl(1,p))||1};let N=!0;function A(M){const O=M[0].intersectionRatio;if(O!==p){if(!N)return d();O?d(!1,O):r=setTimeout(()=>{d(!1,1e-7)},1e3)}O===1&&!Vw(m,e.getBoundingClientRect())&&d(),N=!1}try{s=new IntersectionObserver(A,{...R,root:i.ownerDocument})}catch{s=new IntersectionObserver(A,R)}s.observe(e)}return d(!0),c}function oj(e,n,s,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=r,m=Nx(e),g=i||c?[...m?fc(m):[],...n?fc(n):[]]:[];g.forEach(C=>{i&&C.addEventListener("scroll",s,{passive:!0}),c&&C.addEventListener("resize",s)});const x=m&&f?D3(m,s):null;let y=-1,S=null;d&&(S=new ResizeObserver(C=>{let[k]=C;k&&k.target===m&&S&&n&&(S.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var R;(R=S)==null||R.observe(n)})),s()}),m&&!p&&S.observe(m),n&&S.observe(n));let w,j=p?io(e):null;p&&_();function _(){const C=io(e);j&&!Vw(j,C)&&s(),j=C,w=requestAnimationFrame(_)}return s(),()=>{var C;g.forEach(k=>{i&&k.removeEventListener("scroll",s),c&&k.removeEventListener("resize",s)}),x?.(),(C=S)==null||C.disconnect(),S=null,p&&cancelAnimationFrame(w)}}const L3=b3,P3=v3,I3=g3,B3=j3,U3=h3,H3=y3,q3=(e,n,s)=>{const r=new Map,i={platform:qw,...s},c={...i.platform,_c:r};return m3(e,n,{...i,platform:c})};var V3=typeof document<"u",$3=function(){},jd=V3?b.useLayoutEffect:$3;function Bd(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let s,r,i;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==n.length)return!1;for(r=s;r--!==0;)if(!Bd(e[r],n[r]))return!1;return!0}if(i=Object.keys(e),s=i.length,s!==Object.keys(n).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(n,i[r]))return!1;for(r=s;r--!==0;){const c=i[r];if(!(c==="_owner"&&e.$$typeof)&&!Bd(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function $w(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lj(e,n){const s=$w(e);return Math.round(n*s)/s}function lg(e){const n=b.useRef(e);return jd(()=>{n.current=e}),n}function G3(e){e===void 0&&(e={});const{placement:n="bottom",strategy:s="absolute",middleware:r=[],platform:i,elements:{reference:c,floating:d}={},transform:f=!0,whileElementsMounted:p,open:m}=e,[g,x]=b.useState({x:0,y:0,strategy:s,placement:n,middlewareData:{},isPositioned:!1}),[y,S]=b.useState(r);Bd(y,r)||S(r);const[w,j]=b.useState(null),[_,C]=b.useState(null),k=b.useCallback(Z=>{Z!==M.current&&(M.current=Z,j(Z))},[]),R=b.useCallback(Z=>{Z!==O.current&&(O.current=Z,C(Z))},[]),N=c||w,A=d||_,M=b.useRef(null),O=b.useRef(null),L=b.useRef(g),B=p!=null,I=lg(p),D=lg(i),z=lg(m),H=b.useCallback(()=>{if(!M.current||!O.current)return;const Z={placement:n,strategy:s,middleware:y};D.current&&(Z.platform=D.current),q3(M.current,O.current,Z).then($=>{const X={...$,isPositioned:z.current!==!1};V.current&&!Bd(L.current,X)&&(L.current=X,Cr.flushSync(()=>{x(X)}))})},[y,n,s,D,z]);jd(()=>{m===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,x(Z=>({...Z,isPositioned:!1})))},[m]);const V=b.useRef(!1);jd(()=>(V.current=!0,()=>{V.current=!1}),[]),jd(()=>{if(N&&(M.current=N),A&&(O.current=A),N&&A){if(I.current)return I.current(N,A,H);H()}},[N,A,H,I,B]);const Y=b.useMemo(()=>({reference:M,floating:O,setReference:k,setFloating:R}),[k,R]),q=b.useMemo(()=>({reference:N,floating:A}),[N,A]),F=b.useMemo(()=>{const Z={position:s,left:0,top:0};if(!q.floating)return Z;const $=lj(q.floating,g.x),X=lj(q.floating,g.y);return f?{...Z,transform:"translate("+$+"px, "+X+"px)",...$w(q.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:$,top:X}},[s,f,q.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:H,refs:Y,elements:q,floatingStyles:F}),[g,H,Y,q,F])}const F3=(e,n)=>{const s=L3(e);return{name:s.name,fn:s.fn,options:[e,n]}},Y3=(e,n)=>{const s=P3(e);return{name:s.name,fn:s.fn,options:[e,n]}},X3=(e,n)=>({fn:H3(e).fn,options:[e,n]}),K3=(e,n)=>{const s=I3(e);return{name:s.name,fn:s.fn,options:[e,n]}},Q3=(e,n)=>{const s=B3(e);return{name:s.name,fn:s.fn,options:[e,n]}},Z3=(e,n)=>{const s=U3(e);return{name:s.name,fn:s.fn,options:[e,n]}},ze=(e,n,s,r,i,c,...d)=>{if(d.length>0)throw new Error(Mn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var ig={exports:{}},cg={};/**
|
|
551
|
-
* @license React
|
|
552
|
-
* use-sync-external-store-shim.production.js
|
|
553
|
-
*
|
|
554
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
555
|
-
*
|
|
556
|
-
* This source code is licensed under the MIT license found in the
|
|
557
|
-
* LICENSE file in the root directory of this source tree.
|
|
558
|
-
*/var ij;function J3(){if(ij)return cg;ij=1;var e=jc();function n(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}var s=typeof Object.is=="function"?Object.is:n,r=e.useState,i=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(x,y){var S=y(),w=r({inst:{value:S,getSnapshot:y}}),j=w[0].inst,_=w[1];return c(function(){j.value=S,j.getSnapshot=y,p(j)&&_({inst:j})},[x,S,y]),i(function(){return p(j)&&_({inst:j}),x(function(){p(j)&&_({inst:j})})},[x]),d(S),S}function p(x){var y=x.getSnapshot;x=x.value;try{var S=y();return!s(x,S)}catch{return!0}}function m(x,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return cg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,cg}var cj;function Gw(){return cj||(cj=1,ig.exports=J3()),ig.exports}var Ud=Gw(),ug={exports:{}},dg={};/**
|
|
559
|
-
* @license React
|
|
560
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
561
|
-
*
|
|
562
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
563
|
-
*
|
|
564
|
-
* This source code is licensed under the MIT license found in the
|
|
565
|
-
* LICENSE file in the root directory of this source tree.
|
|
566
|
-
*/var uj;function W3(){if(uj)return dg;uj=1;var e=jc(),n=Gw();function s(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var r=typeof Object.is=="function"?Object.is:s,i=n.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return dg.useSyncExternalStoreWithSelector=function(m,g,x,y,S){var w=c(null);if(w.current===null){var j={hasValue:!1,value:null};w.current=j}else j=w.current;w=f(function(){function C(M){if(!k){if(k=!0,R=M,M=y(M),S!==void 0&&j.hasValue){var O=j.value;if(S(O,M))return N=O}return N=M}if(O=N,r(R,M))return O;var L=y(M);return S!==void 0&&S(O,L)?(R=M,O):(R=M,N=L)}var k=!1,R,N,A=x===void 0?null:x;return[function(){return C(g())},A===null?void 0:function(){return C(A())}]},[g,x,y,S]);var _=i(m,w[0],w[1]);return d(function(){j.hasValue=!0,j.value=_},[_]),p(_),_},dg}var dj;function e5(){return dj||(dj=1,ug.exports=W3()),ug.exports}var t5=e5();const n5=Sx(19),a5=n5?r5:o5;function tt(e,n,s,r,i){return a5(e,n,s,r,i)}function s5(e,n,s,r,i){const c=b.useCallback(()=>n(e.getSnapshot(),s,r,i),[e,n,s,r,i]);return Ud.useSyncExternalStore(e.subscribe,c,c)}LA({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let n=!1;for(let s=0;s<e.syncHooks.length;s+=1){const r=e.syncHooks[s],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(n=!0,r.value=i,r.didChange=!1)}return n&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=n=>{const s=new Set;for(const i of e.syncHooks)s.add(i.store);const r=[];for(const i of s)r.push(i.subscribe(n));return()=>{for(const i of r)i()}}),Ud.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function r5(e,n,s,r,i){const c=DA();if(!c)return s5(e,n,s,r,i);const d=c.syncIndex;c.syncIndex+=1;let f;return c.didInitialize?(f=c.syncHooks[d],(f.store!==e||f.selector!==n||!Object.is(f.a1,s)||!Object.is(f.a2,r)||!Object.is(f.a3,i))&&(f.store!==e&&(c.didChangeStore=!0),f.store=e,f.selector=n,f.a1=s,f.a2=r,f.a3=i,f.didChange=!0)):(f={store:e,selector:n,a1:s,a2:r,a3:i,value:n(e.getSnapshot(),s,r,i),didChange:!1},c.syncHooks.push(f)),f.value}function o5(e,n,s,r,i){return t5.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>n(c,s,r,i))}class Fw{constructor(n){this.state=n,this.listeners=new Set,this.updateTick=0}subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)});getSnapshot=()=>this.state;setState(n){if(this.state===n)return;this.state=n,this.updateTick+=1;const s=this.updateTick;for(const r of this.listeners){if(s!==this.updateTick)return;r(n)}}update(n){for(const s in n)if(!Object.is(this.state[s],n[s])){this.setState({...this.state,...n});return}}set(n,s){Object.is(this.state[n],s)||this.setState({...this.state,[n]:s})}notifyAll(){const n={...this.state};this.setState(n)}use(n,s,r,i){return tt(this,n,s,r,i)}}class Rx extends Fw{constructor(n,s={},r){super(n),this.context=s,this.selectors=r}useSyncedValue(n,s){b.useDebugValue(n);const r=this;Me(()=>{r.state[n]!==s&&r.set(n,s)},[r,n,s])}useSyncedValueWithCleanup(n,s){const r=this;Me(()=>(r.state[n]!==s&&r.set(n,s),()=>{r.set(n,void 0)}),[r,n,s])}useSyncedValues(n){const s=this,r=Object.values(n);Me(()=>{s.update(n)},[s,...r])}useControlledProp(n,s){b.useDebugValue(n);const r=this,i=s!==void 0;Me(()=>{i&&!Object.is(r.state[n],s)&&r.setState({...r.state,[n]:s})},[r,n,s,i])}select(n,s,r,i){const c=this.selectors[n];return c(this.state,s,r,i)}useState(n,s,r,i){return b.useDebugValue(n),tt(this,this.selectors[n],s,r,i)}useContextCallback(n,s){b.useDebugValue(n);const r=Le(s??Bn);this.context[n]=r}useStateSetter(n){const s=b.useRef(void 0);return s.current===void 0&&(s.current=r=>{this.set(n,r)}),s.current}observe(n,s){let r;typeof n=="function"?r=n:r=this.selectors[n];let i=r(this.state);return s(i,i,this),this.subscribe(c=>{const d=r(c);if(!Object.is(i,d)){const f=i;i=d,s(d,f,this)}})}}const l5={open:ze(e=>e.open),transitionStatus:ze(e=>e.transitionStatus),domReferenceElement:ze(e=>e.domReferenceElement),referenceElement:ze(e=>e.positionReference??e.referenceElement),floatingElement:ze(e=>e.floatingElement),floatingId:ze(e=>e.floatingId)};class bf extends Rx{constructor(n){const{syncOnly:s,nested:r,onOpenChange:i,triggerElements:c,...d}=n;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:e3(),nested:r,triggerElements:c},l5),this.syncOnly=s}syncOpenEvent=(n,s)=>{(!n||!this.state.open||s!=null&&YA(s))&&(this.context.dataRef.current.openEvent=n?s:void 0)};dispatchOpenChange=(n,s)=>{this.syncOpenEvent(n,s.event);const r={open:n,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",r)};setOpen=(n,s)=>{if(this.syncOnly){this.context.onOpenChange?.(n,s);return}this.dispatchOpenChange(n,s),this.context.onOpenChange?.(n,s)}}function i5(e){const{popupStore:n,treatPopupAsFloatingElement:s=!1,floatingRootContext:r,floatingId:i,nested:c,onOpenChange:d}=e,f=n.useState("open"),p=n.useState("activeTriggerElement"),m=n.useState(s?"popupElement":"positionerElement"),g=n.context.triggerElements,x=d,y=b.useRef(null);r===void 0&&y.current===null&&(y.current=new bf({open:f,transitionStatus:void 0,referenceElement:p,floatingElement:m,triggerElements:g,onOpenChange:x,floatingId:i,syncOnly:!0,nested:c}));const S=r??y.current;return n.useSyncedValue("floatingId",i),Me(()=>{const w={open:f,floatingId:i,referenceElement:p,floatingElement:m};ft(p)&&(w.domReferenceElement=p),S.state.positionReference===S.state.referenceElement&&(w.positionReference=p),S.update(w)},[f,i,p,m,S]),S.context.onOpenChange=x,S.context.nested=c,S}function Nc(e,n=!1,s=!1){const[r,i]=b.useState(e&&n?"idle":void 0),[c,d]=b.useState(e);return e&&!c&&(d(!0),i("starting")),!e&&c&&r!=="ending"&&!s&&i("ending"),!e&&!c&&r==="ending"&&i(void 0),Me(()=>{if(!e&&c&&r!=="ending"&&s){const f=Za.request(()=>{i("ending")});return()=>{Za.cancel(f)}}},[e,c,r,s]),Me(()=>{if(!e||n)return;const f=Za.request(()=>{i(void 0)});return()=>{Za.cancel(f)}},[n,e]),Me(()=>{if(!e||!n)return;e&&c&&r!=="idle"&&i("starting");const f=Za.request(()=>{i("idle")});return()=>{Za.cancel(f)}},[n,e,c,r]),{mounted:c,setMounted:d,transitionStatus:r}}let co=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const c5={[co.startingStyle]:""},u5={[co.endingStyle]:""},Ll={transitionStatus(e){return e==="starting"?c5:e==="ending"?u5:null}};function d5(e,n=!1,s=!0){const r=yl();return Le((i,c=null)=>{r.cancel();const d=As(e);if(d==null)return;const f=d,p=()=>{Cr.flushSync(i)};if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function m(){Promise.all(f.getAnimations().map(g=>g.finished)).then(()=>{c?.aborted||p()}).catch(()=>{if(s){c?.aborted||p();return}const g=f.getAnimations();!c?.aborted&&g.length>0&&g.some(x=>x.pending||x.playState!=="finished")&&m()})}if(n){const g=co.startingStyle;if(!f.hasAttribute(g)){r.request(m);return}const x=new MutationObserver(()=>{f.hasAttribute(g)||(x.disconnect(),m())});x.observe(f,{attributes:!0,attributeFilter:[g]}),c?.addEventListener("abort",()=>x.disconnect(),{once:!0});return}r.request(m)})}function Rr(e){const{enabled:n=!0,open:s,ref:r,onComplete:i}=e,c=Le(i),d=d5(r,s,!1);b.useEffect(()=>{if(!n)return;const f=new AbortController;return d(c,f.signal),()=>{f.abort()}},[n,s,c,d])}const vf={tabIndex:-1,[ph]:""};function Yw(e,n,s=!1){const r=gf(),i=hf()!=null,c=b.useRef(null);e===void 0&&c.current===null&&(c.current=n(r,i));const d=e??c.current;return i5({popupStore:d,treatPopupAsFloatingElement:s,floatingRootContext:d.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:d.setOpen}),{store:d,internalStore:c.current}}function f5(e,n){const s=b.useRef(null),r=b.useRef(null);return b.useCallback(i=>{if(e===void 0)return;let c=!1;if(s.current!==null){const d=s.current,f=r.current,p=n.context.triggerElements.getById(d);f&&p===f&&(n.context.triggerElements.delete(d),c=!0),s.current=null,r.current=null}if(i!==null&&(s.current=e,r.current=i,n.context.triggerElements.add(e,i),c=!0),c){const d=n.context.triggerElements.size;n.select("open")&&n.state.triggerCount!==d&&n.set("triggerCount",d)}},[n,e])}function Xw(e,n,s){const r=s?.id??null;(r||n)&&(e.activeTriggerId=r,e.activeTriggerElement=s??null)}function p5(e,n,s,r){const i=s.useState("isMountedByTrigger",e),c=f5(e,s),d=Le(f=>{if(c(f),!f)return;const p=s.select("open"),m=s.select("activeTriggerId");if(m===e){s.update({activeTriggerElement:f,...p?r:null});return}m==null&&p&&s.update({activeTriggerId:e,activeTriggerElement:f,...r})});return Me(()=>{i&&s.update({activeTriggerElement:n.current,...r})},[i,s,n,...Object.values(r)]),{registerTrigger:d,isMountedByThisTrigger:i}}function Kw(e){const n=e.useState("open"),s=e.useState("triggerCount");Me(()=>{if(!n){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const r=e.context.triggerElements.size,i={};if(e.state.triggerCount!==r&&(i.triggerCount=r),!e.select("activeTriggerId")&&r===1){const c=e.context.triggerElements.entries().next();if(!c.done){const[d,f]=c.value;i.activeTriggerId=d,i.activeTriggerElement=f}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0)&&e.update(i)},[n,e,s])}function Qw(e,n,s){const{mounted:r,setMounted:i,transitionStatus:c}=Nc(e);n.useSyncedValues({mounted:r,transitionStatus:c});const d=Le(()=>{i(!1),n.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n.context.onOpenChangeComplete?.(!1)}),f=n.useState("preventUnmountingOnClose");return Rr({enabled:r&&!e&&!f,open:e,ref:n.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:c}}function Zw(e,n){e.useSyncedValues(n),Me(()=>()=>{e.update({activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln})},[e])}function m5(e,n){Me(()=>{!n&&e.state.openMethod!==null&&e.set("openMethod",null)},[n,e]),Me(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class yf{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(n,s){const r=this.idMap.get(n);r!==s&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(s),this.idMap.set(n,s))}delete(n){const s=this.idMap.get(n);s&&(this.elementsSet.delete(s),this.idMap.delete(n))}hasElement(n){return this.elementsSet.has(n)}hasMatchingElement(n){for(const s of this.elementsSet)if(n(s))return!0;return!1}getById(n){return this.idMap.get(n)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function g5(){return new bf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new yf,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Jw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:g5(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln}}function Ww(e,n,s=!1){return new bf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:s,onOpenChange:void 0})}const nc=ze(e=>e.triggerIdProp??e.activeTriggerId),Tx=ze(e=>e.openProp??e.open),fj=ze(e=>(e.popupElement?.id??e.floatingId)||void 0);function e2(e,n){return n!==void 0&&Tx(e)&&nc(e)===n}function h5(e,n){return e2(e,n)?!0:n!==void 0&&Tx(e)&&nc(e)==null&&e.triggerCount===1}const t2={open:Tx,mounted:ze(e=>e.mounted),transitionStatus:ze(e=>e.transitionStatus),floatingRootContext:ze(e=>e.floatingRootContext),triggerCount:ze(e=>e.triggerCount),preventUnmountingOnClose:ze(e=>e.preventUnmountingOnClose),payload:ze(e=>e.payload),activeTriggerId:nc,activeTriggerElement:ze(e=>e.mounted?e.activeTriggerElement:null),popupId:fj,isTriggerActive:ze((e,n)=>n!==void 0&&nc(e)===n),isOpenedByTrigger:ze((e,n)=>e2(e,n)),isMountedByTrigger:ze((e,n)=>n!==void 0&&nc(e)===n&&e.mounted),triggerProps:ze((e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:ze((e,n)=>h5(e,n)?fj(e):void 0),popupProps:ze(e=>e.popupProps),popupElement:ze(e=>e.popupElement),positionerElement:ze(e=>e.positionerElement)};function n2(e){const{open:n=!1,onOpenChange:s,elements:r={}}=e,i=gf(),c=hf()!=null,d=xa(()=>new bf({open:n,transitionStatus:void 0,onOpenChange:s,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new yf,floatingId:i,syncOnly:!1,nested:c})).current;return Me(()=>{const f={open:n,floatingId:i};r.reference!==void 0&&(f.referenceElement=r.reference,f.domReferenceElement=ft(r.reference)?r.reference:null),r.floating!==void 0&&(f.floatingElement=r.floating),d.update(f)},[n,i,r.reference,r.floating,d]),d.context.onOpenChange=s,d.context.nested=c,d}function x5(e={}){const{nodeId:n,externalTree:s}=e,r=n2(e),i=e.rootContext||r,c=i.useState("referenceElement"),d=i.useState("floatingElement"),f=i.useState("domReferenceElement"),p=i.useState("open"),m=i.useState("floatingId"),[g,x]=b.useState(null),[y,S]=b.useState(void 0),[w,j]=b.useState(void 0),_=b.useRef(null),C=Dl(s),k=b.useMemo(()=>({reference:c,floating:d,domReference:f}),[c,d,f]),R=G3({...e,elements:{...k,...g&&{reference:g}}}),N=ft(y)?y:null,A=w===void 0?i.state.floatingElement:w;i.useSyncedValue("referenceElement",y??null),i.useSyncedValue("domReferenceElement",y===void 0?f:N),i.useSyncedValue("floatingElement",A);const M=b.useCallback(z=>{const H=ft(z)?{getBoundingClientRect:()=>z.getBoundingClientRect(),getClientRects:()=>z.getClientRects(),contextElement:z}:z;x(H),R.refs.setReference(H)},[R.refs]),O=b.useCallback(z=>{(ft(z)||z===null)&&(_.current=z,S(z)),(ft(R.refs.reference.current)||R.refs.reference.current===null||z!==null&&!ft(z))&&R.refs.setReference(z)},[R.refs,S]),L=b.useCallback(z=>{j(z),R.refs.setFloating(z)},[R.refs]),B=b.useMemo(()=>({...R.refs,setReference:O,setFloating:L,setPositionReference:M,domReference:_}),[R.refs,O,L,M]),I=b.useMemo(()=>({...R.elements,domReference:f}),[R.elements,f]),D=b.useMemo(()=>({...R,dataRef:i.context.dataRef,open:p,onOpenChange:i.setOpen,events:i.context.events,floatingId:m,refs:B,elements:I,nodeId:n,rootStore:i}),[R,B,I,n,i,p,m]);return Me(()=>{f&&(_.current=f)},[f]),Me(()=>{i.context.dataRef.current.floatingContext=D;const z=C?.nodesRef.current.find(H=>H.id===n);z&&(z.context=D)}),b.useMemo(()=>({...R,context:D,refs:B,elements:I,rootStore:i}),[R,B,I,D,i])}const fg=qA&&ZS;function b5(e,n={}){const{enabled:s=!0,delay:r}=n,i="rootStore"in e?e.rootStore:e,{events:c,dataRef:d}=i.context,f=b.useRef(!1),p=b.useRef(null),m=b.useRef(!0),g=na();b.useEffect(()=>{const y=i.select("domReferenceElement");if(!s)return;const S=Qt(y);function w(){const C=i.select("domReferenceElement");!i.select("open")&&$t(C)&&C===Pn(yt(C))&&(f.current=!0)}function j(){m.current=!0}function _(){m.current=!1}return ts(pt(S,"blur",w),fg&&pt(S,"keydown",j,!0),fg&&pt(S,"pointerdown",_,!0))},[i,s]),b.useEffect(()=>{if(!s)return;function y(S){if(S.reason===mc||S.reason===hx){const w=i.select("domReferenceElement");ft(w)&&(p.current=w,f.current=!0)}}return c.on("openchange",y),()=>{c.off("openchange",y)}},[c,s,i]);const x=b.useMemo(()=>{function y(){f.current=!1,p.current=null}return{onMouseLeave(){y()},onFocus(S){const w=S.currentTarget;if(f.current){if(p.current===w)return;y()}const j=Rn(S.nativeEvent);if(ft(j)){if(fg&&!S.relatedTarget){if(!m.current&&!df(j))return}else if(!eM(j))return}const _=Ad(S.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:k}=S,R=typeof r=="function"?r():r;if(i.select("open")&&_||R===0||R===void 0){i.setOpen(!0,ot(bd,C,k));return}g.start(R,()=>{f.current||i.setOpen(!0,ot(bd,C,k))})},onBlur(S){y();const w=S.relatedTarget,j=S.nativeEvent,_=ft(w)&&w.hasAttribute(xc("focus-guard"))&&w.getAttribute("data-type")==="outside";g.start(0,()=>{const C=i.select("domReferenceElement"),k=Pn(yt(C));!w&&k===C||Qe(d.current.floatingContext?.refs.floating.current,k)||Qe(C,k)||_||Ad(w??k,i.context.triggerElements)||i.setOpen(!1,ot(bd,j))})}}},[d,r,i,g]);return b.useMemo(()=>s?{reference:x,trigger:x}:{},[s,x])}class Ax{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 Va,this.restTimeout=new Va,this.handleCloseOptions=void 0}static create(){return new Ax}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Hd=new WeakMap;function qd(e){if(!e.performedPointerEventsMutation)return;const n=e.pointerEventsScopeElement;n&&Hd.get(n)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Hd.delete(n)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function a2(e,n){const{scopeElement:s,referenceElement:r,floatingElement:i}=n,c=Hd.get(s);c&&c!==e&&qd(c),qd(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Hd.set(s,e),s.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function Mx(e){const n=e.context.dataRef.current,s=xa(()=>n.hoverInteractionState??Ax.create()).current;return n.hoverInteractionState||(n.hoverInteractionState=s),cx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function v5(e,n={}){const{enabled:s=!0,closeDelay:r=0,nodeId:i}=n,c="rootStore"in e?e.rootStore:e,d=c.useState("open"),f=c.useState("floatingElement"),p=c.useState("domReferenceElement"),{dataRef:m}=c.context,g=Dl(),x=hf(),y=Mx(c),S=na(),w=Le(()=>nw(m.current.openEvent?.type,y.interactedInside)),j=Le(()=>nM(m.current.openEvent?.type)),_=Le(()=>{qd(y)});Me(()=>{d||(y.pointerType=void 0,y.restTimeoutPending=!1,y.interactedInside=!1,_())},[d,y,_]),b.useEffect(()=>_,[_]),Me(()=>{if(s&&d&&y.handleCloseOptions?.blockPointerEvents&&j()&&ft(p)&&f){const C=p,k=f,R=yt(f),N=g?.nodesRef.current.find(L=>L.id===x)?.context?.elements.floating;N&&(N.style.pointerEvents="");const A=y.pointerEventsScopeElement!==k?y.pointerEventsScopeElement:null,M=N!==k?N:null,O=y.handleCloseOptions?.getScope?.()??A??M??C.closest("[data-rootownerid]")??R.body;return a2(y,{scopeElement:O,referenceElement:C,floatingElement:k}),()=>{_()}}},[s,d,p,f,y,j,g,x,_]),b.useEffect(()=>{if(!s)return;function C(){return!!(g&&x&&Sr(g.nodesRef.current,x).length>0)}function k(L){const B=Od(r,"close",y.pointerType),I=()=>{c.setOpen(!1,ot(Vn,L)),g?.events.emit("floating.closed",L)};B?y.openChangeTimeout.start(B,I):(y.openChangeTimeout.clear(),I())}function R(L){const B=Rn(L);if(!WA(B)){y.interactedInside=!1;return}y.interactedInside=B?.closest("[aria-haspopup]")!=null}function N(){y.openChangeTimeout.clear(),S.clear(),g?.events.off("floating.closed",M),_()}function A(L){if(C()&&g){g.events.on("floating.closed",M);return}if(Ad(L.relatedTarget,c.context.triggerElements))return;const B=m.current.floatingContext?.nodeId??i,I=L.relatedTarget;if(!(g&&B&&ft(I)&&Sr(g.nodesRef.current,B,!1).some(z=>Qe(z.context?.elements.floating,I)))){if(y.handler){y.handler(L);return}_(),w()||k(L)}}function M(L){!g||!x||C()||S.start(0,()=>{g.events.off("floating.closed",M),c.setOpen(!1,ot(Vn,L)),g.events.emit("floating.closed",L)})}const O=f;return ts(O&&pt(O,"mouseenter",N),O&&pt(O,"mouseleave",A),O&&pt(O,"pointerdown",R,!0),()=>{g?.events.off("floating.closed",M)})},[s,f,c,m,r,i,w,_,y,g,x,S])}const y5={current:null};function j5(e,n={}){const{enabled:s=!0,delay:r=0,handleClose:i=null,mouseOnly:c=!1,restMs:d=0,move:f=!0,triggerElementRef:p=y5,externalTree:m,isActiveTrigger:g=!0,getHandleCloseContext:x,isClosing:y,shouldOpen:S}=n,w="rootStore"in e?e.rootStore:e,{dataRef:j,events:_}=w.context,C=Dl(m),k=Mx(w),R=b.useRef(!1),N=pn(i),A=pn(r),M=pn(d),O=pn(s),L=pn(S),B=pn(y),I=Le(()=>nw(j.current.openEvent?.type,k.interactedInside)),D=Le(()=>L.current?.()!==!1),z=Le((Y,q,F)=>{const Z=w.context.triggerElements;if(Z.hasElement(q))return!Y||!Qe(Y,q);if(!ft(F))return!1;const $=F;return Z.hasMatchingElement(X=>Qe(X,$))&&(!Y||!Qe(Y,$))}),H=Le(()=>{if(!k.handler)return;yt(w.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),V=Le(()=>{qd(k)});return g&&(k.handleCloseOptions=N.current?.__options),b.useEffect(()=>H,[H]),b.useEffect(()=>{if(!s)return;function Y(q){q.open?R.current=!1:(R.current=q.reason===Vn,H(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return _.on("openchange",Y),()=>{_.off("openchange",Y)}},[s,_,k,H]),b.useEffect(()=>{if(!s)return;function Y($,X=!0){const U=Od(A.current,"close",k.pointerType);U?k.openChangeTimeout.start(U,()=>{w.setOpen(!1,ot(Vn,$)),C?.events.emit("floating.closed",$)}):X&&(k.openChangeTimeout.clear(),w.setOpen(!1,ot(Vn,$)),C?.events.emit("floating.closed",$))}const q=p.current??(g?w.select("domReferenceElement"):null);if(!ft(q))return;function F($){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,c&&!lo(k.pointerType))return;const X=L1(M.current),U=Od(A.current,"open",k.pointerType),K=Rn($),G=$.currentTarget??null,W=w.select("domReferenceElement");let ie=G;if(ft(K)&&!w.context.triggerElements.hasElement(K)){for(const Ee of w.context.triggerElements.elements())if(Qe(Ee,K)){ie=Ee;break}}ft(G)&&ft(W)&&!w.context.triggerElements.hasElement(G)&&Qe(G,W)&&(ie=W);const re=ie==null?!1:z(W,ie,K),oe=w.select("open"),ce=B.current?.()??w.select("transitionStatus")==="ending",ee=!oe&&ce&&R.current,Te=!re&&ft(ie)&&ft(W)&&Qe(W,ie)&&ee,$e=X>0&&!U,be=re&&(oe||ee)||Te,Ce=!oe||re;if(be){D()&&w.setOpen(!0,ot(Vn,$,ie));return}$e||(U?k.openChangeTimeout.start(U,()=>{Ce&&D()&&w.setOpen(!0,ot(Vn,$,ie))}):Ce&&D()&&w.setOpen(!0,ot(Vn,$,ie)))}function Z($){if(I()){V();return}H();const X=w.select("domReferenceElement"),U=yt(X);k.restTimeout.clear(),k.restTimeoutPending=!1;const K=j.current.floatingContext??x?.();if(Ad($.relatedTarget,w.context.triggerElements))return;if(N.current&&K){w.select("open")||k.openChangeTimeout.clear();const W=p.current;k.handler=N.current({...K,tree:C,x:$.clientX,y:$.clientY,onClose(){V(),H(),O.current&&!I()&&W===w.select("domReferenceElement")&&Y($,!0)}}),U.addEventListener("mousemove",k.handler),k.handler($);return}(k.pointerType==="touch"?!Qe(w.select("floatingElement"),$.relatedTarget):!0)&&Y($)}return f?ts(pt(q,"mousemove",F,{once:!0}),pt(q,"mouseenter",F),pt(q,"mouseleave",Z)):ts(pt(q,"mouseenter",F),pt(q,"mouseleave",Z))},[H,V,j,A,w,s,N,k,g,z,I,c,f,M,p,C,O,x,B,D]),b.useMemo(()=>{if(!s)return;function Y(q){k.pointerType=q.pointerType}return{onPointerDown:Y,onPointerEnter:Y,onMouseMove(q){const{nativeEvent:F}=q,Z=q.currentTarget,$=w.select("domReferenceElement"),X=w.select("open"),U=z($,Z,q.target);if(c&&!lo(k.pointerType))return;if(X&&U&&k.handleCloseOptions?.blockPointerEvents){const W=w.select("floatingElement");if(W){const ie=k.handleCloseOptions?.getScope?.()??Z.ownerDocument.body;a2(k,{scopeElement:ie,referenceElement:Z,floatingElement:W})}}const K=L1(M.current);if(X&&!U||K===0||!U&&k.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;k.restTimeout.clear();function G(){if(k.restTimeoutPending=!1,I())return;const W=w.select("open");!k.blockMouseMove&&(!W||U)&&D()&&w.setOpen(!0,ot(Vn,F,Z))}k.pointerType==="touch"?Cr.flushSync(()=>{G()}):U&&X?G():(k.restTimeoutPending=!0,k.restTimeout.start(K,G))}}},[s,k,I,z,c,w,M,D])}const _5="Escape";function jf(e,n,s){switch(e){case"vertical":return n;case"horizontal":return s;default:return n||s}}function Zu(e,n){return jf(n,e===mx||e===Ec,e===vr||e===yr)}function pg(e,n,s){return jf(n,e===Ec,s?e===vr:e===yr)||e==="Enter"||e===" "||e===""}function S5(e,n,s){return jf(n,s?e===vr:e===yr,e===Ec)}function w5(e,n,s,r){const i=s?e===yr:e===vr,c=e===mx;return n==="both"||n==="horizontal"&&r&&r>1?e===_5:jf(n,i,c)}function C5(e,n){const{listRef:s,activeIndex:r,onNavigate:i=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:g=!1,virtual:x=!1,focusItemOnOpen:y="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:j=void 0,orientation:_="vertical",parentOrientation:C,cols:k=1,id:R,resetOnPointerLeave:N=!0,externalTree:A}=n,M="rootStore"in e?e.rootStore:e,O=M.useState("open"),L=M.useState("floatingElement"),B=M.useState("domReferenceElement"),I=M.context.dataRef,D=Md(L),z=mh(B),H=pn(D),V=hf(),Y=Dl(A),q=b.useRef(y),F=b.useRef(d??-1),Z=b.useRef(null),$=b.useRef(!0),X=Le(ye=>{i(F.current===-1?null:F.current,ye)}),U=b.useRef(X),K=b.useRef(!!L),G=b.useRef(O),W=b.useRef(!1),ie=b.useRef(!1),re=b.useRef(null),oe=pn(j),ce=pn(O),ee=pn(d),Te=pn(N),$e=yl(),be=yl(),Ce=Le(()=>{function ye(Ue){x?Y?.events.emit("virtualfocus",Ue):re.current=yd(Ue,{sync:W.current,preventScroll:!0})}const le=s.current[F.current],je=ie.current;le&&ye(le),(W.current?Ue=>Ue():Ue=>$e.request(Ue))(()=>{const Ue=s.current[F.current]||le;if(!Ue)return;le||ye(Ue),_e&&(je||!$.current)&&Ue.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Me(()=>{I.current.orientation=_},[I,_]),Me(()=>{c&&(O&&L?(F.current=d??-1,q.current&&d!=null&&(ie.current=!0,X())):K.current&&(F.current=-1,U.current()))},[c,O,L,d,X]),Me(()=>{if(c){if(!O){W.current=!1;return}if(L)if(r==null){if(W.current=!1,ee.current!=null)return;if(K.current&&(F.current=-1,Ce()),(!G.current||!K.current)&&q.current&&(Z.current!=null||q.current===!0&&Z.current==null)){let ye=0;const le=()=>{s.current[0]==null?(ye<2&&(ye?we=>be.request(we):queueMicrotask)(le),ye+=1):(F.current=Z.current==null||pg(Z.current,_,g)||m?vd(s):xh(s),Z.current=null,X())};le()}}else hc(s.current,r)||(F.current=r,Ce(),ie.current=!1)}},[c,O,L,r,ee,m,s,_,g,X,Ce,be]),Me(()=>{if(!c||L||!Y||x||!K.current)return;const ye=Y.nodesRef.current,le=ye.find(Ue=>Ue.id===V)?.context?.elements.floating,je=Pn(yt(L)),we=ye.some(Ue=>Ue.context&&Qe(Ue.context.elements.floating,je));le&&!we&&$.current&&le.focus({preventScroll:!0})},[c,L,Y,V,x]),Me(()=>{U.current=X,G.current=O,K.current=!!L}),Me(()=>{O||(Z.current=null,q.current=y)},[O,y]);const Ee=r!=null,Pe=Le(ye=>{if(!ce.current)return;const le=s.current.indexOf(ye.currentTarget);le!==-1&&(F.current!==le||r!==le)&&(F.current=le,X(ye))}),Ie=Le(()=>C??Y?.nodesRef.current.find(ye=>ye.id===V)?.context?.dataRef?.current.orientation),xe=Le(()=>vd(s,oe.current)),Ae=Le(ye=>{if($.current=!1,W.current=!0,ye.which===229||!ce.current&&ye.currentTarget===H.current)return;if(m&&w5(ye.key,_,g,k)){Zu(ye.key,Ie())||ga(ye),M.setOpen(!1,ot(P1,ye.nativeEvent)),$t(B)&&(x?Y?.events.emit("virtualfocus",B):B.focus());return}const le=F.current,je=vd(s,j),we=xh(s,j);if(z||(ye.key==="Home"&&(ga(ye),F.current=je,X(ye)),ye.key==="End"&&(ga(ye),F.current=we,X(ye))),k>1){const Ue=Array.from({length:s.current.length},()=>({width:1,height:1})),We=fw(Ue,k,!1),jt=We.findIndex(ke=>ke!=null&&!Ds(s.current,ke,j)),zt=We.reduce((ke,Ne,qe)=>Ne!=null&&!Ds(s.current,Ne,j)?qe:ke,-1),pe=We[dw(We.map(ke=>ke!=null?s.current[ke]:null),{event:ye,orientation:_,loopFocus:p,rtl:g,cols:k,disabledIndices:mw([...(typeof j!="function"?j:null)||s.current.map((ke,Ne)=>Ds(s.current,Ne,j)?Ne:void 0),void 0],We),minIndex:jt,maxIndex:zt,prevIndex:pw(F.current>we?je:F.current,Ue,We,k,ye.key===Ec?"bl":ye.key===(g?vr:yr)?"tr":"tl"),stopEvent:!0})];if(pe!=null&&(F.current=pe,X(ye)),_==="both")return}if(Zu(ye.key,_)){if(ga(ye),O&&!x&&Pn(ye.currentTarget.ownerDocument)===ye.currentTarget){F.current=pg(ye.key,_,g)?je:we,X(ye);return}pg(ye.key,_,g)?p?le>=we?f&&le!==s.current.length?F.current=-1:(W.current=!1,F.current=je):F.current=Ln(s.current,{startingIndex:le,disabledIndices:j}):F.current=Math.min(we,Ln(s.current,{startingIndex:le,disabledIndices:j})):p?le<=je?f&&le!==-1?F.current=s.current.length:(W.current=!1,F.current=we):F.current=Ln(s.current,{startingIndex:le,decrement:!0,disabledIndices:j}):F.current=Math.max(je,Ln(s.current,{startingIndex:le,decrement:!0,disabledIndices:j})),hc(s.current,F.current)&&(F.current=-1),X(ye)}}),_e=b.useMemo(()=>({onFocus(le){W.current=!0,Pe(le)},onClick:({currentTarget:le})=>le.focus({preventScroll:!0}),onMouseMove(le){W.current=!0,ie.current=!1,S&&Pe(le)},onPointerLeave(le){if(!ce.current||!$.current||le.pointerType==="touch")return;W.current=!0;const je=le.relatedTarget;if(!(!S||s.current.includes(je))&&Te.current&&(re.current?.(),re.current=null,F.current=-1,X(le),!x)){const we=H.current,Ue=Pn(yt(we));we&&Qe(we,Ue)&&we.focus({preventScroll:!0})}}}),[Pe,ce,H,S,s,X,Te,x]),Be=b.useMemo(()=>x&&O&&Ee&&{"aria-activedescendant":`${R}-${r}`},[x,O,Ee,R,r]),Fe=b.useMemo(()=>({"aria-orientation":_==="both"?void 0:_,...z?{}:Be,onKeyDown(ye){if(ye.key==="Tab"&&ye.shiftKey&&O&&!x){const le=Rn(ye.nativeEvent);if(le&&!Qe(H.current,le))return;ga(ye),M.setOpen(!1,ot(ff,ye.nativeEvent)),$t(B)&&B.focus();return}Ae(ye)},onPointerMove(){$.current=!0}}),[Be,Ae,H,_,z,M,O,x,B]),Ge=b.useMemo(()=>{function ye(we){M.setOpen(!0,ot(P1,we.nativeEvent,we.currentTarget))}function le(we){y==="auto"&&dx(we.nativeEvent)&&(q.current=!x)}function je(we){q.current=y,y==="auto"&&WS(we.nativeEvent)&&(q.current=!0)}return{onKeyDown(we){const Ue=M.select("open");$.current=!1;const We=we.key.startsWith("Arrow"),jt=S5(we.key,Ie(),g),zt=Zu(we.key,_),pe=(m?jt:zt)||we.key==="Enter"||we.key.trim()==="";if(x&&Ue)return Ae(we);if(!(!Ue&&!w&&We)){if(pe){const ke=Zu(we.key,Ie());Z.current=m&&ke?null:we.key}if(m){jt&&(ga(we),Ue?(F.current=xe(),X(we)):ye(we));return}zt&&(ee.current!=null&&(F.current=ee.current),ga(we),!Ue&&w?ye(we):Ae(we),Ue&&X(we))}},onFocus(we){M.select("open")&&!x&&(F.current=-1,X(we))},onPointerDown:je,onPointerEnter:je,onMouseDown:le,onClick:le}},[Ae,y,xe,m,X,M,w,_,Ie,g,ee,x]),De=b.useMemo(()=>({...Be,...Ge}),[Be,Ge]);return b.useMemo(()=>c?{reference:De,floating:Fe,item:_e,trigger:Ge}:{},[c,De,Fe,Ge,_e])}function k5(e,n){const{listRef:s,elementsRef:r,activeIndex:i,onMatch:c,onTyping:d,enabled:f=!0,resetMs:p=750,selectedIndex:m=null}=n,g="rootStore"in e?e.rootStore:e,x=g.useState("open"),y=na(),S=b.useRef(""),w=b.useRef(m??i??-1),j=b.useRef(null),_=Le(R=>{function N(z){const H=r?.current[z];return!H||pf(H)}function A(z,H,V=0){if(z.length===0)return-1;const Y=(V%z.length+z.length)%z.length,q=H.toLocaleLowerCase();for(let F=0;F<z.length;F+=1){const Z=(Y+F)%z.length;if(!(!z[Z]?.toLocaleLowerCase().startsWith(q)||!N(Z)))return Z}return-1}const M=s.current;if(S.current.length>0&&R.key===" "&&(ga(R),d?.(!0)),S.current.length>0&&S.current[0]!==" "&&A(M,S.current)===-1&&R.key!==" "&&d?.(!1),M==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;x&&R.key!==" "&&(ga(R),d?.(!0));const O=S.current==="";O&&(w.current=m??i??-1),M.every(z=>z?z[0]?.toLocaleLowerCase()!==z[1]?.toLocaleLowerCase():!0)&&S.current===R.key&&(S.current="",w.current=j.current),S.current+=R.key,y.start(p,()=>{S.current="",w.current=j.current,d?.(!1)});const I=((O?m??i??-1:w.current)??0)+1,D=A(M,S.current,I);D!==-1?(c?.(D),j.current=D):R.key!==" "&&(S.current="",d?.(!1))}),C=Le(R=>{const N=R.relatedTarget,A=g.select("domReferenceElement"),M=g.select("floatingElement");Qe(A,N)||Qe(M,N)||(y.clear(),S.current="",w.current=j.current,d?.(!1))});Me(()=>{!x&&m!==null||(y.clear(),j.current=null,S.current!==""&&(S.current=""))},[x,m,y]),Me(()=>{x&&S.current===""&&(w.current=m??i??-1)},[x,m,i]);const k=b.useMemo(()=>({onKeyDown:_,onBlur:C}),[_,C]);return b.useMemo(()=>f?{reference:k,floating:k}:{},[f,k])}const pj=.1,E5=pj*pj,Bt=.5;function Ju(e,n,s,r,i,c){return r>=n!=c>=n&&e<=(i-s)*(n-r)/(c-r)+s}function Wu(e,n,s,r,i,c,d,f,p,m){let g=!1;return Ju(e,n,s,r,i,c)&&(g=!g),Ju(e,n,i,c,d,f)&&(g=!g),Ju(e,n,d,f,p,m)&&(g=!g),Ju(e,n,p,m,s,r)&&(g=!g),g}function N5(e,n,s){return e>=s.x&&e<=s.x+s.width&&n>=s.y&&n<=s.y+s.height}function ed(e,n,s,r,i,c){const d=Math.min(s,i),f=Math.max(s,i),p=Math.min(r,c),m=Math.max(r,c);return e>=d&&e<=f&&n>=p&&n<=m}function R5(e={}){const{blockPointerEvents:n=!1}=e,s=new Va,r=({x:i,y:c,placement:d,elements:f,onClose:p,nodeId:m,tree:g})=>{const x=d?.split("-")[0];let y=!1,S=null,w=null,j=typeof performance<"u"?performance.now():0;function _(k,R){const N=performance.now(),A=N-j;if(S===null||w===null||A===0)return S=k,w=R,j=N,!1;const M=k-S,O=R-w,L=M*M+O*O,B=A*A*E5;return S=k,w=R,j=N,L<B}function C(){s.clear(),p()}return function(R){s.clear();const N=f.domReference,A=f.floating;if(!N||!A||x==null||i==null||c==null)return;const{clientX:M,clientY:O}=R,L=Rn(R),B=R.type==="mouseleave",I=Qe(A,L),D=Qe(N,L);if(I&&(y=!0,!B))return;if(D&&(y=!1,!B)){y=!0;return}if(B&&ft(R.relatedTarget)&&Qe(A,R.relatedTarget))return;function z(){return!!(g&&Sr(g.nodesRef.current,m).length>0)}function H(){z()||C()}if(z())return;const V=N.getBoundingClientRect(),Y=A.getBoundingClientRect(),q=i>Y.right-Y.width/2,F=c>Y.bottom-Y.height/2,Z=Y.width>V.width,$=Y.height>V.height,X=(Z?V:Y).left,U=(Z?V:Y).right,K=($?V:Y).top,G=($?V:Y).bottom;if(x==="top"&&c>=V.bottom-1||x==="bottom"&&c<=V.top+1||x==="left"&&i>=V.right-1||x==="right"&&i<=V.left+1){H();return}let W=!1;switch(x){case"top":W=ed(M,O,X,V.top+1,U,Y.bottom-1);break;case"bottom":W=ed(M,O,X,Y.top+1,U,V.bottom-1);break;case"left":W=ed(M,O,Y.right-1,G,V.left+1,K);break;case"right":W=ed(M,O,V.right-1,G,Y.left+1,K);break}if(W)return;if(y&&!N5(M,O,V)){H();return}if(!B&&_(M,O)){H();return}let ie=!1;switch(x){case"top":{const re=Z?Bt/2:Bt*4,oe=Z||q?i+re:i-re,ce=Z?i-re:q?i+re:i-re,ee=c+Bt+1,Te=q||Z?Y.bottom-Bt:Y.top,$e=q?Z?Y.bottom-Bt:Y.top:Y.bottom-Bt;ie=Wu(M,O,oe,ee,ce,ee,Y.left,Te,Y.right,$e);break}case"bottom":{const re=Z?Bt/2:Bt*4,oe=Z||q?i+re:i-re,ce=Z?i-re:q?i+re:i-re,ee=c-Bt,Te=q||Z?Y.top+Bt:Y.bottom,$e=q?Z?Y.top+Bt:Y.bottom:Y.top+Bt;ie=Wu(M,O,oe,ee,ce,ee,Y.left,Te,Y.right,$e);break}case"left":{const re=$?Bt/2:Bt*4,oe=$||F?c+re:c-re,ce=$?c-re:F?c+re:c-re,ee=i+Bt+1,Te=F||$?Y.right-Bt:Y.left,$e=F?$?Y.right-Bt:Y.left:Y.right-Bt;ie=Wu(M,O,Te,Y.top,$e,Y.bottom,ee,oe,ee,ce);break}case"right":{const re=$?Bt/2:Bt*4,oe=$||F?c+re:c-re,ce=$?c-re:F?c+re:c-re,ee=i-Bt,Te=F||$?Y.left+Bt:Y.right,$e=F?$?Y.left+Bt:Y.right:Y.left+Bt;ie=Wu(M,O,ee,oe,ee,ce,Te,Y.top,$e,Y.bottom);break}}ie?y||s.start(40,H):H()}};return r.__options={...e,blockPointerEvents:n},r}const T5={...t2,disabled:ze(e=>e.disabled),instantType:ze(e=>e.instantType),isInstantPhase:ze(e=>e.isInstantPhase),trackCursorAxis:ze(e=>e.trackCursorAxis),disableHoverablePopup:ze(e=>e.disableHoverablePopup),lastOpenChangeReason:ze(e=>e.openChangeReason),closeOnClick:ze(e=>e.closeOnClick),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport)};class Ox extends Rx{constructor(n,s,r=!1){const i=new yf,c={...A5(),...n};c.floatingRootContext=Ww(i,s,r),super(c,{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},T5)}setOpen=(n,s)=>{const r=s.reason,i=r===Vn,c=n&&r===bd,d=!n&&(r===mc||r===hx);if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(n,s),s.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,s);const f=()=>{const p={open:n,openChangeReason:r};c?p.instantType="focus":d?p.instantType="dismiss":r===Vn&&(p.instantType=void 0),Xw(p,n,s.trigger),this.update(p)};i?Cr.flushSync(f):f()};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,ot(mc,n))}static useStore(n,s){return Yw(n,(i,c)=>new Ox(s,i,c)).store}}function A5(){return{...Jw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const M5=FS(function(n){const{disabled:s=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:c=!1,trackCursorAxis:d="none",actionsRef:f,onOpenChange:p,onOpenChangeComplete:m,handle:g,triggerId:x,defaultTriggerId:y=null,children:S}=n,w=Ox.useStore(g?.store,{open:r,openProp:i,activeTriggerId:y,triggerIdProp:x});ix(()=>{i===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:y})}),w.useControlledProp("openProp",i),w.useControlledProp("triggerIdProp",x),w.useContextCallback("onOpenChange",p),w.useContextCallback("onOpenChangeComplete",m);const j=w.useState("open"),_=!s&&j,C=w.useState("activeTriggerId"),k=w.useState("mounted"),R=w.useState("payload");w.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:c}),w.useSyncedValue("disabled",s),Kw(w);const{forceUnmount:N,transitionStatus:A}=Qw(_,w),M=w.useState("isInstantPhase"),O=w.useState("instantType"),L=w.useState("lastOpenChangeReason"),B=b.useRef(null);Me(()=>{j&&s&&w.setOpen(!1,ot(aw))},[j,s,w]),Me(()=>{A==="ending"&&L===Bs||A!=="ending"&&M?(O!=="delay"&&(B.current=O),w.set("instantType","delay")):B.current!==null&&(w.set("instantType",B.current),B.current=null)},[A,M,L,O,w]),Me(()=>{_&&C==null&&w.set("payload",void 0)},[w,C,_]);const I=b.useCallback(()=>{w.setOpen(!1,ot(sw))},[w]);b.useImperativeHandle(f,()=>({unmount:N,close:I}),[N,I]);const D=_||k||!s&&d!=="none";return o.jsxs(YS.Provider,{value:w,children:[D&&o.jsx(O5,{store:w,disabled:s,trackCursorAxis:d}),typeof S=="function"?S({payload:R}):S]})});function O5({store:e,disabled:n,trackCursorAxis:s}){const r=e.useState("floatingRootContext"),i=Ex(r,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),c=i3(r,{enabled:!n&&s!=="none",axis:s==="none"?void 0:s}),d=b.useMemo(()=>Ma(c.reference,i.reference),[c.reference,i.reference]),f=b.useMemo(()=>Ma(c.trigger,i.trigger),[c.trigger,i.trigger]),p=b.useMemo(()=>Ma(vf,c.floating,i.floating),[c.floating,i.floating]);return Zw(e,{activeTriggerProps:d,inactiveTriggerProps:f,popupProps:p}),null}let no=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=co.startingStyle]="startingStyle",e[e.endingStyle=co.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Vd=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const z5={[Vd.popupOpen]:""},D5={[Vd.popupOpen]:"",[Vd.pressed]:""},L5={[no.open]:""},P5={[no.closed]:""},I5={[no.anchorHidden]:""},s2={open(e){return e?z5:null}},B5={open(e){return e?D5:null}},Pl={open(e){return e?L5:P5},anchorHidden(e){return e?I5:null}};function Tr(e){return gf(e,"base-ui")}const r2=b.createContext(void 0);function U5(){return b.useContext(r2)}let H5=(function(e){return e[e.popupOpen=Vd.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const q5=600,o2="data-base-ui-tooltip-trigger";function mj(e){if("composedPath"in e){const s=e.composedPath();for(let r=0;r<s.length;r+=1){const i=s[r];if(ft(i))return i}}const n=e.target;return ft(n)?n:null}function V5(e){let n=e;for(;n;){if(n.hasAttribute(o2))return n;const s=n.parentElement;if(s){n=s;continue}const r=n.getRootNode();n="host"in r&&ft(r.host)?r.host:null}return null}const $5=PA(function(n,s){const{render:r,className:i,style:c,handle:d,payload:f,disabled:p,delay:m,closeOnClick:g=!0,closeDelay:x,id:y,...S}=n,w=kc(!0),j=d?.store??w;if(!j)throw new Error(Mn(82));const _=Tr(y),C=j.useState("isTriggerActive",_),k=j.useState("isOpenedByTrigger",_),R=j.useState("floatingRootContext"),N=b.useRef(null),A=m??q5,M=x??0,{registerTrigger:O,isMountedByThisTrigger:L}=p5(_,N,j,{payload:f,closeOnClick:g,closeDelay:M}),B=U5(),{delayRef:I,isInstantPhase:D,hasProvider:z}=lM(R,{open:k}),H=Mx(R);j.useSyncedValue("isInstantPhase",D);const V=j.useState("disabled"),Y=p??V,q=pn(Y),F=j.useState("trackCursorAxis"),Z=j.useState("disableHoverablePopup"),$=b.useRef(!1),X=na(),U=b.useRef(void 0);function K(){const be=B?.delay,Ce=typeof I.current=="object"?I.current.open:void 0;let Ee=A;return z&&(Ce!==0?Ee=m??be??A:Ee=0),Ee}function G(be){const Ce=N.current;if(!Ce||!be)return!1;const Ee=V5(be);return Ee!==null&&Ee!==Ce&&Qe(Ce,Ee)}function W(be){const Ce=G(be);return $.current=Ce,Ce&&(H.openChangeTimeout.clear(),H.restTimeout.clear(),H.restTimeoutPending=!1,X.clear()),Ce}const ie=j5(R,{enabled:!Y,mouseOnly:!0,move:!1,handleClose:!Z&&F!=="both"?R5():null,restMs:K,delay(){const be=typeof I.current=="object"?I.current.close:void 0;let Ce=M;return x==null&&z&&(Ce=be),{close:Ce}},triggerElementRef:N,isActiveTrigger:C,isClosing:()=>j.select("transitionStatus")==="ending",shouldOpen(){return!$.current}}),re=b5(R,{enabled:!Y}).reference,oe=be=>{const Ce=$.current,Ee=mj(be),Pe=W(Ee),Ie=N.current,xe=Ie&&Ee&&Qe(Ie,Ee);if(Pe&&j.select("open")&&j.select("lastOpenChangeReason")===Vn){j.setOpen(!1,ot(Vn,be));return}if(Ce&&!Pe&&xe&&!q.current&&!j.select("open")&&Ie&&lo(U.current)){const Ae=()=>{!$.current&&!q.current&&!j.select("open")&&j.setOpen(!0,ot(Vn,be,Ie))},_e=K();_e===0?(X.clear(),Ae()):X.start(_e,Ae)}},ce=j.useState("triggerProps",L);return Ht("button",n,{state:{open:k},ref:[s,O,N],props:[ie,re,L||F!=="none"?ce:void 0,{onMouseOver(be){oe(be.nativeEvent)},onFocus(be){G(mj(be.nativeEvent))&&be.preventBaseUIHandler()},onMouseLeave(){$.current=!1,X.clear(),U.current=void 0},onPointerEnter(be){U.current=be.pointerType},onPointerDown(be){U.current=be.pointerType,j.set("closeOnClick",g),g&&!j.select("open")&&j.cancelPendingOpen(be.nativeEvent)},onClick(be){g&&!j.select("open")&&j.cancelPendingOpen(be.nativeEvent)},id:_,[H5.triggerDisabled]:Y?"":void 0,[o2]:Y?void 0:""},S],stateAttributesMapping:s2})}),l2=b.createContext(void 0);function G5(){const e=b.useContext(l2);if(e===void 0)throw new Error(Mn(70));return e}const F5=b.forwardRef(function(n,s){const{children:r,container:i,className:c,render:d,style:f,...p}=n,{portalNode:m,portalSubtree:g}=Ow({container:i,ref:s,componentProps:n,elementProps:p});return!g&&!m?null:o.jsxs(b.Fragment,{children:[g,m&&Cr.createPortal(r,m)]})}),Y5=b.forwardRef(function(n,s){const{keepMounted:r=!1,...i}=n;return kc().useState("mounted")||r?o.jsx(l2.Provider,{value:r,children:o.jsx(F5,{ref:s,...i})}):null}),i2=b.createContext(void 0);function c2(){const e=b.useContext(i2);if(e===void 0)throw new Error(Mn(71));return e}const X5=b.createContext(void 0);function zx(){return b.useContext(X5)?.direction??"ltr"}const K5=e=>({name:"arrow",options:e,async fn(n){const{x:s,y:r,placement:i,rects:c,platform:d,elements:f,middlewareData:p}=n,{element:m,padding:g=0,offsetParent:x="real"}=Hs(e,n)||{};if(m==null)return{};const y=uw(g),S={x:s,y:r},w=jx(i),j=yx(w),_=await d.getDimensions(m),C=w==="y",k=C?"top":"left",R=C?"bottom":"right",N=C?"clientHeight":"clientWidth",A=c.reference[j]+c.reference[w]-S[w]-c.floating[j],M=S[w]-c.reference[w],O=x==="real"?await d.getOffsetParent?.(m):f.floating;let L=f.floating[N]||c.floating[j];(!L||!await d.isElement?.(O))&&(L=f.floating[N]||c.floating[j]);const B=A/2-M/2,I=L/2-_[j]/2-1,D=Math.min(y[k],I),z=Math.min(y[R],I),H=D,V=L-_[j]-z,Y=L/2-_[j]/2+B,q=gh(H,Y,V),F=!p.arrow&&Nr(i)!=null&&Y!==q&&c.reference[j]/2-(Y<H?D:z)-_[j]/2<0,Z=F?Y<H?Y-H:Y-V:0;return{[w]:S[w]+Z,data:{[w]:q,centerOffset:Y-q-Z,...F&&{alignmentOffset:Z}},reset:F}}}),Q5=(e,n)=>({...K5(e),options:[e,n]}),Z5={name:"hide",async fn(e){const{width:n,height:s,x:r,y:i}=e.rects.reference,c=n===0&&s===0&&r===0&&i===0;return{data:{referenceHidden:(await Z3().fn(e)).data?.referenceHidden||c}}}},_d={sideX:"left",sideY:"top"},J5={name:"adaptiveOrigin",async fn(e){const{x:n,y:s,rects:{floating:r},elements:{floating:i},platform:c,strategy:d,placement:f}=e,p=Qt(i),m=p.getComputedStyle(i);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:n,y:s,data:_d};const x=await c.getOffsetParent?.(i);let y={width:0,height:0};if(d==="fixed"&&p?.visualViewport)y={width:p.visualViewport.width,height:p.visualViewport.height};else if(x===p){const k=yt(i);y={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await c.isElement?.(x)&&(y=await c.getDimensions(x));const S=aa(f);let w=n,j=s;S==="left"&&(w=y.width-(n+r.width)),S==="top"&&(j=y.height-(s+r.height));const _=S==="left"?"right":_d.sideX,C=S==="top"?"bottom":_d.sideY;return{x:w,y:j,data:{sideX:_,sideY:C}}}};function u2(e,n,s){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?s?"inline-start":"inline-end":"right",bottom:"bottom",left:r?s?"inline-end":"inline-start":"left"}[n]}function gj(e,n,s){const{rects:r,placement:i}=e;return{side:u2(n,aa(i),s),align:Nr(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function d2(e){const{anchor:n,positionMethod:s="absolute",side:r="bottom",sideOffset:i=0,align:c="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:p=5,sticky:m=!1,arrowPadding:g=5,disableAnchorTracking:x=!1,inline:y,keepMounted:S=!1,floatingRootContext:w,mounted:j,collisionAvoidance:_,shiftCrossAxis:C=!1,nodeId:k,adaptiveOrigin:R,lazyFlip:N=!1,externalTree:A}=e,[M,O]=b.useState(null);!j&&M!==null&&O(null);const L=_.side||"flip",B=_.align||"flip",I=_.fallbackAxisSide||"end",D=typeof n=="function"?n:void 0,z=Le(D),H=D?z:n,V=pn(n),Y=pn(j),F=zx()==="rtl",Z=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[r],$=c==="center"?Z:`${Z}-${c}`;let X=p;const U=1,K=r==="bottom"?U:0,G=r==="top"?U:0,W=r==="right"?U:0,ie=r==="left"?U:0;typeof X=="number"?X={top:X+K,right:X+ie,bottom:X+G,left:X+W}:X&&(X={top:(X.top||0)+K,right:(X.right||0)+ie,bottom:(X.bottom||0)+G,left:(X.left||0)+W});const re={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:X},oe=b.useRef(null),ce=pn(i),ee=pn(d),Te=typeof i!="function"?i:0,$e=typeof d!="function"?d:0,be=[];y&&be.push(y),be.push(F3(mt=>{const Nt=gj(mt,r,F),Zt=typeof ce.current=="function"?ce.current(Nt):ce.current,St=typeof ee.current=="function"?ee.current(Nt):ee.current;return{mainAxis:Zt,crossAxis:St,alignmentAxis:St}},[Te,$e,F,r]));const Ce=B==="none"&&L!=="shift",Ee=!Ce&&(m||C||L==="shift"),Pe=L==="none"?null:K3({...re,padding:{top:X.top+U,right:X.right+U,bottom:X.bottom+U,left:X.left+U},mainAxis:!C&&L==="flip",crossAxis:B==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),Ie=Ce?null:Y3(mt=>{const Nt=yt(mt.elements.floating).documentElement;return{...re,rootBoundary:C?{x:0,y:0,width:Nt.clientWidth,height:Nt.clientHeight}:void 0,mainAxis:B!=="none",crossAxis:Ee,limiter:m||C?void 0:X3(Zt=>{if(!oe.current)return{};const{width:St,height:an}=oe.current.getBoundingClientRect(),Ft=Ta(aa(Zt.placement)),un=Ft==="y"?St:an,On=Ft==="y"?X.left+X.right:X.top+X.bottom;return{offset:un/2+On/2}})}},[re,m,C,X,B]);L==="shift"||B==="shift"||c==="center"?be.push(Ie,Pe):be.push(Pe,Ie),be.push(Q3({...re,apply({elements:{floating:mt},availableWidth:Nt,availableHeight:Zt,rects:St}){if(!Y.current)return;const an=mt.style;an.setProperty("--available-width",`${Nt}px`),an.setProperty("--available-height",`${Zt}px`);const Ft=Qt(mt).devicePixelRatio||1,{x:un,y:On,width:Yn,height:oa}=St.reference,Xn=(Math.round((un+Yn)*Ft)-Math.round(un*Ft))/Ft,is=(Math.round((On+oa)*Ft)-Math.round(On*Ft))/Ft;an.setProperty("--anchor-width",`${Xn}px`),an.setProperty("--anchor-height",`${is}px`)}}),Q5(mt=>({element:oe.current||yt(mt.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(mt){const{elements:Nt,middlewareData:Zt,placement:St,rects:an,y:Ft}=mt,un=aa(St),On=Ta(un),Yn=oe.current,oa=Zt.arrow?.x||0,Xn=Zt.arrow?.y||0,is=Yn?.clientWidth||0,zn=Yn?.clientHeight||0,la=oa+is/2,Da=Xn+zn/2,cs=Math.abs(Zt.shift?.y||0),it=an.reference.height/2,Dt=typeof i=="function"?i(gj(mt,r,F)):i,Sn=cs>Dt,sn={top:`${la}px calc(100% + ${Dt}px)`,bottom:`${la}px ${-Dt}px`,left:`calc(100% + ${Dt}px) ${Da}px`,right:`${-Dt}px ${Da}px`}[un],Rt=`${la}px ${an.reference.y+it-Ft}px`;return Nt.floating.style.setProperty("--transform-origin",Ee&&On==="y"&&Sn?Rt:sn),{}}},Z5,R),Me(()=>{!j&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[j,w]);const xe=b.useMemo(()=>({elementResize:!x&&typeof ResizeObserver<"u",layoutShift:!x&&typeof IntersectionObserver<"u"}),[x]),{refs:Ae,elements:_e,x:Be,y:Fe,middlewareData:Ge,update:De,placement:ye,context:le,isPositioned:je,floatingStyles:we}=x5({rootContext:w,open:S?j:void 0,placement:$,middleware:be,strategy:s,whileElementsMounted:S?void 0:(...mt)=>oj(...mt,xe),nodeId:k,externalTree:A}),{sideX:Ue,sideY:We}=Ge.adaptiveOrigin||_d,jt=je?s:"fixed",zt=b.useMemo(()=>{const mt=R?{position:jt,[Ue]:Be,[We]:Fe}:{position:jt,...we};return je||(mt.opacity=0),mt},[R,jt,Ue,Be,We,Fe,we,je]),pe=b.useRef(null);Me(()=>{if(!j)return;const mt=V.current,Nt=typeof mt=="function"?mt():mt,St=(hj(Nt)?Nt.current:Nt)||null||null;St!==pe.current&&(Ae.setPositionReference(St),pe.current=St)},[j,Ae,H,V]),b.useEffect(()=>{if(!j)return;const mt=V.current;typeof mt!="function"&&hj(mt)&&mt.current!==pe.current&&(Ae.setPositionReference(mt.current),pe.current=mt.current)},[j,Ae,H,V]),b.useEffect(()=>{if(S&&j&&_e.domReference&&_e.floating)return oj(_e.domReference,_e.floating,De,xe)},[S,j,_e,De,xe]);const ke=aa(ye),Ne=u2(r,ke,F),qe=Nr(ye)||"center",at=!!Ge.hide?.referenceHidden;Me(()=>{N&&j&&je&&O(ke)},[N,j,je,ke]);const nn=b.useMemo(()=>({position:"absolute",top:Ge.arrow?.y,left:Ge.arrow?.x}),[Ge.arrow]),qt=Ge.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:zt,arrowStyles:nn,arrowRef:oe,arrowUncentered:qt,side:Ne,align:qe,physicalSide:ke,anchorHidden:at,refs:Ae,context:le,isPositioned:je,update:De}),[zt,nn,oe,qt,Ne,qe,ke,at,Ae,le,je,De])}function hj(e){return e!=null&&"current"in e}function Dx(e){return e==="starting"?XM:ln}function f2(e,n,{styles:s,transitionStatus:r,props:i,refs:c,hidden:d,inert:f=!1}){const p={...s};return f&&(p.pointerEvents="none"),Ht("div",e,{state:n,ref:c,props:[{role:"presentation",hidden:d,style:p},Dx(r),i],stateAttributesMapping:Pl})}const W5=b.forwardRef(function(n,s){const{render:r,className:i,anchor:c,positionMethod:d="absolute",side:f="top",align:p="center",sideOffset:m=0,alignOffset:g=0,collisionBoundary:x="clipping-ancestors",collisionPadding:y=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:j=!1,collisionAvoidance:_=ZM,style:C,...k}=n,R=kc(),N=G5(),A=R.useState("open"),M=R.useState("mounted"),O=R.useState("trackCursorAxis"),L=R.useState("disableHoverablePopup"),B=R.useState("floatingRootContext"),I=R.useState("instantType"),D=R.useState("transitionStatus"),z=R.useState("hasViewport"),H=d2({anchor:c,positionMethod:d,floatingRootContext:B,mounted:M,side:f,sideOffset:m,align:p,alignOffset:g,collisionBoundary:x,collisionPadding:y,sticky:w,arrowPadding:S,disableAnchorTracking:j,keepMounted:N,collisionAvoidance:_,adaptiveOrigin:z?J5:void 0}),V=b.useMemo(()=>({open:A,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:O!=="none"?"tracking-cursor":I}),[A,H.side,H.align,H.anchorHidden,O,I]),Y=f2(n,V,{styles:H.positionerStyles,transitionStatus:D,props:k,refs:[s,R.useStateSetter("positionerElement")],hidden:!M,inert:!A||O==="both"||L});return o.jsx(i2.Provider,{value:H,children:Y})}),eO={...Pl,...Ll},tO=b.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=kc(),{side:p,align:m}=c2(),g=f.useState("open"),x=f.useState("instantType"),y=f.useState("transitionStatus"),S=f.useState("popupProps"),w=f.useState("floatingRootContext"),j=f.useState("disabled"),_=f.useState("closeDelay");Rr({open:g,ref:f.context.popupRef,onComplete(){g&&f.context.onOpenChangeComplete?.(!0)}}),v5(w,{enabled:!j,closeDelay:_});const C=f.useStateSetter("popupElement");return Ht("div",n,{state:{open:g,side:p,align:m,instant:x,transitionStatus:y},ref:[s,f.context.popupRef,C],props:[S,Dx(y),d],stateAttributesMapping:eO})}),nO=b.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=kc(),{arrowRef:p,side:m,align:g,arrowUncentered:x,arrowStyles:y}=c2(),S=f.useState("open"),w=f.useState("instantType");return Ht("div",n,{state:{open:S,side:m,align:g,uncentered:x,instant:w},ref:[s,p],props:[{style:y,"aria-hidden":!0},d],stateAttributesMapping:Pl})}),aO=function(n){const{delay:s,closeDelay:r,timeout:i=400}=n,c=b.useMemo(()=>({delay:s,closeDelay:r}),[s,r]),d=b.useMemo(()=>({open:s,close:r}),[s,r]);return o.jsx(r2.Provider,{value:c,children:o.jsx(oM,{delay:d,timeoutMs:i,children:n.children})})};function Lx(e){return Sx(19)?e:e?"true":void 0}function sO(e){const[n,s]=b.useState({current:e,previous:null});return e!==n.current&&s({current:e,previous:n.current}),n.previous}function Ot(...e){return GS(ox(e))}function rO({delay:e=0,...n}){return o.jsx(aO,{"data-slot":"tooltip-provider",delay:e,...n})}function Px({...e}){return o.jsx(M5,{"data-slot":"tooltip",...e})}function Ix({...e}){return o.jsx($5,{"data-slot":"tooltip-trigger",...e})}function Bx({className:e,side:n="top",sideOffset:s=4,align:r="center",alignOffset:i=0,children:c,...d}){return o.jsx(Y5,{children:o.jsx(W5,{align:r,alignOffset:i,side:n,sideOffset:s,className:"isolate z-50",children:o.jsxs(tO,{"data-slot":"tooltip-content",className:Ot("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:[c,o.jsx(nO,{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 Di({label:e,active:n,onClick:s,isAdd:r,isSettings:i,isDefault:c,icon:d,title:f,testId:p}){const m=e.trim()||"·",{initials:g,subLabel:x}=oO(m),y=r||i?"indigo":iO(m),S=x&&!r&&!i&&!c;return o.jsxs(Px,{children:[o.jsx(Ix,{render:o.jsxs("button",{type:"button",onClick:s,"data-testid":p,className:"group relative flex w-full cursor-pointer flex-col items-center gap-1",children:[o.jsx("span",{className:Oe("flex size-10 items-center justify-center rounded-xl text-sm font-bold transition-all",n&&"ring-2 ring-foreground ring-offset-2 ring-offset-card",r&&"border border-dashed border-muted-fg/50 bg-transparent text-muted-fg hover:bg-accent/60 hover:text-foreground",i&&"bg-muted text-muted-fg hover:bg-accent hover:text-foreground",c&&"overflow-hidden bg-muted",!r&&!i&&!c&&n&&fO(y),!r&&!i&&!c&&!n&&dO(y)),children:d??g}),S&&o.jsx("span",{className:"block max-w-[3.6rem] truncate text-[9px] leading-tight text-muted-fg group-hover:text-foreground",children:x})]})}),o.jsx(Bx,{side:"right",children:f||e})]})}function oO(e){const n=e.trim().replace(/[_\-.]+/g," ").replace(/\s+/g," ");if(!n)return{initials:"·",subLabel:null};const s=n.split(" ");if(s.length>=2)return{initials:(s[0][0]+s[1][0]).toUpperCase(),subLabel:lO(n)};const r=s[0];return r.length<=4?{initials:r[0].toUpperCase(),subLabel:r}:{initials:r[0].toUpperCase(),subLabel:r.slice(0,4)+"…"}}function lO(e){return e.length>6?e.slice(0,5)+"…":e}function iO(e){let n=0;for(let s=0;s<e.length;s++)n=n*31+e.charCodeAt(s)|0;return M1[Math.abs(n)%M1.length]}const cO={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"},uO={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 dO(e){return cO[e]}function fO(e){return uO[e]}function Mt({content:e,side:n="top",children:s}){return e?o.jsxs(Px,{children:[o.jsx(Ix,{render:s}),o.jsx(Bx,{side:n,children:e})]}):s}const p2=0,m2=1,g2=2,xj=3;var bj=Object.prototype.hasOwnProperty;function jh(e,n){var s,r;if(e===n)return!0;if(e&&n&&(s=e.constructor)===n.constructor){if(s===Date)return e.getTime()===n.getTime();if(s===RegExp)return e.toString()===n.toString();if(s===Array){if((r=e.length)===n.length)for(;r--&&jh(e[r],n[r]););return r===-1}if(!s||typeof e=="object"){r=0;for(s in e)if(bj.call(e,s)&&++r&&!bj.call(n,s)||!(s in n)||!jh(e[s],n[s]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const Ms=new WeakMap,Os=()=>{},Un=Os(),_h=Object,vt=e=>e===Un,Ja=e=>typeof e=="function",wr=(e,n)=>({...e,...n}),h2=e=>Ja(e.then),mg={},td={},Ux="undefined",Rc=typeof window!=Ux,Sh=typeof document!=Ux,pO=Rc&&"Deno"in window,mO=()=>Rc&&typeof window.requestAnimationFrame!=Ux,x2=(e,n)=>{const s=Ms.get(e);return[()=>!vt(n)&&e.get(n)||mg,r=>{if(!vt(n)){const i=e.get(n);n in td||(td[n]=i),s[5](n,wr(i,r),i||mg)}},s[6],()=>!vt(n)&&n in td?td[n]:!vt(n)&&e.get(n)||mg]};let wh=!0;const gO=()=>wh,[Ch,kh]=Rc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Os,Os],hO=()=>{const e=Sh&&document.visibilityState;return vt(e)||e!=="hidden"},xO=e=>(Sh&&document.addEventListener("visibilitychange",e),Ch("focus",e),()=>{Sh&&document.removeEventListener("visibilitychange",e),kh("focus",e)}),bO=e=>{const n=()=>{wh=!0,e()},s=()=>{wh=!1};return Ch("online",n),Ch("offline",s),()=>{kh("online",n),kh("offline",s)}},vO={isOnline:gO,isVisible:hO},yO={initFocus:xO,initReconnect:bO},vj=!_c.useId,ml=!Rc||pO,jO=e=>mO()?window.requestAnimationFrame(e):setTimeout(e,1),gg=ml?b.useEffect:b.useLayoutEffect,hg=typeof navigator<"u"&&navigator.connection,yj=!ml&&hg&&(["slow-2g","2g"].includes(hg.effectiveType)||hg.saveData),nd=new WeakMap,_O=e=>_h.prototype.toString.call(e),xg=(e,n)=>e===`[object ${n}]`;let SO=0;const Eh=e=>{const n=typeof e,s=_O(e),r=xg(s,"Date"),i=xg(s,"RegExp"),c=xg(s,"Object");let d,f;if(_h(e)===e&&!r&&!i){if(d=nd.get(e),d)return d;if(d=++SO+"~",nd.set(e,d),Array.isArray(e)){for(d="@",f=0;f<e.length;f++)d+=Eh(e[f])+",";nd.set(e,d)}if(c){d="#";const p=_h.keys(e).sort();for(;!vt(f=p.pop());)vt(e[f])||(d+=f+":"+Eh(e[f])+",");nd.set(e,d)}}else d=r?e.toJSON():n=="symbol"?e.toString():n=="string"?JSON.stringify(e):""+e;return d},Hx=e=>{if(Ja(e))try{e=e()}catch{e=""}const n=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Eh(e):"",[e,n]};let wO=0;const Nh=()=>++wO;async function b2(...e){const[n,s,r,i]=e,c=wr({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let d=c.populateCache;const f=c.rollbackOnError;let p=c.optimisticData;const m=y=>typeof f=="function"?f(y):f!==!1,g=c.throwOnError;if(Ja(s)){const y=s,S=[],w=n.keys();for(const j of w)!/^\$(inf|sub)\$/.test(j)&&y(n.get(j)._k)&&S.push(j);return Promise.all(S.map(x))}return x(s);async function x(y){const[S]=Hx(y);if(!S)return;const[w,j]=x2(n,S),[_,C,k,R]=Ms.get(n),N=()=>{const V=_[S];return(Ja(c.revalidate)?c.revalidate(w().data,y):c.revalidate!==!1)&&(delete k[S],delete R[S],V&&V[0])?V[0](g2).then(()=>w().data):w().data};if(e.length<3)return N();let A=r,M,O=!1;const L=Nh();C[S]=[L,0];const B=!vt(p),I=w(),D=I.data,z=I._c,H=vt(z)?D:z;if(B&&(p=Ja(p)?p(H,D):p,j({data:p,_c:H})),Ja(A))try{A=A(H)}catch(V){M=V,O=!0}if(A&&h2(A))if(A=await A.catch(V=>{M=V,O=!0}),L!==C[S][0]){if(O)throw M;return A}else O&&B&&m(M)&&(d=!0,j({data:H,_c:Un}));if(d&&!O)if(Ja(d)){const V=d(A,H);j({data:V,error:Un,_c:Un})}else j({data:A,error:Un,_c:Un});if(C[S][1]=Nh(),Promise.resolve(N()).then(()=>{j({_c:Un})}),O){if(g)throw M;return}return A}}const jj=(e,n)=>{for(const s in e)e[s][0]&&e[s][0](n)},CO=(e,n)=>{if(!Ms.has(e)){const s=wr(yO,n),r=Object.create(null),i=b2.bind(Un,e);let c=Os;const d=Object.create(null),f=(g,x)=>{const y=d[g]||[];return d[g]=y,y.push(x),()=>y.splice(y.indexOf(x),1)},p=(g,x,y)=>{e.set(g,x);const S=d[g];if(S)for(const w of S)w(x,y)},m=()=>{if(!Ms.has(e)&&(Ms.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,p,f]),!ml)){const g=s.initFocus(setTimeout.bind(Un,jj.bind(Un,r,p2))),x=s.initReconnect(setTimeout.bind(Un,jj.bind(Un,r,m2)));c=()=>{g&&g(),x&&x(),Ms.delete(e)}}};return m(),[e,i,m,c]}return[e,Ms.get(e)[4]]},kO=(e,n,s,r,i)=>{const c=s.errorRetryCount,d=i.retryCount,f=~~((Math.random()+.5)*(1<<(d<8?d:8)))*s.errorRetryInterval;!vt(c)&&d>c||setTimeout(r,f,i)},EO=jh,[v2,NO]=CO(new Map),RO=wr({onLoadingSlow:Os,onSuccess:Os,onError:Os,onErrorRetry:kO,onDiscarded:Os,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:yj?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:yj?5e3:3e3,compare:EO,isPaused:()=>!1,cache:v2,mutate:NO,fallback:{}},vO),TO=(e,n)=>{const s=wr(e,n);if(n){const{use:r,fallback:i}=e,{use:c,fallback:d}=n;r&&c&&(s.use=r.concat(c)),i&&d&&(s.fallback=wr(i,d))}return s},AO=b.createContext({}),MO="$inf$",y2=Rc&&window.__SWR_DEVTOOLS_USE__,OO=y2?window.__SWR_DEVTOOLS_USE__:[],zO=()=>{y2&&(window.__SWR_DEVTOOLS_REACT__=_c)},DO=e=>Ja(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],j2=()=>{const e=b.useContext(AO);return b.useMemo(()=>wr(RO,e),[e])},LO=e=>(n,s,r)=>e(n,s&&((...c)=>{const[d]=Hx(n),[,,,f]=Ms.get(v2);if(d.startsWith(MO))return s(...c);const p=f[d];return vt(p)?s(...c):(delete f[d],p)}),r),PO=OO.concat(LO),IO=e=>function(...s){const r=j2(),[i,c,d]=DO(s),f=TO(r,d);let p=e;const{use:m}=f,g=(m||[]).concat(PO);for(let x=g.length;x--;)p=g[x](p);return p(i,c||f.fetcher||null,f)},BO=(e,n,s)=>{const r=n[e]||(n[e]=[]);return r.push(s),()=>{const i=r.indexOf(s);i>=0&&(r[i]=r[r.length-1],r.pop())}};zO();const bg=_c.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(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),vg={dedupe:!0},_j=Promise.resolve(Un),UO=()=>Os,HO=(e,n,s)=>{const{cache:r,compare:i,suspense:c,fallbackData:d,revalidateOnMount:f,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:x,keepPreviousData:y,strictServerPrefetchWarning:S}=s,[w,j,_,C]=Ms.get(r),[k,R]=Hx(e),N=b.useRef(!1),A=b.useRef(!1),M=b.useRef(k),O=b.useRef(n),L=b.useRef(s),B=()=>L.current,I=()=>B().isVisible()&&B().isOnline(),[D,z,H,V]=x2(r,k),Y=b.useRef({}).current,q=vt(d)?vt(s.fallback)?Un:s.fallback[k]:d,F=(xe,Ae)=>{for(const _e in Y){const Be=_e;if(Be==="data"){if(!i(xe[Be],Ae[Be])&&(!vt(xe[Be])||!i(re,Ae[Be])))return!1}else if(Ae[Be]!==xe[Be])return!1}return!0},Z=!N.current,$=b.useMemo(()=>{const xe=D(),Ae=V(),_e=De=>{const ye=wr(De);return delete ye._k,(()=>{if(!k||!n||B().isPaused())return!1;if(Z&&!vt(f))return f;const je=vt(q)?ye.data:q;return vt(je)||p})()?{isValidating:!0,isLoading:!0,...ye}:ye},Be=_e(xe),Fe=xe===Ae?Be:_e(Ae);let Ge=Be;return[()=>{const De=_e(D());return F(De,Ge)?(Ge.data=De.data,Ge.isLoading=De.isLoading,Ge.isValidating=De.isValidating,Ge.error=De.error,Ge):(Ge=De,De)},()=>Fe]},[r,k]),X=Ud.useSyncExternalStore(b.useCallback(xe=>H(k,(Ae,_e)=>{F(_e,Ae)||xe()}),[r,k]),$[0],$[1]),U=w[k]&&w[k].length>0,K=X.data,G=vt(K)?q&&h2(q)?bg(q):q:K,W=X.error,ie=b.useRef(G),re=y?vt(K)?vt(ie.current)?G:ie.current:K:G,oe=k&&vt(G),ce=b.useRef(null);!ml&&Ud.useSyncExternalStore(UO,()=>(ce.current=!1,ce),()=>(ce.current=!0,ce));const ee=ce.current;S&&ee&&!c&&oe&&console.warn(`Missing pre-initiated data for serialized key "${k}" 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 Te=!k||!n||B().isPaused()||U&&!vt(W)?!1:Z&&!vt(f)?f:c?vt(G)?!1:p:vt(G)||p,$e=Z&&Te,be=vt(X.isValidating)?$e:X.isValidating,Ce=vt(X.isLoading)?$e:X.isLoading,Ee=b.useCallback(async xe=>{const Ae=O.current;if(!k||!Ae||A.current||B().isPaused())return!1;let _e,Be,Fe=!0;const Ge=xe||{},De=!_[k]||!Ge.dedupe,ye=()=>vj?!A.current&&k===M.current&&N.current:k===M.current,le={isValidating:!1,isLoading:!1},je=()=>{z(le)},we=()=>{const We=_[k];We&&We[1]===Be&&delete _[k]},Ue={isValidating:!0};vt(D().data)&&(Ue.isLoading=!0);try{if(De&&(z(Ue),s.loadingTimeout&&vt(D().data)&&setTimeout(()=>{Fe&&ye()&&B().onLoadingSlow(k,s)},s.loadingTimeout),_[k]=[Ae(R),Nh()]),[_e,Be]=_[k],_e=await _e,De&&setTimeout(we,s.dedupingInterval),!_[k]||_[k][1]!==Be)return De&&ye()&&B().onDiscarded(k),!1;le.error=Un;const We=j[k];if(!vt(We)&&(Be<=We[0]||Be<=We[1]||We[1]===0))return je(),De&&ye()&&B().onDiscarded(k),!1;const jt=D().data;le.data=i(jt,_e)?jt:_e,De&&ye()&&B().onSuccess(_e,k,s)}catch(We){we();const jt=B(),{shouldRetryOnError:zt}=jt;jt.isPaused()||(le.error=We,De&&ye()&&(jt.onError(We,k,jt),(zt===!0||Ja(zt)&&zt(We))&&(!B().revalidateOnFocus||!B().revalidateOnReconnect||I())&&jt.onErrorRetry(We,k,jt,pe=>{const ke=w[k];ke&&ke[0]&&ke[0](xj,pe)},{retryCount:(Ge.retryCount||0)+1,dedupe:!0})))}return Fe=!1,je(),!0},[k,r]),Pe=b.useCallback((...xe)=>b2(r,M.current,...xe),[]);if(gg(()=>{O.current=n,L.current=s,vt(K)||(ie.current=K)}),gg(()=>{if(!k)return;const xe=Ee.bind(Un,vg);let Ae=0;B().revalidateOnFocus&&(Ae=Date.now()+B().focusThrottleInterval);const Be=BO(k,w,(Fe,Ge={})=>{if(Fe==p2){const De=Date.now();B().revalidateOnFocus&&De>Ae&&I()&&(Ae=De+B().focusThrottleInterval,xe())}else if(Fe==m2)B().revalidateOnReconnect&&I()&&xe();else{if(Fe==g2)return Ee();if(Fe==xj)return Ee(Ge)}});return A.current=!1,M.current=k,N.current=!0,z({_k:R}),Te&&(_[k]||(vt(G)||ml?xe():jO(xe))),()=>{A.current=!0,Be()}},[k]),gg(()=>{let xe;function Ae(){const Be=Ja(m)?m(D().data):m;Be&&xe!==-1&&(xe=setTimeout(_e,Be))}function _e(){!D().error&&(g||B().isVisible())&&(x||B().isOnline())?Ee(vg).then(Ae):Ae()}return Ae(),()=>{xe&&(clearTimeout(xe),xe=-1)}},[m,g,x,k]),b.useDebugValue(re),c){if(!vj&&ml&&oe)throw new Error("Fallback data is required when using Suspense in SSR.");oe&&(O.current=n,L.current=s,A.current=!1);const xe=C[k],Ae=!vt(xe)&&oe?Pe(xe):_j;if(bg(Ae),!vt(W)&&oe)throw W;const _e=oe?Ee(vg):_j;!vt(re)&&oe&&(_e.status="fulfilled",_e.value=!0),bg(_e)}return{mutate:Pe,get data(){return Y.data=!0,re},get error(){return Y.error=!0,W},get isValidating(){return Y.isValidating=!0,be},get isLoading(){return Y.isLoading=!0,Ce}}},Je=IO(HO);let _l=null;function eo(e){_l=e}function qx(){return _l}class Tc extends Error{status;body;constructor(n,s,r){super(s),this.status=n,this.body=r}}async function Li(e,n,s,r={}){const i={"content-type":"application/json",..._l?{authorization:`Bearer ${_l}`}:{},...r.headers||{}},c=await fetch(n,{...r,method:e,headers:i,body:s!==void 0?JSON.stringify(s):void 0});if(!c.ok){let d="",f=null;try{f=await c.json(),d=f?.error||JSON.stringify(f)}catch{d=await c.text()}throw new Tc(c.status,`${e} ${n} → ${c.status}: ${d}`,f)}if(c.status!==204)return await c.json()}const he={get:e=>Li("GET",e),post:(e,n)=>Li("POST",e,n),put:(e,n)=>Li("PUT",e,n),patch:(e,n)=>Li("PATCH",e,n),del:e=>Li("DELETE",e)};async function _2(e,n,s,r){const i=await fetch(e,{method:"POST",signal:r,headers:{"content-type":"application/json",..._l?{authorization:`Bearer ${_l}`}:{}},body:JSON.stringify(n)});if(!i.ok||!i.body){const p=await i.text().catch(()=>"");throw new Tc(i.status,`POST ${e} → ${i.status}: ${p||"stream failed"}`)}const c=i.body.getReader(),d=new TextDecoder("utf-8");let f="";for(;;){const{value:p,done:m}=await c.read();if(m)break;f+=d.decode(p,{stream:!0});let g=f.indexOf(`
|
|
567
|
-
`);for(;g>=0;){const x=f.slice(0,g).trim();if(f=f.slice(g+1),x)try{s(JSON.parse(x))}catch{}g=f.indexOf(`
|
|
568
|
-
`)}}if(f.trim())try{s(JSON.parse(f.trim()))}catch{}}const qO={get:()=>he.get("/health")},ta={list:()=>he.get("/projects"),register:e=>he.post("/projects",{path:e}),remove:e=>he.del(`/projects/${encodeURIComponent(e)}`),rebuild:e=>he.post(`/projects/${encodeURIComponent(e)}/rebuild`),config:{show:e=>he.get(`/projects/${e}/config`),set:(e,n)=>he.patch(`/projects/${e}/config`,{set:n}),unset:(e,n)=>he.patch(`/projects/${e}/config`,{unset:n}),put:(e,n)=>he.put(`/projects/${e}/config`,n)},apcProject:{set:(e,n,s)=>he.patch(`/projects/${e}/apc-project`,{set:n,unset:s}),put:(e,n)=>he.put(`/projects/${e}/apc-project`,n)},memory:{get:e=>he.get(`/projects/${e}/memory`),put:(e,n)=>he.put(`/projects/${e}/memory`,{body:n})}},Wt={list:e=>he.get(`/projects/${e}/agents`),get:(e,n)=>he.get(`/projects/${e}/agents/${n}`),create:(e,n)=>he.post(`/projects/${e}/agents`,n),update:(e,n,s)=>he.patch(`/projects/${e}/agents/${encodeURIComponent(n)}`,s),remove:(e,n)=>he.del(`/projects/${e}/agents/${encodeURIComponent(n)}`),chat:(e,n,s)=>he.post(`/projects/${e}/agents/${encodeURIComponent(n)}/chat`,s),memory:{get:(e,n)=>he.get(`/projects/${e}/agents/${n}/memory`),put:(e,n,s)=>he.put(`/projects/${e}/agents/${n}/memory`,{body:s})},vault:e=>he.get(e?.includeRemoved?"/agents/vault?include_removed=1":"/agents/vault"),vaultCreate:(e,n={},s="")=>he.post("/agents/vault",{slug:e,fields:n,body:s}),vaultPatch:(e,n)=>he.patch(`/agents/vault/${encodeURIComponent(e)}`,n),vaultRemove:e=>he.del(`/agents/vault/${encodeURIComponent(e)}`),vaultRestore:e=>he.post(`/agents/vault/${encodeURIComponent(e)}/restore`),import:(e,n)=>he.post(`/projects/${e}/agents/import`,{slug:n})},Vx={list:(e,n)=>he.get(`/projects/${e}/agents/${n}/conversations`),get:(e,n,s)=>he.get(`/projects/${e}/agents/${n}/conversations/${s}`),compact:(e,n,s)=>he.post(s?`/projects/${e}/agents/${n}/conversations/${s}/compact`:`/projects/${e}/agents/${n}/compact`,{})},gr={list:e=>he.get(`/projects/${e}/routines`),get:(e,n)=>he.get(`/projects/${e}/routines/${n}`),run:(e,n)=>he.post(`/projects/${e}/routines/${n}/run`),enable:(e,n)=>he.post(`/projects/${e}/routines/${n}/enable`),disable:(e,n)=>he.post(`/projects/${e}/routines/${n}/disable`),upsert:(e,n)=>he.post(`/projects/${e}/routines`,n),remove:(e,n)=>he.del(`/projects/${e}/routines/${encodeURIComponent(n)}`)},hr={list:(e,n="open")=>he.get(`/projects/${e}/tasks?state=${n}`),global:(e="open")=>he.get(`/tasks?state=${e}`),add:(e,n)=>he.post(`/projects/${e}/tasks`,n),done:(e,n)=>he.post(`/projects/${e}/tasks/${n}/done`),drop:(e,n)=>he.post(`/projects/${e}/tasks/${n}/drop`),reopen:(e,n)=>he.post(`/projects/${e}/tasks/${n}/reopen`)},ac={list:e=>he.get(`/projects/${e}/mcps`),check:e=>he.get(`/projects/${e}/mcps/check`),add:(e,n,s)=>he.post(`/projects/${e}/mcps?scope=${n}`,s),remove:(e,n,s="shared")=>he.del(`/projects/${e}/mcps/${encodeURIComponent(n)}?scope=${s}`)},yg=e=>{const n=new URLSearchParams;for(const[r,i]of Object.entries(e))i!==void 0&&i!==""&&n.set(r,String(i));const s=n.toString();return s?`?${s}`:""},Rh={global:(e={})=>he.get(`/messages/global${yg(e)}`),project:(e,n={})=>he.get(`/projects/${e}/messages${yg(n)}`),search:(e,n,s=50)=>he.get(`/projects/${e}/messages/search${yg({q:n,limit:s})}`)},VO={global:e=>he.get(`/sessions${e?`?engine=${encodeURIComponent(e)}`:""}`)},$O={list:()=>he.get("/tools")},Tn={channels:{list:()=>he.get("/telegram/channels"),upsert:e=>he.post("/telegram/channels",e),patch:(e,n)=>he.patch(`/telegram/channels/${e}`,n),remove:e=>he.del(`/telegram/channels/${encodeURIComponent(e)}`)},contacts:{list:()=>he.get("/telegram/contacts"),patch:(e,n)=>he.patch(`/telegram/contacts/${encodeURIComponent(String(e))}`,n),remove:e=>he.del(`/telegram/contacts/${encodeURIComponent(String(e))}`)},roles:{list:()=>he.get("/telegram/roles"),set:(e,n)=>he.put(`/telegram/roles/${encodeURIComponent(e)}`,{tools:n}),remove:e=>he.del(`/telegram/roles/${encodeURIComponent(e)}`)},status:()=>he.get("/telegram/status"),start:()=>he.post("/telegram/start"),stop:()=>he.post("/telegram/stop"),send:e=>he.post("/telegram/send",e)},$d={list:()=>he.get("/engines"),models:e=>he.post("/engines/models",e)},Sl={reload:()=>he.post("/admin/reload"),shutdown:()=>he.post("/admin/shutdown"),config:{get:()=>he.get("/admin/config"),patch:e=>he.patch("/admin/config",e)},superAgent:()=>he.get("/admin/super-agent"),logs:(e="errors",n=200)=>he.get(`/admin/logs?file=${e}&limit=${n}`)},wl={list:()=>he.get("/pair/list"),revoke:e=>he.del(`/pair/revoke/${encodeURIComponent(e)}`),init:()=>he.post("/pair/init",{}),status:e=>he.get(`/pair/status/${encodeURIComponent(e)}`),confirm:e=>he.post("/pair/confirm",e)},Sj={get:()=>he.get("/identity"),patch:e=>he.patch("/identity",e)},S2={send:(e,n)=>he.post(`/projects/${e}/super-agent/chat`,n),stream:(e,n,s,r)=>_2(`/projects/${e}/super-agent/chat/stream`,n,s,r),summarize:e=>he.post("/super-agent/summarize",e)},GO={dirs:e=>he.get(`/admin/fs/dirs?path=${encodeURIComponent(e)}`)},FO=["alloy","echo","fable","onyx","nova","shimmer"],YO=["Kore","Puck","Charon","Fenrir","Aoede"],XO=["eleven_multilingual_v2","eleven_turbo_v2_5","eleven_flash_v2_5"],KO=["tts-1","tts-1-hd"],QO=["tiny","base","small","medium","large-v2","large-v3"],Gd={piper:{name:"Piper",note:"Local, offline (CLI + modelo .onnx). Sin API key.",local:!0},elevenlabs:{name:"ElevenLabs",note:"Cloud, multilingüe. Requiere API key."},openai:{name:"OpenAI",note:"Cloud (tts-1 / tts-1-hd). Usa la key de OpenAI."},gemini:{name:"Gemini",note:"Cloud (preview). Usa la key de Gemini."},mock:{name:"Mock",note:"Silencio de prueba. Fallback siempre disponible.",local:!0}};async function ZO(e){const n=qx(),s=await fetch(`/voice/tts?path=${encodeURIComponent(e)}`,{headers:n?{authorization:`Bearer ${n}`}:{}});if(!s.ok){const i=await s.text().catch(()=>"");throw new Error(`No se pudo leer el audio (${s.status}): ${i.slice(0,160)}`)}const r=await s.blob();return URL.createObjectURL(r)}const w2={providers:()=>he.get("/tts/providers"),say:e=>he.post("/tts/say",e),turn:e=>he.post("/voice/turn",e)},wj={manifest:()=>he.get("/deck/manifest"),setWidget:(e,n)=>he.patch(`/deck/widgets/${encodeURIComponent(e)}`,n),exec:e=>he.post("/deck/exec",e)},Zr=e=>`/projects/${e}/code/sessions`,Rs={sessions:{list:e=>he.get(Zr(e)).then(n=>n.sessions),get:(e,n)=>he.get(`${Zr(e)}/${n}`),create:(e,n={})=>he.post(Zr(e),n),update:(e,n,s)=>he.patch(`${Zr(e)}/${n}`,s),remove:(e,n)=>he.del(`${Zr(e)}/${n}`)},changes:(e,n)=>he.get(`${Zr(e)}/${n}/changes`),stream:(e,n,s,r,i)=>_2(`${Zr(e)}/${n}/chat/stream`,s,r,i)},gl={list:e=>he.get(`/projects/${encodeURIComponent(e)}/artifacts`),read:(e,n)=>he.get(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`),run:(e,n,s=[])=>he.post(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}/run`,{args:s}),remove:(e,n)=>he.del(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`),write:(e,n,s)=>he.patch(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`,{content:s}),rename:(e,n,s)=>he.patch(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`,{newName:s})},JO={list:e=>he.get(e?`/skills?project_path=${encodeURIComponent(e)}`:"/skills")};function Ac(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/projects",()=>ta.list(),{refreshInterval:rf.projects});return{projects:(e||[]).slice().sort((c,d)=>{const f=Number(c.id),p=Number(d.id);return f===0&&p!==0?-1:p===0&&f!==0?1:f-p}),error:n,isLoading:s,mutate:r}}function C2(e){const{projects:n,isLoading:s,mutate:r}=Ac();return{project:n.find(c=>String(c.id)===e)??null,isLoading:s,mutate:r}}const WO={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"},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",modules:{voice:"Voces",desktop:"Escritorio",deck:"Deck",code:"Code"}},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",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",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",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:"ej. America/Argentina/Buenos_Aires",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.",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:"Proyecto {pid} no encontrado.",rebuild:"Rebuild context",rebuild_done:"Rebuild OK.",unregister_confirm:"¿Desregistrar {label}? La carpeta no se borra.",unregistered:"Desregistrado.",base_subtitle:"Espacio general · super-agente",nav:{overview:"Overview",chat:"Chat",config:"Config",telegram:"Telegram",agents:"Agents",routines:"Rutinas",tasks:"Tasks",mcps:"MCPs",threads:"Chats",logs:"Logs",memories:"Memorias"},sections:{workspace:"Workspace",automation:"Automatización",knowledge:"Conversaciones",config:"Config"},overview:{tasks_open:"Tasks abiertas",routines:"Rutinas",agents:"Agents",mcps:"MCPs",chat:"Chat (super-agent)",chat_value:"abrir"},chat:{title:"Chat con agente",subtitle:"Chat directo con el agente del proyecto.",superagent_title:"Chat con {persona}",superagent_subtitle:"Chat con {persona} — el super-agente APX. Puede usar tools (proyectos, tasks, mcps, agentes).",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",clear:"Limpiar",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"},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}?",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",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:"Texto (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.",delete_success:"borrada."},agents:{title:"Agents",subtitle:"Definidos en AGENTS.md + .apc/agents/<slug>.md.",subtitle_full:"Definidos en AGENTS.md + .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}",new_title:"Nuevo 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, opcional)",url_label:"url",url_ph:"https://example.com/mcp",enabled_label:"Habilitado",add_btn:"Agregar",name_required:"name requerido",env_invalid:"env debe ser JSON válido",removed:"eliminado",added:"MCP agregado."},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."},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:{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
|
|
569
|
-
|
|
570
|
-
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_all:"Todos los engines",sessions_empty:"Sin sesiones.",sessions_error:"No pude leer las sesiones: {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:"Esa ruta no existe."},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]"}},e4={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"},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",modules:{voice:"Voices",desktop:"Desktop",deck:"Deck",code:"Code"}},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",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",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",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:"e.g. America/New_York",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.",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:"Project {pid} not found.",rebuild:"Rebuild context",rebuild_done:"Rebuild OK.",unregister_confirm:"Unregister {label}? The folder is not deleted.",unregistered:"Unregistered.",base_subtitle:"General workspace · super-agent",nav:{overview:"Overview",chat:"Chat",config:"Config",telegram:"Telegram",agents:"Agents",routines:"Routines",tasks:"Tasks",mcps:"MCPs",threads:"Chats",logs:"Logs",memories:"Memories"},sections:{workspace:"Workspace",automation:"Automation",knowledge:"Conversations",config:"Config"},overview:{tasks_open:"Open tasks",routines:"Routines",agents:"Agents",mcps:"MCPs",chat:"Chat (super-agent)",chat_value:"open"},chat:{title:"Chat with agent",subtitle:"Direct conversations with project agents. The super-agent does not intervene.",superagent_title:"Chat with {persona}",superagent_subtitle:"Chat with {persona} — the APX super-agent. Can use tools (projects, tasks, mcps, agents).",empty:"Send a message to start the conversation.",placeholder:"Type something and press enter to send (shift+enter = new line)",send:"Send",stop:"Stop",clear:"Clear",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"},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}?",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",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:"Text (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.",delete_success:"deleted."},agents:{title:"Agents",subtitle:"Defined in AGENTS.md + .apc/agents/<slug>.md.",subtitle_full:"Defined in AGENTS.md + .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}",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."},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."},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:{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
|
|
571
|
-
|
|
572
|
-
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_all:"All engines",sessions_empty:"No sessions.",sessions_error:"Could not read sessions: {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:"That route does not exist."},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]"}},$x={es:WO,en:e4};function t4(){try{const e=localStorage.getItem(Nn.language);if(e&&e in $x)return e}catch{}return"es"}let _f=t4();function n4(e){_f=e;try{localStorage.setItem(Nn.language,e)}catch{}}const a4=[{value:"es",label:"Español"},{value:"en",label:"English"}];function s4(){return _f}function r4(e){const n=$x[_f],s=e.split(".");let r=n;for(const i of s)if(r&&typeof r=="object"&&i in r)r=r[i];else return;return typeof r=="string"?r:void 0}function o4(e,n){return n?e.replace(/\{(\w+)\}/g,(s,r)=>r in n?String(n[r]):`{${r}}`):e}function l4(e){const n=r4(e);if(n!==void 0)return n;if(_f!=="es"){const s=$x.es,r=e.split(".");let i=s;for(const c of r)if(i&&typeof i=="object"&&c in i)i=i[c];else return;return typeof i=="string"?i:void 0}}function E(e,n){const s=l4(e);return s===void 0?e:o4(s,n)}function Gx(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/identity",()=>Sj.get());return{identity:e||{},error:n,isLoading:s,mutate:r,save:async c=>{const d=await Sj.patch(c);return await r(d,{revalidate:!1}),d}}}function Fx(){const{identity:e}=Gx();return e?.agent_name?.trim()||"APX"}function i4(){return[{id:"voice",label:E("nav.modules.voice"),href:"/m/voice",icon:IT},{id:"desktop",label:E("nav.modules.desktop"),href:"/m/desktop",icon:BT},{id:"deck",label:E("nav.modules.deck"),href:"/m/deck",icon:zT},{id:"code",label:E("nav.modules.code"),href:"/m/code",icon:oo}]}function c4({onSelect:e,onOpenRoby:n}){const{projects:s,isLoading:r}=Ac(),i=ra(),c=i4(),d=Fx(),f=g=>i.pathname===g||i.pathname.startsWith(`${g}/`),p=s.find(g=>String(g.id)==="0"),m=s.filter(g=>String(g.id)!=="0");return o.jsxs("aside",{className:"flex h-full w-20 flex-col items-center gap-3 overflow-y-auto bg-transparent py-3",children:[o.jsx(Mt,{content:E("nav.apx_admin"),side:"right",children:o.jsx("button",{type:"button",onClick:()=>e("/"),"data-testid":"nav-home",className:"mb-2 cursor-pointer",children:o.jsx(aA,{size:36})})}),r&&o.jsx("div",{className:"size-10 animate-pulse rounded-xl bg-muted"}),p&&o.jsx(Di,{label:E("base.title"),testId:"project-avatar-0",title:E("base.subtitle"),active:f("/p/0"),isDefault:!0,icon:o.jsx("img",{src:"/modules/superagent.png",alt:E("base.title"),className:"size-7 object-contain",draggable:!1}),onClick:()=>e("/p/0")}),o.jsx("div",{className:"my-0.5 h-px w-8 rounded-full bg-border"}),c.map(g=>o.jsx(Di,{label:g.label,testId:`module-avatar-${g.id}`,title:g.label,active:f(g.href),icon:o.jsx(g.icon,{size:18}),onClick:()=>e(g.href)},g.id)),m.length>0&&o.jsx("div",{className:"my-0.5 h-px w-8 rounded-full bg-border"}),m.map(g=>{const x=g.name||g.path.split("/").pop()||String(g.id),y=`/p/${g.id}`;return o.jsx(Di,{label:x,testId:`project-avatar-${g.id}`,title:`${x} — ${g.path}`,active:f(y),onClick:()=>e(y)},g.id)}),o.jsx(Di,{label:"Add",isAdd:!0,testId:"nav-add-project",icon:o.jsx(An,{size:18}),active:!1,onClick:()=>e("/?action=add-project"),title:E("nav.add_project")}),o.jsx("div",{className:"flex-1"}),o.jsx(Di,{label:"Settings",isSettings:!0,testId:"nav-settings",icon:o.jsx(Td,{size:16}),active:i.pathname==="/settings"||i.pathname.startsWith("/settings/"),onClick:()=>e("/settings"),title:E("nav.settings")}),o.jsx(Mt,{content:E("superagent.talk",{persona:d}),side:"right",children:o.jsx("button",{type:"button",onClick:n,"data-testid":"nav-roby","aria-label":E("superagent.talk",{persona:d}),className:"mt-1 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:o.jsx(vn,{size:18})})})]})}function k2(e){switch(e){case"personal":return"Personal";case"company":return"Company";case"app":return"App";case"software":return"Software";case"default":return"Default";case"other":return"Other";default:return E("nav.project")}}function Ye({title:e,description:n,action:s,className:r,children:i}){return o.jsxs("section",{className:Oe("rounded-xl border border-border bg-card p-5",r),children:[o.jsxs("header",{className:"mb-4 flex items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e}),n&&o.jsx("p",{className:"mt-0.5 text-sm text-muted-fg",children:n})]}),s]}),o.jsx("div",{children:i})]})}function Cj({children:e}){return o.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 Sf({ok:e}){return o.jsx("span",{className:Oe("inline-block size-2 rounded-full",e===null?"bg-muted-fg":e?"bg-emerald-500":"bg-red-500")})}const E2=b.createContext(void 0);function N2(e=!1){const n=b.useContext(E2);if(n===void 0&&!e)throw new Error(Mn(16));return n}function u4(e){const{focusableWhenDisabled:n,disabled:s,composite:r=!1,tabIndex:i=0,isNativeButton:c}=e,d=r&&n!==!1,f=r&&n===!1;return{props:b.useMemo(()=>{const m={onKeyDown(g){s&&n&&g.key!=="Tab"&&g.preventDefault()}};return r||(m.tabIndex=i,!c&&s&&(m.tabIndex=n?i:-1)),(c&&(n||d)||!c&&s)&&(m["aria-disabled"]=s),c&&(!n||f)&&(m.disabled=s),m},[r,s,n,d,f,c,i])}}function Il(e={}){const{disabled:n=!1,focusableWhenDisabled:s,tabIndex:r=0,native:i=!0,composite:c}=e,d=b.useRef(null),f=N2(!0),p=c??f!==void 0,{props:m}=u4({focusableWhenDisabled:s,disabled:n,composite:p,tabIndex:r,isNativeButton:i}),g=b.useCallback(()=>{const S=d.current;jg(S)&&p&&n&&m.disabled===void 0&&S.disabled&&(S.disabled=!1)},[n,m.disabled,p]);Me(g,[g]);const x=b.useCallback((S={})=>{const{onClick:w,onMouseDown:j,onKeyUp:_,onKeyDown:C,onPointerDown:k,...R}=S;return Ma({onClick(N){if(n){N.preventDefault();return}w?.(N)},onMouseDown(N){n||j?.(N)},onKeyDown(N){if(n||(Id(N),C?.(N),N.baseUIHandlerPrevented))return;const A=N.target===N.currentTarget,M=N.currentTarget,O=jg(M),L=!i&&d4(M),B=A&&(i?O:!L),I=N.key==="Enter",D=N.key===" ",z=M.getAttribute("role"),H=z?.startsWith("menuitem")||z==="option"||z==="gridcell";if(A&&p&&D){if(N.defaultPrevented&&H)return;N.preventDefault(),L||i&&O?(M.click(),N.preventBaseUIHandler()):B&&(w?.(N),N.preventBaseUIHandler());return}B&&(!i&&(D||I)&&N.preventDefault(),!i&&I&&w?.(N))},onKeyUp(N){if(!n){if(Id(N),_?.(N),N.target===N.currentTarget&&i&&p&&jg(N.currentTarget)&&N.key===" "){N.preventDefault();return}N.baseUIHandlerPrevented||N.target===N.currentTarget&&!i&&!p&&N.key===" "&&w?.(N)}},onPointerDown(N){if(n){N.preventDefault();return}k?.(N)}},i?{type:"button"}:{role:"button"},m,R)},[n,m,p,i]),y=Le(S=>{d.current=S,g()});return{getButtonProps:x,buttonRef:y}}function jg(e){return $t(e)&&e.tagName==="BUTTON"}function d4(e){return!!(e?.tagName==="A"&&e?.href)}const f4=b.forwardRef(function(n,s){const{render:r,className:i,disabled:c=!1,focusableWhenDisabled:d=!1,nativeButton:f=!0,style:p,...m}=n,{getButtonProps:g,buttonRef:x}=Il({disabled:c,focusableWhenDisabled:d,native:f});return Ht("button",n,{state:{disabled:c},ref:[s,x],props:[m,g]})}),kj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ej=ox,Yx=(e,n)=>s=>{var r;if(n?.variants==null)return Ej(e,s?.class,s?.className);const{variants:i,defaultVariants:c}=n,d=Object.keys(i).map(m=>{const g=s?.[m],x=c?.[m];if(g===null)return null;const y=kj(g)||kj(x);return i[m][y]}),f=s&&Object.entries(s).reduce((m,g)=>{let[x,y]=g;return y===void 0||(m[x]=y),m},{}),p=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:x,className:y,...S}=g;return Object.entries(S).every(w=>{let[j,_]=w;return Array.isArray(_)?_.includes({...c,...f}[j]):{...c,...f}[j]===_})?[...m,x,y]:m},[]);return Ej(e,d,p,s?.class,s?.className)},p4=Yx("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 uo({className:e,variant:n="default",size:s="default",...r}){return o.jsx(f4,{"data-slot":"button",className:Ot(p4({variant:n,size:s,className:e})),...r})}let Nj=(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 m4={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Xi={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},g4={disabled:!1,...Xi},Xx={valid(e){return e===null?null:e?{[Nj.valid]:""}:{[Nj.invalid]:""}}},h4={invalid:void 0,name:void 0,validityData:{state:m4,errors:[],error:"",value:"",initialValue:null},setValidityData:Bn,disabled:void 0,touched:Xi.touched,setTouched:Bn,dirty:Xi.dirty,setDirty:Bn,filled:Xi.filled,setFilled:Bn,focused:Xi.focused,setFocused:Bn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:g4,markedDirtyRef:{current:!1},registerFieldControl:Bn,validation:{getValidationProps:(e=ln)=>e,getInputValidationProps:(e=ln)=>e,inputRef:{current:null},commit:async()=>{}}},x4=b.createContext(h4);function Mc(e=!0){const n=b.useContext(x4);if(n.setValidityData===Bn&&!e)throw new Error(Mn(28));return n}const b4=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Bn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function R2(){return b.useContext(b4)}const v4=b.createContext({controlId:void 0,registerControlId:Bn,labelId:void 0,setLabelId:Bn,messageIds:[],setMessageIds:Bn,getDescriptionProps:e=>e});function wf(){return b.useContext(v4)}function y4(e,n,s,r=!0,i){const[c,d]=b.useState(),f=Tr(i?`${i}-label`:void 0),p=e??n??c;return Me(()=>{const m=e||n||!r?void 0:j4(s.current,f);c!==m&&d(m)}),p}function j4(e,n){const s=_4(e);if(s)return!s.id&&n&&(s.id=n),s.id||void 0}function _4(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const s=e.id;if(s){const i=e.nextElementSibling;if(i&&i.htmlFor===s)return i}const r=e.labels;return r&&r[0]}function Cf(e={}){const{id:n,implicit:s=!1,controlRef:r}=e,{controlId:i,registerControlId:c}=wf(),d=Tr(n),f=s?i:void 0,p=xa(()=>Symbol("labelable-control")),m=b.useRef(!1),g=b.useRef(n!=null),x=Le(()=>{!m.current||c===Bn||(m.current=!1,c(p.current,void 0))});return Me(()=>{if(c===Bn)return;let y;if(s){const S=r?.current;ft(S)&&S.closest("label")!=null?y=n??null:y=f??d}else if(n!=null)g.current=!0,y=n;else if(g.current)y=d;else{x();return}if(y===void 0){x();return}m.current=!0,c(p.current,y)},[n,r,f,c,s,d,p,x]),b.useEffect(()=>x,[x]),i??d}function bc({controlled:e,default:n,name:s,state:r="value"}){const{current:i}=b.useRef(e!==void 0),[c,d]=b.useState(n),f=i?e:c,p=b.useCallback(m=>{i||d(m)},[]);return[f,p]}function Kx(e,n,s,r,i=!0){const{registerFieldControl:c}=Mc(),d=b.useRef(null);d.current||(d.current=Symbol()),Me(()=>{const f=d.current;return!f||!i?void 0:(c(f,{controlRef:e,getValue:r,id:n,value:s}),()=>{c(f,void 0)})},[e,i,r,n,c,s])}const S4=b.forwardRef(function(n,s){const{render:r,className:i,id:c,name:d,value:f,disabled:p=!1,onValueChange:m,defaultValue:g,autoFocus:x=!1,style:y,...S}=n,{state:w,name:j,disabled:_,setTouched:C,setDirty:k,validityData:R,setFocused:N,setFilled:A,validationMode:M,validation:O}=Mc(),L=_||p,B=j??d,I={...w,disabled:L},{labelId:D}=wf(),z=Cf({id:c});Me(()=>{const $=f!=null;O.inputRef.current?.value||$&&f!==""?A(!0):$&&f===""&&A(!1)},[O.inputRef,A,f]);const H=b.useRef(null);Me(()=>{x&&H.current===Pn(yt(H.current))&&N(!0)},[x,N]);const[V]=bc({controlled:f,default:g,name:"FieldControl",state:"value"}),Y=f!==void 0,q=Y?V:void 0,F=Le(()=>O.inputRef.current?.value);return Kx(O.inputRef,z,q,F),Ht("input",n,{ref:[s,H],state:I,props:[{id:z,disabled:L,name:B,ref:O.inputRef,"aria-labelledby":D,autoFocus:x,...Y?{value:q}:{defaultValue:g},onChange($){const X=$.currentTarget.value;m?.(X,ot(Bs,$.nativeEvent)),k(X!==R.initialValue),A(X!=="")},onFocus(){N(!0)},onBlur($){C(!0),N(!1),M==="onBlur"&&O.commit($.currentTarget.value)},onKeyDown($){$.currentTarget.tagName==="INPUT"&&$.key==="Enter"&&(C(!0),O.commit($.currentTarget.value))}},O.getInputValidationProps(),S],stateAttributesMapping:Xx})}),w4=b.forwardRef(function(n,s){return o.jsx(S4,{ref:s,...n})});function C4({className:e,type:n,...s}){return o.jsx(w4,{type:n,"data-slot":"input",className:Ot("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),...s})}function k4({className:e,...n}){return o.jsx("textarea",{"data-slot":"textarea",className:Ot("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),...n})}function E4(e){return Ht(e.defaultTagName??"div",e,e)}const N4=Yx("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 R4({className:e,variant:n="default",render:s,...r}){return E4({defaultTagName:"span",props:Ma({className:Ot(N4({variant:n}),e)},r),render:s,state:{slot:"badge",variant:n}})}const T2=b.createContext(void 0);function T4(){const e=b.useContext(T2);if(e===void 0)throw new Error(Mn(63));return e}let Rj=(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 A2={...Xx,checked(e){return e?{[Rj.checked]:""}:{[Rj.unchecked]:""}}};function Qx(e,n){const s=b.useRef(e),r=Le(n);Me(()=>{s.current!==e&&r(s.current)},[e,r]),Me(()=>{s.current=e},[e])}const A4=b.forwardRef(function(n,s){const{checked:r,className:i,defaultChecked:c,"aria-labelledby":d,form:f,id:p,inputRef:m,name:g,nativeButton:x=!1,onCheckedChange:y,readOnly:S=!1,required:w=!1,disabled:j=!1,render:_,uncheckedValue:C,value:k,style:R,...N}=n,{clearErrors:A}=R2(),{state:M,setTouched:O,setDirty:L,validityData:B,setFilled:I,setFocused:D,shouldValidateOnChange:z,validationMode:H,disabled:V,name:Y,validation:q}=Mc(),{labelId:F}=wf(),Z=V||j,$=Y??g,X=b.useRef(null),U=Us(X,m,q.inputRef),K=b.useRef(null),G=Tr(),W=Cf({id:p,implicit:!1,controlRef:K}),ie=x?void 0:W,[re,oe]=bc({controlled:r,default:!!c,name:"Switch",state:"checked"});Kx(K,G,re),Me(()=>{X.current&&I(X.current.checked)},[X,I]),Qx(re,()=>{A($),L(re!==B.initialValue),I(re),z()?q.commit(re):q.commit(re,!0)});const{getButtonProps:ce,buttonRef:ee}=Il({disabled:Z,native:x}),Te=y4(d,F,X,!x,ie),$e={id:x?W:G,role:"switch","aria-checked":re,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":Te,onFocus(){Z||D(!0)},onBlur(){const Pe=X.current;!Pe||Z||(O(!0),D(!1),H==="onBlur"&&q.commit(Pe.checked))},onClick(Pe){if(S||Z)return;Pe.preventDefault();const Ie=X.current;Ie&&Ie.dispatchEvent(new(Qt(Ie)).PointerEvent("click",{bubbles:!0,shiftKey:Pe.shiftKey,ctrlKey:Pe.ctrlKey,altKey:Pe.altKey,metaKey:Pe.metaKey}))}},be=Ma({checked:re,disabled:Z,form:f,id:ie,name:$,required:w,style:$?cw:bx,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:U,onChange(Pe){if(Pe.nativeEvent.defaultPrevented)return;if(S){Pe.preventDefault();return}const Ie=Pe.currentTarget.checked,xe=ot(Bs,Pe.nativeEvent);y?.(Ie,xe),!xe.isCanceled&&oe(Ie)},onFocus(){K.current?.focus()}},q.getInputValidationProps,k!==void 0?{value:k}:ln),Ce=b.useMemo(()=>({...M,checked:re,disabled:Z,readOnly:S,required:w}),[M,re,Z,S,w]),Ee=Ht("span",n,{state:Ce,ref:[s,K,ee],props:[$e,q.getValidationProps,N,ce],stateAttributesMapping:A2});return o.jsxs(T2.Provider,{value:Ce,children:[Ee,!re&&$&&C!==void 0&&o.jsx("input",{type:"hidden",form:f,name:$,value:C}),o.jsx("input",{...be,suppressHydrationWarning:!0})]})}),M4=b.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=T4();return Ht("span",n,{state:f,ref:s,stateAttributesMapping:A2,props:d})});function O4({className:e,size:n="default",...s}){return o.jsx(A4,{"data-slot":"switch","data-size":n,className:Ot("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),...s,children:o.jsx(M4,{"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 z4({className:e,...n}){return o.jsx(nf,{role:"status","aria-label":"Loading",className:Ot("size-4 animate-spin",e),...n})}const M2=b.createContext(!1),O2=b.createContext(void 0);function bo(e){const n=b.useContext(O2);if(e===!1&&n===void 0)throw new Error(Mn(27));return n}const D4={...Pl,...Ll},z2=b.forwardRef(function(n,s){const{render:r,className:i,style:c,forceRender:d=!1,...f}=n,{store:p}=bo(),m=p.useState("open"),g=p.useState("nested"),x=p.useState("mounted"),y=p.useState("transitionStatus");return Ht("div",n,{state:{open:m,transitionStatus:y},ref:[p.context.backdropRef,s],stateAttributesMapping:D4,props:[{role:"presentation",hidden:!x,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:d||!g})}),kf=b.forwardRef(function(n,s){const{render:r,className:i,style:c,disabled:d=!1,nativeButton:f=!0,...p}=n,{store:m}=bo(),g=m.useState("open"),{getButtonProps:x,buttonRef:y}=Il({disabled:d,native:f}),S={disabled:d};function w(j){g&&m.setOpen(!1,ot(aM,j.nativeEvent))}return Ht("button",n,{state:S,ref:[s,y],props:[{onClick:w},p,x]})}),D2=b.forwardRef(function(n,s){const{render:r,className:i,style:c,id:d,...f}=n,{store:p}=bo(),m=Tr(d);return p.useSyncedValueWithCleanup("descriptionElementId",m),Ht("p",n,{ref:s,props:[{id:m},f]})});let L4=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),P4=(function(e){return e[e.open=no.open]="open",e[e.closed=no.closed]="closed",e[e.startingStyle=no.startingStyle]="startingStyle",e[e.endingStyle=no.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const L2=b.createContext(void 0);function I4(){const e=b.useContext(L2);if(e===void 0)throw new Error(Mn(26));return e}const sc="ArrowUp",ul="ArrowDown",Fd="ArrowLeft",rc="ArrowRight",Ef="Home",Nf="End",P2=new Set([Fd,rc]),B4=new Set([Fd,rc,Ef,Nf]),I2=new Set([sc,ul]),U4=new Set([sc,ul,Ef,Nf]),B2=new Set([...P2,...I2]),Zx=new Set([...B2,Ef,Nf]),H4="Shift",q4="Control",V4="Alt",$4="Meta",G4=new Set([H4,q4,V4,$4]);function F4(e){return $t(e)&&e.tagName==="INPUT"}function Tj(e){return!!(F4(e)&&e.selectionStart!=null||$t(e)&&e.tagName==="TEXTAREA")}function Aj(e,n,s,r){if(!e||!n||!n.scrollTo)return;let i=e.scrollLeft,c=e.scrollTop;const d=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(d&&r!=="vertical"){const p=Mj(e,n,"left"),m=ad(e),g=ad(n);s==="ltr"&&(p+n.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight?i=p+n.offsetWidth+g.scrollMarginRight-e.clientWidth+m.scrollPaddingRight:p-g.scrollMarginLeft<e.scrollLeft+m.scrollPaddingLeft&&(i=p-g.scrollMarginLeft-m.scrollPaddingLeft)),s==="rtl"&&(p-g.scrollMarginRight<e.scrollLeft+m.scrollPaddingLeft?i=p-g.scrollMarginLeft-m.scrollPaddingLeft:p+n.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight&&(i=p+n.offsetWidth+g.scrollMarginRight-e.clientWidth+m.scrollPaddingRight))}if(f&&r!=="horizontal"){const p=Mj(e,n,"top"),m=ad(e),g=ad(n);p-g.scrollMarginTop<e.scrollTop+m.scrollPaddingTop?c=p-g.scrollMarginTop-m.scrollPaddingTop:p+n.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-m.scrollPaddingBottom&&(c=p+n.offsetHeight+g.scrollMarginBottom-e.clientHeight+m.scrollPaddingBottom)}e.scrollTo({left:i,top:c,behavior:"auto"})}function Mj(e,n,s){const r=s==="left"?"offsetLeft":"offsetTop";let i=0;for(;n.offsetParent&&(i+=n[r],n.offsetParent!==e);)n=n.offsetParent;return i}function ad(e){const n=getComputedStyle(e);return{scrollMarginTop:parseFloat(n.scrollMarginTop)||0,scrollMarginRight:parseFloat(n.scrollMarginRight)||0,scrollMarginBottom:parseFloat(n.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(n.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(n.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(n.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(n.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(n.scrollPaddingLeft)||0}}const Y4={...Pl,...Ll,nestedDialogOpen(e){return e?{[P4.nestedDialogOpen]:""}:null}},U2=b.forwardRef(function(n,s){const{render:r,className:i,style:c,finalFocus:d,initialFocus:f,...p}=n,{store:m}=bo(),g=m.useState("descriptionElementId"),x=m.useState("disablePointerDismissal"),y=m.useState("floatingRootContext"),S=m.useState("popupProps"),w=m.useState("modal"),j=m.useState("mounted"),_=m.useState("nested"),C=m.useState("nestedOpenDialogCount"),k=m.useState("open"),R=m.useState("openMethod"),N=m.useState("titleElementId"),A=m.useState("transitionStatus"),M=m.useState("role"),O=y.useState("floatingId"),L=p.id??O;I4(),Rr({open:k,ref:m.context.popupRef,onComplete(){k&&m.context.onOpenChangeComplete?.(!0)}});function B(Y){return Y==="touch"?m.context.popupRef.current:!0}const I=f===void 0?B:f,D=C>0,z=m.useStateSetter("popupElement"),V=Ht("div",n,{state:{open:k,nested:_,transitionStatus:A,nestedDialogOpen:D},props:[S,{id:L,"aria-labelledby":N??void 0,"aria-describedby":g??void 0,role:M,...vf,hidden:!j,onKeyDown(Y){Zx.has(Y.key)&&Y.stopPropagation()},style:{[L4.nestedDialogs]:C}},p],ref:[s,m.context.popupRef,z],stateAttributesMapping:Y4});return o.jsx(Dw,{context:y,openInteractionType:R,disabled:!j,closeOnFocusOut:!x,initialFocus:I,returnFocus:d,modal:w!==!1,restoreFocus:"popup",children:V})}),H2=b.forwardRef(function(n,s){const{cutout:r,...i}=n;let c;if(r){const d=r.getBoundingClientRect();c=`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 o.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})}),q2=b.forwardRef(function(n,s){const{keepMounted:r=!1,...i}=n,{store:c}=bo(),d=c.useState("mounted"),f=c.useState("modal"),p=c.useState("open");return d||r?o.jsx(L2.Provider,{value:r,children:o.jsxs(zw,{ref:s,...i,children:[d&&f===!0&&o.jsx(H2,{ref:c.context.internalBackdropRef,inert:Lx(!p)}),n.children]})}):null});let Oj={},zj={},Dj="";function X4(e){if(typeof document>"u")return!1;const n=yt(e);return Qt(n).innerWidth-n.documentElement.clientWidth>0}function K4(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=yt(e),r=s.documentElement,i=s.body,c=Er(r)?r:i,d=c.style.overflowY,f=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",c.style.overflowY="scroll";const p=c.offsetWidth;c.style.overflowY="hidden";const m=c.offsetWidth;return c.style.overflowY=d,r.style.scrollbarGutter=f,p===m}function Q4(e){const n=yt(e),s=n.documentElement,r=n.body,i=Er(s)?s:r,c={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,c)}}function Z4(e){const n=yt(e),s=n.documentElement,r=n.body,i=Qt(s);let c=0,d=0,f=!1;const p=Za.create();if(ux&&(i.visualViewport?.scale??1)!==1)return()=>{};function m(){const S=i.getComputedStyle(s),w=i.getComputedStyle(r),C=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=s.scrollTop,d=s.scrollLeft,Oj={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},Dj=s.style.scrollBehavior,zj={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const k=s.scrollHeight>s.clientHeight,R=s.scrollWidth>s.clientWidth,N=S.overflowY==="scroll"||w.overflowY==="scroll",A=S.overflowX==="scroll"||w.overflowX==="scroll",M=Math.max(0,i.innerWidth-r.clientWidth),O=Math.max(0,i.innerHeight-r.clientHeight),L=parseFloat(w.marginTop)+parseFloat(w.marginBottom),B=parseFloat(w.marginLeft)+parseFloat(w.marginRight),I=Er(s)?s:r;if(f=K4(e),f){s.style.scrollbarGutter=C,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(k||N)&&(s.style.overflowY="scroll"),(R||A)&&(s.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||O?`calc(100dvh - ${L+O}px)`:"100dvh",width:B||M?`calc(100vw - ${B+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=c,r.scrollLeft=d,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function g(){Object.assign(s.style,Oj),Object.assign(r.style,zj),f||(s.scrollTop=c,s.scrollLeft=d,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=Dj)}function x(){g(),p.request(m)}m();const y=pt(i,"resize",x);return()=>{p.cancel(),g(),typeof i.removeEventListener=="function"&&y()}}class J4{lockCount=0;restore=null;timeoutLock=Va.create();timeoutUnlock=Va.create();acquire(n){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(n)),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(n){if(this.lockCount===0||this.restore!==null)return;const r=yt(n).documentElement,i=Qt(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Bn;return}const c=QS||!X4(n);this.restore=c?Q4(n):Z4(n)}}const W4=new J4;function V2(e=!0,n=null){Me(()=>{if(e)return W4.acquire(n)},[e,n])}function ez(e){const{store:n,parentContext:s,actionsRef:r,isDrawer:i}=e,c=n.useState("open");m5(n,c),Kw(n);const{forceUnmount:d}=Qw(c,n),f=b.useCallback(()=>{n.setOpen(!1,ot(sw))},[n]);return b.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]),{parentContext:s,isDrawer:i}}function tz({store:e,dialogRoot:n}){const{parentContext:s,isDrawer:r}=n,i=e.useState("open"),c=e.useState("disablePointerDismissal"),d=e.useState("modal"),f=e.useState("popupElement"),p=e.useState("floatingRootContext"),[m,g]=b.useState(0),[x,y]=b.useState(0),S=m===0,w=Ex(p,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:d==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(k){if(!e.context.outsidePressEnabledRef.current||"button"in k&&k.button!==0||"touches"in k&&k.touches.length!==1)return!1;const R=Rn(k);if(S&&!c){const N=R;return d&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===N||e.context.backdropRef.current===N||Qe(N,f)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:S});V2(i&&d===!0,f),e.useContextCallback("onNestedDialogOpen",(k,R)=>{g(k),y(R)}),e.useContextCallback("onNestedDialogClose",()=>{g(0),y(0)}),b.useEffect(()=>(s?.onNestedDialogOpen&&i&&s.onNestedDialogOpen(m+1,x+(r?1:0)),s?.onNestedDialogClose&&!i&&s.onNestedDialogClose(),()=>{s?.onNestedDialogClose&&i&&s.onNestedDialogClose()}),[r,i,m,x,s]);const j=w.reference??ln,_=w.trigger??ln,C=b.useMemo(()=>Ma(vf,w.floating),[w.floating]);return Zw(e,{activeTriggerProps:j,inactiveTriggerProps:_,popupProps:C,nestedOpenDialogCount:m,nestedOpenDrawerCount:x}),null}const nz={...t2,modal:ze(e=>e.modal),nested:ze(e=>e.nested),nestedOpenDialogCount:ze(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ze(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ze(e=>e.disablePointerDismissal),openMethod:ze(e=>e.openMethod),descriptionElementId:ze(e=>e.descriptionElementId),titleElementId:ze(e=>e.titleElementId),viewportElement:ze(e=>e.viewportElement),role:ze(e=>e.role)};class Jx extends Rx{constructor(n,s,r=!1){const i=new yf,c=az(n);c.floatingRootContext=Ww(i,s,r),super(c,{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:i,onOpenChange:void 0,onOpenChangeComplete:void 0},nz)}setOpen=(n,s)=>{if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(n,s),s.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,s);const r={open:n};Xw(r,n,s.trigger),this.update(r)};static useStore(n,s){return Yw(n,(i,c)=>new Jx(s,i,c),!0).store}}function az(e={}){return{...Jw(),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 sz(e,n="dialog"){const{children:s,open:r,defaultOpen:i=!1,onOpenChange:c,onOpenChangeComplete:d,disablePointerDismissal:f=!1,modal:p=!0,actionsRef:m,handle:g,triggerId:x,defaultTriggerId:y=null}=e,S=n==="drawer",w=n==="alert-dialog",j=w?!0:p,_=w||f,C=w?"alertdialog":"dialog",k=bo(!0),N={modal:j,disablePointerDismissal:_,nested:!!k,role:C},A=Jx.useStore(g?.store,{open:i,openProp:r,activeTriggerId:y,triggerIdProp:x,...N});ix(()=>{const z=r===void 0&&A.state.open===!1&&i===!0?{open:!0,activeTriggerId:y}:null;w?A.update(z?{...N,...z}:N):z&&A.update(z)}),A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",x),A.useSyncedValues(N),A.useContextCallback("onOpenChange",c),A.useContextCallback("onOpenChangeComplete",d);const M=A.useState("open"),O=A.useState("mounted"),L=A.useState("payload"),B=ez({store:A,actionsRef:m,parentContext:k?.store.context,isDrawer:S}),I=M||O,D=b.useMemo(()=>({store:A}),[A]);return o.jsx(M2.Provider,{value:!1,children:o.jsxs(O2.Provider,{value:D,children:[I&&o.jsx(tz,{store:A,dialogRoot:B}),typeof s=="function"?s({payload:L}):s]})})}function $2(e){const n=b.useContext(M2)?"drawer":"dialog";return sz(e,n)}const G2=b.forwardRef(function(n,s){const{render:r,className:i,style:c,id:d,...f}=n,{store:p}=bo(),m=Tr(d);return p.useSyncedValueWithCleanup("titleElementId",m),Ht("h2",n,{ref:s,props:[{id:m},f]})});function rz(e){const n=b.useRef(""),s=b.useCallback(i=>{i.defaultPrevented||(n.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:b.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,n.current),n.current=""},[e]),onPointerDown:s}}function oz(e,n){const s=Le((c,d)=>{(typeof e=="function"?e():e)||n(d||(QS?"touch":""))}),{onClick:r,onPointerDown:i}=rz(s);return b.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function lz(e){const[n,s]=b.useState(null),r=oz(e,s);return Qx(e,i=>{i&&!e&&s(null)}),b.useMemo(()=>({openMethod:n,triggerProps:r}),[n,r])}function Th({...e}){return o.jsx($2,{"data-slot":"dialog",...e})}function iz({...e}){return o.jsx(q2,{"data-slot":"dialog-portal",...e})}function cz({...e}){return o.jsx(kf,{"data-slot":"dialog-close",...e})}function uz({className:e,...n}){return o.jsx(z2,{"data-slot":"dialog-overlay",className:Ot("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),...n})}function Ah({className:e,children:n,showCloseButton:s=!0,...r}){return o.jsxs(iz,{children:[o.jsx(uz,{}),o.jsxs(U2,{"data-slot":"dialog-content",className:Ot("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),...r,children:[n,s&&o.jsxs(kf,{"data-slot":"dialog-close",render:o.jsx(uo,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[o.jsx(xo,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Mh({className:e,...n}){return o.jsx("div",{"data-slot":"dialog-header",className:Ot("flex flex-col gap-2",e),...n})}function Lj({className:e,showCloseButton:n=!1,children:s,...r}){return o.jsxs("div",{"data-slot":"dialog-footer",className:Ot("-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),...r,children:[s,n&&o.jsx(kf,{render:o.jsx(uo,{variant:"outline"}),children:"Close"})]})}function Oh({className:e,...n}){return o.jsx(G2,{"data-slot":"dialog-title",className:Ot("font-heading text-base leading-none font-medium",e),...n})}function dz({className:e,...n}){return o.jsx(D2,{"data-slot":"dialog-description",className:Ot("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}const fz={primary:"default",secondary:"outline",ghost:"ghost",destructive:"destructive"},pz={sm:"sm",md:"default"};function ve({variant:e="secondary",size:n="md",loading:s,className:r,children:i,disabled:c,type:d="button",...f}){return o.jsxs(uo,{type:d,variant:fz[e],size:pz[n],disabled:c||s,className:r,...f,children:[s?o.jsx(Oa,{size:14}):null,i]})}function Re(e){return o.jsx(C4,{...e})}function en(e){return o.jsx(k4,{...e})}function mz(e){return o.jsx("select",{...e,className:Oe("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 fe({label:e,hint:n,badge:s,children:r}){return o.jsxs("label",{className:"block space-y-1",children:[o.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[e,s&&o.jsx("span",{className:"rounded bg-muted px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground",children:s})]}),r,n&&o.jsx("span",{className:"block text-[11px] text-muted-foreground/70",children:n})]})}function cn({checked:e,onChange:n,label:s,disabled:r}){return o.jsxs("label",{className:Oe("inline-flex items-center gap-2",r&&"opacity-50"),children:[o.jsx(O4,{checked:e,onCheckedChange:n,disabled:r}),s&&o.jsx("span",{className:"text-sm",children:s})]})}function Xe({children:e,tone:n="muted",className:s}){const r=n==="danger"?"destructive":n==="muted"?"secondary":"outline",i={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 o.jsx(R4,{variant:r,className:Oe("rounded-md",i[n],s),children:e})}function ba({open:e,onClose:n,title:s,description:r,children:i,footer:c,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 o.jsx(Th,{open:e,onOpenChange:p=>{p||n()},children:o.jsxs(Ah,{className:Oe("flex max-h-[88vh] w-full flex-col gap-0 p-0",f[d]),children:[(s||r)&&o.jsxs(Mh,{className:"shrink-0 border-b border-border px-5 py-4 pr-12",children:[s&&o.jsx(Oh,{children:s}),r&&o.jsx(dz,{children:r})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:i}),c&&o.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border px-5 py-4",children:c})]})})}function Oa({size:e=14}){return o.jsx(z4,{style:{width:e,height:e}})}function dt({children:e}){return o.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 nt({label:e="Cargando…"}){return o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(Oa,{})," ",e]})}const F2=b.createContext(null);let gz=1;function hz({children:e}){const[n,s]=b.useState([]),r=b.useCallback((c,d)=>{const f=gz++;s(p=>[...p,{id:f,kind:c,message:d}]),setTimeout(()=>{s(p=>p.filter(m=>m.id!==f))},4500)},[]),i=b.useMemo(()=>({show:r,success:c=>r("success",c),error:c=>r("error",c),info:c=>r("info",c)}),[r]);return b.useEffect(()=>(window.__apxToast=i,()=>{delete window.__apxToast}),[i]),o.jsxs(F2.Provider,{value:i,children:[e,o.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:n.map(c=>o.jsx("div",{className:Oe("pointer-events-auto overflow-hidden rounded-lg border bg-card px-3 py-2 text-sm shadow-lg",c.kind==="success"&&"border-emerald-500/40",c.kind==="error"&&"border-destructive/60",c.kind==="info"&&"border-border"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:Oe("mt-1 size-2 shrink-0 rounded-full",c.kind==="success"&&"bg-emerald-500",c.kind==="error"&&"bg-destructive",c.kind==="info"&&"bg-sky-500")}),o.jsx("span",{className:"flex-1 break-words",children:c.message})]})},c.id))})]})}function lt(){const e=b.useContext(F2);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function Y2(){const{data:e,error:n,isLoading:s}=Je("/health",()=>qO.get(),{refreshInterval:rf.health});return{health:e,error:n,isLoading:s,isUp:!n&&!!e}}function xz(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/engines",()=>$d.list());return{engines:e?.engines||[],error:n,isLoading:s,mutate:r}}function bz(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/telegram/status",()=>Tn.status(),{refreshInterval:rf.telegramStatus});return{status:e,error:n,isLoading:s,mutate:r}}function Wx(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/telegram/channels",()=>Tn.channels.list());return{channels:e?.channels||[],error:n,isLoading:s,mutate:r}}function eb(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/telegram/contacts",()=>Tn.contacts.list());return{contacts:e?.contacts||[],roles:e?.roles||{},channelOwners:e?.channel_owners||[],error:n,isLoading:s,mutate:r}}function Ua(e){return typeof e=="string"&&e.startsWith("*** set ***")}function jr(e,n="(no seteada)"){return Ua(e)?e:n}function Cl(e){if(typeof e!="string")return null;const n=e.match(/\(\.\.\.([^)]+)\)/);return n?n[1]:null}function X2({channel:e,onClose:n,onSaved:s}){const r=lt(),[i,c]=b.useState(!1),[d,f]=b.useState({name:""});b.useEffect(()=>{f(e?{...e,bot_token:""}:{name:""})},[e?.name]);const p=async()=>{if(!d.name?.trim()){r.error("name requerido");return}c(!0);try{e&&e.name!==""&&e?.name===d.name?await Tn.channels.patch(e.name,d):await Tn.channels.upsert(d),r.success("Canal guardado."),s()}catch(m){r.error(m.message)}finally{c(!1)}};return o.jsx(ba,{open:!!e,onClose:n,title:e?.name?`Editar canal: ${e.name}`:"Nuevo canal de Telegram",description:"POST /telegram/channels (upsert) — PATCH /telegram/channels/:name (parcial).",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:i,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:p,loading:i,children:E("common.save")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"name (slug interno)",children:o.jsx(Re,{value:d.name,onChange:m=>f({...d,name:m.target.value}),disabled:!!e?.name})}),o.jsx(fe,{label:"bot_token",hint:e?.bot_token?jr(e.bot_token):"Token del BotFather. Se guarda en ~/.apx/config.json.",children:o.jsx(Re,{type:"password",value:d.bot_token||"",onChange:m=>f({...d,bot_token:m.target.value}),placeholder:e?.bot_token?jr(e.bot_token):""})}),o.jsx(fe,{label:"chat_id",children:o.jsx(Re,{value:d.chat_id||"",onChange:m=>f({...d,chat_id:m.target.value})})}),o.jsx(fe,{label:"project",hint:"Slug o id del proyecto al que pinear este canal (opcional).",children:o.jsx(Re,{value:d.project||"",onChange:m=>f({...d,project:m.target.value})})}),o.jsx(fe,{label:"route_to_agent",hint:"Agente que contesta; vacío = super-agent APX.",children:o.jsx(Re,{value:d.route_to_agent||"",onChange:m=>f({...d,route_to_agent:m.target.value})})}),o.jsx(fe,{label:"owner_user_id",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.",children:o.jsx(Re,{value:d.owner_user_id!=null?String(d.owner_user_id):"",onChange:m=>{const g=m.target.value.trim();f({...d,owner_user_id:g===""?void 0:/^\d+$/.test(g)?Number(g):g})},placeholder:"889721252"})}),o.jsx(cn,{checked:!!d.respond_with_engine,onChange:m=>f({...d,respond_with_engine:m}),label:"Responder con engine (no echo)"})]})})}function K2({channel:e,onClose:n}){const s=lt(),[r,i]=b.useState(E("admin.telegram_default_message")),[c,d]=b.useState(!1),f=async()=>{if(!(!r.trim()||!e)){d(!0);try{await Tn.send({text:r,channel:e.name}),s.success("Mensaje enviado."),n()}catch(p){s.error(p.message)}finally{d(!1)}}};return o.jsx(ba,{open:!!e,onClose:n,title:e?`${E("admin.telegram_send_test_title")} ${e.name}`:"",description:e?`chat_id: ${e.chat_id||"—"}`:"",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:c,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:f,loading:c,children:"Enviar"})]}),children:o.jsx(fe,{label:"Texto",children:o.jsx(en,{rows:4,value:r,onChange:p=>i(p.target.value)})})})}function Q2({bare:e=!1}){const n=lt(),{contacts:s,roles:r,channelOwners:i,isLoading:c,mutate:d}=eb(),f=new Set(i.filter(y=>y.owner_user_id!=null).map(y=>String(y.owner_user_id))),p=Array.from(new Set(["owner","guest",...Object.keys(r)])),m=async(y,S)=>{try{await Tn.contacts.patch(y.user_id,{role:S}),n.success(`${y.name||y.user_id} → ${S}`),d()}catch(w){n.error(w.message)}},g=async y=>{if(confirm(E("telegram_contacts.delete_confirm",{name:y.name||String(y.user_id)})))try{await Tn.contacts.remove(y.user_id),n.success(E("telegram_contacts.removed")),d()}catch(S){n.error(S.message)}},x=o.jsxs(o.Fragment,{children:[c&&o.jsx(nt,{}),!c&&s.length===0&&o.jsx(dt,{children:E("telegram_contacts.empty")}),s.length>0&&o.jsx("ul",{className:"space-y-2 text-sm",children:s.map(y=>{const S=f.has(String(y.user_id)),w=S?"owner":y.role||"guest";return o.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium",children:y.name||"—"}),y.username&&o.jsxs("span",{className:"ml-2 text-xs text-muted-fg",children:["@",y.username]}),S&&o.jsx(Xe,{tone:"success",children:E("telegram_contacts.owner_badge")})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(mz,{value:w,disabled:S,onChange:j=>m(y,j.target.value),title:E(S?"telegram_contacts.owner_hint":"telegram_contacts.assign_role"),children:p.map(j=>o.jsx("option",{value:j,children:j},j))}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>g(y),children:E("common.delete")})]})]}),o.jsxs("div",{className:"mt-1 grid grid-cols-3 gap-2 text-xs text-muted-fg",children:[o.jsxs("span",{children:["user_id: ",String(y.user_id)]}),o.jsxs("span",{children:[E("telegram_contacts.last_seen")," ",y.last_seen?y.last_seen.slice(0,10):"—"]}),o.jsx("span",{children:vz(r[w])})]})]},String(y.user_id))})})]});return e?x:o.jsx(Ye,{title:E("telegram_contacts.title"),description:E("telegram_contacts.desc"),children:x})}function vz(e){return!e||e.tools===void 0?"":e.tools==="*"?E("telegram_contacts.tools_all"):Array.isArray(e.tools)?e.tools.length?`${E("telegram_contacts.tools_label")} ${e.tools.join(", ")}`:E("telegram_contacts.tools_none"):""}function yz(){const e=$a(),n=lt(),{health:s,isUp:r}=Y2(),{projects:i,isLoading:c,mutate:d}=Ac(),{engines:f,isLoading:p}=xz(),{status:m,mutate:g}=bz(),{channels:x,isLoading:y,mutate:S}=Wx(),[w,j]=b.useState(null),[_,C]=b.useState(null),k=async()=>{try{await Sl.reload(),n.success(E("admin.reload_success"))}catch(M){n.error(M.message)}},R=async()=>{try{m?.enabled?(await Tn.stop(),n.info(E("admin.telegram_polling_stopped"))):(await Tn.start(),n.success(E("admin.telegram_polling_started"))),g()}catch(M){n.error(M.message)}},N=async M=>{if(confirm(E("telegram_channels.delete_confirm",{name:M})))try{await Tn.channels.remove(M),n.success(E("admin.telegram_channel_removed")),S()}catch(O){n.error(O.message)}},A=async(M,O)=>{if(confirm(E("admin.unregister_confirm",{label:O})))try{await ta.remove(M),n.success(E("project.unregistered")),d()}catch(L){n.error(L.message)}};return o.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 p-6","data-testid":"screen-admin",children:[o.jsxs("header",{className:"flex items-end justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E("admin.title")}),o.jsx("p",{className:"text-sm text-muted-fg",children:E("admin.subtitle")})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(ve,{size:"sm",onClick:k,title:E("daemon.reload_hint"),children:[E("common.reload")," config"]}),o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>e("/?action=add-project"),children:[o.jsx(An,{size:14})," ",E("nav.project")]})]})]}),o.jsx(Ye,{title:E("daemon.version"),children:o.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[o.jsx(_g,{label:E("daemon.version"),value:s?.version||"—"}),o.jsx(_g,{label:E("daemon.uptime"),value:s?`${s.uptime_s}s`:"—"}),o.jsx(_g,{label:E("daemon.status"),value:E(r?"daemon.running":"daemon.down"),ok:r})]})}),o.jsxs(Ye,{title:E("admin.engines_title"),description:E("admin.engines_subtitle"),children:[p&&o.jsx(nt,{}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(M=>o.jsx(Xe,{tone:"info",children:M},M))})]}),o.jsxs(Ye,{title:E("admin.telegram_title"),description:E("admin.telegram_subtitle"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cn,{checked:!!m?.enabled,onChange:R,label:m?.enabled?E("admin.telegram_polling_on"):E("admin.telegram_polling_off")}),o.jsxs(ve,{size:"sm",onClick:()=>j({name:""}),children:[o.jsx(An,{size:14})," ",E("admin.telegram_add_channel")]})]}),children:[y&&o.jsx(nt,{}),x.length===0&&o.jsx(dt,{children:E("common.none_yet")}),o.jsx("ul",{className:"space-y-2 text-sm",children:x.map(M=>o.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"font-medium",children:M.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[M.project&&o.jsxs(Xe,{tone:"success",children:["project = ",M.project]}),o.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>C(M),children:[o.jsx(ss,{size:13})," ",E("admin.telegram_send_test")]}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>j(M),children:E("common.edit")}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>N(M.name),children:E("common.delete")})]})]}),o.jsxs("div",{className:"mt-1 grid grid-cols-3 gap-2 text-xs text-muted-fg",children:[o.jsxs("span",{children:["chat_id: ",M.chat_id||"—"]}),o.jsxs("span",{children:["route_to_agent: ",M.route_to_agent||"default APX"]}),o.jsxs("span",{children:["engine: ",M.respond_with_engine?E("admin.engine_badge"):E("admin.engine_badge_no")]})]})]},M.name))})]}),o.jsx(Q2,{}),o.jsxs(Ye,{title:E("admin.projects_title"),description:E("admin.projects_subtitle"),children:[c&&o.jsx(nt,{}),o.jsx("ul",{className:"divide-y divide-border",children:i.map(M=>o.jsxs("li",{className:"flex items-center gap-3 py-2",children:[o.jsxs("span",{className:"w-10 font-mono text-xs text-muted-fg",children:["#",M.id]}),o.jsxs("button",{type:"button",className:"flex-1 text-left hover:underline",onClick:()=>e(`/p/${M.id}`),children:[o.jsx("span",{className:"font-medium",children:M.name||M.path.split("/").pop()}),o.jsx("span",{className:"ml-2 text-xs text-muted-fg",children:M.path})]}),o.jsxs(Xe,{children:[M.agents??0," ",E("admin.agents_badge")]}),Number(M.id)!==0&&o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>A(String(M.id),M.name||M.path),children:E("admin.unregister")})]},M.id))})]}),o.jsx(X2,{channel:w,onClose:()=>j(null),onSaved:()=>{j(null),S()}}),o.jsx(K2,{channel:_,onClose:()=>C(null)})]})}function _g({label:e,value:n,ok:s}){return o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[o.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),o.jsxs("div",{className:"mt-1 flex items-center gap-2 text-base font-medium",children:[s!==void 0&&o.jsx(Sf,{ok:s}),o.jsx("span",{children:n})]})]})}function Z2(e){const[n,s]=b.useState(!1);b.useEffect(()=>{try{s(localStorage.getItem(e)==="true")}catch{}},[e]);const r=b.useCallback(()=>s(i=>{const c=!i;try{localStorage.setItem(e,String(c))}catch{}return c}),[e]);return{collapsed:n,toggle:r}}function jz({collapsed:e,onToggle:n}){return o.jsx(Mt,{content:e?"Expandir menú":"Colapsar menú",side:"bottom",children:o.jsx("button",{type:"button",onClick:n,"aria-label":e?"Expandir menú":"Colapsar menú",className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-fg transition-colors hover:bg-accent hover:text-foreground",children:o.jsx(OS,{className:Oe("size-4 transition-transform",e&&"rotate-180")})})})}function _z({sections:e,active:n,onChange:s,collapsed:r=!1}){return o.jsx("nav",{className:Oe("hidden md:flex shrink-0 flex-col gap-1 py-3 transition-all",r?"w-12 items-center px-1":"w-52 px-2"),children:e.map((i,c)=>o.jsxs("div",{className:Oe("w-full",c>0&&"mt-2"),children:[!r&&i.title&&o.jsx("p",{className:"mb-1 px-2 text-[9px] font-semibold uppercase tracking-wider text-muted-fg/70",children:i.title}),o.jsx("div",{className:"space-y-0.5",children:i.items.map(({key:d,label:f,icon:p,badge:m})=>{const g=n===d,x=o.jsxs("button",{type:"button",onClick:()=>s(d),"data-testid":`tabnav-${d||"index"}`,className:Oe("flex cursor-pointer items-center rounded-lg transition-colors",r?"size-9 justify-center":"w-full gap-2 px-2.5 py-1.5",g?"bg-accent text-accent-fg":"text-muted-fg hover:bg-accent/60 hover:text-foreground"),children:[o.jsx(p,{className:"size-4 shrink-0"}),!r&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"flex-1 truncate text-left text-xs",children:f}),m!==void 0&&o.jsx("span",{className:"rounded-full bg-muted px-1.5 text-[9px] text-muted-fg",children:m})]})]});return r?o.jsx(Mt,{content:f,side:"right",children:x},d):o.jsx(b.Fragment,{children:x},d)})})]},c))})}const J2=b.createContext(null),W2=b.createContext(null),eC=b.createContext(""),tC=b.createContext(null),nC=b.createContext(null),aC=b.createContext(null);function Sz({children:e}){const[n,s]=b.useState(null),[r,i]=b.useState(""),[c,d]=b.useState(null);return o.jsx(W2.Provider,{value:s,children:o.jsx(J2.Provider,{value:n,children:o.jsx(tC.Provider,{value:i,children:o.jsx(eC.Provider,{value:r,children:o.jsx(aC.Provider,{value:d,children:o.jsx(nC.Provider,{value:c,children:e})})})})})})}function wz(){return b.useContext(J2)}function Cz(e,n){const s=b.useContext(W2);b.useEffect(()=>(s?.({collapsed:e,toggle:n}),()=>s?.(null)),[e,n,s])}function kz(){return b.useContext(eC)}function Ez(e){const n=b.useContext(tC);b.useEffect(()=>(n?.(e),()=>n?.("")),[e,n])}function Nz(){return b.useContext(nC)}function Rz(e){const n=b.useContext(aC);b.useEffect(()=>(n?.(e),()=>n?.(null)),[e,n])}function sC({sections:e,active:n,onChange:s,collapsed:r,onToggleCollapse:i,actions:c,contentClassName:d,testId:f,children:p}){return Cz(r,i),o.jsxs("div",{className:"flex h-full",children:[o.jsx(_z,{sections:e,active:n,onChange:s,collapsed:r}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[c?o.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2 px-6 pt-3",children:c}):null,o.jsx("div",{className:Oe("flex-1 min-h-0 overflow-y-auto",d),"data-testid":f,children:p})]})]})}function Pj({pid:e}){const n=Je(`/projects/${e}/tasks?state=open`,()=>hr.list(e)),s=Je(`/projects/${e}/routines`,()=>gr.list(e)),r=Je(`/projects/${e}/agents`,()=>Wt.list(e)),i=Je(`/projects/${e}/mcps`,()=>ac.list(e));return o.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:[o.jsx(Pi,{title:E("project.overview.tasks_open"),value:n.data?.length??"…",href:`/p/${e}/tasks`,icon:dc}),o.jsx(Pi,{title:E("project.overview.routines"),value:s.data?.length??"…",href:`/p/${e}/routines`,icon:bl}),o.jsx(Pi,{title:E("project.overview.agents"),value:r.data?.length??"…",href:`/p/${e}/agents`,icon:vn}),o.jsx(Pi,{title:E("project.overview.mcps"),value:i.data?.length??"…",href:`/p/${e}/mcps`,icon:oh}),o.jsx(Pi,{title:E("project.overview.chat"),value:E("project.overview.chat_value"),href:`/p/${e}/chat`,icon:ec})]})}function Pi({title:e,value:n,href:s,icon:r}){return o.jsxs(bS,{to:s,className:"flex items-center gap-3 rounded-xl border border-border bg-card p-4 hover:bg-accent/40",children:[o.jsx("span",{className:"grid size-10 place-items-center rounded-lg bg-muted text-muted-fg",children:o.jsx(r,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),o.jsx("div",{className:"text-2xl font-semibold",children:n})]})]})}function Tz(){const e=$a(),{projects:n,isLoading:s}=Ac();return o.jsxs(Ye,{title:E("base.workspaces_title"),description:E("base.workspaces_desc"),action:o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>e("/p/0/workspaces?action=add-project"),children:[o.jsx(An,{size:14})," ",E("base.workspaces_new")]}),children:[s&&o.jsx(nt,{}),!s&&n.length===0&&o.jsx(dt,{children:E("base.workspaces_empty")}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n.map(r=>{const i=String(r.id)==="0",c=i?E("base.title"):r.name||r.path.split("/").pop()||String(r.id);return o.jsxs("button",{type:"button",onClick:()=>e(`/p/${r.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:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(RS,{className:"size-4 text-muted-fg"}),o.jsx("span",{className:"truncate text-sm font-semibold",children:c}),o.jsx(Xe,{tone:i?"success":"info",children:i?E("base.title"):k2(r.kind)})]}),o.jsx("p",{className:"truncate font-mono text-[10px] text-muted-fg",children:r.path})]},r.id)})})]})}const rC=b.createContext(null),oC=b.createContext(null);function ls(){const e=b.useContext(rC);if(e===null)throw new Error(Mn(60));return e}function lC(){const e=b.useContext(oC);if(e===null)throw new Error(Mn(61));return e}const Az=(e,n)=>Object.is(e,n);function kl(e,n,s){return e==null||n==null?Object.is(e,n):s(e,n)}function Mz(e,n,s){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:kl(n,r,s))}function oc(e,n,s){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:kl(r,n,s))}function Oz(e,n,s){return e.filter(r=>!kl(n,r,s))}function zh(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function iC(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function zz(e){if(!Array.isArray(e))return e!=null&&"null"in e;const n=e;if(iC(n)){for(const s of n)for(const r of s.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const s of n)if(s&&s.value==null&&s.label!=null)return!0;return!1}function cC(e,n){if(n&&e!=null)return n(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 zh(e)}function il(e,n){return n&&e!=null?n(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?zh(e.value):zh(e)}function uC(e,n,s){function r(){return cC(e,s)}if(s&&e!=null)return s(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(n&&!Array.isArray(n))return n[e]??r();if(Array.isArray(n)){const i=n,c=iC(i)?i.flatMap(d=>d.items):i;if(e==null||typeof e!="object"){const d=c.find(f=>f.value===e);return d&&d.label!=null?d.label:r()}if("value"in e){const d=c.find(f=>f&&f.value===e.value);if(d&&d.label!=null)return d.label}}return r()}function Dz(e,n,s){return e.reduce((r,i,c)=>(c>0&&r.push(", "),r.push(o.jsx(b.Fragment,{children:uC(i,n,s)},c)),r),[])}const Ze={id:ze(e=>e.id),labelId:ze(e=>e.labelId),modal:ze(e=>e.modal),multiple:ze(e=>e.multiple),items:ze(e=>e.items),itemToStringLabel:ze(e=>e.itemToStringLabel),itemToStringValue:ze(e=>e.itemToStringValue),isItemEqualToValue:ze(e=>e.isItemEqualToValue),value:ze(e=>e.value),hasSelectedValue:ze(e=>{const{value:n,multiple:s,itemToStringValue:r}=e;return n==null?!1:s&&Array.isArray(n)?n.length>0:il(n,r)!==""}),hasNullItemLabel:ze((e,n)=>n?zz(e.items):!1),open:ze(e=>e.open),mounted:ze(e=>e.mounted),forceMount:ze(e=>e.forceMount),transitionStatus:ze(e=>e.transitionStatus),openMethod:ze(e=>e.openMethod),activeIndex:ze(e=>e.activeIndex),selectedIndex:ze(e=>e.selectedIndex),isActive:ze((e,n)=>e.activeIndex===n),isSelected:ze((e,n,s)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(c=>kl(s,c,r)):e.selectedIndex===n&&e.selectedIndex!==null?!0:kl(s,i,r)}),isSelectedByFocus:ze((e,n)=>e.selectedIndex===n),popupProps:ze(e=>e.popupProps),triggerProps:ze(e=>e.triggerProps),triggerElement:ze(e=>e.triggerElement),positionerElement:ze(e=>e.positionerElement),listElement:ze(e=>e.listElement),popupSide:ze(e=>e.popupSide),scrollUpArrowVisible:ze(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ze(e=>e.scrollDownArrowVisible),hasScrollArrows:ze(e=>e.hasScrollArrows)};function Ki(e,n=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,s))}const Ba=1;function tb(e,n){return Math.max(0,e-n)}function Yd(e,n){if(n<=0)return 0;const s=Ki(e,0,n),r=s,i=n-s,c=r<=Ba,d=i<=Ba;return c&&d?r<=i?0:n:c?0:d?n:s}function Lz(e){const{id:n,value:s,defaultValue:r=null,onValueChange:i,open:c,defaultOpen:d=!1,onOpenChange:f,name:p,form:m,autoComplete:g,disabled:x=!1,readOnly:y=!1,required:S=!1,modal:w=!0,actionsRef:j,inputRef:_,onOpenChangeComplete:C,items:k,multiple:R=!1,itemToStringLabel:N,itemToStringValue:A,isItemEqualToValue:M=Az,highlightItemOnHover:O=!0,children:L}=e,{clearErrors:B}=R2(),{setDirty:I,setTouched:D,setFocused:z,shouldValidateOnChange:H,validityData:V,setFilled:Y,name:q,disabled:F,validation:Z,validationMode:$}=Mc(),X=Cf({id:n}),U=F||x,K=q??p,[G,W]=bc({controlled:s,default:R?r??pc:r,name:"Select",state:"value"}),[ie,re]=bc({controlled:c,default:d,name:"Select",state:"open"}),oe=b.useRef([]),ce=b.useRef([]),ee=b.useRef(null),Te=b.useRef(null),$e=b.useRef(0),be=b.useRef(null),Ce=b.useRef([]),Ee=b.useRef(!1),Pe=b.useRef(!1),Ie=b.useRef(null),xe=b.useRef(null),Ae=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),_e=b.useRef(!1),{mounted:Be,setMounted:Fe,transitionStatus:Ge}=Nc(ie),{openMethod:De,triggerProps:ye}=lz(ie),le=xa(()=>new Fw({id:X,labelId:void 0,modal:w,multiple:R,itemToStringLabel:N,itemToStringValue:A,isItemEqualToValue:M,value:G,open:ie,mounted:Be,transitionStatus:Ge,items:k,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,je=tt(le,Ze.activeIndex),we=tt(le,Ze.selectedIndex),Ue=tt(le,Ze.triggerElement),We=tt(le,Ze.positionerElement),jt=sO(De),zt=De??jt,pe=b.useMemo(()=>R&&Array.isArray(G)&&G.length===0?"":il(G,A),[R,G,A]),ke=b.useMemo(()=>R&&Array.isArray(G)?G.map(it=>il(it,A)):il(G,A),[R,G,A]),Ne=pn(le.state.triggerElement),qe=Le(()=>ke);Kx(Ne,X,G,qe);const at=b.useRef(G),nn=R?Array.isArray(G)&&G.length>0:G!=null;Me(()=>{G!==at.current&&le.set("forceMount",!0)},[le,G]),Me(()=>{Y(nn)},[nn,Y]),Me(function(){const Dt=Ce.current;let Sn;if(R){const sn=Array.isArray(G)?G:[];if(sn.length===0)Sn=null;else{const Rt=sn[sn.length-1],mn=oc(Dt,Rt,M);Sn=mn===-1?null:mn}}else{const sn=oc(Dt,G,M);Sn=sn===-1?null:sn}Sn===null&&(xe.current=null),!ie&&le.set("selectedIndex",Sn)},[nn,R,ie,G,Ce,M,le,xe]),Qx(G,()=>{B(K),I(G!==V.initialValue),H()?Z.commit(G):Z.commit(G,!0)});const qt=Le((it,Dt)=>{if(f?.(it,Dt),!Dt.isCanceled&&(re(it),!it&&(Dt.reason===ff||Dt.reason===gx)&&(D(!0),z(!1),$==="onBlur"&&Z.commit(G)),!it&&le.state.activeIndex!==null)){const Sn=oe.current[le.state.activeIndex];queueMicrotask(()=>{Sn?.setAttribute("tabindex","-1")})}}),mt=Le(()=>{Fe(!1),le.update({activeIndex:null,openMethod:null}),C?.(!1)});Rr({enabled:!j,open:ie,ref:ee,onComplete(){ie||mt()}}),b.useImperativeHandle(j,()=>({unmount:mt}),[mt]);const Nt=Le((it,Dt)=>{i?.(it,Dt),!Dt.isCanceled&&W(it)}),Zt=Le(()=>{const it=le.state.listElement||ee.current;if(!it)return;const Dt=tb(it.scrollHeight,it.clientHeight),Sn=Yd(it.scrollTop,Dt),sn=Sn>0,Rt=Sn<Dt;le.state.scrollUpArrowVisible!==sn&&le.set("scrollUpArrowVisible",sn),le.state.scrollDownArrowVisible!==Rt&&le.set("scrollDownArrowVisible",Rt)}),St=n2({open:ie,onOpenChange:qt,elements:{reference:Ue,floating:We}}),an=o3(St,{enabled:!y&&!U,event:"mousedown"}),Ft=Ex(St),un=C5(St,{enabled:!y&&!U,listRef:oe,activeIndex:je,selectedIndex:we,disabledIndices:pc,onNavigate(it){it===null&&!ie||le.set("activeIndex",it)},focusItemOnHover:O}),On=k5(St,{enabled:!y&&!U&&(ie||!R),listRef:ce,activeIndex:je,selectedIndex:we,onMatch(it){ie?le.set("activeIndex",it):Nt(Ce.current[it],ot("none"))},onTyping(it){Ee.current=it}}),Yn=b.useMemo(()=>{const it=Ma(On.reference,un.reference,Ft.reference,an.reference,ye);return X&&(it.id=X),it},[an.reference,On.reference,un.reference,Ft.reference,ye,X]),oa=b.useMemo(()=>Ma(vf,On.floating,un.floating,Ft.floating),[On.floating,un.floating,Ft.floating]),Xn=un.item??ln;ix(()=>{le.update({popupProps:oa,triggerProps:Yn})}),Me(()=>{le.update({id:X,modal:w,multiple:R,value:G,open:ie,mounted:Be,transitionStatus:Ge,popupProps:oa,triggerProps:Yn,items:k,itemToStringLabel:N,itemToStringValue:A,isItemEqualToValue:M,openMethod:zt})},[le,X,w,R,G,ie,Be,Ge,oa,Yn,k,N,A,M,zt]);const is=b.useMemo(()=>({store:le,name:K,required:S,disabled:U,readOnly:y,multiple:R,highlightItemOnHover:O,setValue:Nt,setOpen:qt,listRef:oe,popupRef:ee,scrollHandlerRef:Te,handleScrollArrowVisibility:Zt,scrollArrowsMountedCountRef:$e,itemProps:Xn,events:St.context.events,valueRef:be,valuesRef:Ce,labelsRef:ce,typingRef:Ee,selectionRef:Ae,firstItemTextRef:Ie,selectedItemTextRef:xe,validation:Z,onOpenChangeComplete:C,keyboardActiveRef:Pe,alignItemWithTriggerActiveRef:_e,initialValueRef:at}),[le,K,S,U,y,R,O,Nt,qt,Xn,St.context.events,Z,C,Zt]),zn=Us(_,Z.inputRef),la=R&&Array.isArray(G)&&G.length>0,Da=R?void 0:K,cs=b.useMemo(()=>!R||!Array.isArray(G)||!K?null:G.map(it=>{const Dt=il(it,A);return o.jsx("input",{type:"hidden",form:m,name:K,value:Dt},Dt)}),[R,G,m,K,A]);return o.jsx(rC.Provider,{value:is,children:o.jsxs(oC.Provider,{value:St,children:[L,o.jsx("input",{...Z.getInputValidationProps({onFocus(){le.state.triggerElement?.focus({focusVisible:!0})},onChange(it){if(it.nativeEvent.defaultPrevented||U||y){it.preventBaseUIHandler?.();return}const Dt=it.currentTarget.value,Sn=ot(Bs,it.nativeEvent);function sn(){if(R)return;const Rt=Ce.current.find(mn=>il(mn,A).toLowerCase()===Dt.toLowerCase()||cC(mn,N).toLowerCase()===Dt.toLowerCase());Rt!=null&&(I(Rt!==V.initialValue),Nt(Rt,Sn),H()&&Z.commit(Rt))}le.set("forceMount",!0),queueMicrotask(sn)}}),id:X&&Da==null?`${X}-hidden-input`:void 0,form:m,name:Da,autoComplete:g,value:pe,disabled:U,required:S&&!la,readOnly:y,ref:zn,style:K?cw:bx,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),cs]})})}function Pz(e,n){return e??n}function Iz(e){const n=e.getBoundingClientRect(),s=Qt(e),r=s.getComputedStyle(e,"::before"),i=s.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return n;const d=parseFloat(r.width)||0,f=parseFloat(r.height)||0,p=parseFloat(i.width)||0,m=parseFloat(i.height)||0,g=Math.max(n.width,d,p),x=Math.max(n.height,f,m),y=g-n.width,S=x-n.height;return{left:n.left-y/2,right:n.right+y/2,top:n.top-S/2,bottom:n.bottom+S/2}}const sd=2,Bz=400,Uz={...B5,...Xx,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Hz=b.forwardRef(function(n,s){const{render:r,className:i,id:c,disabled:d=!1,nativeButton:f=!0,style:p,...m}=n,{setTouched:g,setFocused:x,validationMode:y,state:S,disabled:w}=Mc(),{labelId:j}=wf(),{store:_,setOpen:C,selectionRef:k,validation:R,readOnly:N,required:A,alignItemWithTriggerActiveRef:M,disabled:O,keyboardActiveRef:L}=ls(),B=w||O||d,I=tt(_,Ze.open),D=tt(_,Ze.mounted),z=tt(_,Ze.value),H=tt(_,Ze.triggerProps),V=tt(_,Ze.positionerElement),Y=tt(_,Ze.listElement),q=tt(_,Ze.popupSide),F=tt(_,Ze.id),Z=tt(_,Ze.labelId),$=tt(_,Ze.hasSelectedValue),X=D&&V?q:null,U=c??F,K=Pz(j,Z);Cf({id:U});const G=pn(V),W=b.useRef(null),{getButtonProps:ie,buttonRef:re}=Il({disabled:B,native:f}),oe=Le(Ee=>{_.set("triggerElement",Ee)}),ce=Us(s,W,re,oe),ee=na(),Te=na(),$e=na();b.useEffect(()=>{if(I)return $e.start(Bz,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}),()=>{$e.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Te.clear()},[I,k,Te,$e]);const be=Ma(H,{id:U,role:"combobox","aria-expanded":I?"true":"false","aria-haspopup":"listbox","aria-controls":I?Y?.id??Md(V)?.id:void 0,"aria-labelledby":K,"aria-readonly":N||void 0,"aria-required":A||void 0,tabIndex:B?-1:0,ref:ce,onFocus(Ee){x(!0),I&&M.current&&C(!1,ot(Bs,Ee.nativeEvent)),ee.start(0,()=>{_.set("forceMount",!0)})},onBlur(Ee){Qe(V,Ee.relatedTarget)||(g(!0),x(!1),y==="onBlur"&&R.commit(z))},onPointerMove(){L.current=!1},onKeyDown(){L.current=!0},onMouseDown(Ee){if(I)return;const Pe=yt(Ee.currentTarget);function Ie(xe){if(!W.current)return;const Ae=xe.target;if(Qe(W.current,Ae)||Qe(G.current,Ae)||Ae===W.current)return;const _e=Iz(W.current);xe.clientX>=_e.left-sd&&xe.clientX<=_e.right+sd&&xe.clientY>=_e.top-sd&&xe.clientY<=_e.bottom+sd||C(!1,ot(sM,xe))}Te.start(0,()=>{Pe.addEventListener("mouseup",Ie,{once:!0})})}},R.getValidationProps,m,ie);be.role="combobox";const Ce={...S,open:I,disabled:B,value:z,readOnly:N,popupSide:X,placeholder:!$};return Ht("button",n,{ref:[s,W],state:Ce,stateAttributesMapping:Uz,props:be})}),qz={value:()=>null},Vz=b.forwardRef(function(n,s){const{className:r,render:i,children:c,placeholder:d,style:f,...p}=n,{store:m,valueRef:g}=ls(),x=tt(m,Ze.value),y=tt(m,Ze.items),S=tt(m,Ze.itemToStringLabel),w=tt(m,Ze.hasSelectedValue),j=!w&&d!=null&&c==null,_=tt(m,Ze.hasNullItemLabel,j),C={value:x,placeholder:!w};let k=null;return typeof c=="function"?k=c(x):c!=null?k=c:!w&&d!=null&&!_?k=d:Array.isArray(x)?k=Dz(x,y,S):k=uC(x,y,S),Ht("span",n,{state:C,ref:[s,g],props:[{children:k},p],stateAttributesMapping:qz})}),$z=b.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,{store:f}=ls(),m={open:tt(f,Ze.open)};return Ht("span",n,{state:m,ref:s,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:s2})}),Gz=b.createContext(void 0),Fz=b.forwardRef(function(n,s){const{store:r}=ls(),i=tt(r,Ze.mounted),c=tt(r,Ze.forceMount);return i||c?o.jsx(Gz.Provider,{value:!0,children:o.jsx(zw,{ref:s,...n})}):null}),dC=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Yz(){return b.useContext(dC)}function nb(e){const{children:n,elementsRef:s,labelsRef:r,onMapChange:i}=e,c=Le(i),d=b.useRef(0),f=xa(Kz).current,p=xa(Xz).current,[m,g]=b.useState(0),x=b.useRef(m),y=Le((C,k)=>{p.set(C,k??null),x.current+=1,g(x.current)}),S=Le(C=>{p.delete(C),x.current+=1,g(x.current)}),w=b.useMemo(()=>{const C=new Map;return Array.from(p.keys()).filter(R=>R.isConnected).sort(Qz).forEach((R,N)=>{const A=p.get(R)??{};C.set(R,{...A,index:N})}),C},[p,m]);Me(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const C=new MutationObserver(k=>{const R=new Set,N=A=>R.has(A)?R.delete(A):R.add(A);k.forEach(A=>{A.removedNodes.forEach(N),A.addedNodes.forEach(N)}),R.size===0&&(x.current+=1,g(x.current))});return w.forEach((k,R)=>{R.parentElement&&C.observe(R.parentElement,{childList:!0})}),()=>{C.disconnect()}},[w]),Me(()=>{x.current===m&&(s.current.length!==w.size&&(s.current.length=w.size),r&&r.current.length!==w.size&&(r.current.length=w.size),d.current=w.size),c(w)},[c,w,s,r,m]),Me(()=>()=>{s.current=[]},[s]),Me(()=>()=>{r&&(r.current=[])},[r]);const j=Le(C=>(f.add(C),()=>{f.delete(C)}));Me(()=>{f.forEach(C=>C(w))},[f,w]);const _=b.useMemo(()=>({register:y,unregister:S,subscribeMapChange:j,elementsRef:s,labelsRef:r,nextIndexRef:d}),[y,S,j,s,r,d]);return o.jsx(dC.Provider,{value:_,children:n})}function Xz(){return new Map}function Kz(){return new Set}function Qz(e,n){const s=e.compareDocumentPosition(n);return s&Node.DOCUMENT_POSITION_FOLLOWING||s&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS?1:0}const fC=b.createContext(void 0);function ab(){const e=b.useContext(fC);if(!e)throw new Error(Mn(59));return e}function Xd(e,n){e&&Object.assign(e.style,n)}const pC={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Zz=20;function Jz(e,n,s,r){const[i,c]=b.useState(!1);Me(()=>{if(!e||!n||s==null){c(!1);return}const d=yt(s).documentElement.clientWidth,f=s.offsetWidth;c(d>0&&f>0&&f>=d-Zz)},[e,n,s]),V2(e&&(!n||i),r)}const Wz={position:"fixed"},eD=b.forwardRef(function(n,s){const{anchor:r,positionMethod:i="absolute",className:c,render:d,side:f="bottom",align:p="center",sideOffset:m=0,alignOffset:g=0,collisionBoundary:x="clipping-ancestors",collisionPadding:y,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:j,alignItemWithTrigger:_=!0,collisionAvoidance:C=QM,style:k,...R}=n,{store:N,listRef:A,labelsRef:M,alignItemWithTriggerActiveRef:O,selectedItemTextRef:L,valuesRef:B,initialValueRef:I,popupRef:D,setValue:z}=ls(),H=lC(),V=tt(N,Ze.open),Y=tt(N,Ze.mounted),q=tt(N,Ze.modal),F=tt(N,Ze.value),Z=tt(N,Ze.openMethod),$=tt(N,Ze.positionerElement),X=tt(N,Ze.triggerElement),U=tt(N,Ze.isItemEqualToValue),K=tt(N,Ze.transitionStatus),G=b.useRef(null),W=b.useRef(null),[ie,re]=b.useState(_),oe=Y&&ie&&Z!=="touch";!Y&&ie!==_&&re(_),Me(()=>{Y||(Ze.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),Ze.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),b.useImperativeHandle(O,()=>oe),Jz((oe||q)&&V,Z==="touch",$,X);const ce=d2({anchor:r,floatingRootContext:H,positionMethod:i,mounted:Y,side:f,sideOffset:m,align:p,alignOffset:g,arrowPadding:S,collisionBoundary:x,collisionPadding:y,sticky:w,disableAnchorTracking:j??oe,collisionAvoidance:C,keepMounted:!0}),ee=oe?"none":ce.side,Te=oe?Wz:ce.positionerStyles,$e={open:V,side:ee,align:ce.align,anchorHidden:ce.anchorHidden};Me(()=>{N.set("popupSide",ce.side)},[N,ce.side]);const be=Le(xe=>{N.set("positionerElement",xe)}),Ce=f2(n,$e,{styles:Te,transitionStatus:K,props:R,refs:[s,be],hidden:!Y,inert:!V}),Ee=b.useRef(0),Pe=Le(xe=>{if(xe.size===0&&Ee.current===0||B.current.length===0)return;const Ae=Ee.current;if(Ee.current=xe.size,xe.size===Ae)return;const _e=ot(Bs);if(Ae!==0&&!N.state.multiple&&F!==null&&oc(B.current,F,U)===-1){const Fe=I.current,De=Fe!=null&&oc(B.current,Fe,U)!==-1?Fe:null;z(De,_e),De===null&&(N.set("selectedIndex",null),L.current=null)}if(Ae!==0&&N.state.multiple&&Array.isArray(F)){const Be=Ge=>oc(B.current,Ge,U)!==-1,Fe=F.filter(Ge=>Be(Ge));(Fe.length!==F.length||Fe.some(Ge=>!Mz(F,Ge,U)))&&(z(Fe,_e),Fe.length===0&&(N.set("selectedIndex",null),L.current=null))}if(V&&oe){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Be={height:""};Xd($,Be),Xd(D.current,Be)}}),Ie=b.useMemo(()=>({...ce,side:ee,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:re,scrollUpArrowRef:G,scrollDownArrowRef:W}),[ce,ee,oe,re]);return o.jsx(nb,{elementsRef:A,labelsRef:M,onMapChange:Pe,children:o.jsxs(fC.Provider,{value:Ie,children:[Y&&q&&o.jsx(H2,{inert:Lx(!V),cutout:X}),Ce]})})}),rd="base-ui-disable-scrollbar",Dh={className:rd,getElement(e){return o.jsx("style",{nonce:e,href:rd,precedence:"base-ui:low",children:`.${rd}{scrollbar-width:none}.${rd}::-webkit-scrollbar{display:none}`})}},tD=b.createContext(void 0);function nD(e){return b.useContext(tD)}const aD=b.createContext(void 0),sD={disableStyleElements:!1};function rD(){return b.useContext(aD)??sD}const oD={...Pl,...Ll},lD=b.forwardRef(function(n,s){const{render:r,className:i,style:c,finalFocus:d,...f}=n,{store:p,popupRef:m,onOpenChangeComplete:g,setOpen:x,valueRef:y,firstItemTextRef:S,selectedItemTextRef:w,keyboardActiveRef:j,multiple:_,handleScrollArrowVisibility:C,scrollHandlerRef:k,listRef:R,highlightItemOnHover:N}=ls(),{side:A,align:M,alignItemWithTriggerActive:O,isPositioned:L,setControlledAlignItemWithTrigger:B,scrollDownArrowRef:I,scrollUpArrowRef:D}=ab(),z=nD()!=null,H=lC(),V=zx(),{nonce:Y,disableStyleElements:q}=rD(),F=tt(p,Ze.id),Z=tt(p,Ze.open),$=tt(p,Ze.mounted),X=tt(p,Ze.popupProps),U=tt(p,Ze.transitionStatus),K=tt(p,Ze.triggerElement),G=tt(p,Ze.positionerElement),W=tt(p,Ze.listElement),ie=b.useRef(!1),re=b.useRef(!1),oe=b.useRef({}),ce=yl(),ee=Le(Ce=>{if(!G||!m.current||!re.current)return;if(ie.current||!O){C();return}const Ee=G.style.top==="0px",Pe=G.style.bottom==="0px";if(!Ee&&!Pe){C();return}const Ie=Bj(G),xe=Qi(G.getBoundingClientRect().height,"y",Ie),Ae=yt(G),_e=getComputedStyle(G),Be=parseFloat(_e.marginTop),Fe=parseFloat(_e.marginBottom),Ge=Ij(getComputedStyle(m.current)),De=Math.min(Ae.documentElement.clientHeight-Be-Fe,Ge),ye=Ce.scrollTop,le=od(Ce);let je=0,we=null,Ue=!1,We=!1;const jt=Ne=>{G.style.height=`${Ne}px`},zt=(Ne,qe)=>{const at=Ki(Ne,0,De-xe);at>0&&jt(xe+at),Ce.scrollTop=qe,De-(xe+at)<=Ba&&(ie.current=!0),C()},pe=Ee?le-ye:ye,ke=Math.min(xe+pe,De);if(je=ke,pe<=Ba){zt(pe,Ee?le:0);return}if(De-ke>Ba)Ee?We=!0:we=0;else if(Ue=!0,Pe&&ye<le){const Ne=xe+pe-De;we=ye-(pe-Ne)}if(je=Math.ceil(je),je!==0&&jt(je),We||we!=null){const Ne=od(Ce),qe=We?Ne:Ki(we,0,Ne);Math.abs(Ce.scrollTop-qe)>Ba&&(Ce.scrollTop=qe)}(Ue||je>=De-Ba)&&(ie.current=!0),C()});b.useImperativeHandle(k,()=>ee,[ee]),Rr({open:Z,ref:m,onComplete(){Z&&g?.(!0)}});const Te={open:Z,transitionStatus:U,side:A,align:M};Me(()=>{!G||!m.current||Object.keys(oe.current).length||(oe.current={top:G.style.top||"0",left:G.style.left||"0",right:G.style.right,height:G.style.height,bottom:G.style.bottom,minHeight:G.style.minHeight,maxHeight:G.style.maxHeight,marginTop:G.style.marginTop,marginBottom:G.style.marginBottom})},[m,G]),Me(()=>{Z||O||(re.current=!1,ie.current=!1,Xd(G,oe.current))},[Z,O,G,m]),Me(()=>{const Ce=m.current;if(!Z||!K||!G||!Ce||O&&!L||p.state.transitionStatus==="ending")return;if(!O){re.current=!0,ce.request(C),Ce.style.removeProperty("--transform-origin");return}const Ee=iD(Ce);Ce.style.removeProperty("--transform-origin");try{let Pe=w.current;Pe?.isConnected||(Pe=!Ze.hasSelectedValue(p.state)&&S.current?.isConnected?S.current:null);const Ie=y.current,xe=getComputedStyle(G),Ae=getComputedStyle(Ce),_e=yt(K),Be=Qt(G),Fe=Bj(K),Ge=ld(K.getBoundingClientRect(),Fe),De=ld(G.getBoundingClientRect(),Fe),ye=Ge.height,le=W||Ce,je=le.scrollHeight,we=parseFloat(Ae.borderBottomWidth),Ue=parseFloat(xe.marginTop)||10,We=parseFloat(xe.marginBottom)||10,jt=parseFloat(xe.minHeight)||100,zt=Ij(Ae),pe=5,ke=5,Ne=20,qe=_e.documentElement.clientHeight-Ue-We,at=_e.documentElement.clientWidth,nn=qe-Ge.bottom+ye;let qt,mt=V==="rtl"?Ge.right-De.width:Ge.left,Nt=0;if(Pe&&Ie){const zn=ld(Ie.getBoundingClientRect(),Fe);qt=ld(Pe.getBoundingClientRect(),Fe),mt=De.left+(V==="rtl"?zn.right-qt.right:zn.left-qt.left);const la=zn.top-Ge.top+zn.height/2;Nt=qt.top-De.top+qt.height/2-la}const Zt=nn+Nt+We+we;let St=Math.min(qe,Zt);const an=qe-Ue-We,Ft=Zt-St,un=at-ke;G.style.left=`${Ki(mt,pe,un-De.width)}px`,G.style.height=`${St}px`,G.style.maxHeight="auto",G.style.marginTop=`${Ue}px`,G.style.marginBottom=`${We}px`,Ce.style.height="100%";const On=od(le),Yn=Ft>=On-Ba;Yn&&(St=Math.min(qe,De.height)-(Ft-On));const oa=Ge.top<Ne||Ge.bottom>qe-Ne||Math.ceil(St)+Ba<Math.min(je,jt),Xn=(Be.visualViewport?.scale??1)!==1&&ux;if(oa||Xn){re.current=!0,Xd(G,oe.current),B(!1);return}const is=Math.max(jt,St);if(Yn){const zn=Math.max(0,qe-Zt);G.style.top=De.height>=an?"0":`${zn}px`,G.style.height=`${St}px`,le.scrollTop=od(le)}else G.style.bottom="0",le.scrollTop=Ft;if(qt){const zn=De.top,la=De.height,Da=qt.top+qt.height/2,cs=la>0?(Da-zn)/la*100:50,it=Ki(cs,0,100);Ce.style.setProperty("--transform-origin",`50% ${it}%`)}(is===qe||St>=zt)&&(ie.current=!0),C(),N&&p.state.selectedIndex===null&&p.state.activeIndex===null&&R.current[0]!=null&&p.set("activeIndex",0),re.current=!0}finally{Ee()}},[p,Z,G,K,y,S,w,m,C,O,B,ce,I,D,W,R,N,V,L]),b.useEffect(()=>{if(!O||!G||!Z)return;const Ce=Qt(G);function Ee(Pe){x(!1,ot(rM,Pe))}return pt(Ce,"resize",Ee)},[x,O,G,Z]);const $e={...W?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":_||void 0,id:`${F}-list`},onKeyDown(Ce){j.current=!0,z&&Zx.has(Ce.key)&&Ce.stopPropagation()},onMouseMove(){j.current=!1},onScroll(Ce){W||ee(Ce.currentTarget)},...O&&{style:W?{height:"100%"}:pC}},be=Ht("div",n,{ref:[s,m],state:Te,stateAttributesMapping:oD,props:[X,$e,Dx(U),{className:!W&&O?Dh.className:void 0},f]});return o.jsxs(b.Fragment,{children:[!q&&Dh.getElement(Y),o.jsx(Dw,{context:H,modal:!1,disabled:!$,returnFocus:d,restoreFocus:!0,children:be})]})});function Ij(e){const n=e.maxHeight||"";return n.endsWith("px")&&parseFloat(n)||1/0}function od(e){return tb(e.scrollHeight,e.clientHeight)}function Bj(e){return qw.getScale(e)}function Qi(e,n,s){return e/s[n]}function ld(e,n){return gc({x:Qi(e.x,"x",n),y:Qi(e.y,"y",n),width:Qi(e.width,"x",n),height:Qi(e.height,"y",n)})}const Uj=[["transform","none"],["scale","1"],["translate","0 0"]];function iD(e){const{style:n}=e,s={};for(const[r,i]of Uj)s[r]=n.getPropertyValue(r),n.setProperty(r,i,"important");return()=>{for(const[r]of Uj){const i=s[r];i?n.setProperty(r,i):n.removeProperty(r)}}}const cD=b.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,{store:f,scrollHandlerRef:p}=ls(),{alignItemWithTriggerActive:m}=ab(),g=tt(f,Ze.hasScrollArrows),x=tt(f,Ze.openMethod),y=tt(f,Ze.multiple),w={id:`${tt(f,Ze.id)}-list`,role:"listbox","aria-multiselectable":y||void 0,onScroll(_){p.current?.(_.currentTarget)},...m&&{style:pC},className:g&&x!=="touch"?Dh.className:void 0},j=Le(_=>{f.set("listElement",_)});return Ht("div",n,{ref:[s,j],props:[w,d]})});let mC=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function sb(e={}){const{label:n,metadata:s,textRef:r,indexGuessBehavior:i,index:c}=e,{register:d,unregister:f,subscribeMapChange:p,elementsRef:m,labelsRef:g,nextIndexRef:x}=Yz(),y=b.useRef(-1),[S,w]=b.useState(c??(i===mC.GuessFromOrder?()=>{if(y.current===-1){const C=x.current;x.current+=1,y.current=C}return y.current}:-1)),j=b.useRef(null),_=b.useCallback(C=>{if(j.current=C,S!==-1&&C!==null&&(m.current[S]=C,g)){const k=n!==void 0;g.current[S]=k?n:r?.current?.textContent??C.textContent}},[S,m,g,n,r]);return Me(()=>{if(c!=null)return;const C=j.current;if(C)return d(C,s),()=>{f(C)}},[c,d,f,s]),Me(()=>{if(c==null)return p(C=>{const k=j.current?C.get(j.current)?.index:null;k!=null&&w(k)})},[c,p,w]),b.useMemo(()=>({ref:_,index:S}),[S,_])}const gC=b.createContext(void 0);function rb(){const e=b.useContext(gC);if(!e)throw new Error(Mn(57));return e}const uD=b.memo(b.forwardRef(function(n,s){const{render:r,className:i,style:c,value:d=null,label:f,disabled:p=!1,nativeButton:m=!1,...g}=n,x=b.useRef(null),y=sb({label:f,textRef:x,indexGuessBehavior:mC.GuessFromOrder}),{store:S,itemProps:w,setOpen:j,setValue:_,selectionRef:C,typingRef:k,valuesRef:R,multiple:N,selectedItemTextRef:A}=ls(),M=tt(S,Ze.isActive,y.index),O=tt(S,Ze.isSelected,y.index,d),L=tt(S,Ze.isSelectedByFocus,y.index),B=tt(S,Ze.isItemEqualToValue),I=y.index,D=I!==-1,z=b.useRef(null);Me(()=>{if(!D)return;const W=R.current;return W[I]=d,()=>{delete W[I]}},[D,I,d,R]),Me(()=>{if(!D)return;const W=S.state.value;let ie=W;N&&Array.isArray(W)&&W.length>0&&(ie=W[W.length-1]),ie!==void 0&&kl(d,ie,B)&&(S.set("selectedIndex",I),x.current&&(A.current=x.current))},[D,I,N,B,S,d,A]);const H=b.useRef(null),V=b.useRef("mouse"),Y=b.useRef(!1),{getButtonProps:q,buttonRef:F}=Il({disabled:p,focusableWhenDisabled:!0,native:m,composite:!0}),Z={disabled:p,selected:O,highlighted:M};function $(W){const ie=S.state.value;if(N){const re=Array.isArray(ie)?ie:[],oe=O?Oz(re,d,B):[...re,d];_(oe,ot(Wm,W))}else _(d,ot(Wm,W)),j(!1,ot(Wm,W))}function X(){C.current.dragY=0}const U={role:"option","aria-selected":O,tabIndex:M?0:-1,onKeyDown(W){H.current=W.key,S.set("activeIndex",I),W.key===" "&&k.current&&W.preventDefault()},onClick(W){const ie=W.type==="click"&&V.current!=="touch",re=W.nativeEvent.pointerType,oe=ie&&dx(W.nativeEvent)&&(re!==void 0||M),ce=ie&&!oe&&!Y.current;Y.current=!1,!(W.type==="keydown"&&H.current===null)&&(p||W.type==="keydown"&&H.current===" "&&k.current||ce||(H.current=null,$(W.nativeEvent)))},onPointerEnter(W){V.current=W.pointerType},onPointerMove(W){if(W.pointerType==="mouse"&&W.buttons===1){const ie=C.current;ie.dragY+=W.movementY,ie.dragY**2>=64&&(ie.allowUnselectedMouseUp=!0)}},onPointerDown(W){V.current=W.pointerType,Y.current=!0,X()},onMouseUp(){if(X(),p||V.current==="touch"||Y.current)return;const W=!C.current.allowSelectedMouseUp&&O,ie=!C.current.allowUnselectedMouseUp&&!O;W||ie||(Y.current=!0,z.current?.click(),Y.current=!1)}},K=Ht("div",n,{ref:[F,s,y.ref,z],state:Z,props:[w,U,g,q]}),G=b.useMemo(()=>({selected:O,index:I,textRef:x,selectedByFocus:L,hasRegistered:D}),[O,I,x,L,D]);return o.jsx(gC.Provider,{value:G,children:K})})),dD=b.forwardRef(function(n,s){const r=n.keepMounted??!1,{selected:i}=rb();return r||i?o.jsx(fD,{...n,ref:s}):null}),fD=b.memo(b.forwardRef((e,n)=>{const{render:s,className:r,style:i,keepMounted:c,...d}=e,{selected:f}=rb(),p=b.useRef(null),{transitionStatus:m,setMounted:g}=Nc(f),y=Ht("span",e,{ref:[n,p],state:{selected:f,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},d],stateAttributesMapping:Ll});return Rr({open:f,ref:p,onComplete(){f||g(!1)}}),y})),pD=b.memo(b.forwardRef(function(n,s){const{index:r,textRef:i,selectedByFocus:c,hasRegistered:d}=rb(),{firstItemTextRef:f,selectedItemTextRef:p}=ls(),{render:m,className:g,style:x,...y}=n,S=b.useCallback(j=>{j&&(d&&r===0&&(f.current=j),d&&c&&(p.current=j))},[f,p,r,c,d]);return Ht("div",n,{ref:[S,s,i],props:y})})),hC=b.forwardRef(function(n,s){const{render:r,className:i,style:c,direction:d,keepMounted:f=!1,...p}=n,m=d==="up",{store:g,popupRef:x,listRef:y,handleScrollArrowVisibility:S,scrollArrowsMountedCountRef:w}=ls(),{side:j,scrollDownArrowRef:_,scrollUpArrowRef:C}=ab(),k=m?Ze.scrollUpArrowVisible:Ze.scrollDownArrowVisible,R=tt(g,k),N=tt(g,Ze.openMethod),A=R&&N!=="touch",M=na(),O=m?C:_,{transitionStatus:L,setMounted:B}=Nc(A);Me(()=>(w.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{w.current=Math.max(0,w.current-1),w.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,w]),Rr({open:A,ref:O,onComplete(){A||B(!1)}});const z=Ht("div",n,{ref:[s,O],state:{direction:d,visible:A,side:j,transitionStatus:L},props:[{"aria-hidden":!0,children:m?"▲":"▼",style:{position:"absolute"},onMouseMove(V){if(V.movementX===0&&V.movementY===0||M.isStarted())return;g.set("activeIndex",null);function Y(){const q=g.state.listElement??x.current;if(!q)return;g.set("activeIndex",null),S();const F=tb(q.scrollHeight,q.clientHeight),Z=Yd(q.scrollTop,F),$=Z===(m?0:F),X=y.current;if(Z!==q.scrollTop&&(q.scrollTop=Z),X.length===0&&g.set(m?"scrollUpArrowVisible":"scrollDownArrowVisible",!$),$){M.clear();return}if(X.length>0){const U=O.current?.offsetHeight||0;q.scrollTop=mD(X,m,Z,q.clientHeight,U,F)}M.start(40,Y)}M.start(40,Y)},onMouseLeave(){M.clear()}},p]});return A||f?z:null});function mD(e,n,s,r,i,c){if(n){let g=0;const x=s+i-Ba;for(let w=0;w<e.length;w+=1){const j=e[w];if(j&&j.offsetTop>=x){g=w;break}}const y=Math.max(0,g-1),S=e[y];return y<g&&S?Yd(S.offsetTop-i,c):0}let d=e.length-1;const f=s+r-i+Ba;for(let g=0;g<e.length;g+=1){const x=e[g];if(x&&x.offsetTop+x.offsetHeight>f){d=Math.max(0,g-1);break}}const p=Math.min(e.length-1,d+1),m=e[p];return p>d&&m?Yd(m.offsetTop+m.offsetHeight-r+i,c):c}const gD=b.forwardRef(function(n,s){return o.jsx(hC,{...n,ref:s,direction:"down"})}),hD=b.forwardRef(function(n,s){return o.jsx(hC,{...n,ref:s,direction:"up"})}),xD=Lz;function bD({className:e,...n}){return o.jsx(Vz,{"data-slot":"select-value",className:Ot("flex flex-1 text-left",e),...n})}function vD({className:e,size:n="default",children:s,...r}){return o.jsxs(Hz,{"data-slot":"select-trigger","data-size":n,className:Ot("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),...r,children:[s,o.jsx($z,{render:o.jsx(ho,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function yD({className:e,children:n,side:s="bottom",sideOffset:r=4,align:i="center",alignOffset:c=0,alignItemWithTrigger:d=!0,...f}){return o.jsx(Fz,{children:o.jsx(eD,{side:s,sideOffset:r,align:i,alignOffset:c,alignItemWithTrigger:d,className:"isolate z-50",children:o.jsxs(lD,{"data-slot":"select-content","data-align-trigger":d,className:Ot("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:[o.jsx(_D,{}),o.jsx(cD,{children:n}),o.jsx(SD,{})]})})})}function jD({className:e,children:n,...s}){return o.jsxs(uD,{"data-slot":"select-item",className:Ot("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),...s,children:[o.jsx(pD,{className:"flex min-w-0 flex-1 gap-2 overflow-hidden whitespace-nowrap",children:n}),o.jsx(dD,{render:o.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:o.jsx(uc,{className:"pointer-events-none"})})]})}function _D({className:e,...n}){return o.jsx(hD,{"data-slot":"select-scroll-up-button",className:Ot("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:o.jsx(kS,{})})}function SD({className:e,...n}){return o.jsx(gD,{"data-slot":"select-scroll-down-button",className:Ot("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:o.jsx(ho,{})})}function kt({value:e,onChange:n,options:s,placeholder:r="— elegir —",disabled:i,className:c,showIcon:d=!1}){return o.jsxs(xD,{value:e,onValueChange:f=>n(f??""),disabled:i,children:[o.jsx(vD,{className:Oe("h-9 w-full",c),children:o.jsx(bD,{placeholder:r,children:f=>{const p=s.find(g=>g.value===f),m=d?p?.icon:void 0;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[m&&o.jsx(m,{className:"size-3.5 shrink-0"}),o.jsx("span",{className:"truncate",children:p?.label??f})]})}})}),o.jsx(yD,{side:"bottom",sideOffset:6,align:"start",alignItemWithTrigger:!1,className:"w-[var(--anchor-width)] p-1.5",children:s.map(f=>{const p=f.icon;return o.jsx(jD,{value:f.value,children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[p?o.jsx(p,{className:"size-4 shrink-0 text-muted-fg"}):null,f.description?o.jsxs("span",{className:"flex min-w-0 flex-col leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:f.label}),o.jsx("span",{className:"truncate text-[11px] text-muted-fg",children:f.description})]}):o.jsx("span",{className:"truncate",children:f.label})]})},f.value)})})]})}const Hj=320;function wD(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function CD(e){return e.agent_slug||e.actor_id||e.author||e.actor_kind||"—"}function kD({m:e}){const[n,s]=b.useState(!1),r=(e.body?.length||0)>Hj,i=!r||n?e.body:`${e.body.slice(0,Hj)}…`;return o.jsxs("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("span",{className:"mt-0.5 shrink-0",children:e.direction==="in"?o.jsx(SS,{size:14,className:"text-blue-400"}):o.jsx(CS,{size:14,className:"text-emerald-400"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[o.jsx("span",{className:"font-mono",children:wD(e.ts)}),o.jsx(Xe,{tone:"info",children:e.channel}),e.type&&o.jsx(Xe,{children:e.type}),o.jsx("span",{className:"font-medium text-foreground",children:CD(e)})]}),e.body&&o.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-xs",children:i}),r&&o.jsx("button",{type:"button",onClick:()=>s(c=>!c),className:"mt-1 text-[11px] font-medium text-sky-400 hover:underline",children:E(n?"logs.show_less":"logs.show_more")})]})]})}function ED(){const[e,n]=b.useState(!1),s=Je(e?"/admin/logs?errors":null,()=>Sl.logs("errors",200)),r=s.data?.entries||[];return o.jsxs("details",{className:"mb-3 rounded-lg border border-border bg-muted/20",onToggle:i=>n(i.target.open),children:[o.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-xs font-medium text-muted-fg",children:[E("logs.daemon_errors"),r.length?` · ${r.length}`:""]}),o.jsxs("div",{className:"border-t border-border p-3",children:[s.isLoading&&o.jsx(nt,{}),e&&!s.isLoading&&r.length===0&&o.jsx("p",{className:"text-xs text-muted-fg",children:E("logs.no_errors")}),o.jsx("ul",{className:"space-y-1",children:r.map((i,c)=>o.jsxs("li",{className:"rounded-md bg-card px-2 py-1 text-[11px]",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-fg",children:[typeof i.ts=="string"&&o.jsx("span",{className:"font-mono",children:new Date(i.ts).toLocaleString()}),typeof i.level=="string"&&o.jsx("span",{className:"text-destructive",children:i.level})]}),o.jsx("p",{className:"whitespace-pre-wrap break-words font-mono",children:String(i.msg??i.message??i.error??i.raw??JSON.stringify(i)).slice(0,500)})]},c))})]})]})}function ND({pid:e}){const n=!e||String(e)==="0",[s,r]=b.useState(""),[i,c]=b.useState(""),[d,f]=b.useState(""),[p,m]=b.useState(""),g=s.trim()||void 0,x=n?`/messages/global?channel=${g??""}`:`/projects/${e}/messages?channel=${g??""}`,y=Je(x,()=>n?Rh.global({channel:g,limit:300}):Rh.project(e,{channel:g,limit:300})),S=b.useMemo(()=>[...y.data||[]].sort((_,C)=>(C.ts||"").localeCompare(_.ts||"")),[y.data]),w=b.useMemo(()=>Array.from(new Set(S.map(_=>_.type).filter(Boolean))),[S]),j=b.useMemo(()=>S.filter(_=>!(i&&_.direction!==i||d&&_.type!==d||p&&!(_.body||"").toLowerCase().includes(p.toLowerCase()))),[S,i,d,p]);return o.jsxs(Ye,{title:E("logs.title"),description:E(n?"logs.desc_global":"logs.desc_project"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Re,{placeholder:E("logs.filter_channel"),value:s,onChange:_=>r(_.target.value),className:"w-44"}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>y.mutate(),children:o.jsx(kr,{size:13})})]}),children:[n&&o.jsx(ED,{}),o.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[o.jsx("div",{className:"w-36",children:o.jsx(kt,{value:i,onChange:c,placeholder:E("logs.filter_dir"),options:[{value:"",label:E("logs.all_directions")},{value:"in",label:E("logs.in")},{value:"out",label:E("logs.out")}]})}),o.jsx("div",{className:"w-40",children:o.jsx(kt,{value:d,onChange:f,placeholder:E("logs.filter_type"),options:[{value:"",label:E("logs.all_types")},...w.map(_=>({value:_,label:_}))]})}),o.jsx(Re,{placeholder:E("logs.search_text"),value:p,onChange:_=>m(_.target.value),className:"w-56"}),o.jsxs("span",{className:"text-[11px] text-muted-fg",children:[j.length," ",E("logs.count_of")," ",S.length]})]}),y.isLoading&&o.jsx(nt,{}),y.error&&o.jsx(dt,{children:E("logs.error",{msg:y.error.message})}),!y.isLoading&&!y.error&&j.length===0&&o.jsx(dt,{children:g?E("logs.no_activity_ch",{ch:g}):E("logs.no_activity")}),o.jsx("ul",{className:"space-y-1 text-sm",children:j.map((_,C)=>o.jsx(kD,{m:_},`${_.ts}-${C}`))})]})}function xC({value:e,onChange:n,options:s,placeholder:r="elegí o escribí un modelo…",invalid:i,invalidHint:c,className:d}){const[f,p]=b.useState(!1),[m,g]=b.useState(e),x=b.useRef(null),y=b.useRef(null),[S,w]=b.useState(null);b.useEffect(()=>{g(e)},[e]),b.useLayoutEffect(()=>{if(!f)return;const R=()=>{const N=x.current;if(!N)return;const A=N.getBoundingClientRect();w({top:A.bottom+4,left:A.left,width:A.width})};return R(),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[f]),b.useEffect(()=>{if(!f)return;const R=N=>{const A=N.target;x.current?.contains(A)||y.current?.contains(A)||p(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[f]);const j=m.trim().toLowerCase(),C=j&&!(m===e)?s.filter(R=>R.toLowerCase().includes(j)):s,k=R=>{n(R),g(R),p(!1)};return o.jsxs("div",{ref:x,className:Oe("relative",d),children:[o.jsxs("div",{className:Oe("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",i?"border-amber-500/60":"border-border"),children:[i&&o.jsx("span",{title:c||"Modelo/proveedor no disponible",children:o.jsx(LS,{className:"size-3.5 shrink-0 text-amber-400"})}),o.jsx("input",{value:m,placeholder:r,onChange:R=>{g(R.target.value),n(R.target.value),p(!0)},onFocus:()=>p(!0),className:"w-full bg-transparent py-1.5 text-sm outline-none placeholder:text-muted-fg/60"}),o.jsx("button",{type:"button",tabIndex:-1,onClick:()=>p(R=>!R),className:"shrink-0 text-muted-fg hover:text-foreground",children:o.jsx(ho,{className:"size-4"})})]}),f&&C.length>0&&S&&Cr.createPortal(o.jsx("ul",{ref:y,style:{position:"fixed",top:S.top,left:S.left,width:S.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:C.map(R=>o.jsx("li",{children:o.jsx("button",{type:"button",onMouseDown:N=>{N.preventDefault(),k(R)},className:Oe("flex w-full items-center rounded-md px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-fg",R===e&&"bg-accent/50"),children:o.jsx("span",{className:"truncate font-mono text-xs",children:R})})},R))}),document.body)]})}function Ar(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/admin/config",()=>Sl.config.get()),i=async(c,d)=>{const f=await Sl.config.patch({set:c,unset:d});return await r({config:f.config},{revalidate:!1}),f.config};return{config:e?.config||{},error:n,isLoading:s,mutate:r,patch:i}}function bC(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/admin/super-agent",()=>Sl.superAgent());return{superAgent:e,error:n,isLoading:s,mutate:r}}const RD={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"},TD={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"},lc=[{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 Sg(e,n){return n&&n in e?e[n]:e.custom}const Kd={anthropic:Al,openai:vn,gemini:kT,groq:dc,openrouter:tx,ollama:zS,azure:pT,mock:ST,custom:Ml},ao={anthropic:{base_url:"",default_model:"claude-sonnet-4.6",api_key_env:"ANTHROPIC_API_KEY",known_models:["claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.6","claude-sonnet-4.5","claude-haiku-4.5"]},openai:{base_url:"https://api.openai.com/v1",default_model:"gpt-4o-mini",api_key_env:"OPENAI_API_KEY",known_models:["gpt-4o","gpt-4o-mini","gpt-4.1","gpt-4.1-mini","o3-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-pro","gemini-3.5-flash","gemini-3.1-pro","gemini-3.1-flash","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite"]},groq:{base_url:"https://api.groq.com/openai/v1",default_model:"llama-3.3-70b-versatile",api_key_env:"GROQ_API_KEY",known_models:["llama-3.3-70b-versatile","llama-3.1-8b-instant","meta-llama/llama-4-scout-17b-16e-instruct","openai/gpt-oss-120b","openai/gpt-oss-20b","groq/compound","groq/compound-mini","qwen/qwen3-32b","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","deepseek/deepseek-r1:free","meta-llama/llama-3.3-70b-instruct:free","google/gemini-2.0-flash-exp:free","qwen/qwen3-235b-a22b:free","anthropic/claude-sonnet-4.5","openai/gpt-4o-mini"]},ollama:{base_url:"http://127.0.0.1:11434",default_model:"gemma2:9b",api_key_env:"",known_models:[]},azure:{base_url:"",default_model:"gpt-4o-mini",api_key_env:"AZURE_OPENAI_API_KEY",known_models:["gpt-4o","gpt-4o-mini"]},mock:{base_url:"",default_model:"mock",api_key_env:"",known_models:["mock"]},custom:{base_url:"",default_model:"",api_key_env:"",known_models:[]}};function vC(e){const n=e.indexOf(":");return n<0?{provider:e,model:""}:{provider:e.slice(0,n),model:e.slice(n+1)}}function wg({value:e,onChange:n,providers:s}){const{provider:r,model:i}=vC(e),c=s.find(g=>g.slug===r),d=!!r&&!c,f=b.useMemo(()=>{const g=c?ao[c.engine]?.known_models||[]:[];return Array.from(new Set([...c?.default_model?[c.default_model]:[],...g]))},[c]),p=g=>{const x=s.find(S=>S.slug===g),y=x?.default_model||ao[x?.engine]?.default_model||"";n(y?`${g}:${y}`:`${g}:`)},m=g=>n(`${r}:${g}`);return o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(kt,{value:r,onChange:p,placeholder:d?`⚠ ${r} (no existe)`:"— proveedor —",options:s.map(g=>({value:g.slug,label:g.slug,icon:Kd[g.engine]}))}),o.jsx(xC,{value:i,onChange:m,options:f,invalid:d,invalidHint:`El proveedor "${r}" no está configurado.`})]})}function AD(){const e=lt(),{superAgent:n,isLoading:s,mutate:r}=bC(),{config:i,patch:c}=Ar(),[d,f]=b.useState(""),[p,m]=b.useState([]),[g,x]=b.useState(""),[y,S]=b.useState(null),[w,j]=b.useState(!1),[_,C]=b.useState({model:"",fallback:[]});b.useEffect(()=>{if(!n)return;const I=n.model_fallback?.models||[],D=Array.isArray(I)?I:[];f(n.model||""),m(D),C({model:n.model||"",fallback:D})},[n]);const k=b.useMemo(()=>{const I=i.engines||{};return Object.entries(I).map(([D,z])=>({slug:D,engine:z?.engine||D,default_model:z?.default_model||ao[z?.engine||D]?.default_model}))},[i.engines]),R=I=>{const{provider:D}=vC(I);return k.some(z=>z.slug===D)};if(s||!n)return o.jsx(nt,{});const N=d!==_.model||JSON.stringify(p)!==JSON.stringify(_.fallback),A=async()=>{j(!0);try{await c({"super_agent.model":d,"super_agent.model_fallback.enabled":p.length>0,"super_agent.model_fallback.models":p}),e.success("Router guardado."),C({model:d,fallback:p}),r()}catch(I){e.error(I.message)}finally{j(!1)}},M=()=>{const I=g.trim().replace(/:$/,"");!I||!I.includes(":")||p.includes(I)||(m([...p,I]),x(""))},O=(I,D)=>{const z=[...p];z[I]=D,m(z)},L=I=>{m(p.filter((D,z)=>z!==I)),y===I&&S(null)},B=(I,D)=>{const z=I+D;if(z<0||z>=p.length)return;const H=[...p];[H[I],H[z]]=[H[z],H[I]],m(H)};return o.jsx(Ye,{title:"Router de modelos",description:"Un solo router general (sin casos por tarea). Elegí proveedor y modelo; si el activo falla, prueba la cadena de fallback en orden.",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-muted/20 p-3",children:[o.jsxs(Xe,{tone:"success",children:[o.jsx(tx,{size:11})," default"]}),o.jsx("span",{className:`font-mono text-xs ${!R(d)&&d?"text-amber-400":""}`,children:d||"—"}),p.map(I=>o.jsxs("span",{className:"flex items-center gap-2 text-muted-fg",children:[o.jsx(wS,{size:12}),o.jsx("span",{className:`font-mono text-xs ${R(I)?"":"text-amber-400"}`,children:I})]},I))]}),k.length===0?o.jsx("p",{className:"text-xs text-muted-fg",children:"Agregá un proveedor abajo para poder elegir modelos."}):o.jsx(fe,{label:"Modelo activo (default)",hint:"Proveedor + modelo. Se guarda como provider:model.",children:o.jsx(wg,{value:d,onChange:f,providers:k})}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3",children:[o.jsxs("div",{className:"mb-2",children:[o.jsx("div",{className:"text-sm font-medium",children:"Cadena de fallback"}),o.jsx("div",{className:"text-xs text-muted-fg",children:"Si el modelo activo falla, prueba estos en orden. Click en uno para editarlo."})]}),o.jsxs("ul",{className:"mb-3 space-y-1",children:[p.map((I,D)=>{const z=!R(I),H=y===D;return o.jsx("li",{className:"rounded-md bg-card px-2 py-1.5 text-xs",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"w-6 text-muted-fg",children:["#",D+1]}),H?o.jsx("div",{className:"flex-1",children:o.jsx(wg,{value:I,onChange:V=>O(D,V),providers:k})}):o.jsxs("button",{type:"button",onClick:()=>S(D),className:"flex flex-1 items-center gap-1.5 text-left",children:[z&&o.jsx(LS,{size:12,className:"text-amber-400"}),o.jsx("span",{className:`font-mono ${z?"text-amber-400":""}`,children:I})]}),H?o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>S(null),children:"listo"}):o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>S(D),children:o.jsx(af,{size:12})}),o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>B(D,-1),disabled:D===0,children:"↑"}),o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>B(D,1),disabled:D===p.length-1,children:"↓"}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>L(D),children:o.jsx(rs,{size:12})})]})},`${D}-${I}`)}),p.length===0&&o.jsx("li",{className:"text-xs text-muted-fg",children:"Sin fallback configurado."})]}),k.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"text-xs text-muted-fg",children:"Agregar a la cadena"}),o.jsx(wg,{value:g,onChange:x,providers:k}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:M,disabled:!g.includes(":")||g.endsWith(":"),children:[o.jsx(An,{size:13})," Agregar a la cadena"]})]})]}),o.jsx(ve,{variant:"primary",loading:w,disabled:!N,onClick:A,children:N?"Guardar router":"Guardado"})]})})}function MD({provider:e,onEdit:n,onDelete:s,onToggle:r}){const i=Sg(RD,e.engine),c=Sg(TD,e.engine),d=Sg(Kd,e.engine),f=lc.find(x=>x.value===e.engine)?.label||e.engine,p=typeof e.api_key=="string"&&e.api_key.length>0,m=Cl(e.api_key),g=e.is_active!==!1;return o.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:n,children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:Oe("flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br",i),children:o.jsx(d,{className:"size-5 text-white"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h3",{className:"truncate text-sm font-semibold",children:e.name||e.slug}),o.jsx("p",{className:"truncate font-mono text-[10px] text-muted-fg",children:e.slug}),o.jsxs("span",{className:Oe("mt-1 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",c),children:[o.jsx(d,{className:"size-3"})," ",f]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[o.jsx(Mt,{content:g?"Activo · click para desactivar":"Inactivo · click para activar",children:o.jsxs("button",{type:"button",onClick:x=>{x.stopPropagation(),r()},className:Oe("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:[o.jsx("span",{className:Oe("size-1.5 rounded-full",g?"bg-emerald-400":"bg-muted-fg/40")}),g?"Active":"Off"]})}),o.jsx(Mt,{content:"Borrar",children:o.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),s()},className:"rounded-md p-1 text-muted-fg hover:bg-destructive/10 hover:text-destructive",children:o.jsx(rs,{className:"size-3.5"})})})]})]}),o.jsxs("div",{className:"mt-auto space-y-1 text-xs",children:[o.jsx(Ii,{label:"Modelo",value:e.default_model||"—",mono:!0}),e.base_url&&o.jsx(Ii,{label:"Base URL",value:e.base_url,mono:!0,truncate:!0}),o.jsx(Ii,{label:"API key",value:p?m?`…${m}`:"✓ seteada":"—",mono:!!m}),e.default_temperature!==void 0&&o.jsx(Ii,{label:"Temp",value:e.default_temperature.toFixed(1)}),e.pricing?.input_per_million!==void 0&&o.jsx(Ii,{label:"$ in/out (1M)",value:`${e.pricing.input_per_million??0} / ${e.pricing.output_per_million??0}`})]})]})}function Ii({label:e,value:n,mono:s,truncate:r}){return o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"text-muted-fg",children:e}),o.jsx("span",{className:Oe("text-foreground",s&&"font-mono",r&&"max-w-[180px] truncate"),children:n})]})}const qj={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:""},OD=["anthropic","openai","gemini","groq","openrouter","ollama","custom"];function Bi(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function id(e){if(e==null)return"";const n=Number(e);return Number.isFinite(n)?String(n):""}function zD(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:id(e.pricing?.input_per_million),p_output:id(e.pricing?.output_per_million),p_cache_read:id(e.pricing?.cache_read_per_million),p_cache_write:id(e.pricing?.cache_write_per_million)}}function DD({open:e,initial:n,existingSlugs:s,onClose:r,onSave:i}){const c=!!n,[d,f]=b.useState(qj),[p,m]=b.useState(!1),[g,x]=b.useState(null),[y,S]=b.useState([]),[w,j]=b.useState(!1),[_,C]=b.useState(null),[k,R]=b.useState(!1),[N,A]=b.useState("");b.useEffect(()=>{if(!e)return;const $=n?zD(n):qj;f($),x(null),C(null),R(!1);const X=ao[$.engine];S(X?.known_models||[])},[e,n]);const M=$=>f(X=>({...X,...$})),O=$=>{const X=ao[$];M({engine:$,name:$==="custom"?d.name:lc.find(U=>U.value===$)?.label||$,slug:$==="custom"?d.slug:$,base_url:X.base_url,default_model:X.default_model}),S(X.known_models),C(null)},L=$=>{const X=ao[$];M({engine:$,base_url:d.base_url||X.base_url,default_model:d.default_model||X.default_model}),S(X.known_models)},B=async()=>{j(!0),C(null);try{const $=await $d.models({engine:d.engine,slug:d.slug||Bi(d.name),base_url:d.base_url||void 0,api_key:d.api_key_value||void 0});if($.error){C($.error);return}S($.models),$.models.length===0&&C("Sin modelos. ¿Key/URL correctas?")}catch($){C($.message||"No se pudo listar modelos.")}finally{j(!1)}},I=b.useMemo(()=>d.default_model&&!y.includes(d.default_model)?[d.default_model,...y]:y,[y,d.default_model]),D=()=>{const $=(d.slug||Bi(d.name)).trim();if(!$)return x("Slug requerido."),null;if(!c&&s.includes($))return x(`Ya existe un provider "${$}".`),null;let X;if(d.model_context_limits_json.trim())try{const G=JSON.parse(d.model_context_limits_json);if(!G||typeof G!="object"||Array.isArray(G))throw new Error;X=G}catch{return x("Límites de contexto por modelo: JSON inválido."),null}const K=[d.p_input,d.p_output,d.p_cache_read,d.p_cache_write].map(G=>G.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:$,name:d.name.trim()||$,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:X,pricing:K},modelLimits:X}},z=()=>{const $=D();if(!$)return;const{provider:X}=$,U={name:X.name,engine:X.engine,is_active:X.is_active!==!1,default_temperature:X.default_temperature,default_max_tokens:X.default_max_tokens};X.base_url&&(U.base_url=X.base_url),X.default_model&&(U.default_model=X.default_model),X.context_limit_tokens&&(U.context_limit_tokens=X.context_limit_tokens),X.model_context_limits&&(U.model_context_limits=X.model_context_limits),X.pricing&&(U.pricing=X.pricing),d.api_key_value.trim()&&(U.api_key=d.api_key_value.trim()),A(JSON.stringify(U,null,2)),x(null),R(!0)},H=async()=>{m(!0),x(null);try{if(k){const X=(d.slug||Bi(d.name)).trim();if(!X){x("Slug requerido (en el formulario).");return}let U;try{U=JSON.parse(N)}catch{x("JSON inválido: revisá la sintaxis.");return}if(!U||typeof U!="object"||Array.isArray(U)){x("El JSON debe ser un objeto con la config del provider.");return}const K=U;if(!K.engine||typeof K.engine!="string"){x('Falta "engine" (ej. "anthropic", "ollama").');return}const G={slug:X,name:typeof K.name=="string"?K.name:X,engine:String(K.engine),base_url:typeof K.base_url=="string"?K.base_url:void 0,default_model:typeof K.default_model=="string"?K.default_model:void 0,is_active:K.is_active!==!1};await i({provider:G,raw:K,originalSlug:n?.slug}),r();return}const $=D();if(!$)return;await i({provider:$.provider,apiKeyValue:d.api_key_value.trim()||void 0,originalSlug:n?.slug}),r()}catch($){x($.message||"Error al guardar.")}finally{m(!1)}},V=c&&Ua(n?.api_key),Y=Cl(n?.api_key),q=V?`…${Y??""} (ya seteada)`:"sk-…",F=d.engine==="ollama",Z=ao[d.engine]?.api_key_env;return o.jsx(ba,{open:e,onClose:r,title:c?`Editar ${n?.name||n?.slug}`:"Nuevo provider",description:"Proveedor LLM. El motor (engine) define qué adapter usa (openai, ollama, …).",size:"lg",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:r,disabled:p,children:"Cancelar"}),o.jsx(ve,{variant:"primary",onClick:H,loading:p,children:c?"Guardar":"Crear"})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[c?o.jsx("span",{}):o.jsx("div",{className:"flex flex-wrap gap-1.5",children:OD.map($=>{const X=Kd[$],U=$==="custom"?"Custom":lc.find(G=>G.value===$)?.label||$,K=d.engine===$;return o.jsxs("button",{type:"button",onClick:()=>O($),className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs transition-colors ${K?"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:[o.jsx(X,{className:"size-3.5"})," ",U]},$)})}),o.jsxs("button",{type:"button",onClick:()=>k?R(!1):z(),className:`flex shrink-0 items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs transition-colors ${k?"border-sky-500/50 bg-sky-500/10 text-sky-400":"border-border text-muted-fg hover:text-foreground"}`,children:[o.jsx(cT,{className:"size-3.5"})," ",k?"Volver al formulario":"JSON"]})]}),k?o.jsxs("div",{className:"space-y-2",children:[o.jsx(fe,{label:"Config del provider (JSON)",hint:`Se guarda como engines.${d.slug||Bi(d.name)||"<slug>"} en config.json`,children:o.jsx(en,{rows:14,className:"font-mono text-xs",value:N,onChange:$=>A($.target.value),spellCheck:!1})}),o.jsxs("p",{className:"text-[11px] text-muted-fg",children:["Debe ser un objeto JSON válido con al menos ",o.jsx("code",{children:"engine"}),". El slug se toma del formulario."]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:"Nombre",children:o.jsx(Re,{value:d.name,onChange:$=>M({name:$.target.value,slug:c?d.slug:Bi($.target.value)}),placeholder:"Mi provider"})}),o.jsx(fe,{label:"Motor (engine)",children:o.jsx(kt,{value:d.engine,onChange:$=>L($),options:lc.map($=>({value:$.value,label:$.label,icon:Kd[$.value]}))})})]}),o.jsx(fe,{label:"URL base (base_url)",hint:"Se completa sola al elegir un proveedor.",children:o.jsx(Re,{value:d.base_url,onChange:$=>M({base_url:$.target.value}),placeholder:"https://api.openai.com/v1"})}),!F&&o.jsx(fe,{label:"API key",hint:V?"Dejá en blanco para mantener la actual.":Z?`Se guarda como secreto. Env sugerida: ${Z}`:"Se guarda como secreto.",children:o.jsx(Re,{type:"password",autoComplete:"new-password",value:d.api_key_value,onChange:$=>M({api_key_value:$.target.value}),placeholder:q})}),o.jsx(fe,{label:"Modelo por defecto",children:o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(xC,{value:d.default_model,onChange:$=>M({default_model:$}),options:I,className:"flex-1"}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:B,disabled:w,title:"Lista los modelos reales del proveedor",children:[w?o.jsx(nf,{className:"size-3.5 animate-spin"}):o.jsx(kr,{className:"size-3.5"}),"Cargar modelos"]})]}),_&&o.jsx("p",{className:"text-[11px] text-amber-400",children:_})]})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:"Máx. tokens (max_tokens)",children:o.jsx(Re,{type:"number",min:256,step:256,value:d.default_max_tokens,onChange:$=>M({default_max_tokens:parseInt($.target.value)||4096})})}),o.jsx(fe,{label:`Temperatura: ${d.default_temperature.toFixed(1)}`,children:o.jsx("input",{type:"range",min:0,max:2,step:.1,value:d.default_temperature,onChange:$=>M({default_temperature:parseFloat($.target.value)}),className:"mt-2 w-full accent-foreground"})})]}),o.jsxs("details",{className:"rounded-md border border-border bg-muted/20 p-3",children:[o.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-fg",children:"Análisis de tokens / pricing (opcional)"}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsx(fe,{label:"Límite de contexto (tokens)",children:o.jsx(Re,{type:"number",min:0,step:1024,value:d.context_limit_tokens,onChange:$=>M({context_limit_tokens:parseInt($.target.value)||0})})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:"$ entrada / 1M",children:o.jsx(Re,{type:"number",min:0,step:1e-4,value:d.p_input,onChange:$=>M({p_input:$.target.value}),placeholder:"0.15"})}),o.jsx(fe,{label:"$ salida / 1M",children:o.jsx(Re,{type:"number",min:0,step:1e-4,value:d.p_output,onChange:$=>M({p_output:$.target.value}),placeholder:"0.60"})}),o.jsx(fe,{label:"$ cache read / 1M",children:o.jsx(Re,{type:"number",min:0,step:1e-4,value:d.p_cache_read,onChange:$=>M({p_cache_read:$.target.value}),placeholder:"0.03"})}),o.jsx(fe,{label:"$ cache write / 1M",children:o.jsx(Re,{type:"number",min:0,step:1e-4,value:d.p_cache_write,onChange:$=>M({p_cache_write:$.target.value}),placeholder:"0.00"})})]}),o.jsx(fe,{label:"Límites de contexto por modelo (JSON)",hint:'{"gpt-4o-mini":128000}',children:o.jsx(en,{rows:3,className:"font-mono text-xs",value:d.model_context_limits_json,onChange:$=>M({model_context_limits_json:$.target.value})})})]})]}),o.jsx(cn,{checked:d.is_active,onChange:$=>M({is_active:$}),label:"Activo (los agentes pueden usarlo)"})]}),g&&o.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:g})]})})}const LD=new Set(lc.map(e=>e.value));function PD(e,n){const s=typeof n.engine=="string"&&n.engine||(LD.has(e)?e:"custom");return{slug:e,name:typeof n.name=="string"?n.name:void 0,engine:s,base_url:typeof n.base_url=="string"?n.base_url:void 0,api_key:typeof n.api_key=="string"?n.api_key:void 0,default_model:typeof n.default_model=="string"?n.default_model:void 0,default_temperature:typeof n.default_temperature=="number"?n.default_temperature:void 0,default_max_tokens:typeof n.default_max_tokens=="number"?n.default_max_tokens:void 0,is_active:typeof n.is_active=="boolean"?n.is_active:void 0,context_limit_tokens:typeof n.context_limit_tokens=="number"?n.context_limit_tokens:void 0,model_context_limits:n.model_context_limits||void 0,pricing:n.pricing||void 0}}function ID(){const e=lt(),{config:n,isLoading:s,patch:r,mutate:i}=Ar(),[c,d]=b.useState(!1),[f,p]=b.useState(null);if(s)return o.jsx(nt,{});const m=n.engines||{},g=Object.entries(m).map(([C,k])=>PD(C,k||{})),x=g.map(C=>C.slug),y=()=>{p(null),d(!0)},S=C=>{p(C),d(!0)},w=async({provider:C,apiKeyValue:k,raw:R})=>{if(R){await r({[`engines.${C.slug}`]:R}),e.success("Provider guardado (JSON)."),i();return}const N=`engines.${C.slug}`,A={[`${N}.name`]:C.name,[`${N}.engine`]:C.engine,[`${N}.is_active`]:C.is_active!==!1,[`${N}.default_temperature`]:C.default_temperature,[`${N}.default_max_tokens`]:C.default_max_tokens},M=[],O=(L,B)=>{B===void 0||B===""?M.push(`${N}.${L}`):A[`${N}.${L}`]=B};O("base_url",C.base_url),O("default_model",C.default_model),O("context_limit_tokens",C.context_limit_tokens),O("pricing",C.pricing),O("model_context_limits",C.model_context_limits),k&&(A[`${N}.api_key`]=k),await r(A,M),e.success("Provider guardado."),i()},j=async C=>{try{await r({[`engines.${C.slug}.is_active`]:C.is_active===!1}),i()}catch(k){e.error(k.message)}},_=async C=>{if(confirm(`Borrar provider ${C.name||C.slug}?`))try{await r(void 0,[`engines.${C.slug}`]),e.success("Provider borrado."),i()}catch(k){e.error(k.message)}};return o.jsxs(Ye,{title:"Proveedores",description:"Proveedores LLM (API). Cada provider usa un engine/adapter (openai, ollama, …) con su key y URL.",action:o.jsxs(ve,{size:"sm",variant:"primary",onClick:y,children:[o.jsx(An,{size:14})," Nuevo provider"]}),children:[g.length===0?o.jsx(dt,{children:"Sin providers. Agregá uno con el botón de arriba."}):o.jsxs("div",{className:"grid grid-cols-1 items-stretch gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[g.map(C=>o.jsx(MD,{provider:C,onEdit:()=>S(C),onDelete:()=>_(C),onToggle:()=>j(C)},C.slug)),o.jsxs("button",{type:"button",onClick:y,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:[o.jsx(An,{size:20}),o.jsx("span",{className:"text-sm font-medium",children:"Agregar provider"})]})]}),o.jsx(DD,{open:c,initial:f,existingSlugs:x,onClose:()=>{d(!1),p(null)},onSave:w})]})}function yC(){return o.jsxs("div",{className:"space-y-6",children:[o.jsx(AD,{}),o.jsx(ID,{})]})}function BD(){const e=lt(),[n,s]=b.useState(!1),i=Je(n?"/agents/vault?include_removed=1":"/agents/vault",()=>Wt.vault({includeRemoved:n})),c=i.data||[],[d,f]=b.useState(null),p=async g=>{const x=g.source!=="user",y=x?E("base.defaults_tombstone_msg",{slug:g.slug}):E("base.defaults_delete_msg",{slug:g.slug});if(confirm(y))try{await Wt.vaultRemove(g.slug),e.success(E(x?"base.defaults_hidden":"base.defaults_deleted")),i.mutate()}catch(S){e.error(S.message)}},m=async g=>{try{await Wt.vaultRestore(g),e.success(E("base.defaults_restored")),i.mutate()}catch(x){e.error(x.message)}};return o.jsxs(Ye,{title:E("base.defaults_title"),description:E("base.defaults_desc"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cn,{checked:n,onChange:s,label:E("base.defaults_show_removed")}),o.jsxs(ve,{size:"sm",onClick:()=>f("new"),children:[o.jsx(An,{size:14})," ",E("base.defaults_new")]})]}),children:[i.isLoading&&o.jsx(nt,{}),!i.isLoading&&c.length===0&&o.jsx(dt,{children:E("base.defaults_empty")}),o.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:c.map(g=>{const x=n&&g.tombstoned;return o.jsxs("div",{className:`flex flex-col gap-2 rounded-xl border bg-card p-4 ${x?"border-dashed border-border opacity-60":"border-border"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.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?o.jsx(Ps,{className:"size-4 text-white"}):o.jsx(vn,{className:"size-4 text-white"})}),o.jsx("span",{className:"truncate text-sm font-semibold",children:g.slug}),o.jsx(UD,{source:g.source})]}),o.jsx("div",{className:"flex shrink-0 items-center gap-0.5",children:x?o.jsx(Cg,{label:E("base.defaults_restore"),onClick:()=>m(g.slug),variant:"secondary",children:o.jsx(ax,{size:13})}):o.jsxs(o.Fragment,{children:[o.jsx(Cg,{label:E("base.defaults_edit"),onClick:()=>f(g),variant:"ghost",children:o.jsx(af,{size:13})}),o.jsx(Cg,{label:g.source==="user"?E("base.defaults_delete"):E("base.defaults_hide"),onClick:()=>p(g),variant:"ghost-destructive",children:o.jsx(rs,{size:13})})]})})]}),g.model?o.jsx(Xe,{tone:"info",children:g.model}):o.jsx("span",{className:"text-[10px] text-muted-fg",children:"modelo: default del router"}),g.description&&o.jsx("p",{className:"line-clamp-3 text-xs text-muted-fg",children:g.description}),o.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.role&&o.jsx(Xe,{children:g.role}),g.skills?.map(y=>o.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[o.jsx(Al,{size:9})," ",y]},y)),g.tools?.map(y=>o.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[o.jsx(Ml,{size:9})," ",y]},y))]})]},g.slug)})}),d!==null&&o.jsx(HD,{agent:d==="new"?null:d,onClose:()=>f(null),onSaved:()=>{f(null),i.mutate()}})]})}function UD({source:e}){return e==="user"?o.jsx(Xe,{tone:"success",children:"user"}):e==="user-override"?o.jsx(Xe,{tone:"warning",children:"override"}):o.jsx(Xe,{tone:"muted",children:"bundled"})}function Cg({label:e,onClick:n,variant:s="ghost",children:r}){const i="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",c={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 o.jsxs(Px,{children:[o.jsx(Ix,{render:o.jsx("button",{type:"button",onClick:n,"aria-label":e,className:`${i} ${c[s]}`,children:r})}),o.jsx(Bx,{children:e})]})}function HD({agent:e,onClose:n,onSaved:s}){const r=lt(),[i,c]=b.useState(!1),d=!e,[f,p]=b.useState(e?.slug??""),[m,g]=b.useState(e?.role??""),[x,y]=b.useState(e?.model??""),[S,w]=b.useState(e?.description??""),[j,_]=b.useState(e?.language??"es"),[C,k]=b.useState((e?.skills??[]).join(", ")),[R,N]=b.useState((e?.tools??[]).join(", ")),[A,M]=b.useState(!!e?.is_master),[O,L]=b.useState(e?.body??""),B=async()=>{const I={role:m||void 0,model:x||void 0,description:S||void 0,language:j||void 0,skills:C,tools:R,is_master:A};c(!0);try{if(d){if(!/^[a-z][a-z0-9_-]*$/.test(f))throw new Error(E("base.defaults_slug_invalid"));await Wt.vaultCreate(f,I,O),r.success(E("base.defaults_created",{slug:f}))}else await Wt.vaultPatch(e.slug,{fields:I,body:O}),r.success(E("base.defaults_saved",{slug:e.slug}));s()}catch(D){r.error(D.message)}finally{c(!1)}};return o.jsx(ba,{open:!0,onClose:n,title:d?E("base.defaults_new_title"):E("base.defaults_edit_title",{slug:e.slug}),description:d?E("base.defaults_new_desc"):e.source==="bundled"?E("base.defaults_bundled_desc"):E("base.defaults_user_desc"),size:"lg",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:i,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:B,loading:i,children:E("common.save")})]}),children:o.jsxs("div",{className:"space-y-3",children:[d&&o.jsx(fe,{label:"slug",hint:"kebab-case, ej. reviewer, my-agent, content-writer",children:o.jsx(Re,{autoFocus:!0,value:f,onChange:I=>p(I.target.value),placeholder:"reviewer"})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:"role",children:o.jsx(Re,{value:m,onChange:I=>g(I.target.value),placeholder:"Code reviewer"})}),o.jsx(fe,{label:"model",children:o.jsx(Re,{value:x,onChange:I=>y(I.target.value),placeholder:"openrouter:..."})}),o.jsx(fe,{label:"language",children:o.jsx(Re,{value:j,onChange:I=>_(I.target.value),placeholder:"es"})}),o.jsx(fe,{label:"is_master",children:o.jsx("div",{className:"flex h-9 items-center",children:o.jsx(cn,{checked:A,onChange:M,label:E("base.defaults_master_label")})})})]}),o.jsx(fe,{label:"description",children:o.jsx(Re,{value:S,onChange:I=>w(I.target.value)})}),o.jsx(fe,{label:"skills",hint:"separadas por coma",children:o.jsx(Re,{value:C,onChange:I=>k(I.target.value),placeholder:"code-review, git"})}),o.jsx(fe,{label:"tools",hint:"separadas por coma",children:o.jsx(Re,{value:R,onChange:I=>N(I.target.value),placeholder:"read, write, run"})}),o.jsx(fe,{label:"body",hint:"markdown — extiende el system prompt del agente",children:o.jsx(en,{value:O,onChange:I=>L(I.target.value),rows:10,placeholder:"# Mission\\n..."})})]})})}const qD={apx:"success",claude:"info",codex:"warning"};function VD(){const[e,n]=b.useState(""),s=Je(`/sessions?engine=${e}`,()=>VO.global(e||void 0)),r=s.data?.sessions||[];return o.jsxs(Ye,{title:E("base.sessions_title"),description:E("base.sessions_desc"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-40",children:o.jsx(kt,{value:e,onChange:n,options:[{value:"",label:E("base.sessions_all")},{value:"apx",label:"apx"},{value:"claude",label:"claude"},{value:"codex",label:"codex"}]})}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>s.mutate(),children:o.jsx(kr,{size:13})})]}),children:[s.isLoading&&o.jsx(nt,{}),s.error&&o.jsx(dt,{children:E("base.sessions_error",{msg:s.error.message})}),!s.isLoading&&!s.error&&r.length===0&&o.jsx(dt,{children:E("base.sessions_empty")}),o.jsx("ul",{className:"space-y-1 text-sm",children:r.map((i,c)=>o.jsxs("li",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx(Xe,{tone:qD[i.engine]||"muted",children:i.engine}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate",children:i.title||i.id}),o.jsx("div",{className:"truncate font-mono text-[10px] text-muted-fg",children:i.cwd})]}),i.mtime>0&&o.jsx("span",{className:"shrink-0 text-[11px] text-muted-fg",children:new Date(i.mtime).toLocaleString()})]},`${i.engine}-${i.id}-${c}`))})]})}function $D(){const e=$a(),[n,s]=b.useState("open"),r=Je(`/tasks?state=${n}`,()=>hr.global(n));return o.jsxs(Ye,{title:E("project.global_tasks.title"),description:E("project.global_tasks.subtitle"),action:o.jsx("div",{className:"flex gap-1",children:["open","done","dropped","all"].map(i=>o.jsx(ve,{size:"sm",variant:n===i?"primary":"ghost",onClick:()=>s(i),children:i},i))}),children:[r.isLoading&&o.jsx(nt,{}),!r.isLoading&&(r.data?.length??0)===0&&o.jsx(dt,{children:E("project.global_tasks.empty")}),o.jsx("ul",{className:"space-y-2 text-sm",children:(r.data||[]).map(i=>o.jsxs("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("button",{type:"button",onClick:()=>e(`/p/${i.project_id}/tasks`),title:E("project.global_tasks.go_project"),children:o.jsx(Xe,{tone:"info",children:(i.project_name||"").split("/").pop()||i.project_id})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"font-medium",children:i.title}),o.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[o.jsx("span",{children:i.state}),i.agent&&o.jsxs(Xe,{tone:"muted",children:["@",i.agent]}),i.tags?.map(c=>o.jsxs("span",{children:["#",c]},c)),i.due&&o.jsxs("span",{children:[E("project.global_tasks.due")," ",i.due]})]})]})]},`${i.project_id}-${i.id}`))})]})}const jC=b.createContext(void 0);function ob(){const e=b.useContext(jC);if(e===void 0)throw new Error(Mn(64));return e}let GD=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const lb={tabActivationDirection:e=>({[GD.activationDirection]:e})},FD=b.forwardRef(function(n,s){const{className:r,defaultValue:i=0,onValueChange:c,orientation:d="horizontal",render:f,value:p,style:m,...g}=n,x=n.defaultValue!==void 0,y=b.useRef([]),[S,w]=b.useState(()=>new Map),[j,_]=bc({controlled:p,default:i,name:"Tabs",state:"value"}),C=p!==void 0,[k,R]=b.useState(()=>new Map),N=b.useCallback(oe=>{if(oe===void 0)return null;for(const[ce,ee]of k.entries())if(ee!=null&&oe===(ee.value??ee.index))return ce;return null},[k]),[A,M]=b.useState(()=>({previousValue:j,tabActivationDirection:"none"})),{previousValue:O,tabActivationDirection:L}=A;let B=L,I=!1;O!==j&&(B=Vj(O,j,d,k),I=O!=null&&j!=null&&N(j)==null);const D=I?O:j,z=O!==D||L!==B;Me(()=>{z&&M({previousValue:D,tabActivationDirection:B})},[D,z,B]);const H=Le((oe,ce)=>{const ee=Vj(j,oe,d,k);ce.activationDirection=ee,c?.(oe,ce),!ce.isCanceled&&_(oe)}),V=Le((oe,ce)=>{c?.(oe,ot(ce,void 0,void 0,{activationDirection:"none"}))}),Y=Le((oe,ce)=>{w(ee=>{if(ee.get(oe)===ce)return ee;const Te=new Map(ee);return Te.set(oe,ce),Te})}),q=Le((oe,ce)=>{w(ee=>{if(!ee.has(oe)||ee.get(oe)!==ce)return ee;const Te=new Map(ee);return Te.delete(oe),Te})}),F=b.useCallback(oe=>S.get(oe),[S]),Z=b.useCallback(oe=>{for(const ce of k.values())if(oe===ce?.value)return ce?.id},[k]),$=b.useMemo(()=>({getTabElementBySelectedValue:N,getTabIdByPanelValue:Z,getTabPanelIdByValue:F,onValueChange:H,orientation:d,registerMountedTabPanel:Y,setTabMap:R,unregisterMountedTabPanel:q,tabActivationDirection:B,value:j}),[N,Z,F,H,d,Y,R,q,B,j]),X=b.useMemo(()=>{for(const oe of k.values())if(oe!=null&&oe.value===j)return oe},[k,j]),U=b.useMemo(()=>{for(const oe of k.values())if(oe!=null&&!oe.disabled)return oe.value},[k]),K=b.useRef(!x),G=b.useRef(x),W=b.useRef(!1);Me(()=>{if(C)return;function oe($e,be){_($e),M(Ce=>Ce.previousValue===$e&&Ce.tabActivationDirection==="none"?Ce:{previousValue:$e,tabActivationDirection:"none"}),V($e,be),K.current=!1}if(k.size===0){if(!W.current||j===null)return;oe(null,I1);return}W.current=!0;const ce=X?.disabled,ee=X==null&&j!==null;if(!ce&&j===i&&(G.current=!1),G.current&&ce&&j===i)return;const Te=K.current;if(ce||ee){const $e=U??null;if(j===$e){K.current=!1;return}let be=I1;Te?be=B1:ce&&(be=aw),oe($e,be);return}Te&&X!=null&&(V(j,B1),K.current=!1)},[i,U,C,V,X,_,k,j]);const re=Ht("div",n,{state:{orientation:d,tabActivationDirection:B},ref:s,props:g,stateAttributesMapping:lb});return o.jsx(jC.Provider,{value:$,children:o.jsx(nb,{elementsRef:y,children:re})})});function Vj(e,n,s,r){if(e==null||n==null)return"none";let i=null,c=null;for(const[p,m]of r.entries()){if(m==null)continue;const g=m.value??m.index;if(e===g&&(i=p),n===g&&(c=p),i!=null&&c!=null)break}if(i==null||c==null)return i!==c&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof n?s==="horizontal"?n>e?"right":"left":n>e?"down":"up":"none";const d=i.getBoundingClientRect(),f=c.getBoundingClientRect();if(s==="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 _C="data-composite-item-active";function YD(e={}){const{highlightItemOnHover:n,highlightedIndex:s,onHighlightedIndexChange:r}=N2(),{ref:i,index:c}=sb(e),d=s===c,f=b.useRef(null),p=Us(i,f);return{compositeProps:b.useMemo(()=>({tabIndex:d?0:-1,onFocus(){r(c)},onMouseMove(){const g=f.current;if(!n||!g)return;const x=g.hasAttribute("disabled")||g.ariaDisabled==="true";!d&&!x&&g.focus()}}),[d,r,c,n]),compositeRef:p,index:c}}const SC=b.createContext(void 0);function XD(){const e=b.useContext(SC);if(e===void 0)throw new Error(Mn(65));return e}const KD=b.forwardRef(function(n,s){const{className:r,disabled:i=!1,render:c,value:d,id:f,nativeButton:p=!0,style:m,...g}=n,{value:x,getTabPanelIdByValue:y,orientation:S}=ob(),{activateOnFocus:w,highlightedTabIndex:j,onTabActivation:_,registerTabResizeObserverElement:C,setHighlightedTabIndex:k,tabsListElement:R}=XD(),N=Tr(f),A=b.useMemo(()=>({disabled:i,id:N,value:d}),[i,N,d]),{compositeProps:M,compositeRef:O,index:L}=YD({metadata:A}),B=d===x,I=b.useRef(!1),D=b.useRef(null);b.useEffect(()=>{const K=D.current;if(K)return C(K)},[C]),Me(()=>{if(I.current){I.current=!1;return}if(!(B&&L>-1&&j!==L))return;const K=R;if(K!=null){const G=Pn(yt(K));if(G&&Qe(K,G))return}i||k(L)},[B,L,j,k,i,R]);const{getButtonProps:z,buttonRef:H}=Il({disabled:i,native:p,focusableWhenDisabled:!0}),V=y(d),Y=b.useRef(!1),q=b.useRef(!1);function F(K){B||i||_(d,ot(Bs,K.nativeEvent,void 0,{activationDirection:"none"}))}function Z(K){B||(L>-1&&!i&&k(L),!i&&w&&(!Y.current||Y.current&&q.current)&&_(d,ot(Bs,K.nativeEvent,void 0,{activationDirection:"none"})))}function $(K){if(B||i)return;Y.current=!0;function G(){Y.current=!1,q.current=!1}(!K.button||K.button===0)&&(q.current=!0,yt(K.currentTarget).addEventListener("pointerup",G,{once:!0}))}return Ht("button",n,{state:{disabled:i,active:B,orientation:S},ref:[s,H,O,D],props:[M,{role:"tab","aria-controls":V,"aria-selected":B,id:N,onClick:F,onFocus:Z,onPointerDown:$,[_C]:B?"":void 0,onKeyDownCapture(){I.current=!0}},g,z]})});let QD=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e[e.startingStyle=co.startingStyle]="startingStyle",e[e.endingStyle=co.endingStyle]="endingStyle",e})({});const ZD={...lb,...Ll},JD=b.forwardRef(function(n,s){const{className:r,value:i,render:c,keepMounted:d=!1,style:f,...p}=n,{value:m,getTabIdByPanelValue:g,orientation:x,tabActivationDirection:y,registerMountedTabPanel:S,unregisterMountedTabPanel:w}=ob(),j=Tr(),_=b.useMemo(()=>({id:j,value:i}),[j,i]),{ref:C,index:k}=sb({metadata:_}),R=i===m,{mounted:N,transitionStatus:A,setMounted:M}=Nc(R),O=!N,L=g(i),B={hidden:O,orientation:x,tabActivationDirection:y,transitionStatus:A},I=b.useRef(null),D=Ht("div",n,{state:B,ref:[s,C,I],props:[{"aria-labelledby":L,hidden:O,id:j,role:"tabpanel",tabIndex:R?0:-1,inert:Lx(!R),[QD.index]:k},p],stateAttributesMapping:ZD});return Rr({open:R,ref:I,onComplete(){R||M(!1)}}),Me(()=>{if(!(O&&!d)&&j!=null)return S(i,j),()=>{w(i,j)}},[O,d,i,j,S,w]),d||N?D:null});function WD(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const e6=[];function t6(e){const{itemSizes:n,cols:s=1,loopFocus:r=!0,onLoop:i,dense:c=!1,orientation:d="both",direction:f,highlightedIndex:p,onHighlightedIndexChange:m,rootRef:g,enableHomeAndEndKeys:x=!1,stopEventPropagation:y=!1,disabledIndices:S,modifierKeys:w=e6}=e,[j,_]=b.useState(0),C=s>1,k=b.useRef(null),R=Us(k,g),N=b.useRef([]),A=b.useRef(!1),M=p??j,O=Le((D,z=!1)=>{if((m??_)(D),z){const H=N.current[D];Aj(k.current,H,f,d)}}),L=Le(D=>{if(D.size===0||A.current)return;A.current=!0;const z=Array.from(D.keys()),H=z.find(Y=>Y?.hasAttribute(_C))??null,V=H?z.indexOf(H):-1;V!==-1&&O(V),Aj(k.current,H,f,d)}),B=Le((D,z,H)=>i?i?.(D,z,H,N):H),I=b.useMemo(()=>({"aria-orientation":d==="both"?void 0:d,ref:R,onFocus(D){const z=k.current,H=Rn(D.nativeEvent);!z||H==null||!Tj(H)||H.setSelectionRange(0,H.value.length??0)},onKeyDown(D){const z=x?Zx:B2;if(!z.has(D.key)||n6(D,w)||!k.current)return;const V=f==="rtl",Y=V?Fd:rc,q={horizontal:Y,vertical:ul,both:Y}[d],F=V?rc:Fd,Z={horizontal:F,vertical:sc,both:F}[d],$=Rn(D.nativeEvent);if($!=null&&Tj($)&&!WD($)){const re=$.selectionStart,oe=$.selectionEnd,ce=$.value??"";if(re==null||D.shiftKey||re!==oe||D.key!==Z&&re<ce.length||D.key!==q&&re>0)return}let X=M;const U=vd(N,S),K=xh(N,S);if(C){const re=n||Array.from({length:N.current.length},()=>({width:1,height:1})),oe=fw(re,s,c),ce=oe.findIndex(Te=>Te!=null&&!Ds(N.current,Te,S)),ee=oe.reduce((Te,$e,be)=>$e!=null&&!Ds(N.current,$e,S)?be:Te,-1);X=oe[dw(oe.map(Te=>Te!=null?N.current[Te]:null),{event:D,orientation:d,loopFocus:r,onLoop:B,cols:s,disabledIndices:mw([...S||N.current.map((Te,$e)=>Ds(N.current,$e)?$e:void 0),void 0],oe),minIndex:ce,maxIndex:ee,prevIndex:pw(M>K?U:M,re,oe,s,D.key===ul?"bl":D.key===rc?"tr":"tl"),rtl:V})]}const G={horizontal:[Y],vertical:[ul],both:[Y,ul]}[d],W={horizontal:[F],vertical:[sc],both:[F,sc]}[d],ie=C?z:{horizontal:x?B4:P2,vertical:x?U4:I2,both:z}[d];x&&(D.key===Ef?X=U:D.key===Nf&&(X=K)),X===M&&(G.includes(D.key)||W.includes(D.key))&&(r&&X===K&&G.includes(D.key)?(X=U,i&&(X=i(D,M,X,N))):r&&X===U&&W.includes(D.key)?(X=K,i&&(X=i(D,M,X,N))):X=Ln(N.current,{startingIndex:X,decrement:W.includes(D.key),disabledIndices:S})),X!==M&&!hc(N.current,X)&&(y&&D.stopPropagation(),ie.has(D.key)&&D.preventDefault(),O(X,!0),queueMicrotask(()=>{N.current[X]?.focus()}))}}),[s,c,f,S,N,x,M,C,n,r,i,B,R,w,O,d,y]);return b.useMemo(()=>({props:I,highlightedIndex:M,onHighlightedIndexChange:O,elementsRef:N,disabledIndices:S,onMapChange:L,relayKeyboardEvent:I.onKeyDown}),[I,M,O,N,S,L])}function n6(e,n){for(const s of G4.values())if(!n.includes(s)&&e.getModifierState(s))return!0;return!1}function a6(e){const{render:n,className:s,style:r,refs:i=pc,props:c=pc,state:d=ln,stateAttributesMapping:f,highlightedIndex:p,onHighlightedIndexChange:m,orientation:g,dense:x,itemSizes:y,loopFocus:S,onLoop:w,cols:j,enableHomeAndEndKeys:_,onMapChange:C,stopEventPropagation:k=!0,rootRef:R,disabledIndices:N,modifierKeys:A,highlightItemOnHover:M=!1,tag:O="div",...L}=e,B=zx(),{props:I,highlightedIndex:D,onHighlightedIndexChange:z,elementsRef:H,onMapChange:V,relayKeyboardEvent:Y}=t6({itemSizes:y,cols:j,loopFocus:S,onLoop:w,dense:x,orientation:g,highlightedIndex:p,onHighlightedIndexChange:m,rootRef:R,stopEventPropagation:k,enableHomeAndEndKeys:_,direction:B,disabledIndices:N,modifierKeys:A}),q=Ht(O,e,{state:d,ref:i,props:[I,...c,L],stateAttributesMapping:f}),F=b.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:z,highlightItemOnHover:M,relayKeyboardEvent:Y}),[D,z,M,Y]);return o.jsx(E2.Provider,{value:F,children:o.jsx(nb,{elementsRef:H,onMapChange:Z=>{C?.(Z),V(Z)},children:q})})}const s6=b.forwardRef(function(n,s){const{activateOnFocus:r=!1,className:i,loopFocus:c=!0,render:d,style:f,...p}=n,{onValueChange:m,orientation:g,value:x,setTabMap:y,tabActivationDirection:S}=ob(),[w,j]=b.useState(0),[_,C]=b.useState(null),k=b.useRef(new Set),R=b.useRef(new Set),N=b.useRef(null);b.useEffect(()=>{if(typeof ResizeObserver>"u")return;const D=new ResizeObserver(()=>{k.current.forEach(z=>{z()})});return N.current=D,_&&D.observe(_),R.current.forEach(z=>{D.observe(z)}),()=>{D.disconnect(),N.current=null}},[_]);const A=Le(D=>(k.current.add(D),()=>{k.current.delete(D)})),M=Le(D=>(R.current.add(D),N.current?.observe(D),()=>{R.current.delete(D),N.current?.unobserve(D)})),O=Le((D,z)=>{D!==x&&m(D,z)}),L={orientation:g,tabActivationDirection:S},B={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},I=b.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,registerIndicatorUpdateListener:A,registerTabResizeObserverElement:M,onTabActivation:O,setHighlightedTabIndex:j,tabsListElement:_}),[r,w,A,M,O,j,_]);return o.jsx(SC.Provider,{value:I,children:o.jsx(a6,{render:d,className:i,style:f,state:L,refs:[s,C],props:[B,p],stateAttributesMapping:lb,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:c,orientation:g,onHighlightedIndexChange:j,onMapChange:y,disabledIndices:pc})})});function Rf({className:e,...n}){return o.jsx(FD,{"data-slot":"tabs",className:Ot("flex flex-col gap-4",e),...n})}const r6=Yx("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 Tf({className:e,variant:n="default",...s}){return o.jsx(s6,{"data-slot":"tabs-list","data-variant":n,className:Ot(r6({variant:n}),e),...s})}function Wa({className:e,...n}){return o.jsx(KD,{"data-slot":"tabs-trigger",className:Ot("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),...n})}function Aa({className:e,...n}){return o.jsx(JD,{"data-slot":"tabs-content",className:Ot("text-sm outline-none",e),...n})}function $j(e,n){let s=e;for(const r of n.split(".")){if(!s||typeof s!="object"||Array.isArray(s))return;s=s[r]}return s}function ib(e,n=""){const s={};for(const[r,i]of Object.entries(e)){const c=n?`${n}.${r}`:r;i&&typeof i=="object"&&!Array.isArray(i)?Object.assign(s,ib(i,c)):s[c]=i}return s}function o6(e){const n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("JSON debe ser objeto.");return n}function Lh({sections:e,source:n,placeholderSource:s,jsonTitle:r,jsonDescription:i,saveLabel:c="Guardar",onSaveFields:d,onSaveJson:f,busy:p}){const m=e[0]?.key||"json",[g,x]=b.useState({}),[y,S]=b.useState(""),[w,j]=b.useState("");b.useEffect(()=>{const R={};for(const N of e.flatMap(A=>A.fields))R[N.path]=$j(n,N.path)??"";x(R),S(JSON.stringify(n||{},null,2)),j("")},[n,e]);const _=b.useMemo(()=>new Set(e.flatMap(R=>R.fields.map(N=>N.path))),[e]),C=async()=>{const R={},N=[];for(const A of e.flatMap(M=>M.fields)){const M=g[A.path];if(!Ua(M)){if(M===""||M===void 0||M===null){N.push(A.path);continue}if(A.kind==="number"){const O=Number(M);Number.isFinite(O)&&(R[A.path]=O)}else R[A.path]=M}}await d(R,N.filter(A=>_.has(A)))},k=async()=>{j("");try{await f(o6(y))}catch(R){j(R.message)}};return o.jsxs(Rf,{defaultValue:m,className:"space-y-4",children:[o.jsxs(Tf,{className:"flex flex-wrap",children:[e.map(R=>o.jsx(Wa,{value:R.key,children:R.label},R.key)),o.jsx(Wa,{value:"json",children:"JSON"})]}),e.map(R=>o.jsx(Aa,{value:R.key,children:o.jsxs("div",{className:"space-y-4",children:[R.description&&o.jsx("p",{className:"text-sm text-muted-fg",children:R.description}),o.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:R.fields.map(N=>o.jsx(l6,{field:N,value:g[N.path],inherited:$j(s,N.path),onChange:A=>x(M=>({...M,[N.path]:A}))},N.path))}),o.jsx(ve,{variant:"primary",loading:p,onClick:C,children:c})]})},R.key)),o.jsx(Aa,{value:"json",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-medium",children:r}),i&&o.jsx("p",{className:"text-xs text-muted-fg",children:i})]}),o.jsx(en,{rows:18,className:"font-mono text-xs",value:y,onChange:R=>S(R.target.value)}),w&&o.jsx("p",{className:"text-xs text-destructive",children:w}),o.jsx(ve,{variant:"primary",loading:p,onClick:k,children:"Guardar JSON"})]})})]})}function l6({field:e,value:n,inherited:s,onChange:r}){const i=e.placeholder||Gj(s)||(Ua(n)?jr(n):""),c=e.hint||(s!==void 0?`Heredado: ${Gj(s)}`:void 0);return e.kind==="boolean"?o.jsx("div",{className:"flex items-end pb-1",children:o.jsx(cn,{checked:n===!0,onChange:r,label:e.label})}):o.jsx(fe,{label:e.label,hint:c,children:e.kind==="select"?o.jsx(kt,{value:String(n||""),onChange:r,placeholder:i||"(sin override)",options:[{value:"",label:i||"(sin override)"},...(e.options||[]).map(d=>({value:String(d.value),label:d.label}))]}):e.kind==="textarea"?o.jsx(en,{rows:4,value:String(n||""),placeholder:i,onChange:d=>r(d.target.value)}):o.jsx(Re,{type:e.kind==="password"?"password":e.kind==="number"?"number":"text",value:String(Ua(n)?"":n||""),placeholder:e.kind==="password"&&Ua(n)?jr(n):e.kind==="password"&&Ua(s)?jr(s):i,onChange:d=>r(d.target.value)})})}function Gj(e){return e==null||e===""?"":Ua(e)?jr(e):Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}const i6=[{key:"routing",label:"Overrides",description:".apc/config.json. Sólo valores propios del proyecto; vacío hereda global/effective.",fields:[{path:"route_to_agent",label:"Route to agent",placeholder:"master"},{path:"super_agent.model",label:"Super-agent model"},{path:"super_agent.permission_mode",label:"Permission mode",kind:"select",options:sx.map(e=>({value:e,label:e}))},{path:"super_agent.system",label:"Prompt extra",kind:"textarea"}]},{key:"telegram",label:"Telegram",fields:[{path:"telegram.route_to_agent",label:"Route to agent"},{path:"telegram.chat_id",label:"Chat ID"},{path:"telegram.bot_token",label:"Bot token",kind:"password"},{path:"telegram.respond_with_engine",label:"Responder con engine",kind:"boolean"}]},{key:"engines",label:"Engines",fields:[{path:"engines.ollama.base_url",label:"Ollama URL"},{path:"engines.anthropic.api_key",label:"Anthropic API key",kind:"password"},{path:"engines.openai.api_key",label:"OpenAI API key",kind:"password"},{path:"engines.groq.api_key",label:"Groq API key",kind:"password"},{path:"engines.openrouter.api_key",label:"OpenRouter API key",kind:"password"},{path:"engines.gemini.api_key",label:"Gemini API key",kind:"password"}]}],c6=[{key:"identity",label:"Proyecto",description:".apc/project.json. Metadata APC portable; no secrets, no runtime.",fields:[{path:"name",label:"Name"},{path:"version",label:"Version"},{path:"apf",label:"APC spec"},{path:"apx",label:"APX install state"},{path:"apx_id",label:"APX storage id"}]}];function u6({pid:e}){const n=lt(),s=Je(`/projects/${e}/config`,()=>ta.config.show(e));if(s.isLoading)return o.jsx(nt,{});if(!s.data)return o.jsx(dt,{children:E("project.config.no_data")});const r=async c=>{await ta.apcProject.put(e,c),n.success(E("project.config.save_project")),s.mutate()},i=async c=>{await ta.config.put(e,c),n.success(E("project.config.save_override")),s.mutate()};return o.jsx("div",{className:"space-y-6",children:o.jsx(Ye,{title:E("project.config.section_title"),description:E("project.config.section_desc"),children:o.jsxs(Rf,{defaultValue:"override",className:"space-y-4",children:[o.jsxs(Tf,{children:[o.jsx(Wa,{value:"override",children:"Override"}),o.jsx(Wa,{value:"project",children:"APC project"}),o.jsx(Wa,{value:"effective",children:"Effective"})]}),o.jsx(Aa,{value:"override",children:o.jsx(Lh,{sections:i6,source:s.data.project_only,placeholderSource:s.data.effective,jsonTitle:s.data.project_config_path,jsonDescription:".apc/config.json. Overrides del proyecto.",onSaveFields:async(c,d)=>{await ta.config.set(e,c),d.length&&await ta.config.unset(e,d),n.success(E("project.config.save_fields_success")),s.mutate()},onSaveJson:i})}),o.jsx(Aa,{value:"project",children:o.jsx(Lh,{sections:c6,source:s.data.apc_project||{},jsonTitle:s.data.project_json_path,jsonDescription:".apc/project.json. Metadata APC portable.",onSaveFields:async(c,d)=>{await ta.apcProject.set(e,d6(c),d),n.success(E("project.config.save_meta_success")),s.mutate()},onSaveJson:r})}),o.jsx(Aa,{value:"effective",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-xs text-muted-fg",children:E("project.config.effective_read")}),o.jsx("pre",{className:"max-h-96 overflow-auto rounded-lg border border-border bg-muted/40 p-3 text-xs",children:JSON.stringify(s.data.effective,null,2)})]})})]})})})}function d6(e){const n={};for(const[s,r]of Object.entries(ib(e)))Ua(r)||(n[s]=r);return n}const f6=["","es","en","pt","fr","it","de"],Fj=e=>e.split(",").map(n=>n.trim()).filter(Boolean);function wC(e){return e.is_master?{gradient:"from-violet-600 to-indigo-600",Icon:Ps}:{gradient:"from-slate-600 to-gray-600",Icon:vn}}function p6(e){const n=e.filter(d=>d.is_master),s=n.length===1?n[0]:null,r=d=>d.parent?d.parent:s&&!d.is_master&&d.slug!==s.slug?s.slug:null,i=new Map,c=[];for(const d of e){const f=r(d);f&&e.some(p=>p.slug===f)?(i.has(f)||i.set(f,[]),i.get(f).push(d)):c.push(d)}return{roots:c,childrenByParent:i}}function m6({pid:e}){const n=$a();lt();const s=Je(`/projects/${e}/agents`,()=>Wt.list(e)),[r,i]=b.useState("hierarchy"),[c,d]=b.useState(!1),[f,p]=b.useState(!1),m=s.data||[],g=w=>n(`/p/${e}/agents/${w}`),x=w=>n(w?`/p/${e}/chat?agent=${w}`:`/p/${e}/chat`),{roots:y,childrenByParent:S}=b.useMemo(()=>p6(m),[m]);return o.jsxs(Ye,{title:E("project.agents.title"),description:E("project.agents.subtitle_full"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[o.jsxs("button",{onClick:()=>i("hierarchy"),className:Oe("flex items-center gap-1 rounded-md px-2 py-1 text-xs",r==="hierarchy"?"bg-accent text-accent-fg":"text-muted-fg"),children:[o.jsx(tx,{size:13})," ",E("project.agents.hierarchy")]}),o.jsxs("button",{onClick:()=>i("list"),className:Oe("flex items-center gap-1 rounded-md px-2 py-1 text-xs",r==="list"?"bg-accent text-accent-fg":"text-muted-fg"),children:[o.jsx(LT,{size:13})," ",E("project.agents.list_view")]})]}),o.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>p(!0),children:[o.jsx(QT,{size:13})," ",E("project.agents.import")]}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>x(),children:[o.jsx(ss,{size:13})," ",E("project.agents.chat")]}),o.jsxs(ve,{size:"sm",variant:"primary","data-testid":"agent-new",onClick:()=>d(!0),children:[o.jsx(An,{size:14})," ",E("project.agents.new")]})]}),children:[s.isLoading&&o.jsx(nt,{}),!s.isLoading&&m.length===0&&o.jsx(dt,{children:E("project.agents.empty_text")}),!s.isLoading&&m.length>0&&(r==="hierarchy"?o.jsx(h6,{roots:y,childrenByParent:S,onOpen:g,onChat:x}):o.jsx(x6,{agents:m,onOpen:g,onChat:x})),o.jsx(b6,{open:c,pid:e,agents:m,onClose:()=>d(!1),onCreated:()=>{d(!1),s.mutate()}}),o.jsx(g6,{open:f,pid:e,existing:m.map(w=>w.slug),onClose:()=>p(!1),onImported:()=>s.mutate()})]})}function g6({open:e,onClose:n,onImported:s,pid:r,existing:i}){const c=lt(),d=Je(e?"/agents/vault":null,()=>Wt.vault()),[f,p]=b.useState(""),m=d.data||[],g=async x=>{p(x);try{await Wt.import(r,x),c.success(E("project.agents.import_success",{slug:x})),s()}catch(y){c.error(y.message)}finally{p("")}};return o.jsxs(ba,{open:e,onClose:n,title:E("project.agents.import_title"),description:E("project.agents.import_desc"),size:"lg",footer:o.jsx(ve,{variant:"ghost",onClick:n,children:E("common.close")}),children:[d.isLoading&&o.jsx(nt,{}),!d.isLoading&&m.length===0&&o.jsx(dt,{children:E("project.agents.import_empty")}),o.jsx("ul",{className:"space-y-2",children:m.map(x=>{const y=i.includes(x.slug);return o.jsxs("li",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted/30 p-3",children:[o.jsx(vn,{size:16,className:"shrink-0 text-muted-fg"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium",children:x.slug}),x.is_master&&o.jsxs(Xe,{tone:"success",children:[o.jsx(Ps,{size:9})," ",E("project.agents.orchestrator")]}),x.model&&o.jsx(Xe,{tone:"info",children:x.model})]}),x.description&&o.jsx("p",{className:"truncate text-xs text-muted-fg",children:x.description})]}),o.jsx(ve,{size:"sm",variant:"primary",disabled:y||f===x.slug,loading:f===x.slug,onClick:()=>g(x.slug),children:E(y?"project.agents.import_already":"project.agents.import_btn")})]},x.slug)})})]})}function h6({roots:e,childrenByParent:n,onOpen:s,onChat:r}){return o.jsx("div",{className:"space-y-8",children:e.map(i=>{const c=n.get(i.slug)||[];return o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(kg,{agent:i,onOpen:s,onChat:r,wide:!0}),c.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-5 w-px bg-border"}),o.jsx("div",{className:"flex flex-wrap items-start justify-center gap-4 border-t border-border pt-5",children:c.map(d=>o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(kg,{agent:d,onOpen:s,onChat:r}),(n.get(d.slug)||[]).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-4 w-px bg-border"}),o.jsx("div",{className:"flex flex-wrap justify-center gap-3 border-t border-border pt-4",children:(n.get(d.slug)||[]).map(f=>o.jsx(kg,{agent:f,onOpen:s,onChat:r,compact:!0},f.slug))})]})]},d.slug))})]})]},i.slug)})})}function kg({agent:e,onOpen:n,onChat:s,wide:r,compact:i}){const{gradient:c,Icon:d}=wC(e);return o.jsxs("div",{"data-testid":`agent-card-${e.slug}`,className:Oe("cursor-pointer rounded-xl border border-border bg-card p-3 transition-colors hover:border-muted-fg/50",r?"w-64":i?"w-44":"w-52"),onClick:()=>n(e.slug),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:Oe("flex size-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br",c),children:o.jsx(d,{className:"size-4 text-white"})}),o.jsx("span",{className:"truncate text-sm font-semibold",children:e.slug})]}),o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:[e.is_master&&o.jsxs(Xe,{tone:"success",children:[o.jsx(Ps,{size:9})," ",E("project.agents.orchestrator")]}),e.role&&o.jsx(Xe,{children:e.role}),e.model&&!i&&o.jsx(Xe,{tone:"info",children:e.model})]}),o.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:[o.jsxs("button",{onClick:()=>n(e.slug),className:"flex items-center gap-1 hover:text-foreground",children:[o.jsx(ex,{size:12})," ",E("project.agents.view")]}),o.jsxs("button",{onClick:()=>s(e.slug),className:"flex items-center gap-1 text-emerald-500 hover:text-emerald-400",children:[o.jsx(ss,{size:12})," ",E("project.agents.chat")]})]})]})}function x6({agents:e,onOpen:n,onChat:s}){const r=[...e].sort((i,c)=>+!!c.is_master-+!!i.is_master||i.slug.localeCompare(c.slug));return o.jsx("div",{className:"space-y-2",children:r.map(i=>{const{gradient:c,Icon:d}=wC(i);return o.jsxs("div",{"data-testid":`agent-card-${i.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:()=>n(i.slug),children:[o.jsx("div",{className:Oe("flex size-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br",c),children:o.jsx(d,{className:"size-4 text-white"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold",children:i.slug}),i.is_master&&o.jsxs(Xe,{tone:"success",children:[o.jsx(Ps,{size:10})," ",E("project.agents.orchestrator")]}),i.role&&o.jsx(Xe,{children:i.role}),i.model&&o.jsx(Xe,{tone:"info",children:i.model}),i.parent&&o.jsxs("span",{className:"text-[10px] text-violet-400",children:["↳ ",i.parent]})]}),i.description&&o.jsx("p",{className:"mt-1 truncate text-xs text-muted-fg",children:i.description}),o.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[i.skills?.map(f=>o.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[o.jsx(Al,{size:9})," ",f]},f)),i.tools?.map(f=>o.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-[9px] text-muted-fg",children:[o.jsx(Ml,{size:9})," ",f]},f))]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-3 text-xs text-muted-fg",onClick:f=>f.stopPropagation(),children:[o.jsxs("button",{onClick:()=>n(i.slug),className:"flex items-center gap-1 hover:text-foreground",children:[o.jsx(ex,{size:12})," ",E("project.agents.view")]}),o.jsxs("button",{onClick:()=>s(i.slug),className:"flex items-center gap-1 text-emerald-500 hover:text-emerald-400",children:[o.jsx(ss,{size:12})," ",E("project.agents.chat")]})]})]},i.slug)})})}function b6({open:e,onClose:n,onCreated:s,pid:r,agents:i}){const c=lt(),[d,f]=b.useState(""),[p,m]=b.useState(""),[g,x]=b.useState(""),[y,S]=b.useState(""),[w,j]=b.useState(""),[_,C]=b.useState(""),[k,R]=b.useState(""),[N,A]=b.useState(!1),[M,O]=b.useState(""),[L,B]=b.useState(!1),I=()=>{f(""),m(""),x(""),S(""),j(""),C(""),R(""),A(!1),O("")},D=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(d)){c.error(E("project.agents.slug_invalid"));return}B(!0);try{await Wt.create(r,{slug:d,role:p||void 0,model:g||void 0,language:y||void 0,description:w||void 0,skills:Fj(_),tools:Fj(k),is_master:N,parent:M||void 0}),c.success(E("project.agents.create_success",{slug:d})),s(),I()}catch(z){c.error(z?.message||E("project.agents.create_error"))}finally{B(!1)}};return o.jsx(ba,{open:e,onClose:n,title:E("project.agents.new_title"),description:E("project.agents.new_desc"),size:"lg",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:L,children:E("common.cancel")}),o.jsx(ve,{variant:"primary","data-testid":"agent-create-submit",onClick:D,loading:L,children:E("common.create")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.agents.slug_label"),children:o.jsx(Re,{autoFocus:!0,"data-testid":"agent-slug",value:d,onChange:z=>f(z.target.value),placeholder:E("project.agents.slug_ph")})}),o.jsx(fe,{label:E("project.agents.role_label"),children:o.jsx(Re,{value:p,onChange:z=>m(z.target.value),placeholder:E("project.agents.role_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.agents.model_label"),hint:E("project.agents.model_hint"),children:o.jsx(Re,{value:g,onChange:z=>x(z.target.value)})}),o.jsx(fe,{label:E("project.agents.lang_label"),children:o.jsx(kt,{value:y,onChange:S,options:f6.map(z=>({value:z,label:z||"—"}))})})]}),o.jsx(fe,{label:E("project.agents.desc_label"),children:o.jsx(en,{rows:2,value:w,onChange:z=>j(z.target.value),placeholder:E("project.agents.desc_ph")})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.agents.skills_label"),children:o.jsx(Re,{value:_,onChange:z=>C(z.target.value),placeholder:E("project.agents.skills_ph")})}),o.jsx(fe,{label:E("project.agents.tools_label"),children:o.jsx(Re,{value:k,onChange:z=>R(z.target.value),placeholder:E("project.agents.tools_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 items-end gap-3",children:[o.jsx(fe,{label:E("project.agents.parent_label"),hint:E("project.agents.parent_hint"),children:o.jsx(kt,{value:M,onChange:O,placeholder:E("project.agents.none_parent"),options:[{value:"",label:E("project.agents.none_parent")},...i.filter(z=>z.slug!==d).map(z=>({value:z.slug,label:z.slug}))]})}),o.jsx(cn,{checked:N,onChange:A,label:E("project.agents.master_label")})]})]})})}function cd(e){return e.split(`
|
|
573
|
-
`).map(n=>n.trim()).filter(Boolean)}const so={exec_agent:{label:"Agente del proyecto",desc:"Ejecuta un agente del proyecto con un prompt. Elegís cuál.",icon:vn},super_agent:{label:"Super-agente",desc:"Llama al super-agente de APX con un prompt.",icon:Ps},telegram:{label:"Telegram",desc:"Manda un mensaje fijo a un canal de Telegram. No usa modelo ni agente.",icon:ss},shell:{label:"Shell",desc:"Corre un comando de shell. Sin prompt ni pre/post — el comando es la acción.",icon:oo},heartbeat:{label:"Latido (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.",icon:bl}},v6=Object.keys(so).map(e=>({value:e,label:so[e].label,description:so[e].desc,icon:so[e].icon}));function CC(e){if(!e)return"—";if(e.startsWith("every:")){const n=e.slice(6),s=n.match(/^(\d+)(s|m|h|d)$/);if(s){const r=s[1],i={s:"segundos",m:"minutos",h:"horas",d:"días"}[s[2]]||s[2];return`cada ${r} ${i}`}return`cada ${n}`}return e.startsWith("once:")?`una vez · ${new Date(e.slice(5)).toLocaleString()}`:e.startsWith("cron ")?`cron · ${e.slice(5)}`:e}const y6=[{label:"cada 10 min",value:"every:10m"},{label:"cada hora",value:"every:1h"},{label:"diario 9am",value:"cron 0 9 * * *"},{label:"días hábiles 9am",value:"cron 0 9 * * 1-5"}],j6=[{v:"{{pre_output}}",where:"prompt",desc:"Salida de los pre-commands, inyectada en el prompt."},{v:"$APX_LLM_OUTPUT",where:"post",desc:"Respuesta del agente / super-agente."},{v:"$APX_STATUS",where:"post",desc:"ok | error."},{v:"$APX_SKIPPED",where:"post",desc:"1 si la acción se salteó."},{v:"$APX_PRE_OUTPUT",where:"post",desc:"Salida de los pre-commands."},{v:"$APX_PRE_OUTPUT_FILE",where:"post",desc:"Archivo con la salida de pre (para outputs grandes)."},{v:"$APX_PRE_EXIT",where:"post",desc:"Exit code de los pre-commands."},{v:"$APX_ROUTINE",where:"pre/post",desc:"Nombre de la rutina."}];function _6(e,n){switch(e){case"exec_agent":return n.agent?`Ejecuta el agente "${n.agent}"`:"Ejecuta un agente (falta elegir)";case"super_agent":return"Llama al super-agente";case"telegram":return`Envía Telegram a "${n.channel||"default"}"`;case"shell":return n.command?`Corre: ${String(n.command).slice(0,40)}`:"Corre un comando shell";case"heartbeat":return"Deja un latido en logs"}}function S6({pid:e}){const n=lt(),s=Je(`/projects/${e}/routines`,()=>gr.list(e)),[r,i]=b.useState(null),c=async p=>{try{await(p.enabled?gr.disable:gr.enable)(e,p.name),s.mutate()}catch(m){n.error(m?.message||E("project.routines.toggle_error"))}},d=async p=>{try{await gr.run(e,p.name),n.success(E("project.routines.run_success",{name:p.name}))}catch(m){n.error(m?.message||E("project.routines.run_error"))}},f=async p=>{if(confirm(E("project.routines.delete_confirm",{name:p.name})))try{await gr.remove(e,p.name),n.success(E("project.routines.delete_success")),s.mutate()}catch(m){n.error(m?.message||E("project.routines.delete_error"))}};return o.jsxs(Ye,{title:E("project.routines.title"),description:E("project.routines.subtitle"),action:o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>i({kind:"super_agent",schedule:"every:10m",enabled:!0}),children:[o.jsx(An,{size:14})," ",E("project.routines.new_btn")]}),children:[s.isLoading&&o.jsx(nt,{}),!s.isLoading&&(s.data?.length??0)===0&&o.jsx(dt,{children:E("project.routines.empty")}),o.jsx("ul",{className:"space-y-2 text-sm",children:(s.data||[]).map(p=>{const m=so[p.kind],g=m?.icon||dc,x=p.last_status==="error";return o.jsxs("li",{className:"cursor-pointer rounded-xl border border-border bg-muted/30 p-3 hover:border-muted-fg/50",onClick:()=>i({...p}),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:Oe("flex size-7 items-center justify-center rounded-lg",p.enabled?"bg-emerald-500/15 text-emerald-400":"bg-muted text-muted-fg"),children:o.jsx(g,{size:14})}),o.jsx("span",{className:"font-medium",children:p.name}),o.jsx(Xe,{tone:p.kind==="shell"?"warning":"info",children:m?.label||p.kind}),!p.enabled&&o.jsx(Xe,{tone:"muted",children:E("project.routines.paused")})]}),o.jsxs("div",{className:"flex items-center gap-2",onClick:y=>y.stopPropagation(),children:[o.jsx(cn,{checked:p.enabled,onChange:()=>c(p)}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>d(p),children:[o.jsx(nx,{size:13})," Run"]}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>f(p),children:o.jsx(rs,{size:13})})]})]}),o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-fg",children:[o.jsxs("span",{children:["⏱ ",CC(p.schedule)]}),o.jsx("span",{children:_6(p.kind,p.spec||{})}),p.next_run_at&&o.jsxs("span",{children:[E("project.routines.next_run")," ",new Date(p.next_run_at).toLocaleString()]}),o.jsxs("span",{className:Oe(p.last_status==="ok"&&"text-emerald-500",x&&"text-destructive"),children:["última: ",p.last_status||"—"]})]}),p.last_error&&o.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive",children:p.last_error})]},p.name)})}),o.jsx(w6,{draft:r,onClose:()=>i(null),onSaved:()=>{i(null),s.mutate()},pid:e})]})}function w6({draft:e,onClose:n,onSaved:s,pid:r}){const i=lt(),c=Je(e?`/projects/${r}/agents`:null,()=>Wt.list(r)),[d,f]=b.useState(!1),[p,m]=b.useState(""),[g,x]=b.useState("super_agent"),[y,S]=b.useState("every:10m"),[w,j]=b.useState(!0),[_,C]=b.useState(""),[k,R]=b.useState(""),[N,A]=b.useState("default"),[M,O]=b.useState(""),[L,B]=b.useState(""),[I,D]=b.useState(""),[z,H]=b.useState("heartbeat"),[V,Y]=b.useState(""),[q,F]=b.useState(""),[Z,$]=b.useState("");b.useEffect(()=>{if(!e)return;const ee=e.spec&&typeof e.spec=="object"?e.spec:{};m(e.name||""),x(e.kind||"super_agent"),S(e.schedule||"every:10m"),j(e.enabled??!0),C(ee.agent||""),R(ee.prompt||""),A(ee.channel||"default"),O(ee.chat_id?String(ee.chat_id):""),B(ee.text||""),D(ee.command||""),H(ee.channel||"heartbeat"),Y(ee.message||""),F((e.pre_commands||[]).join(`
|
|
574
|
-
`)),$((e.post_commands||[]).join(`
|
|
575
|
-
`))},[e]);const X=()=>{switch(g){case"exec_agent":return{agent:_,prompt:k};case"super_agent":return{prompt:k};case"telegram":return{channel:N,...M?{chat_id:M}:{},text:L};case"shell":return{command:I};case"heartbeat":return{channel:z,message:V}}},U=async()=>{if(!p){i.error(E("project.routines.name_required"));return}f(!0);try{const ee=g==="exec_agent"||g==="super_agent";await gr.upsert(r,{name:p,kind:g,schedule:y,enabled:w,spec:X(),pre_commands:ee?cd(q):[],post_commands:ee?cd(Z):[]}),i.success(E("project.routines.saved")),s()}catch(ee){i.error(ee?.message||E("project.routines.save_error"))}finally{f(!1)}},K=g==="exec_agent"||g==="super_agent",G=K?cd(q):[],W=K?cd(Z):[],ie=(()=>{switch(g){case"exec_agent":return _?`Agente "${_}" responde el prompt`:"Agente (elegí cuál) responde el prompt";case"super_agent":return"El super-agente responde el prompt";case"telegram":return`Manda Telegram al canal "${N}"`;case"shell":return I?`Corre: ${I.slice(0,48)}`:"Corre el comando shell";case"heartbeat":return"Deja un latido en logs"}})(),re=K,oe=so[g].icon,ce=[...G.map((ee,Te)=>({id:`pre-${Te}`,icon:oo,label:"Pre",detail:ee,action:!1})),{id:"action",icon:oe,label:ie,detail:re&&k?k.slice(0,90):void 0,action:!0},...W.map((ee,Te)=>({id:`post-${Te}`,icon:oo,label:"Post",detail:ee,action:!1}))];return o.jsx(ba,{open:!!e,onClose:n,title:e?.name?E("project.routines.edit_title",{name:e.name}):E("project.routines.new_title"),description:E("project.routines.dialog_desc"),size:"xl",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:d,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:U,loading:d,children:E("common.save")})]}),children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/20 px-3 py-2",children:[o.jsx(cn,{checked:w,onChange:j,label:E("project.routines.enabled_label")}),o.jsx("span",{className:"text-[11px] text-muted-fg",children:E(w?"project.routines.enabled_hint":"project.routines.disabled_hint")})]}),o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:E("project.routines.name_field"),hint:e?.name?E("project.routines.name_no_edit"):void 0,children:o.jsx(Re,{value:p,disabled:!!e?.name,onChange:ee=>m(ee.target.value),placeholder:"resumen-diario"})}),o.jsx(fe,{label:E("project.routines.kind_field"),children:o.jsx(kt,{value:g,onChange:ee=>x(ee),options:v6})}),o.jsx("p",{className:"-mt-1 text-[11px] text-muted-fg",children:so[g].desc}),g==="exec_agent"&&o.jsx(fe,{label:E("project.routines.agent_field"),hint:E("project.routines.agent_hint"),children:o.jsx(kt,{value:_,onChange:C,placeholder:c.isLoading?E("project.routines.agent_loading"):E("project.routines.agent_pick"),options:(c.data||[]).map(ee=>({value:ee.slug,label:ee.slug,description:[ee.role,ee.model].filter(Boolean).join(" · ")||void 0}))})}),o.jsx(fe,{label:E("project.routines.schedule_field"),hint:E("project.routines.schedule_hint"),children:o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-wrap gap-1",children:[y6.map(ee=>o.jsx("button",{type:"button",onClick:()=>S(ee.value),className:Oe("rounded-md border px-2 py-0.5 text-[11px]",y===ee.value?"border-emerald-500/50 text-emerald-400":"border-border text-muted-fg hover:text-foreground"),children:ee.label},ee.value)),o.jsx("button",{type:"button",onClick:()=>S("manual"),className:Oe("rounded-md border px-2 py-0.5 text-[11px]",y==="manual"?"border-emerald-500/50 text-emerald-400":"border-border text-muted-fg hover:text-foreground"),children:"Manual"})]}),o.jsx(Re,{value:y,onChange:ee=>S(ee.target.value),placeholder:"every:10m · cron 0 9 * * 1-5 · once:ISO · manual"})]})})]}),o.jsxs("div",{className:"space-y-3",children:[K&&o.jsx(fe,{label:E("project.routines.pre_field"),hint:E("project.routines.pre_hint"),children:o.jsx(en,{rows:2,className:"font-mono text-xs",value:q,onChange:ee=>F(ee.target.value),placeholder:"curl -s https://wttr.in/Bariloche"})}),g==="exec_agent"&&o.jsx(fe,{label:E("project.routines.prompt_exec"),children:o.jsx(en,{rows:4,value:k,onChange:ee=>R(ee.target.value),placeholder:E("project.routines.prompt_exec_ph")})}),g==="super_agent"&&o.jsx(fe,{label:E("project.routines.prompt_super"),children:o.jsx(en,{rows:4,value:k,onChange:ee=>R(ee.target.value),placeholder:E("project.routines.prompt_super_ph")})}),g==="telegram"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.routines.tg_channel"),children:o.jsx(Re,{value:N,onChange:ee=>A(ee.target.value),placeholder:"default"})}),o.jsx(fe,{label:E("project.routines.tg_chat_id"),children:o.jsx(Re,{value:M,onChange:ee=>O(ee.target.value),placeholder:"(usa el del canal)"})})]}),o.jsx(fe,{label:E("project.routines.tg_text"),hint:E("project.routines.tg_text_hint"),children:o.jsx(en,{rows:8,value:L,onChange:ee=>B(ee.target.value),placeholder:"mensaje a enviar"})})]}),g==="shell"&&o.jsx(fe,{label:E("project.routines.shell_field"),hint:E("project.routines.shell_hint"),children:o.jsx(en,{rows:11,className:"font-mono text-xs",value:I,onChange:ee=>D(ee.target.value),placeholder:"cd /repo && git pull && npm test"})}),g==="heartbeat"&&o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.routines.hb_channel"),children:o.jsx(Re,{value:z,onChange:ee=>H(ee.target.value),placeholder:"heartbeat"})}),o.jsx(fe,{label:E("project.routines.hb_message"),children:o.jsx(Re,{value:V,onChange:ee=>Y(ee.target.value),placeholder:"sigo vivo"})})]}),K&&o.jsx(fe,{label:E("project.routines.post_field"),hint:E("project.routines.post_hint"),children:o.jsx(en,{rows:2,className:"font-mono text-xs",value:Z,onChange:ee=>$(ee.target.value),placeholder:'apx telegram send "$APX_LLM_OUTPUT"'})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 p-3",children:[o.jsx("div",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-fg",children:E("project.routines.vars_title")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:j6.map(ee=>o.jsxs("span",{title:ee.desc,className:"inline-flex items-center gap-1 rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[10px]",children:[ee.v,o.jsxs("span",{className:"not-italic text-muted-fg",children:["· ",ee.where]})]},ee.v))})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3",children:[o.jsxs("div",{className:"mb-2 text-xs font-semibold text-muted-fg",children:[E("project.routines.what_happens")," ",o.jsxs("span",{className:"font-normal text-muted-fg",children:["· ⏱ ",CC(y)]})]}),o.jsx("div",{className:"flex flex-wrap items-stretch gap-2",children:ce.map((ee,Te)=>o.jsxs("div",{className:"flex items-stretch gap-2",children:[o.jsxs("div",{className:Oe("flex max-w-[240px] flex-col gap-1 rounded-lg border px-2.5 py-2",ee.action?"border-emerald-500/40 bg-emerald-500/5":"border-border bg-card"),children:[o.jsxs("div",{className:Oe("flex items-center gap-1.5 text-[11px] font-medium",ee.action?"text-emerald-400":"text-muted-fg"),children:[o.jsx(ee.icon,{size:12})," ",ee.label]}),ee.detail&&o.jsx("div",{className:"line-clamp-2 font-mono text-[10px] text-muted-fg",children:ee.detail})]}),Te<ce.length-1&&o.jsx(wS,{size:14,className:"shrink-0 self-center text-muted-fg"})]},ee.id))})]})]})})}function C6({pid:e}){const[n,s]=b.useState("open"),r=lt(),i=Je(`/projects/${e}/tasks?state=${n}`,()=>hr.list(e,n),{dedupingInterval:0,revalidateOnFocus:!0}),[c,d]=b.useState(""),[f,p]=b.useState(!1),m=async()=>{if(c.trim()){p(!0);try{await hr.add(e,{title:c.trim()}),d(""),r.success(E("project.tasks.created")),i.mutate()}catch(x){r.error(x?.message||E("project.tasks.create_error"))}finally{p(!1)}}},g=async(x,y)=>{try{await x(),r.success(y),i.mutate()}catch(S){r.error(S?.message||E("common.error_generic"))}};return o.jsxs(Ye,{title:E("project.tasks.title"),description:E("project.tasks.subtitle"),action:o.jsx("div",{className:"flex gap-1",children:["open","done","dropped"].map(x=>o.jsx(ve,{size:"sm","data-testid":`task-filter-${x}`,variant:n===x?"primary":"ghost",onClick:()=>s(x),children:x},x))}),children:[o.jsxs("div",{className:"mb-4 flex items-end gap-2",children:[o.jsx(fe,{label:E("project.tasks.add_label"),children:o.jsx(Re,{"data-testid":"task-input",placeholder:E("project.tasks.add_placeholder"),value:c,onChange:x=>d(x.target.value),onKeyDown:x=>{x.key==="Enter"&&m()}})}),o.jsxs(ve,{variant:"primary","data-testid":"task-add",onClick:m,loading:f,children:[o.jsx(An,{size:14})," ",E("project.tasks.add")]})]}),i.isLoading&&o.jsx(nt,{}),!i.isLoading&&(i.data?.length??0)===0&&o.jsxs(dt,{children:[n==="open"?E("project.tasks.empty_open"):E("project.tasks.empty",{state:n})," ",o.jsx("code",{children:'apx task add "…"'})]}),o.jsx("ul",{className:"space-y-2 text-sm","data-testid":"task-list",children:(i.data||[]).map(x=>o.jsxs("li",{"data-testid":`task-${x.id}`,className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("span",{className:"mt-0.5 font-mono text-[10px] text-muted-fg",children:x.id}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"font-medium",children:x.title}),o.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-fg",children:[x.tags?.map(y=>o.jsxs(Xe,{children:["#",y]},y)),x.agent&&o.jsxs(Xe,{tone:"info",children:["@",x.agent]}),x.source&&o.jsxs("span",{children:[E("project.tasks.via")," ",x.source]}),x.due&&o.jsxs("span",{children:[E("project.tasks.due")," ",x.due]})]})]}),o.jsxs("div",{className:"flex gap-1",children:[n==="open"&&o.jsxs(o.Fragment,{children:[o.jsx(ve,{size:"sm",variant:"secondary","aria-label":E("project.tasks.aria_done"),"data-testid":`task-done-${x.id}`,onClick:()=>g(()=>hr.done(e,x.id),E("project.tasks.done")),children:o.jsx(uc,{size:13})}),o.jsx(ve,{size:"sm",variant:"destructive","aria-label":E("project.tasks.aria_drop"),"data-testid":`task-drop-${x.id}`,onClick:()=>g(()=>hr.drop(e,x.id),E("project.tasks.drop")),children:o.jsx(rs,{size:13})})]}),n!=="open"&&o.jsx(ve,{size:"sm",variant:"ghost","aria-label":E("project.tasks.aria_reopen"),"data-testid":`task-reopen-${x.id}`,onClick:()=>g(()=>hr.reopen(e,x.id),E("project.tasks.reopen")),children:o.jsx(ax,{size:13})})]})]},x.id))})]})}function k6({pid:e}){const n=lt(),s=Je(`/projects/${e}/mcps`,()=>ac.list(e)),r=Je(`/projects/${e}/mcps/check`,()=>ac.check(e)),[i,c]=b.useState(!1),d=async(f,p)=>{if(confirm(E("project.mcps.delete_confirm",{name:f,scope:p})))try{await ac.remove(e,f,p),n.success(E("project.mcps.removed")),s.mutate()}catch(m){n.error(m?.message||E("common.error_generic"))}};return o.jsxs(Ye,{title:E("project.mcps.title"),description:E("project.mcps.subtitle"),action:o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>c(!0),children:[o.jsx(An,{size:14})," ",E("project.mcps.new")]}),children:[r.data?.conflicts?.length?o.jsx("div",{className:"mb-3 rounded-md border border-amber-500/40 bg-amber-500/10 p-2 text-xs",children:E("project.mcps.conflicts",{names:r.data.conflicts.map(f=>f.name).join(", ")})}):null,s.isLoading&&o.jsx(nt,{}),!s.isLoading&&(s.data?.length??0)===0&&o.jsx(dt,{children:E("project.mcps.empty")}),o.jsx("ul",{className:"space-y-2 text-sm",children:(s.data||[]).map(f=>o.jsxs("li",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("span",{className:"font-medium",children:f.name}),o.jsx(Xe,{tone:"info",children:f.source}),o.jsxs("span",{className:"ml-auto text-xs text-muted-fg",children:[f.transport," · ",f.enabled===!1?"disabled":"enabled"]}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>d(f.name,f.source),children:o.jsx(rs,{size:13})})]},`${f.source}-${f.name}`))}),o.jsx(E6,{open:i,onClose:()=>c(!1),pid:e,onCreated:()=>{c(!1),s.mutate()}})]})}function E6({open:e,onClose:n,pid:s,onCreated:r}){const i=lt(),[c,d]=b.useState(!1),[f,p]=b.useState("shared"),[m,g]=b.useState(""),[x,y]=b.useState("stdio"),[S,w]=b.useState(""),[j,_]=b.useState(""),[C,k]=b.useState(""),[R,N]=b.useState(""),[A,M]=b.useState(!0),O=async()=>{if(!m){i.error(E("project.mcps.name_required"));return}d(!0);try{let L;if(R.trim())try{L=JSON.parse(R)}catch{i.error(E("project.mcps.env_invalid")),d(!1);return}const B=x==="stdio"?{name:m,command:S,args:j?j.split(/\s+/):void 0,env:L,enabled:A}:{name:m,url:C,enabled:A};await ac.add(s,f,B),i.success(E("project.mcps.added")),g(""),w(""),_(""),k(""),N(""),r()}catch(L){i.error(L?.message||E("common.error_generic"))}finally{d(!1)}};return o.jsx(ba,{open:e,onClose:n,title:E("project.mcps.new_title"),description:E("project.mcps.new_desc"),footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:c,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:O,loading:c,children:E("project.mcps.add_btn")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.mcps.scope_label"),children:o.jsx(kt,{value:f,onChange:L=>p(L),options:[{value:"shared",label:"shared",description:".apc/mcps.json"},{value:"runtime",label:"runtime",description:"~/.apx, con secrets"},{value:"global",label:"global",description:"estilo ~/.claude/mcp.json"}]})}),o.jsx(fe,{label:E("project.mcps.transport_label"),children:o.jsx(kt,{value:x,onChange:L=>y(L),options:[{value:"stdio",label:"stdio",description:"command"},{value:"http",label:"http",description:"url"}]})})]}),o.jsx(fe,{label:E("project.mcps.name_label"),children:o.jsx(Re,{value:m,onChange:L=>g(L.target.value),placeholder:E("project.mcps.name_ph")})}),x==="stdio"?o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:E("project.mcps.cmd_label"),children:o.jsx(Re,{value:S,onChange:L=>w(L.target.value),placeholder:E("project.mcps.cmd_ph")})}),o.jsx(fe,{label:E("project.mcps.args_label"),hint:E("project.mcps.args_hint"),children:o.jsx(Re,{value:j,onChange:L=>_(L.target.value),placeholder:E("project.mcps.args_ph")})}),o.jsx(fe,{label:E("project.mcps.env_label"),hint:'{"FOO":"bar"}',children:o.jsx(en,{rows:3,className:"font-mono text-xs",value:R,onChange:L=>N(L.target.value)})})]}):o.jsx(fe,{label:E("project.mcps.url_label"),children:o.jsx(Re,{value:C,onChange:L=>k(L.target.value),placeholder:E("project.mcps.url_ph")})}),o.jsx(cn,{checked:A,onChange:M,label:E("project.mcps.enabled_label")})]})})}function N6({pid:e}){const n=Je(`/projects/${e}/agents`,()=>Wt.list(e)),[s,r]=b.useState(null),[i,c]=b.useState(null);return o.jsxs(Ye,{title:E("project.threads.title"),description:E("project.threads.subtitle"),children:[n.isLoading&&o.jsx(nt,{}),!n.isLoading&&(n.data?.length??0)===0&&o.jsx(dt,{children:E("project.threads.no_agents")}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[o.jsx("ul",{className:"space-y-1 md:col-span-1",children:(n.data||[]).map(d=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>r(d.slug),className:Oe("flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-sm",s===d.slug?"bg-accent text-accent-fg":"text-foreground hover:bg-accent/60"),children:[o.jsx("span",{children:d.slug}),d.model&&o.jsx(Xe,{tone:"info",children:d.model})]})},d.slug))}),o.jsx("div",{className:"md:col-span-2",children:s?o.jsx(R6,{pid:e,slug:s,onOpen:c}):o.jsx(dt,{children:E("project.threads.pick")})})]}),s&&i&&o.jsx(T6,{pid:e,slug:s,id:i,onClose:()=>c(null)})]})}function R6({pid:e,slug:n,onOpen:s}){const r=Je(`/projects/${e}/agents/${n}/conversations`,()=>Vx.list(e,n));return r.isLoading?o.jsx(nt,{}):r.data?.length?o.jsx("ul",{className:"space-y-1 text-sm",children:r.data.map(i=>o.jsxs("li",{className:"cursor-pointer rounded-md border border-border bg-muted/30 px-3 py-2 hover:bg-accent/40",onClick:()=>s(i.id),children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"font-medium",children:i.title||i.filename}),o.jsx("span",{className:"text-xs text-muted-fg",children:new Date(i.started_at).toLocaleString()})]}),o.jsxs("div",{className:"mt-0.5 text-xs text-muted-fg",children:[i.channel&&o.jsxs(o.Fragment,{children:[E("project.threads.via")," ",i.channel," · "]}),i.messages??0," ",E("project.threads.messages")]})]},i.id))}):o.jsx(dt,{children:E("project.threads.empty",{slug:n})})}function T6({pid:e,slug:n,id:s,onClose:r}){const i=Je(`/projects/${e}/agents/${n}/conversations/${s}`,()=>Vx.get(e,n,s));return o.jsxs(ba,{open:!0,onClose:r,title:E("project.threads.conversation_title",{id:s}),size:"lg",children:[i.isLoading&&o.jsx(nt,{}),i.data&&o.jsx("div",{className:"max-h-[60vh] space-y-3 overflow-y-auto pr-2",children:i.data.messages.map((c,d)=>o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm",children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-muted-fg",children:[o.jsxs("span",{className:"uppercase tracking-wide",children:[c.role,c.name?` (${c.name})`:""]}),c.ts&&o.jsx("span",{children:new Date(c.ts).toLocaleString()})]}),o.jsx("div",{className:"whitespace-pre-wrap",children:c.content})]},d))})]})}function cb({value:e,onValueChange:n,onSubmit:s,onStop:r,busy:i=!1,disabled:c=!1,placeholder:d,autoFocus:f,minRows:p=2,maxRows:m=8,footer:g,className:x}){const y=b.useRef(null);b.useLayoutEffect(()=>{const w=y.current;if(!w)return;const j=()=>{w.style.height="auto",w.offsetHeight;const C=parseFloat(getComputedStyle(w).lineHeight)||20,k=C*p,R=C*m;w.style.height=`${Math.min(Math.max(w.scrollHeight,k),R)}px`,w.style.overflowY=w.scrollHeight>R?"auto":"hidden"};j();const _=requestAnimationFrame(j);return()=>cancelAnimationFrame(_)},[e,p,m]);const S=e.trim().length>0&&!c;return o.jsxs("div",{className:Ot("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",c&&"opacity-60",x),children:[o.jsx("textarea",{ref:y,rows:p,value:e,autoFocus:f,disabled:c,placeholder:d,onChange:w=>n(w.target.value),onKeyDown:w=>{if(w.key==="Enter"&&!w.shiftKey){if(w.preventDefault(),i||!S)return;s()}},className:"w-full resize-none bg-transparent px-2 pt-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground"}),o.jsxs("div",{className:"flex items-center justify-between gap-2 pl-1",children:[o.jsx("div",{className:"flex min-w-0 items-center gap-2 text-[11px] text-muted-foreground",children:g}),i&&r?o.jsx(uo,{type:"button",size:"icon-sm",variant:"destructive",onClick:r,"aria-label":"Detener",title:"Detener",children:o.jsx(DS,{className:"size-3.5",fill:"currentColor"})}):o.jsx(uo,{type:"button",size:"icon-sm",variant:"default",onClick:s,disabled:!S,"aria-label":"Enviar",title:"Enviar",children:o.jsx(lT,{className:"size-4"})})]})]})}function ub({value:e,onChange:n,disabled:s}){const[r,i]=b.useState(!1),[c,d]=b.useState(""),[f,p]=b.useState([]),[m,g]=b.useState(!1),x=b.useRef(null);b.useEffect(()=>{if(!r)return;const _=C=>{x.current&&!x.current.contains(C.target)&&i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[r]),b.useEffect(()=>{if(!r||m)return;let _=!1;return(async()=>{try{const{engines:C}=await $d.list(),k=await Promise.all(C.map(R=>$d.models({engine:R}).then(N=>(N.models||[]).map(A=>A.includes(":")?A:`${R}:${A}`)).catch(()=>[])));if(!_){const R=Array.from(new Set(k.flat())).sort();p(R),g(!0)}}catch{_||g(!0)}})(),()=>{_=!0}},[r,m]);const y=c.trim().toLowerCase(),S=y?f.filter(_=>_.toLowerCase().includes(y)):f,w=e||"Auto",j=_=>{n(_),i(!1),d("")};return o.jsxs("div",{ref:x,className:"relative",children:[o.jsxs("button",{type:"button",disabled:s,onClick:()=>i(_=>!_),"data-testid":"chat-model-picker",className:Oe("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"),title:"Elegir modelo (o Auto)",children:[o.jsx(zS,{className:"size-3 shrink-0"}),o.jsx("span",{className:"truncate font-mono",children:w}),o.jsx(ho,{className:"size-3 shrink-0 opacity-60"})]}),r&&o.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:[o.jsx("input",{autoFocus:!0,value:c,placeholder:"filtrar o escribir modelo…",onChange:_=>d(_.target.value),onKeyDown:_=>{_.key==="Enter"&&c.trim()&&j(c.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"}),o.jsxs("ul",{className:"max-h-56 overflow-y-auto",children:[o.jsx("li",{children:o.jsxs("button",{type:"button",onMouseDown:_=>{_.preventDefault(),j("")},className:Oe("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:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(xo,{className:"size-3"})," Auto (router decide)"]}),!e&&o.jsx(uc,{className:"size-3"})]})}),!m&&o.jsx("li",{className:"px-2 py-1 text-[11px] text-muted-fg",children:"cargando modelos…"}),m&&S.length===0&&c.trim()&&o.jsx("li",{children:o.jsxs("button",{type:"button",onMouseDown:_=>{_.preventDefault(),j(c.trim())},className:"w-full rounded-md px-2 py-1 text-left font-mono text-xs hover:bg-accent hover:text-accent-fg",children:["usar “",c.trim(),"”"]})}),S.map(_=>o.jsx("li",{children:o.jsxs("button",{type:"button",onMouseDown:C=>{C.preventDefault(),j(_)},className:Oe("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",_===e&&"bg-accent/50"),children:[o.jsx("span",{className:"truncate",children:_}),_===e&&o.jsx(uc,{className:"size-3 shrink-0"})]})},_))]})]})]})}function A6({onSend:e,onStop:n,streaming:s,model:r,onModelChange:i}){const[c,d]=b.useState(""),f=()=>{const p=c.trim();p&&(d(""),e(p))};return o.jsx("div",{className:"border-t border-border bg-card/60 p-3",children:o.jsx(cb,{value:c,onValueChange:d,onSubmit:f,onStop:n,busy:s,placeholder:E("project.chat.placeholder"),maxRows:12,footer:i?o.jsx(ub,{value:r||"",onChange:i,disabled:s}):void 0})})}const M6={read_file:{icon:yT,label:"Leer archivo"},write_file:{icon:vT,label:"Escribir archivo"},edit_file:{icon:Rd,label:"Editar archivo"},list_files:{icon:AS,label:"Listar archivos"},search_files:{icon:xd,label:"Buscar en archivos"},search_messages:{icon:xd,label:"Buscar mensajes"},tail_messages:{icon:xd,label:"Últimos mensajes"},run_shell:{icon:oo,label:"Ejecutar shell"},send_telegram:{icon:ss,label:"Enviar Telegram"},call_agent:{icon:vn,label:"Llamar agente"},call_mcp:{icon:$T,label:"Llamar MCP"},call_runtime:{icon:vn,label:"Llamar runtime"},create_task:{icon:DT,label:"Crear tarea"}},kC=new Set(["write_file","edit_file"]);function O6(e){return M6[e]||{icon:Ml,label:e}}function z6(e,n){if(!n)return"";const s=i=>typeof n[i]=="string"?n[i]:void 0,r=s("path")||s("file")||s("pattern")||s("query")||s("command")||s("slug")||s("name")||s("agent");return r?String(r):""}function Yj(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function D6({status:e}){return e==="running"?o.jsx(nf,{className:"size-3 shrink-0 animate-spin text-sky-400"}):e==="error"?o.jsx(xo,{className:"size-3 shrink-0 text-rose-400"}):e==="deduped"?o.jsx(gT,{className:"size-3 shrink-0 text-amber-400"}):o.jsx(uc,{className:"size-3 shrink-0 text-emerald-400"})}function L6({part:e}){const[n,s]=b.useState(!1),{icon:r,label:i}=O6(e.tool),c=z6(e.tool,e.args),d=kC.has(e.tool),f=!!e.args||e.result!==void 0;return o.jsxs("div",{className:Oe("rounded-lg border bg-muted/30 text-[12px]",e.status==="error"?"border-rose-500/30":"border-border"),children:[o.jsxs("button",{type:"button",onClick:()=>f&&s(p=>!p),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left",children:[f?o.jsx(ef,{className:Oe("size-3 shrink-0 text-muted-foreground transition-transform",n&&"rotate-90")}):o.jsx("span",{className:"size-3 shrink-0"}),o.jsx(r,{className:Oe("size-3.5 shrink-0",d?"text-violet-400":"text-muted-foreground")}),o.jsx("span",{className:"shrink-0 font-medium",children:i}),c&&o.jsx("span",{className:"truncate font-mono text-muted-foreground",children:c}),o.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.status==="deduped"&&o.jsx("span",{className:"text-[10px] text-amber-400",children:"dedup"}),o.jsx(D6,{status:e.status})]})]}),n&&f&&o.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&&o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:"args"}),o.jsx("pre",{className:"max-h-48 overflow-auto rounded-md bg-background/60 p-2 font-mono text-[11px] leading-relaxed text-foreground",children:Yj(e.args)})]}),e.result!==void 0&&o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:"result"}),o.jsx("pre",{className:Oe("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:Yj(e.result)})]})]})]})}function P6(e){const n=e.args;return(n&&Array.isArray(n.questions)?n.questions:[]).map(r=>typeof r=="string"?r:r&&typeof r=="object"&&typeof r.question=="string"?r.question:null).filter(r=>!!r)}function I6({part:e,pending:n}){const s=P6(e),r=E(n?"ask_panel.status_waiting":"ask_panel.status_received");return o.jsxs("div",{className:Oe("rounded-2xl border px-3 py-2 text-sm shadow-sm",n?"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":n?"pending":"answered",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[n?o.jsx(nf,{className:"size-3.5 shrink-0 animate-spin text-amber-600 dark:text-amber-400"}):o.jsx(ES,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),o.jsx(PT,{className:"size-3.5 shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-[12px] font-medium",children:r}),s.length>1&&o.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:[s.length," preguntas"]})]}),s.length>0&&o.jsx("ul",{className:"mt-1.5 space-y-0.5 pl-5 text-[12px] text-muted-foreground",children:s.map((i,c)=>o.jsx("li",{className:"list-disc",children:i},c))})]})}function EC(e){return e.parts.filter(n=>n.kind==="text").map(n=>n.text).join(`
|
|
576
|
-
|
|
577
|
-
`).trim()}function B6(e){const n=e.args?.questions;if(!Array.isArray(n)||n.length===0)return null;const s=n.map(r=>{if(typeof r=="string")return`- ${r}`;if(!r||typeof r!="object")return null;const i=r;if(typeof i.question!="string")return null;const d=(Array.isArray(i.options)?i.options:[]).map(f=>typeof f=="string"?f:f&&typeof f=="object"&&typeof f.label=="string"?f.label:"").filter(f=>f).join(", ");return d?`- ${i.question} (opciones: ${d})`:`- ${i.question}`}).filter(r=>!!r);return s.length===0?null:`[ask_questions]
|
|
578
|
-
${s.join(`
|
|
579
|
-
`)}`}function U6(e){const n=[];for(const s of e.parts)if(s.kind==="text"&&s.text)n.push(s.text);else if(s.kind==="tool"&&s.tool==="ask_questions"){const r=B6(s);r&&n.push(r)}return n.join(`
|
|
580
|
-
|
|
581
|
-
`).trim()}const H6=e=>[{kind:"text",text:e}];function q6(e){if(!e||typeof e!="object")return!1;const n=e;return"error"in n&&!!n.error}function db(e,n){const s=r=>({...e,notes:[...e.notes||[],r]});switch(n.type){case"model_start":return n.model?{...e,model:n.model}:e;case"model_routed":{const r=n.model?{...e,model:n.model}:e;return n.from_fallback?{...r,notes:[...r.notes||[],`routing fell back → ${n.model}`]}:r}case"engine_failed":return s(`engine ${n.model||"?"} failed → ${n.retry_with||"retry"}`);case"model_retry":return s(`retry (${n.reason||"?"})`);case"tools_suppressed":return s(`tools suppressed: ${(n.tools||[]).join(", ")}`);case"assistant_text":return n.text?{...e,parts:[...e.parts,{kind:"text",text:n.text}]}:e;case"tool_start":return n.trace?{...e,parts:[...e.parts,{kind:"tool",id:n.trace.id,tool:n.trace.tool,args:n.trace.args,status:"running"}]}:e;case"tool_deduped":return n.trace?{...e,parts:e.parts.map(r=>r.kind==="tool"&&r.id===n.trace.id?{...r,status:"deduped"}:r)}:e;case"tool_result":if(!n.trace)return e;{const r=q6(n.trace.result);return{...e,parts:e.parts.map(i=>i.kind==="tool"&&i.id===n.trace.id?{...i,result:n.trace.result,status:r?"error":i.status==="deduped"?"deduped":"done"}:i)}}case"final":return{...e,pending:!1,usage:n.result?.usage??e.usage,model:e.model??n.result?.name,parts:n.result?.text&&!e.parts.some(r=>r.kind==="text")?[...e.parts,{kind:"text",text:n.result.text}]:e.parts};default:{const r=n.delta||n.content||"";if(!r)return e;const i=[...e.parts],c=i[i.length-1];return c&&c.kind==="text"?i[i.length-1]={...c,text:c.text+r}:i.push({kind:"text",text:r}),{...e,parts:i}}}}function V6(e,n){const[s,r]=b.useState([]),[i,c]=b.useState(!1),d=b.useRef(null),f=b.useRef(void 0),p=b.useCallback(S=>{r(w=>{const j=[...w],_=j[j.length-1];return _&&_.role==="assistant"&&(j[j.length-1]=S(_)),j})},[]),m=b.useCallback(S=>{if(S.type==="error"){n?.(S.error||"stream error");return}p(w=>db(w,S))},[p,n]),g=b.useCallback(async(S,w={})=>{const j=S.trim();if(!j||i)return;const _=()=>new Date().toISOString(),C=s.map(R=>({role:R.role,content:U6(R)}));if(r(R=>[...R,{role:"user",parts:H6(j),ts:_()},{role:"assistant",parts:[],ts:_(),pending:!0}]),c(!0),w.agentSlug){try{const R=await Wt.chat(e,w.agentSlug,{prompt:j,conversation_id:f.current,model:w.model||void 0});f.current=R.conversation_id,p(N=>({...N,pending:!1,model:R.engine,parts:[{kind:"text",text:R.text}]}))}catch(R){n?.(R?.message||"fallo"),r(N=>N.filter((A,M)=>M!==N.length-1))}finally{c(!1)}return}const k=new AbortController;d.current=k;try{await S2.stream(e,{prompt:j,previousMessages:C,model:w.model||void 0,channel:"web"},m,k.signal),p(R=>({...R,pending:!1}))}catch(R){k.signal.aborted?p(N=>({...N,pending:!1,parts:[...N.parts,{kind:"text",text:"[detenido]"}]})):(n?.(R?.message||"stream falló"),r(N=>N.filter((A,M)=>M!==N.length-1)))}finally{c(!1),d.current=null}},[e,s,i,m,p,n]),x=b.useCallback(()=>d.current?.abort(),[]),y=b.useCallback(()=>{i||(f.current=void 0,r([]))},[i]);return{msgs:s,send:g,stop:x,clear:y,streaming:i}}function $6({msg:e,isLast:n,onCopy:s}){const r=e.role==="user",i=EC(e),c=e.parts.some(d=>d.kind==="tool");return o.jsxs("div",{className:Oe("group flex items-start gap-2",r?"justify-end":"justify-start"),children:[!r&&o.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground",children:o.jsx(vn,{size:14})}),o.jsxs("div",{className:Oe("flex min-w-0 flex-col gap-1.5",r?"items-end":"w-full max-w-[85%]"),children:[!r&&e.notes&&e.notes.length>0&&o.jsx("div",{className:"flex flex-col gap-0.5",children:e.notes.map((d,f)=>o.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-400/80",children:[o.jsx(AT,{size:10})," ",d]},f))}),e.parts.map((d,f)=>d.kind==="tool"?d.tool==="ask_questions"&&!r?o.jsx(I6,{part:d,pending:!!n},`${d.id}-${f}`):o.jsx(L6,{part:d},`${d.id}-${f}`):d.text?o.jsx("div",{className:Oe("whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed shadow-sm",r?"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:d.text},f):null),!r&&e.pending&&e.parts.length===0&&o.jsx("div",{className:"rounded-2xl rounded-bl-sm border border-border bg-card px-3 py-2 text-sm text-muted-foreground",children:"…"}),o.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("span",{children:G6(e.ts)}),!r&&e.model&&o.jsxs("span",{className:"font-mono",children:["· ",e.model]}),!r&&c&&o.jsxs("span",{children:["· ",e.parts.filter(d=>d.kind==="tool").length," tools"]}),s&&i&&o.jsxs("button",{type:"button",onClick:()=>s(i),className:"inline-flex items-center gap-1 hover:text-foreground",title:"Copiar",children:[o.jsx(Nd,{size:10})," copiar"]})]})]}),r&&o.jsx("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground",children:o.jsx(PS,{size:14})})]})}function G6(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function fb({msgs:e,onCopy:n}){const s=b.useRef(null);if(b.useEffect(()=>{s.current?.scrollIntoView({behavior:"smooth",block:"end"})},[e]),e.length===0)return o.jsx("div",{className:"grid h-full place-items-center p-6",children:o.jsx(dt,{children:E("project.chat.empty")})});const r=e.length-1;return o.jsxs("div",{className:"space-y-4 px-3 py-4",children:[e.map((i,c)=>o.jsx($6,{msg:i,isLast:c===r,onCopy:n},c)),o.jsx("div",{ref:s})]})}function F6(e){if(!e)return;const n=e.path??e.file??e.filename;return typeof n=="string"?n:void 0}function NC({msgs:e}){const[n,s]=b.useState(!1),{inTok:r,outTok:i,toolCount:c,changed:d,model:f}=b.useMemo(()=>{let m=0,g=0,x=0,y;const S=new Set,w=[];for(const j of e)if(j.role==="assistant"){j.usage&&(m+=j.usage.input_tokens||0,g+=j.usage.output_tokens||0),j.model&&(y=j.model);for(const _ of j.parts)if(_.kind==="tool"&&(x+=1,kC.has(_.tool)&&_.status!=="error")){const C=F6(_.args);C&&!S.has(C)&&(S.add(C),w.push({path:C,tool:_.tool}))}}return{inTok:m,outTok:g,toolCount:x,changed:w,model:y}},[e]),p=r+i;return p===0&&c===0?null:o.jsxs("div",{className:"shrink-0 border-t border-border bg-card/40 text-[11px]",children:[o.jsxs("button",{type:"button",onClick:()=>d.length>0&&s(m=>!m),className:Oe("flex w-full items-center gap-3 px-4 py-1.5 text-muted-foreground",d.length>0&&"hover:text-foreground"),children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(tf,{size:12})," ",Eg(p)," tok",o.jsxs("span",{className:"text-muted-foreground/60",children:["(",Eg(r),"↑ / ",Eg(i),"↓)"]})]}),c>0&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Ml,{size:12})," ",c," tools"]}),d.length>0&&o.jsxs("span",{className:"flex items-center gap-1 text-violet-400",children:[o.jsx(Rd,{size:12})," ",d.length," archivos"]}),f&&o.jsx("span",{className:"ml-auto font-mono text-muted-foreground/70",children:f}),d.length>0&&o.jsx(ho,{className:Oe("size-3 shrink-0 transition-transform",n&&"rotate-180")})]}),n&&d.length>0&&o.jsx("ul",{className:"max-h-40 space-y-0.5 overflow-y-auto border-t border-border/60 px-4 py-2",children:d.map(m=>o.jsxs("li",{className:"flex items-center gap-2 font-mono text-[11px]",children:[o.jsx(Rd,{size:11,className:"shrink-0 text-violet-400"}),o.jsx("span",{className:"truncate",children:m.path}),o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground/60",children:m.tool==="write_file"?"write":"edit"})]},m.path))})]})}function Eg(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function cl(){return{picked:new Set,text:"",skipped:!1}}function Xj(e,n){const s=[];return e.forEach((r,i)=>{const c=n[i]||cl();if(c.skipped){s.push(`- ${r.question}
|
|
582
|
-
→ (omitido)`);return}const d=[];if(r.options&&r.options.length>0){const m=[...c.picked].sort((g,x)=>g-x).map(g=>r.options[g]?.label).filter(Boolean);m.length>0&&d.push(m.join(", "))}const f=c.text.trim();f&&d.push(r.options&&r.options.length>0?`(Otro: ${f})`:f);const p=d.length>0?d.join(" "):"(sin respuesta)";s.push(`- ${r.question}
|
|
583
|
-
→ ${p}`)}),s.join(`
|
|
584
|
-
`)}function RC({turnKey:e,questions:n,onSubmit:s,onDismiss:r,disabled:i}){const c=n.length,[d,f]=b.useState(0),[p,m]=b.useState(()=>n.map(()=>cl()));b.useEffect(()=>{f(0),m(n.map(()=>cl()))},[e,n]);const g=n[d],x=p[d]||cl(),y=!!g?.options&&g.options.length>0,S=!!g?.multiSelect,w=g?.allowText!==!1,j=M=>{m(O=>{const L=[...O],B=L[d]||cl();return L[d]={...B,...M,skipped:!1},L})},_=M=>{m(O=>{const L=[...O],B=L[d]||cl(),I=new Set(B.picked);return S?I.has(M)?I.delete(M):I.add(M):(I.clear(),I.add(M)),L[d]={...B,picked:I,skipped:!1},L})},C=b.useMemo(()=>!0,[]),k=d===c-1,R=()=>f(M=>Math.max(0,M-1)),N=()=>{if(k){s(Xj(n,p));return}f(M=>Math.min(c-1,M+1))},A=()=>{if(m(M=>{const O=[...M];return O[d]={picked:new Set,text:"",skipped:!0},O}),k){const M=p.map((O,L)=>L===d?{picked:new Set,text:"",skipped:!0}:O);s(Xj(n,M))}else f(M=>Math.min(c-1,M+1))};return b.useEffect(()=>{const M=O=>{if(i)return;const L=O.target?.tagName?.toLowerCase(),B=L==="input"||L==="textarea";if(O.key==="Enter"&&(O.metaKey||O.ctrlKey)){O.preventDefault(),N();return}if(!B&&y&&/^[1-9]$/.test(O.key)){const I=parseInt(O.key,10)-1;I<(g?.options?.length||0)&&(O.preventDefault(),_(I))}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)}),!g||c===0?null:o.jsxs("div",{className:Oe("mx-3 mb-2 rounded-xl border border-border bg-card/95 shadow-xl backdrop-blur supports-[backdrop-filter]:bg-card/80",i&&"pointer-events-none opacity-60"),"data-testid":"inline-ask-panel",children:[o.jsxs("header",{className:"flex items-start gap-2 border-b border-border px-3 py-2",children:[o.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,"/",c]}),g.header&&o.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}),o.jsx("p",{className:"min-w-0 flex-1 text-sm font-semibold leading-snug",children:g.question}),r&&o.jsx("button",{type:"button",onClick:r,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":E("common.close"),children:o.jsx(xo,{className:"size-3.5"})})]}),o.jsxs("div",{className:"space-y-1 px-2 py-2",children:[y&&g.options.map((M,O)=>{const L=x.picked.has(O);return o.jsxs("button",{type:"button",onClick:()=>_(O),className:Oe("flex w-full items-start gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition",L?"border-emerald-500/40 bg-emerald-500/10":"hover:border-border hover:bg-accent/40"),children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"text-xs font-medium",children:M.label}),M.description&&o.jsx("div",{className:"text-[11px] text-muted-foreground",children:M.description})]}),S?o.jsx("span",{className:Oe("mt-0.5 grid size-4 shrink-0 place-items-center rounded border",L?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-background"),children:L&&o.jsx("span",{className:"text-[10px] leading-none",children:"✓"})}):o.jsx("span",{className:Oe("mt-0.5 grid size-4 shrink-0 place-items-center rounded border font-mono text-[10px]",L?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-muted text-muted-foreground"),children:O+1})]},`${O}:${M.label}`)}),(w||!y)&&o.jsxs("div",{className:"rounded-md border border-transparent px-2 py-1.5 hover:border-border",children:[y&&o.jsx("div",{className:"mb-1 text-xs font-medium",children:E("ask_panel.other")}),o.jsx("input",{type:"text",value:x.text,onChange:M=>j({text:M.target.value}),placeholder:E(y?"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"})]})]}),o.jsxs("footer",{className:"flex items-center justify-between gap-2 border-t border-border px-3 py-2",children:[o.jsx("button",{type:"button",onClick:R,disabled:d===0,className:"rounded px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent disabled:opacity-30",children:E("ask_panel.back")}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{type:"button",onClick:A,className:"rounded px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",children:E("ask_panel.skip")}),o.jsxs("button",{type:"button",onClick:N,disabled:!C,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:[E(k?"ask_panel.submit":"ask_panel.next"),o.jsx(mT,{className:"size-3 opacity-60"})]})]})]})]})}function Y6(e){if(typeof e=="string")return{question:e,options:[],multiSelect:!1,allowText:!0};if(!e||typeof e!="object")return null;const n=e,s=typeof n.question=="string"?n.question:"";if(!s)return null;const i=(Array.isArray(n.options)?n.options:[]).map(c=>{if(typeof c=="string")return{label:c};if(c&&typeof c=="object"&&typeof c.label=="string"){const d=c;return{label:d.label,description:typeof d.description=="string"?d.description:void 0}}return null}).filter(c=>c!==null);return{question:s,header:typeof n.header=="string"?n.header:void 0,options:i,multiSelect:n.multiSelect===!0,allowText:n.allowText!==!1}}function TC(e){if(!e.length)return null;const n=e[e.length-1];if(n.role!=="assistant")return null;let s=null,r=-1;for(let m=n.parts.length-1;m>=0;m--){const g=n.parts[m];if(g.kind==="tool"&&g.tool==="ask_questions"){s=g,r=m;break}}if(!s||r<0)return null;let i=null;if(typeof s.result=="string")try{i=JSON.parse(s.result)}catch{i=null}else s.result&&typeof s.result=="object"&&(i=s.result);const c=[];Array.isArray(s.args?.questions)&&c.push(s.args.questions),i&&Array.isArray(i.questions)&&c.push(i.questions);let d=[];for(const m of c)if(d=m.map(Y6).filter(g=>!!g),d.length>0)break;return d.length?{turnKey:`${n.ts||""}#${r}`,questions:d}:null}const Ui="__super_agent__";function X6({pid:e}){const n=lt(),[s]=yS(),r=Je(`/projects/${e}/agents`,()=>Wt.list(e)),[i,c]=b.useState(s.get("agent")||""),[d,f]=b.useState(!1),[p,m]=b.useState(""),[g,x]=b.useState(null),{msgs:y,send:S,stop:w,clear:j,streaming:_}=V6(e,z=>n.error(z)),C=Fx(),k=r.data||[],R=z=>z===Ui,N=b.useMemo(()=>[{value:Ui,label:`${C} (super-agent)`},...k.map(z=>({value:z.slug,label:z.slug}))],[k,C]),A=b.useMemo(()=>k.find(z=>z.slug===i)||k[0],[k,i]),M=R(i)?Ui:A?.slug||Ui,O=M===Ui;b.useEffect(()=>{!i&&A?.slug&&c(A.slug)},[A?.slug,i]);const L=()=>j(),B=async z=>{!O&&!A||await S(z,{model:p||void 0,agentSlug:O?void 0:A.slug})},I=async z=>{try{await navigator.clipboard.writeText(z),n.info(E("project.chat.copied"))}catch{}};if(r.isLoading)return o.jsx(nt,{});const D=O?E("project.chat.superagent_subtitle",{persona:C}):E("project.chat.subtitle");return o.jsxs("div",{className:"flex h-full flex-col overflow-hidden rounded-xl border border-border bg-card/40",children:[o.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-4 py-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"text-sm font-semibold",children:O?E("project.chat.superagent_title",{persona:C}):E("project.chat.title")}),o.jsx("p",{className:"truncate text-[11px] text-muted-fg",children:D})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-52",children:o.jsx(kt,{value:M,onChange:z=>{c(z),L()},options:N})}),O?o.jsx(Xe,{tone:"success",children:"super-agent"}):A?.model&&o.jsx(Xe,{tone:"info",children:A.model}),!k.length&&!O&&o.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>f(!0),children:[o.jsx(An,{size:14})," ",E("project.chat.create_agent")]}),o.jsxs(ve,{variant:"ghost",size:"sm",disabled:_||y.length===0,onClick:L,children:[o.jsx(rs,{size:13})," ",E("project.chat.clear")]})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length?o.jsx(fb,{msgs:y,onCopy:I}):o.jsx("div",{className:"flex h-full items-center justify-center p-8",children:o.jsx("p",{className:"text-sm text-muted-fg",children:E("project.chat.empty")})})}),o.jsx(NC,{msgs:y}),(()=>{const z=_?null:TC(y);return!z||z.turnKey===g?null:o.jsx(RC,{turnKey:z.turnKey,questions:z.questions,onSubmit:H=>void B(H),onDismiss:()=>x(z.turnKey),disabled:_})})(),o.jsx(A6,{onSend:B,onStop:w,streaming:_,model:p,onModelChange:m}),o.jsx(K6,{open:d,pid:e,onClose:()=>f(!1),onCreated:()=>{f(!1),r.mutate()}})]})}function K6({open:e,onClose:n,onCreated:s,pid:r}){const i=lt(),[c,d]=b.useState(""),[f,p]=b.useState("master"),[m,g]=b.useState(""),[x,y]=b.useState(!0),[S,w]=b.useState(!1),j=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(c)){i.error(E("project.agents.slug_invalid"));return}w(!0);try{await Wt.create(r,{slug:c,role:f,model:m||void 0,is_master:x}),i.success(E("project.agents.created",{slug:c})),d(""),p("master"),g(""),y(!0),s()}catch(_){i.error(_.message)}finally{w(!1)}};return o.jsx(ba,{open:e,onClose:n,title:E("project.chat.create_agent_title"),description:E("project.chat.create_agent_desc"),footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:S,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:j,loading:S,children:E("common.create")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"slug",children:o.jsx(Re,{autoFocus:!0,value:c,onChange:_=>d(_.target.value),placeholder:"master"})}),o.jsx(fe,{label:E("project.chat.role_label"),children:o.jsx(Re,{value:f,onChange:_=>p(_.target.value),placeholder:"master"})}),o.jsx(fe,{label:E("project.chat.model_label"),hint:E("project.chat.model_hint"),children:o.jsx(Re,{value:m,onChange:_=>g(_.target.value)})}),o.jsx(cn,{checked:x,onChange:y,label:E("project.chat.master_label")})]})})}function Q6({pid:e}){const n=lt(),{project:s}=C2(e),{channels:r,isLoading:i,mutate:c}=Wx(),d=String(e),f=s?.name||s?.path?.split("/").pop()||d,p=`proj-${d}`,m=r.find(O=>O.project===d||O.project===f||O.name===p),[g,x]=b.useState(!!m),[y,S]=b.useState(""),[w,j]=b.useState(""),[_,C]=b.useState(""),[k,R]=b.useState(!0),[N,A]=b.useState(!1);if(b.useEffect(()=>{m?(x(!0),S(""),j(m.chat_id||""),C(m.route_to_agent||""),R(m.respond_with_engine??!0)):(x(!1),S(""),j(""),C(""),R(!0))},[m?.name,m?.chat_id,m?.route_to_agent]),i)return o.jsx(nt,{});const M=async()=>{A(!0);try{if(!g){m&&(await Tn.channels.remove(m.name),n.success(E("project.telegram.cleared"))),await c();return}const O={name:m?.name||p,project:d,chat_id:w,route_to_agent:_,respond_with_engine:k,...y?{bot_token:y}:{}};m?await Tn.channels.patch(m.name,O):await Tn.channels.upsert(O),n.success(E("project.telegram.saved")),await c(),S("")}catch(O){n.error(O.message)}finally{A(!1)}};return o.jsx(Ye,{title:E("project.telegram.title"),description:E("project.telegram.subtitle"),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(cn,{checked:g,onChange:x,label:E(g?"project.telegram.override_active":"project.telegram.use_default")}),m&&o.jsx(Xe,{tone:"success",children:E("project.telegram.channel_badge",{name:m.name})})]}),g&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.telegram.bot_token"),hint:m?.bot_token?`${jr(m.bot_token)} — vacío = mantener`:E("project.telegram.bot_hint_none"),children:o.jsx(Re,{type:"password",value:y,onChange:O=>S(O.target.value),placeholder:m?.bot_token?jr(m.bot_token):""})}),o.jsx(fe,{label:E("project.telegram.chat_id"),children:o.jsx(Re,{value:w,onChange:O=>j(O.target.value)})}),o.jsx(fe,{label:E("project.telegram.route_agent"),hint:E("project.telegram.route_hint"),children:o.jsx(Re,{value:_,onChange:O=>C(O.target.value)})})]}),o.jsx(cn,{checked:k,onChange:R,label:E("project.telegram.respond_engine")})]}),o.jsx("div",{className:"pt-2",children:o.jsx(ve,{variant:"primary",loading:N,onClick:M,children:E("common.save")})}),!g&&!m&&o.jsx(dt,{children:E("project.telegram.no_override")})]})})}function AC({load:e,save:n,rows:s=10,placeholder:r}){const i=lt(),[c,d]=b.useState(null),[f,p]=b.useState(""),[m,g]=b.useState(!1);if(b.useEffect(()=>{let S=!0;return e().then(w=>{S&&(d(w),p(w))}).catch(()=>{S&&(d(""),p(""))}),()=>{S=!1}},[e]),c===null)return o.jsx(nt,{});const x=f!==c,y=async()=>{g(!0);try{await n(f),d(f),i.success(E("project.memories.saved"))}catch(S){i.error(S.message)}finally{g(!1)}};return o.jsxs("div",{className:"space-y-2",children:[o.jsx(en,{rows:s,className:"font-mono text-xs",value:f,onChange:S=>p(S.target.value),placeholder:r}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-[11px] text-muted-fg",children:[f.length," ",E("project.memories.chars")]}),o.jsxs(ve,{size:"sm",variant:"primary",loading:m,disabled:!x,onClick:y,children:[o.jsx(sf,{size:12})," ",E("project.memories.save_btn")]})]})]})}function Z6({pid:e,agent:n}){const[s,r]=b.useState(!1),i=n.is_master?Ps:vn;return o.jsxs("li",{className:"rounded-xl border border-border bg-muted/30",children:[o.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center gap-3 px-3 py-2 text-left",children:[s?o.jsx(ho,{size:14,className:"text-muted-fg"}):o.jsx(ef,{size:14,className:"text-muted-fg"}),o.jsx(i,{size:14,className:n.is_master?"text-violet-400":"text-muted-fg"}),o.jsx("span",{className:"text-sm font-medium",children:n.slug}),n.role&&o.jsxs("span",{className:"text-xs text-muted-fg",children:["· ",n.role]})]}),s&&o.jsx("div",{className:"border-t border-border p-3",children:o.jsx(AC,{rows:8,load:()=>Wt.memory.get(e,n.slug).then(c=>c.body),save:c=>Wt.memory.put(e,n.slug,c).then(()=>{})})})]})}function J6({pid:e}){const n=Je(`/projects/${e}/agents`,()=>Wt.list(e));return o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ye,{title:E("project.memories.project_title"),description:E("project.memories.project_desc"),children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-1 flex size-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-sky-600 to-indigo-600",children:o.jsx(Ed,{className:"size-4 text-white"})}),o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(AC,{rows:12,load:()=>ta.memory.get(e).then(s=>s.body),save:s=>ta.memory.put(e,s).then(()=>{}),placeholder:E("project.memories.project_ph")})})]})}),o.jsxs(Ye,{title:E("project.memories.agents_title"),description:E("project.memories.agents_desc"),children:[n.isLoading&&o.jsx(nt,{}),!n.isLoading&&(n.data?.length??0)===0&&o.jsx(dt,{children:E("project.memories.no_agents")}),o.jsx("ul",{className:"space-y-2",children:(n.data||[]).map(s=>o.jsx(Z6,{pid:e,agent:s},s.slug))})]})]})}function W6(e,n){var s,r=1;e==null&&(e=0),n==null&&(n=0);function i(){var c,d=s.length,f,p=0,m=0;for(c=0;c<d;++c)f=s[c],p+=f.x,m+=f.y;for(p=(p/d-e)*r,m=(m/d-n)*r,c=0;c<d;++c)f=s[c],f.x-=p,f.y-=m}return i.initialize=function(c){s=c},i.x=function(c){return arguments.length?(e=+c,i):e},i.y=function(c){return arguments.length?(n=+c,i):n},i.strength=function(c){return arguments.length?(r=+c,i):r},i}function eL(e){const n=+this._x.call(null,e),s=+this._y.call(null,e);return MC(this.cover(n,s),n,s,e)}function MC(e,n,s,r){if(isNaN(n)||isNaN(s))return e;var i,c=e._root,d={data:r},f=e._x0,p=e._y0,m=e._x1,g=e._y1,x,y,S,w,j,_,C,k;if(!c)return e._root=d,e;for(;c.length;)if((j=n>=(x=(f+m)/2))?f=x:m=x,(_=s>=(y=(p+g)/2))?p=y:g=y,i=c,!(c=c[C=_<<1|j]))return i[C]=d,e;if(S=+e._x.call(null,c.data),w=+e._y.call(null,c.data),n===S&&s===w)return d.next=c,i?i[C]=d:e._root=d,e;do i=i?i[C]=new Array(4):e._root=new Array(4),(j=n>=(x=(f+m)/2))?f=x:m=x,(_=s>=(y=(p+g)/2))?p=y:g=y;while((C=_<<1|j)===(k=(w>=y)<<1|S>=x));return i[k]=c,i[C]=d,e}function tL(e){var n,s,r=e.length,i,c,d=new Array(r),f=new Array(r),p=1/0,m=1/0,g=-1/0,x=-1/0;for(s=0;s<r;++s)isNaN(i=+this._x.call(null,n=e[s]))||isNaN(c=+this._y.call(null,n))||(d[s]=i,f[s]=c,i<p&&(p=i),i>g&&(g=i),c<m&&(m=c),c>x&&(x=c));if(p>g||m>x)return this;for(this.cover(p,m).cover(g,x),s=0;s<r;++s)MC(this,d[s],f[s],e[s]);return this}function nL(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var s=this._x0,r=this._y0,i=this._x1,c=this._y1;if(isNaN(s))i=(s=Math.floor(e))+1,c=(r=Math.floor(n))+1;else{for(var d=i-s||1,f=this._root,p,m;s>e||e>=i||r>n||n>=c;)switch(m=(n<r)<<1|e<s,p=new Array(4),p[m]=f,f=p,d*=2,m){case 0:i=s+d,c=r+d;break;case 1:s=i-d,c=r+d;break;case 2:i=s+d,r=c-d;break;case 3:s=i-d,r=c-d;break}this._root&&this._root.length&&(this._root=f)}return this._x0=s,this._y0=r,this._x1=i,this._y1=c,this}function aL(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function sL(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 $n(e,n,s,r,i){this.node=e,this.x0=n,this.y0=s,this.x1=r,this.y1=i}function rL(e,n,s){var r,i=this._x0,c=this._y0,d,f,p,m,g=this._x1,x=this._y1,y=[],S=this._root,w,j;for(S&&y.push(new $n(S,i,c,g,x)),s==null?s=1/0:(i=e-s,c=n-s,g=e+s,x=n+s,s*=s);w=y.pop();)if(!(!(S=w.node)||(d=w.x0)>g||(f=w.y0)>x||(p=w.x1)<i||(m=w.y1)<c))if(S.length){var _=(d+p)/2,C=(f+m)/2;y.push(new $n(S[3],_,C,p,m),new $n(S[2],d,C,_,m),new $n(S[1],_,f,p,C),new $n(S[0],d,f,_,C)),(j=(n>=C)<<1|e>=_)&&(w=y[y.length-1],y[y.length-1]=y[y.length-1-j],y[y.length-1-j]=w)}else{var k=e-+this._x.call(null,S.data),R=n-+this._y.call(null,S.data),N=k*k+R*R;if(N<s){var A=Math.sqrt(s=N);i=e-A,c=n-A,g=e+A,x=n+A,r=S.data}}return r}function oL(e){if(isNaN(g=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e)))return this;var n,s=this._root,r,i,c,d=this._x0,f=this._y0,p=this._x1,m=this._y1,g,x,y,S,w,j,_,C;if(!s)return this;if(s.length)for(;;){if((w=g>=(y=(d+p)/2))?d=y:p=y,(j=x>=(S=(f+m)/2))?f=S:m=S,n=s,!(s=s[_=j<<1|w]))return this;if(!s.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(r=n,C=_)}for(;s.data!==e;)if(i=s,!(s=s.next))return this;return(c=s.next)&&delete s.next,i?(c?i.next=c:delete i.next,this):n?(c?n[_]=c:delete n[_],(s=n[0]||n[1]||n[2]||n[3])&&s===(n[3]||n[2]||n[1]||n[0])&&!s.length&&(r?r[C]=s:this._root=s),this):(this._root=c,this)}function lL(e){for(var n=0,s=e.length;n<s;++n)this.remove(e[n]);return this}function iL(){return this._root}function cL(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function uL(e){var n=[],s,r=this._root,i,c,d,f,p;for(r&&n.push(new $n(r,this._x0,this._y0,this._x1,this._y1));s=n.pop();)if(!e(r=s.node,c=s.x0,d=s.y0,f=s.x1,p=s.y1)&&r.length){var m=(c+f)/2,g=(d+p)/2;(i=r[3])&&n.push(new $n(i,m,g,f,p)),(i=r[2])&&n.push(new $n(i,c,g,m,p)),(i=r[1])&&n.push(new $n(i,m,d,f,g)),(i=r[0])&&n.push(new $n(i,c,d,m,g))}return this}function dL(e){var n=[],s=[],r;for(this._root&&n.push(new $n(this._root,this._x0,this._y0,this._x1,this._y1));r=n.pop();){var i=r.node;if(i.length){var c,d=r.x0,f=r.y0,p=r.x1,m=r.y1,g=(d+p)/2,x=(f+m)/2;(c=i[0])&&n.push(new $n(c,d,f,g,x)),(c=i[1])&&n.push(new $n(c,g,f,p,x)),(c=i[2])&&n.push(new $n(c,d,x,g,m)),(c=i[3])&&n.push(new $n(c,g,x,p,m))}s.push(r)}for(;r=s.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function fL(e){return e[0]}function pL(e){return arguments.length?(this._x=e,this):this._x}function mL(e){return e[1]}function gL(e){return arguments.length?(this._y=e,this):this._y}function pb(e,n,s){var r=new mb(n??fL,s??mL,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function mb(e,n,s,r,i,c){this._x=e,this._y=n,this._x0=s,this._y0=r,this._x1=i,this._y1=c,this._root=void 0}function Kj(e){for(var n={data:e.data},s=n;e=e.next;)s=s.next={data:e.data};return n}var Fn=pb.prototype=mb.prototype;Fn.copy=function(){var e=new mb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,s,r;if(!n)return e;if(!n.length)return e._root=Kj(n),e;for(s=[{source:n,target:e._root=new Array(4)}];n=s.pop();)for(var i=0;i<4;++i)(r=n.source[i])&&(r.length?s.push({source:r,target:n.target[i]=new Array(4)}):n.target[i]=Kj(r));return e};Fn.add=eL;Fn.addAll=tL;Fn.cover=nL;Fn.data=aL;Fn.extent=sL;Fn.find=rL;Fn.remove=oL;Fn.removeAll=lL;Fn.root=iL;Fn.size=cL;Fn.visit=uL;Fn.visitAfter=dL;Fn.x=pL;Fn.y=gL;function ro(e){return function(){return e}}function br(e){return(e()-.5)*1e-6}function hL(e){return e.x+e.vx}function xL(e){return e.y+e.vy}function bL(e){var n,s,r,i=1,c=1;typeof e!="function"&&(e=ro(e==null?1:+e));function d(){for(var m,g=n.length,x,y,S,w,j,_,C=0;C<c;++C)for(x=pb(n,hL,xL).visitAfter(f),m=0;m<g;++m)y=n[m],j=s[y.index],_=j*j,S=y.x+y.vx,w=y.y+y.vy,x.visit(k);function k(R,N,A,M,O){var L=R.data,B=R.r,I=j+B;if(L){if(L.index>y.index){var D=S-L.x-L.vx,z=w-L.y-L.vy,H=D*D+z*z;H<I*I&&(D===0&&(D=br(r),H+=D*D),z===0&&(z=br(r),H+=z*z),H=(I-(H=Math.sqrt(H)))/H*i,y.vx+=(D*=H)*(I=(B*=B)/(_+B)),y.vy+=(z*=H)*I,L.vx-=D*(I=1-I),L.vy-=z*I)}return}return N>S+I||M<S-I||A>w+I||O<w-I}}function f(m){if(m.data)return m.r=s[m.data.index];for(var g=m.r=0;g<4;++g)m[g]&&m[g].r>m.r&&(m.r=m[g].r)}function p(){if(n){var m,g=n.length,x;for(s=new Array(g),m=0;m<g;++m)x=n[m],s[x.index]=+e(x,m,n)}}return d.initialize=function(m,g){n=m,r=g,p()},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(i=+m,d):i},d.radius=function(m){return arguments.length?(e=typeof m=="function"?m:ro(+m),p(),d):e},d}function vL(e){return e.index}function Qj(e,n){var s=e.get(n);if(!s)throw new Error("node not found: "+n);return s}function yL(e){var n=vL,s=x,r,i=ro(30),c,d,f,p,m,g=1;e==null&&(e=[]);function x(_){return 1/Math.min(f[_.source.index],f[_.target.index])}function y(_){for(var C=0,k=e.length;C<g;++C)for(var R=0,N,A,M,O,L,B,I;R<k;++R)N=e[R],A=N.source,M=N.target,O=M.x+M.vx-A.x-A.vx||br(m),L=M.y+M.vy-A.y-A.vy||br(m),B=Math.sqrt(O*O+L*L),B=(B-c[R])/B*_*r[R],O*=B,L*=B,M.vx-=O*(I=p[R]),M.vy-=L*I,A.vx+=O*(I=1-I),A.vy+=L*I}function S(){if(d){var _,C=d.length,k=e.length,R=new Map(d.map((A,M)=>[n(A,M,d),A])),N;for(_=0,f=new Array(C);_<k;++_)N=e[_],N.index=_,typeof N.source!="object"&&(N.source=Qj(R,N.source)),typeof N.target!="object"&&(N.target=Qj(R,N.target)),f[N.source.index]=(f[N.source.index]||0)+1,f[N.target.index]=(f[N.target.index]||0)+1;for(_=0,p=new Array(k);_<k;++_)N=e[_],p[_]=f[N.source.index]/(f[N.source.index]+f[N.target.index]);r=new Array(k),w(),c=new Array(k),j()}}function w(){if(d)for(var _=0,C=e.length;_<C;++_)r[_]=+s(e[_],_,e)}function j(){if(d)for(var _=0,C=e.length;_<C;++_)c[_]=+i(e[_],_,e)}return y.initialize=function(_,C){d=_,m=C,S()},y.links=function(_){return arguments.length?(e=_,S(),y):e},y.id=function(_){return arguments.length?(n=_,y):n},y.iterations=function(_){return arguments.length?(g=+_,y):g},y.strength=function(_){return arguments.length?(s=typeof _=="function"?_:ro(+_),w(),y):s},y.distance=function(_){return arguments.length?(i=typeof _=="function"?_:ro(+_),j(),y):i},y}var jL={value:()=>{}};function OC(){for(var e=0,n=arguments.length,s={},r;e<n;++e){if(!(r=arguments[e]+"")||r in s||/[\s.]/.test(r))throw new Error("illegal type: "+r);s[r]=[]}return new Sd(s)}function Sd(e){this._=e}function _L(e,n){return e.trim().split(/^|\s+/).map(function(s){var r="",i=s.indexOf(".");if(i>=0&&(r=s.slice(i+1),s=s.slice(0,i)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:r}})}Sd.prototype=OC.prototype={constructor:Sd,on:function(e,n){var s=this._,r=_L(e+"",s),i,c=-1,d=r.length;if(arguments.length<2){for(;++c<d;)if((i=(e=r[c]).type)&&(i=SL(s[i],e.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<d;)if(i=(e=r[c]).type)s[i]=Zj(s[i],e.name,n);else if(n==null)for(i in s)s[i]=Zj(s[i],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new Sd(e)},call:function(e,n){if((i=arguments.length-2)>0)for(var s=new Array(i),r=0,i,c;r<i;++r)s[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],r=0,i=c.length;r<i;++r)c[r].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,c=r.length;i<c;++i)r[i].value.apply(n,s)}};function SL(e,n){for(var s=0,r=e.length,i;s<r;++s)if((i=e[s]).name===n)return i.value}function Zj(e,n,s){for(var r=0,i=e.length;r<i;++r)if(e[r].name===n){e[r]=jL,e=e.slice(0,r).concat(e.slice(r+1));break}return s!=null&&e.push({name:n,value:s}),e}var El=0,Zi=0,Hi=0,zC=1e3,Qd,Ji,Zd=0,fo=0,Af=0,vc=typeof performance=="object"&&performance.now?performance:Date,DC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function LC(){return fo||(DC(wL),fo=vc.now()+Af)}function wL(){fo=0}function Ph(){this._call=this._time=this._next=null}Ph.prototype=PC.prototype={constructor:Ph,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?LC():+s)+(n==null?0:+n),!this._next&&Ji!==this&&(Ji?Ji._next=this:Qd=this,Ji=this),this._call=e,this._time=s,Ih()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ih())}};function PC(e,n,s){var r=new Ph;return r.restart(e,n,s),r}function CL(){LC(),++El;for(var e=Qd,n;e;)(n=fo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--El}function Jj(){fo=(Zd=vc.now())+Af,El=Zi=0;try{CL()}finally{El=0,EL(),fo=0}}function kL(){var e=vc.now(),n=e-Zd;n>zC&&(Af-=n,Zd=e)}function EL(){for(var e,n=Qd,s,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:Qd=s);Ji=e,Ih(r)}function Ih(e){if(!El){Zi&&(Zi=clearTimeout(Zi));var n=e-fo;n>24?(e<1/0&&(Zi=setTimeout(Jj,e-vc.now()-Af)),Hi&&(Hi=clearInterval(Hi))):(Hi||(Zd=vc.now(),Hi=setInterval(kL,zC)),El=1,DC(Jj))}}const NL=1664525,RL=1013904223,Wj=4294967296;function TL(){let e=1;return()=>(e=(NL*e+RL)%Wj)/Wj}function AL(e){return e.x}function ML(e){return e.y}var OL=10,zL=Math.PI*(3-Math.sqrt(5));function DL(e){var n,s=1,r=.001,i=1-Math.pow(r,1/300),c=0,d=.6,f=new Map,p=PC(x),m=OC("tick","end"),g=TL();e==null&&(e=[]);function x(){y(),m.call("tick",n),s<r&&(p.stop(),m.call("end",n))}function y(j){var _,C=e.length,k;j===void 0&&(j=1);for(var R=0;R<j;++R)for(s+=(c-s)*i,f.forEach(function(N){N(s)}),_=0;_<C;++_)k=e[_],k.fx==null?k.x+=k.vx*=d:(k.x=k.fx,k.vx=0),k.fy==null?k.y+=k.vy*=d:(k.y=k.fy,k.vy=0);return n}function S(){for(var j=0,_=e.length,C;j<_;++j){if(C=e[j],C.index=j,C.fx!=null&&(C.x=C.fx),C.fy!=null&&(C.y=C.fy),isNaN(C.x)||isNaN(C.y)){var k=OL*Math.sqrt(.5+j),R=j*zL;C.x=k*Math.cos(R),C.y=k*Math.sin(R)}(isNaN(C.vx)||isNaN(C.vy))&&(C.vx=C.vy=0)}}function w(j){return j.initialize&&j.initialize(e,g),j}return S(),n={tick:y,restart:function(){return p.restart(x),n},stop:function(){return p.stop(),n},nodes:function(j){return arguments.length?(e=j,S(),f.forEach(w),n):e},alpha:function(j){return arguments.length?(s=+j,n):s},alphaMin:function(j){return arguments.length?(r=+j,n):r},alphaDecay:function(j){return arguments.length?(i=+j,n):+i},alphaTarget:function(j){return arguments.length?(c=+j,n):c},velocityDecay:function(j){return arguments.length?(d=1-j,n):1-d},randomSource:function(j){return arguments.length?(g=j,f.forEach(w),n):g},force:function(j,_){return arguments.length>1?(_==null?f.delete(j):f.set(j,w(_)),n):f.get(j)},find:function(j,_,C){var k=0,R=e.length,N,A,M,O,L;for(C==null?C=1/0:C*=C,k=0;k<R;++k)O=e[k],N=j-O.x,A=_-O.y,M=N*N+A*A,M<C&&(L=O,C=M);return L},on:function(j,_){return arguments.length>1?(m.on(j,_),n):m.on(j)}}}function LL(){var e,n,s,r,i=ro(-30),c,d=1,f=1/0,p=.81;function m(S){var w,j=e.length,_=pb(e,AL,ML).visitAfter(x);for(r=S,w=0;w<j;++w)n=e[w],_.visit(y)}function g(){if(e){var S,w=e.length,j;for(c=new Array(w),S=0;S<w;++S)j=e[S],c[j.index]=+i(j,S,e)}}function x(S){var w=0,j,_,C=0,k,R,N;if(S.length){for(k=R=N=0;N<4;++N)(j=S[N])&&(_=Math.abs(j.value))&&(w+=j.value,C+=_,k+=_*j.x,R+=_*j.y);S.x=k/C,S.y=R/C}else{j=S,j.x=j.data.x,j.y=j.data.y;do w+=c[j.data.index];while(j=j.next)}S.value=w}function y(S,w,j,_){if(!S.value)return!0;var C=S.x-n.x,k=S.y-n.y,R=_-w,N=C*C+k*k;if(R*R/p<N)return N<f&&(C===0&&(C=br(s),N+=C*C),k===0&&(k=br(s),N+=k*k),N<d&&(N=Math.sqrt(d*N)),n.vx+=C*S.value*r/N,n.vy+=k*S.value*r/N),!0;if(S.length||N>=f)return;(S.data!==n||S.next)&&(C===0&&(C=br(s),N+=C*C),k===0&&(k=br(s),N+=k*k),N<d&&(N=Math.sqrt(d*N)));do S.data!==n&&(R=c[S.data.index]*r/N,n.vx+=C*R,n.vy+=k*R);while(S=S.next)}return m.initialize=function(S,w){e=S,s=w,g()},m.strength=function(S){return arguments.length?(i=typeof S=="function"?S:ro(+S),g(),m):i},m.distanceMin=function(S){return arguments.length?(d=S*S,m):Math.sqrt(d)},m.distanceMax=function(S){return arguments.length?(f=S*S,m):Math.sqrt(f)},m.theta=function(S){return arguments.length?(p=S*S,m):Math.sqrt(p)},m}const qi={agent:"#a78bfa",memory:"#38bdf8",thread:"#34d399",task:"#fbbf24",routine:"#f472b6",agentlink:"#c084fc"},e_={agent:"agente",memory:"memoria",thread:"thread",task:"task",routine:"rutina",agentlink:"jerarquía"},Vi=760,$i=460;function PL({center:e,nodes:n}){const s=b.useRef(null),r=b.useRef(null),i=b.useRef([]),c=b.useRef([]),d=b.useRef(null),[,f]=b.useState(0),[p,m]=b.useState(null);b.useEffect(()=>{const _={id:"__center",label:e,kind:"agent",relation:"self",x:Vi/2,y:$i/2,fx:Vi/2,fy:$i/2},C=[_,...n.map(N=>({...N}))],k=C.slice(1).map(N=>({source:_,target:N}));i.current=C,c.current=k;const R=DL(C).force("link",yL(k).distance(120).strength(.5)).force("charge",LL().strength(-220)).force("center",W6(Vi/2,$i/2).strength(.05)).force("collide",bL(26)).on("tick",()=>f(N=>N+1));return r.current=R,()=>{R.stop()}},[e,n]);const g=_=>{const C=s.current.getBoundingClientRect();return{x:(_.clientX-C.left)/C.width*Vi,y:(_.clientY-C.top)/C.height*$i}},x=_=>C=>{_.id!=="__center"&&(d.current=_,C.target.setPointerCapture?.(C.pointerId),r.current?.alphaTarget(.3).restart())},y=_=>{const C=d.current;if(!C)return;const{x:k,y:R}=g(_);C.fx=k,C.fy=R},S=()=>{const _=d.current;_&&(_.fx=null,_.fy=null),d.current=null,r.current?.alphaTarget(0)},w=i.current,j=c.current;return o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-muted/10",children:o.jsxs("svg",{ref:s,viewBox:`0 0 ${Vi} ${$i}`,className:"h-[460px] w-full touch-none select-none",onPointerMove:y,onPointerUp:S,onPointerLeave:S,children:[j.map((_,C)=>o.jsx("line",{x1:_.source.x,y1:_.source.y,x2:_.target.x,y2:_.target.y,stroke:qi[_.target.kind],strokeOpacity:.22,strokeWidth:1.5},C)),w.map(_=>{if(_.id==="__center")return o.jsxs("g",{transform:`translate(${_.x},${_.y})`,children:[o.jsx("circle",{r:22,fill:qi.agent}),o.jsx("text",{textAnchor:"middle",y:4,fontSize:11,fontWeight:700,fill:"#1a1a1a",children:e.length>8?e.slice(0,8):e})]},_.id);const C=p?.id===_.id;return o.jsxs("g",{transform:`translate(${_.x},${_.y})`,className:"cursor-grab active:cursor-grabbing",onPointerDown:x(_),onClick:()=>m(_),children:[o.jsx("circle",{r:C?9:6,fill:qi[_.kind],fillOpacity:C?1:.9,stroke:C?"#fff":"none",strokeWidth:C?2:0}),o.jsx("text",{x:10,y:4,fontSize:10,className:"fill-foreground/80",children:_.label.length>22?`${_.label.slice(0,22)}…`:_.label})]},_.id)})]})}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-[11px] text-muted-fg",children:[Object.keys(e_).filter(_=>_!=="agent").map(_=>o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx("span",{className:"size-2 rounded-full",style:{background:qi[_]}})," ",e_[_]]},_)),o.jsxs("span",{className:"ml-auto",children:[n.length," nodos · arrastrá para reacomodar"]})]}),p&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"size-2 rounded-full",style:{background:qi[p.kind]}}),o.jsx("span",{className:"font-medium",children:p.label}),o.jsxs("span",{className:"text-muted-fg",children:["· ",p.relation]})]}),p.detail&&o.jsx("p",{className:"mt-1 whitespace-pre-wrap text-muted-fg",children:p.detail})]})]})}function IL(){return[{key:"overview",label:"Explorer",icon:tf},{key:"memories",label:E("project.nav.memories"),icon:Ed},{key:"records",label:E("project.agent_detail.records_title"),icon:_S},{key:"sleep",label:E("project.agent_detail.sleep_title"),icon:bl},{key:"brain",label:E("project.agent_detail.brain_title"),icon:Al},{key:"config",label:E("settings.tabs.advanced"),icon:Td}]}const BL=[{value:"",label:"— sin tipo —"},{value:"orchestrator",label:"Orchestrator",description:"Coordina al equipo y delega."},{value:"specialist",label:"Specialist",description:"Experto en un dominio; ejecuta tareas."},{value:"assistant",label:"Assistant",description:"Ayudante conversacional."},{value:"worker",label:"Worker",description:"Corre tareas autónomas."},{value:"monitor",label:"Monitor",description:"Observa estado y reporta."}],Bh=e=>e.split(",").map(n=>n.trim()).filter(Boolean),UL=(e,n)=>e.filter(s=>s.spec?.agent===n||n==="super-agent"&&s.kind==="super_agent");function HL(e){return e.split(`
|
|
585
|
-
`).map(n=>n.replace(/^[-*#>\s]+/,"").trim()).filter(n=>n.length>2&&!n.startsWith("```")).slice(0,12)}function qL({pid:e}){const{slug:n=""}=dS(),s=$a(),[r,i]=b.useState("overview"),c=IL(),d=Je(`/projects/${e}/agents/${n}`,()=>Wt.get(e,n)),f=Je(`/projects/${e}/agents`,()=>Wt.list(e)),p=Je(`/projects/${e}/routines`,()=>gr.list(e)),m=Je(`/projects/${e}/messages?agent=${n}`,()=>Rh.project(e,{agent:n,limit:200})),g=Je(`/projects/${e}/agents/${n}/conversations`,()=>Vx.list(e,n)),x=Je(`/projects/${e}/tasks?all`,()=>hr.list(e,"all")),y=d.data,S=UL(p.data||[],n),w=(x.data||[]).filter(C=>C.agent===n),j=(f.data||[]).filter(C=>C.parent===n);if(d.isLoading)return o.jsx(nt,{});if(!y)return o.jsx("div",{className:"text-sm text-muted-fg",children:E("project.agent_detail.not_found")});const _=y.is_master?Ps:vn;return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("button",{onClick:()=>s(`/p/${e}/agents`),className:"mt-1 text-muted-fg hover:text-foreground",children:o.jsx(oT,{size:16})}),o.jsx("div",{className:Oe("flex size-11 items-center justify-center rounded-xl bg-gradient-to-br",y.is_master?"from-violet-600 to-indigo-600":"from-slate-600 to-gray-600"),children:o.jsx(_,{className:"size-5 text-white"})}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("h1",{className:"text-lg font-semibold",children:y.slug}),y.is_master&&o.jsxs(Xe,{tone:"success",children:[o.jsx(Ps,{size:10})," ",E("project.agents.orchestrator")]}),y.role&&o.jsx(Xe,{children:y.role}),y.model&&o.jsx(Xe,{tone:"info",children:y.model}),y.parent&&o.jsxs("button",{onClick:()=>s(`/p/${e}/agents/${y.parent}`),className:"text-[11px] text-violet-400 hover:underline",children:[E("project.agent_detail.reports_to")," ",y.parent]})]}),y.description&&o.jsx("p",{className:"mt-0.5 max-w-2xl text-xs text-muted-fg",children:y.description})]})]}),o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>s(`/p/${e}/chat?agent=${n}`),children:[o.jsx(ss,{size:13})," ",E("project.agent_detail.chat_btn",{slug:y.slug})]})]}),o.jsx("div",{className:"flex flex-wrap gap-1 border-b border-border",children:c.map(({key:C,label:k,icon:R})=>o.jsxs("button",{onClick:()=>i(C),className:Oe("flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm transition-colors -mb-px",r===C?"border-foreground text-foreground":"border-transparent text-muted-fg hover:text-foreground"),children:[o.jsx(R,{size:14})," ",k]},C))}),r==="overview"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[o.jsx(ud,{label:"Threads",value:g.data?.length??0,icon:ec}),o.jsx(ud,{label:"Records",value:m.data?.length??0,icon:_S}),o.jsx(ud,{label:"Tasks",value:w.length,icon:tf}),o.jsx(ud,{label:"Heartbeats",value:S.length,icon:bl})]}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsx(Ye,{title:"Skills & tools",description:"",children:o.jsxs("div",{className:"flex flex-wrap gap-1",children:[y.skills?.map(C=>o.jsxs(Xe,{tone:"info",children:[o.jsx(Al,{size:10})," ",C]},C)),y.tools?.map(C=>o.jsxs(Xe,{children:[o.jsx(Ml,{size:10})," ",C]},C)),!y.skills?.length&&!y.tools?.length&&o.jsx("span",{className:"text-xs text-muted-fg",children:"—"})]})}),o.jsx(Ye,{title:E("project.agent_detail.threads_recent"),description:"",children:o.jsxs("ul",{className:"space-y-1 text-xs",children:[(g.data||[]).slice(0,6).map(C=>o.jsxs("li",{className:"flex items-center justify-between rounded-md bg-muted/30 px-2 py-1",children:[o.jsx("span",{className:"truncate",children:C.title||C.filename}),o.jsxs("span",{className:"shrink-0 text-muted-fg",children:[C.messages??0," ",E("project.agent_detail.msgs_count")]})]},C.id)),!g.data?.length&&o.jsx("li",{className:"text-muted-fg",children:E("project.agent_detail.no_threads")})]})})]}),j.length>0&&o.jsx(Ye,{title:E("project.agent_detail.subagents"),description:E("project.agent_detail.subagents_desc"),children:o.jsx("div",{className:"flex flex-wrap gap-2",children:j.map(C=>o.jsxs("button",{onClick:()=>s(`/p/${e}/agents/${C.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:[o.jsx(vn,{size:14,className:"text-muted-fg"})," ",C.slug]},C.slug))})})]}),r==="memories"&&o.jsx($L,{pid:e,slug:n,initial:y.memory||"",onSaved:()=>d.mutate()}),r==="records"&&o.jsx(GL,{records:m.data||[],loading:m.isLoading}),r==="sleep"&&o.jsx(FL,{routines:S}),r==="brain"&&o.jsx(XL,{slug:n,memory:y.memory||"",threads:(g.data||[]).map(C=>({id:C.id,label:C.title||C.filename})),tasks:w.map(C=>({id:C.id,label:C.title,detail:C.body||void 0})),routines:S,parent:y.parent||null,children:j.map(C=>C.slug)}),r==="config"&&o.jsx(VL,{pid:e,agent:y,agents:f.data||[],onSaved:()=>{d.mutate(),f.mutate()},onDeleted:()=>{f.mutate(),s(`/p/${e}/agents`)}})]})}function VL({pid:e,agent:n,agents:s,onSaved:r,onDeleted:i}){const c=lt(),[d,f]=b.useState(n.type||""),[p,m]=b.useState(n.area||""),[g,x]=b.useState(n.role||""),[y,S]=b.useState(n.model||""),[w,j]=b.useState(n.parent||""),[_,C]=b.useState(!!n.is_master),[k,R]=b.useState((n.skills||[]).join(", ")),[N,A]=b.useState((n.tools||[]).join(", ")),[M,O]=b.useState(n.description||""),[L,B]=b.useState(n.system||""),[I,D]=b.useState(!1),z=async()=>{D(!0);try{await Wt.update(e,n.slug,{type:d||null,area:p||null,role:g||null,model:y||null,parent:w||null,is_master:_||d==="orchestrator",skills:Bh(k),tools:Bh(N),description:M||null,system:L}),c.success(E("project.agent_detail.update_success")),r()}catch(V){c.error(V.message)}finally{D(!1)}},H=async()=>{if(confirm(E("project.agent_detail.delete_confirm",{slug:n.slug})))try{await Wt.remove(e,n.slug),c.success(E("project.agent_detail.delete_success")),i()}catch(V){c.error(V.message)}};return o.jsx(Ye,{title:E("project.agent_detail.config_title"),description:`.apc/agents/${n.slug}.md — definición (frontmatter + system prompt).`,children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.agent_detail.type_label"),children:o.jsx(kt,{value:d,onChange:f,options:BL})}),o.jsx(fe,{label:E("project.agent_detail.area_label"),hint:E("project.agent_detail.area_hint"),children:o.jsx(Re,{value:p,onChange:V=>m(V.target.value),placeholder:E("project.agent_detail.area_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("project.agent_detail.role_label"),children:o.jsx(Re,{value:g,onChange:V=>x(V.target.value),placeholder:"Operations Lead"})}),o.jsx(fe,{label:E("project.agent_detail.parent_label"),children:o.jsx(kt,{value:w,onChange:j,placeholder:E("project.agent_detail.none_parent"),options:[{value:"",label:E("project.agent_detail.none_parent")},...s.filter(V=>V.slug!==n.slug).map(V=>({value:V.slug,label:V.slug}))]})})]}),o.jsx(fe,{label:E("project.agent_detail.model_label"),hint:E("project.agent_detail.model_hint"),children:o.jsx(Re,{value:y,onChange:V=>S(V.target.value),placeholder:E("project.agent_detail.model_ph")})}),o.jsx(fe,{label:E("project.agent_detail.skills_label"),children:o.jsx(Re,{value:k,onChange:V=>R(V.target.value),placeholder:"skill-a, skill-b"})}),o.jsx(YL,{value:N,onChange:A}),o.jsx(fe,{label:E("project.agent_detail.bio_label"),children:o.jsx(en,{rows:2,value:M,onChange:V=>O(V.target.value)})}),o.jsx(fe,{label:E("project.agent_detail.system_label"),hint:E("project.agent_detail.system_hint"),children:o.jsx(en,{rows:10,className:"font-mono text-xs",value:L,onChange:V=>B(V.target.value),placeholder:"You are…"})}),o.jsx(cn,{checked:_,onChange:C,label:E("project.agent_detail.master_label")}),o.jsxs("div",{className:"flex items-center justify-between border-t border-border pt-3",children:[o.jsxs(ve,{variant:"destructive",onClick:H,children:[o.jsx(rs,{size:13})," ",E("project.agent_detail.delete_btn")]}),o.jsxs(ve,{variant:"primary",loading:I,onClick:z,children:[o.jsx(sf,{size:13})," ",E("project.agent_detail.save_btn")]})]})]})})}function ud({label:e,value:n,icon:s}){return o.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-fg",children:[o.jsx(s,{size:13})," ",e]}),o.jsx("div",{className:"mt-1 text-2xl font-semibold",children:n})]})}function $L({pid:e,slug:n,initial:s,onSaved:r}){const i=lt(),[c,d]=b.useState(s),[f,p]=b.useState(!1);b.useEffect(()=>{d(s)},[s]);const m=c!==s,g=async()=>{p(!0);try{await Wt.memory.put(e,n,c),i.success(E("project.agent_detail.memory_saved")),r()}catch(x){i.error(x.message)}finally{p(!1)}};return o.jsxs(Ye,{title:E("project.agent_detail.memory_title"),description:`~/.apx/projects/<id>/agents/${n}/memory.md — hechos durables que el agente recuerda.`,children:[o.jsx(en,{rows:16,className:"font-mono text-xs",value:c,onChange:x=>d(x.target.value),placeholder:E("project.agent_detail.memory_empty")}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("span",{className:"text-[11px] text-muted-fg",children:[c.length," ",E("project.memories.chars")]}),o.jsxs(ve,{size:"sm",variant:"primary",loading:f,disabled:!m,onClick:g,children:[o.jsx(sf,{size:12})," ",E("project.memories.save_btn")]})]})]})}function GL({records:e,loading:n}){const s=b.useMemo(()=>[...e].sort((r,i)=>(i.ts||"").localeCompare(r.ts||"")),[e]);return o.jsxs(Ye,{title:E("project.agent_detail.records_title"),description:E("project.agent_detail.records_desc"),children:[n&&o.jsx(nt,{}),!n&&s.length===0&&o.jsx("p",{className:"text-xs text-muted-fg",children:E("project.agent_detail.no_activity")}),o.jsx("ul",{className:"space-y-1 text-sm",children:s.map((r,i)=>o.jsxs("li",{className:"flex items-start gap-2 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("span",{className:"mt-0.5 shrink-0",children:r.direction==="in"?o.jsx(SS,{size:13,className:"text-blue-400"}):o.jsx(CS,{size:13,className:"text-emerald-400"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-fg",children:[o.jsx("span",{className:"font-mono",children:new Date(r.ts).toLocaleString()}),o.jsx(Xe,{tone:"info",children:r.channel}),r.type&&o.jsx(Xe,{children:r.type})]}),r.body&&o.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words text-xs",children:r.body.length>400?`${r.body.slice(0,400)}…`:r.body})]})]},`${r.ts}-${i}`))})]})}function FL({routines:e}){return e.length===0?o.jsx(Ye,{title:E("project.agent_detail.sleep_title"),description:E("project.agent_detail.sleep_desc"),children:o.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-4 text-sm",children:[o.jsx("div",{className:"font-medium text-amber-400",children:E("project.agent_detail.sleep_deep")}),o.jsx("p",{className:"mt-1 text-xs text-muted-fg",children:E("project.agent_detail.sleep_deep_desc")})]})}):o.jsx(Ye,{title:E("project.agent_detail.sleep_title"),description:E("project.agent_detail.sleep_desc"),children:o.jsx("div",{className:"space-y-3",children:e.map(n=>{const s=n.enabled,r=n.last_status==="error";return o.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:Oe("size-2 rounded-full",r?"bg-destructive":s?"bg-emerald-400":"bg-muted-fg/40")}),o.jsx("span",{className:"text-sm font-medium",children:n.name}),o.jsx(Xe,{tone:s?"success":"muted",children:s?"running":"paused"}),r&&o.jsx(Xe,{tone:"danger",children:"last: error"})]}),o.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs sm:grid-cols-4",children:[o.jsx(dd,{label:"Tick",value:n.schedule}),o.jsx(dd,{label:"Next tick",value:n.next_run_at?new Date(n.next_run_at).toLocaleString():"—"}),o.jsx(dd,{label:"Last tick",value:n.last_run_at?new Date(n.last_run_at).toLocaleString():"—"}),o.jsx(dd,{label:"Last run",value:n.last_status||"—"})]}),n.last_error&&o.jsx("p",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:n.last_error})]},n.name)})})})}function dd({label:e,value:n}){return o.jsxs("div",{className:"rounded-md border border-border bg-card p-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-fg",children:e}),o.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px]",children:n})]})}function YL({value:e,onChange:n}){const s=Je("/tools",()=>$O.list()),r=Bh(e),i=s.data||[],c=f=>{const p=new Set(r);p.has(f)?p.delete(f):p.add(f),n([...p].join(", "))},d=r.filter(f=>!i.some(p=>p.name===f));return o.jsxs(fe,{label:"Tools",hint:E("project.agent_detail.tools_hint"),children:[o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(f=>{const p=r.includes(f.name);return o.jsx("button",{type:"button",title:f.description||f.name,onClick:()=>c(f.name),className:Oe("rounded-md border px-2 py-0.5 font-mono text-[11px] transition-colors",p?"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=>o.jsxs("button",{type:"button",onClick:()=>c(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))]}),o.jsx(Re,{className:"mt-2",value:e,onChange:f=>n(f.target.value),placeholder:E("project.agent_detail.tools_custom_ph")})]})}function XL({slug:e,memory:n,threads:s,tasks:r,routines:i,parent:c,children:d}){const f=b.useMemo(()=>{const p=[];return HL(n).forEach((m,g)=>p.push({id:`m${g}`,label:m,kind:"memory",relation:"knows",detail:m})),s.slice(0,8).forEach(m=>p.push({id:`th-${m.id}`,label:m.label,kind:"thread",relation:"in_thread"})),r.slice(0,8).forEach(m=>p.push({id:`ts-${m.id}`,label:m.label,kind:"task",relation:"handles_task",detail:m.detail})),i.forEach(m=>p.push({id:`rt-${m.name}`,label:m.name,kind:"routine",relation:"ticks",detail:`schedule: ${m.schedule}`})),c&&p.push({id:`p-${c}`,label:c,kind:"agentlink",relation:"reports_to"}),d.forEach(m=>p.push({id:`c-${m}`,label:m,kind:"agentlink",relation:"orchestrates"})),p},[n,s,r,i,c,d]);return o.jsx(Ye,{title:E("project.agent_detail.brain_title"),description:E("project.agent_detail.brain_desc"),children:f.length===0?o.jsx("p",{className:"text-xs text-muted-fg",children:E("project.agent_detail.brain_empty")}):o.jsx(PL,{center:e,nodes:f})})}function KL(){const e=$a(),n=ra(),s=lt(),{pid:r=""}=dS(),{project:i,mutate:c}=C2(r),{collapsed:d,toggle:f}=Z2(Nn.sidebarCollapsed+".project"),p=String(r)==="0",m=b.useMemo(()=>p?[{title:E("base.nav_general"),items:[{key:"",label:"Dashboard",icon:OT},{key:"workspaces",label:E("base.workspaces_title"),icon:iT},{key:"models",label:E("settings.tabs.engines"),icon:Wh},{key:"agent-defaults",label:E("base.defaults_title"),icon:vn}]},{title:E("base.nav_activity"),items:[{key:"chat",label:E("project.nav.chat"),icon:ec},{key:"sessions",label:E("base.sessions_title"),icon:RT},{key:"tasks",label:E("project.nav.tasks"),icon:dc},{key:"logs",label:E("project.nav.logs"),icon:lh}]},{title:E("base.nav_system"),items:[{key:"agents",label:E("project.nav.agents"),icon:vn},{key:"memories",label:E("project.nav.memories"),icon:Ed},{key:"routines",label:E("project.nav.routines"),icon:bl},{key:"mcps",label:E("project.nav.mcps"),icon:oh},{key:"config",label:E("project.nav.config"),icon:Td}]}]:[{title:E("project.sections.workspace"),items:[{key:"",label:E("project.nav.overview"),icon:RS},{key:"telegram",label:E("project.nav.telegram"),icon:ss},{key:"chat",label:E("project.nav.chat"),icon:ec},{key:"threads",label:E("project.nav.threads"),icon:ec},{key:"agents",label:E("project.nav.agents"),icon:vn},{key:"memories",label:E("project.nav.memories"),icon:Ed}]},{title:E("project.sections.automation"),items:[{key:"routines",label:E("project.nav.routines"),icon:bl},{key:"tasks",label:E("project.nav.tasks"),icon:dc},{key:"mcps",label:E("project.nav.mcps"),icon:oh},{key:"logs",label:E("project.nav.logs"),icon:lh}]},{title:E("project.sections.config"),items:[{key:"config",label:E("project.nav.config"),icon:Td}]}],[p]),g=n.pathname.replace(`/p/${r}`,"").replace(/^\//,"").split("/")[0];if(!i)return o.jsx("div",{className:"p-8 text-muted-fg",children:E("project.not_found",{pid:r})});const x=async()=>{try{await ta.rebuild(r),s.success(E("project.rebuild_done"))}catch(j){s.error(j.message)}},y=async()=>{const j=i.name||i.path;if(confirm(E("project.unregister_confirm",{label:j})))try{await ta.remove(r),s.success(E("project.unregistered")),c(),e("/")}catch(_){s.error(_.message)}},S=j=>{const _=j?`/p/${r}/${j}`:`/p/${r}`;e(_)},w=Number(r)!==0?o.jsxs(o.Fragment,{children:[o.jsxs(ve,{size:"sm",variant:"secondary",onClick:x,children:[o.jsx(kr,{size:13})," ",E("project.rebuild")]}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:y,children:E("admin.unregister")})]}):void 0;return o.jsx(sC,{sections:m,active:g,onChange:S,collapsed:d,onToggleCollapse:f,actions:w,contentClassName:"w-full space-y-6 p-6 pt-3",testId:`project-tab-${g||"overview"}`,children:o.jsxs(gS,{children:[o.jsx(Gt,{index:!0,element:o.jsx(Pj,{pid:r})}),o.jsx(Gt,{path:"workspaces",element:o.jsx(Tz,{})}),o.jsx(Gt,{path:"models",element:o.jsx(yC,{})}),o.jsx(Gt,{path:"agent-defaults",element:o.jsx(BD,{})}),o.jsx(Gt,{path:"sessions",element:o.jsx(VD,{})}),o.jsx(Gt,{path:"logs",element:o.jsx(ND,{pid:r})}),o.jsx(Gt,{path:"config",element:o.jsx(u6,{pid:r})}),o.jsx(Gt,{path:"telegram",element:o.jsx(Q6,{pid:r})}),o.jsx(Gt,{path:"agents",element:o.jsx(m6,{pid:r})}),o.jsx(Gt,{path:"agents/:slug",element:o.jsx(qL,{pid:r})}),o.jsx(Gt,{path:"memories",element:o.jsx(J6,{pid:r})}),o.jsx(Gt,{path:"routines",element:o.jsx(S6,{pid:r})}),o.jsx(Gt,{path:"tasks",element:p?o.jsx($D,{}):o.jsx(C6,{pid:r})}),o.jsx(Gt,{path:"mcps",element:o.jsx(k6,{pid:r})}),o.jsx(Gt,{path:"threads",element:o.jsx(N6,{pid:r})}),o.jsx(Gt,{path:"chat",element:o.jsx(X6,{pid:r})}),o.jsx(Gt,{path:"*",element:o.jsx(Pj,{pid:r})})]})})}const QL=["es","en","pt","fr","it","de"];function ZL(){const e=lt(),{identity:n,isLoading:s,save:r}=Gx(),[i,c]=b.useState({}),[d,f]=b.useState(!1);if(b.useEffect(()=>{c(n)},[n]),s)return o.jsx(nt,{});const p=async()=>{f(!0);try{await r({owner_name:i.owner_name,owner_context:i.owner_context,language:i.language,timezone:i.timezone}),e.success(E("settings.identity.saved"))}catch(m){e.error(m.message)}finally{f(!1)}};return o.jsxs(Ye,{title:E("settings.identity.title"),description:E("settings.identity.subtitle"),children:[n?null:o.jsx(dt,{children:E("common.none_yet")}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("settings.identity.owner_name"),children:o.jsx(Re,{value:i.owner_name||"",onChange:m=>c({...i,owner_name:m.target.value})})}),o.jsx(fe,{label:E("settings.identity.language"),children:o.jsx(kt,{value:i.language||"es",onChange:m=>c({...i,language:m}),options:QL.map(m=>({value:m,label:m}))})}),o.jsx(fe,{label:E("settings.identity.timezone"),hint:"ej. America/Argentina/Buenos_Aires",children:o.jsx(Re,{value:i.timezone||"",onChange:m=>c({...i,timezone:m.target.value})})})]}),o.jsx("div",{className:"mt-3",children:o.jsx(fe,{label:E("settings.identity.owner_context"),hint:"Quién sos, en qué trabajás, qué le interesa al agente saber de vos.",children:o.jsx(en,{rows:3,value:i.owner_context||"",onChange:m=>c({...i,owner_context:m.target.value})})})}),o.jsx("div",{className:"mt-4",children:o.jsx(ve,{variant:"primary",loading:d,onClick:p,children:E("common.save")})})]})}function JL(){const e=lt(),n=$a(),{superAgent:s,isLoading:r,mutate:i}=bC(),{patch:c}=Ar(),{identity:d,save:f}=Gx(),[p,m]=b.useState(!0),[g,x]=b.useState(""),[y,S]=b.useState(""),[w,j]=b.useState("permiso"),[_,C]=b.useState(!1);if(b.useEffect(()=>{s&&(m(!!s.enabled),x(s.system||""),j(s.permission_mode||"permiso"))},[s]),b.useEffect(()=>{S(d.personality||"")},[d.personality]),r||!s)return o.jsx(nt,{});const k=async()=>{C(!0);try{await c({"super_agent.enabled":p,"super_agent.system":g,"super_agent.permission_mode":w},["super_agent.name"]),await f({personality:y}),e.success(E("settings.super_agent.saved")),i()}catch(R){e.error(R.message)}finally{C(!1)}};return o.jsx(Ye,{title:E("settings.super_agent.title"),description:"Comportamiento del super-agente. El modelo y la cadena de fallback se configuran en el Router de modelos.",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsx(cn,{checked:p,onChange:m,label:"Super-agente habilitado"})}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/20 p-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium",children:"Modelo activo (router)"}),o.jsx("div",{className:"truncate font-mono text-xs text-muted-fg",children:s.model||"—"})]}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>n("/p/0/models"),children:[o.jsx(Wh,{size:13})," Configurar en Modelos"]})]}),o.jsx(fe,{label:E("settings.super_agent.permission_mode"),children:o.jsx(kt,{value:w,onChange:j,options:sx.map(R=>({value:R,label:R}))})}),o.jsx(fe,{label:E("settings.super_agent.personality"),children:o.jsx(en,{rows:2,value:y,onChange:R=>S(R.target.value)})}),o.jsx(fe,{label:E("settings.super_agent.system"),hint:E("settings.super_agent.system_hint"),children:o.jsx(en,{rows:6,className:"font-mono text-xs",value:g,onChange:R=>x(R.target.value),placeholder:"(Vacío = se usa el prompt base de core/agent/prompts/super-agent-base.md)"})}),o.jsx(ve,{variant:"primary",loading:_,onClick:k,children:E("common.save")})]})})}const Ng={providers:()=>he.get("/embeddings/providers"),test:(e={})=>he.post("/embeddings/test",e),reindex:()=>he.post("/embeddings/reindex",{})},WL=[{value:"auto",label:"Automático (cadena: Ollama → Gemini → OpenAI → offline)"},{value:"ollama",label:"Ollama — local, sin API key (nomic-embed-text)"},{value:"gemini",label:"Gemini — free tier con key (text-embedding-004)"},{value:"openai",label:"OpenAI — text-embedding-3-small (cloud)"},{value:"tf",label:"Offline (term-frequency, sin modelo — degradado)"}],eP=[{value:"chain",label:"Cadena (fallback automático)"},{value:"single",label:"Único (usa solo el elegido)"}],t_=e=>e.startsWith("***");function tP(){const e=lt(),{config:n,isLoading:s,patch:r}=Ar(),{data:i,mutate:c}=Je("/embeddings/providers",()=>Ng.providers()),[d,f]=b.useState(!1),[p,m]=b.useState(null);if(s)return o.jsx(nt,{});const x=(n.memory||{}).embeddings||{},y=i?.configured_provider||x.provider||"auto",S=i?.mode||x.mode||"chain",w=i?.engines||[],j=async k=>{f(!0);try{await r(k),await c()}catch(R){e.error(`No se pudo guardar: ${R.message}`)}finally{f(!1)}},_=async()=>{f(!0),m(null);try{const k=await Ng.test({});m(`${k.embedder} · dim ${k.dim} · ${k.ms}ms`),e.success(`Embedding OK con ${k.embedder}`)}catch(k){e.error(`Falló el test: ${k.message}`)}finally{f(!1)}},C=async()=>{f(!0);try{const k=await Ng.reindex();e.success(`Reindexado: ${k.indexed} chunks (limpiados ${k.cleared}).`)}catch(k){e.error(`Falló el reindex: ${k.message}`)}finally{f(!1)}};return o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ye,{title:"Embeddings (RAG)",description:"Modelo que vectoriza el historial de todos los canales para la memoria relevante. Igual que TTS/STT: elegí proveedor y modelo. 'Automático' prueba local primero y cae al offline si no hay nada.",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"Proveedor",hint:"Ollama es local y gratis. Gemini/OpenAI usan la API key de su sección en Modelos (o la de acá abajo).",children:o.jsx(kt,{value:y,onChange:k=>j({"memory.embeddings.provider":k}),options:WL,disabled:d,className:"max-w-xl"})}),o.jsx(fe,{label:"Modo de selección",hint:"Cadena cae al siguiente si uno falla; Único usa exactamente el proveedor elegido.",children:o.jsx(kt,{value:S,onChange:k=>j({"memory.embeddings.mode":k}),options:eP,disabled:d,className:"max-w-md"})}),o.jsx("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:w.map(k=>o.jsxs(Xe,{tone:k.available?"success":"muted",children:[k.id,": ",k.available?"disponible":"no disp."]},k.id))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[o.jsxs(ve,{variant:"secondary",onClick:_,loading:d,children:[o.jsx(Al,{size:14})," Probar embedding"]}),o.jsxs(ve,{variant:"secondary",onClick:C,loading:d,children:[o.jsx(NS,{size:14})," Reindexar memoria"]}),p&&o.jsx("span",{className:"text-sm text-muted-foreground",children:p})]})]})}),o.jsxs(Ye,{title:"Ollama (local)",description:"Sin API key. Corre nomic-embed-text en tu Ollama local o cloud.",children:[o.jsx(fe,{label:"Modelo",children:o.jsx(Re,{defaultValue:x.ollama?.model||"nomic-embed-text",placeholder:"nomic-embed-text",disabled:d,onBlur:k=>{const R=k.target.value.trim();R&&R!==x.ollama?.model&&j({"memory.embeddings.ollama.model":R})},className:"max-w-md"})}),o.jsx(fe,{label:"Base URL",hint:"Vacío usa engines.ollama.base_url (por defecto http://localhost:11434).",children:o.jsx(Re,{defaultValue:x.ollama?.base_url||"",placeholder:"http://localhost:11434",disabled:d,onBlur:k=>j({"memory.embeddings.ollama.base_url":k.target.value.trim()}),className:"max-w-md"})})]}),o.jsxs(Ye,{title:"OpenAI",description:"text-embedding-3-small (1536 dims) u otro modelo compatible.",children:[o.jsx(fe,{label:"Modelo",children:o.jsx(Re,{defaultValue:x.openai?.model||"text-embedding-3-small",placeholder:"text-embedding-3-small",disabled:d,onBlur:k=>{const R=k.target.value.trim();R&&R!==x.openai?.model&&j({"memory.embeddings.openai.model":R})},className:"max-w-md"})}),o.jsx(fe,{label:"API key",hint:"Vacío reusa engines.openai.api_key. Dejalo en blanco para no tocar la guardada.",children:o.jsx(Re,{type:"password",defaultValue:x.openai?.api_key||"",placeholder:"sk-…",disabled:d,onBlur:k=>{const R=k.target.value;R&&!t_(R)&&j({"memory.embeddings.openai.api_key":R})},className:"max-w-md"})})]}),o.jsxs(Ye,{title:"Gemini",description:"text-embedding-004 (768 dims). Free tier con API key de Google.",children:[o.jsx(fe,{label:"Modelo",children:o.jsx(Re,{defaultValue:x.gemini?.model||"text-embedding-004",placeholder:"text-embedding-004",disabled:d,onBlur:k=>{const R=k.target.value.trim();R&&R!==x.gemini?.model&&j({"memory.embeddings.gemini.model":R})},className:"max-w-md"})}),o.jsx(fe,{label:"API key",hint:"Vacío reusa engines.gemini.api_key.",children:o.jsx(Re,{type:"password",defaultValue:x.gemini?.api_key||"",placeholder:"AIza…",disabled:d,onBlur:k=>{const R=k.target.value;R&&!t_(R)&&j({"memory.embeddings.gemini.api_key":R})},className:"max-w-md"})})]})]})}function nP(){const e=lt(),{config:n,isLoading:s,patch:r,mutate:i}=Ar(),c=n.telegram?.channels||[],d=Math.max(0,c.findIndex(A=>A.name==="default")),f=c[d],[p,m]=b.useState(!0),[g,x]=b.useState(1500),[y,S]=b.useState(!0),[w,j]=b.useState(""),[_,C]=b.useState(""),[k,R]=b.useState(!1);if(b.useEffect(()=>{m(!!n.telegram?.enabled),x(Number(n.telegram?.poll_interval_ms||1500)),S(!!n.telegram?.respond_with_engine),j(""),C(f?.chat_id||"")},[n,f?.chat_id]),s)return o.jsx(nt,{});const N=async()=>{R(!0);try{const A=c.slice(),M={name:"default",chat_id:_,respond_with_engine:y,...w?{bot_token:w}:{}};c.length===0?A.push(M):A[d]={...f,...M},await r({"telegram.enabled":p,"telegram.poll_interval_ms":g,"telegram.respond_with_engine":y,"telegram.channels":A}),e.success(E("settings.telegram_global.saved")),i(),j("")}catch(A){e.error(A.message)}finally{R(!1)}};return o.jsx(Ye,{title:E("settings.telegram_global.title"),description:E("settings.telegram_global.subtitle"),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(cn,{checked:p,onChange:m,label:E("settings.telegram_global.enabled")}),o.jsx(cn,{checked:y,onChange:S,label:E("settings.telegram_global.respond_with_engine")})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("settings.telegram_global.bot_token"),hint:f?.bot_token?`…${Cl(f.bot_token)??""} (seteado — escribí para reemplazar)`:"Token del BotFather.",children:o.jsx(Re,{type:"password",value:w,onChange:A=>j(A.target.value),placeholder:f?.bot_token?`…${Cl(f.bot_token)??""} (ya seteado)`:""})}),o.jsx(fe,{label:E("settings.telegram_global.chat_id"),children:o.jsx(Re,{value:_,onChange:A=>C(A.target.value),placeholder:"889721252"})}),o.jsx(fe,{label:E("settings.telegram_global.poll_interval"),children:o.jsx(Re,{type:"number",value:String(g),onChange:A=>x(Number(A.target.value)||1500)})})]}),o.jsx(ve,{variant:"primary",loading:k,onClick:N,children:E("common.save")})]})})}function aP(){const e=lt(),{channels:n,isLoading:s,mutate:r}=Wx(),{contacts:i}=eb(),[c,d]=b.useState(null),[f,p]=b.useState(null),m=new Map;for(const x of i)m.set(String(x.user_id),x.name||`@${x.username||x.user_id}`);const g=async x=>{if(confirm(E("telegram_channels.delete_confirm",{name:x})))try{await Tn.channels.remove(x),e.success(E("telegram_channels.removed")),r()}catch(y){e.error(y.message)}};return o.jsxs(Ye,{title:E("telegram_channels.title"),description:E("telegram_channels.desc"),action:o.jsxs(ve,{size:"sm",onClick:()=>d({name:""}),children:[o.jsx(An,{size:14})," ",E("telegram_channels.new_btn")]}),children:[s&&o.jsx(nt,{}),!s&&n.length===0&&o.jsx(dt,{children:E("telegram_channels.empty")}),o.jsx("ul",{className:"space-y-2 text-sm",children:n.map(x=>{const y=x.owner_user_id!=null?m.get(String(x.owner_user_id))||`user_id ${x.owner_user_id}`:E("telegram_channels.no_owner");return o.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"font-medium",children:x.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[x.project&&o.jsxs(Xe,{tone:"success",children:["project = ",x.project]}),o.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>p(x),children:[o.jsx(ss,{size:13})," ",E("admin.telegram_send_test")]}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>d(x),children:E("common.edit")}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>g(x.name),children:E("common.delete")})]})]}),o.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2 text-xs text-muted-fg",children:[o.jsxs("span",{children:["chat_id: ",x.chat_id||"—"]}),o.jsxs("span",{children:["bot_token: ",x.bot_token?`…${Cl(x.bot_token)??""}`:"—"]}),o.jsxs("span",{children:["route_to_agent: ",x.route_to_agent||"default APX"]}),o.jsxs("span",{children:["engine: ",x.respond_with_engine?"sí":"no"]}),o.jsxs("span",{className:"col-span-2",children:[E("telegram_channels.owner_label")," ",y]})]})]},x.name)})}),o.jsx(X2,{channel:c,onClose:()=>d(null),onSaved:()=>{d(null),r()}}),o.jsx(K2,{channel:f,onClose:()=>p(null)})]})}const n_=new Set(["owner","guest"]);function sP(){const e=lt(),{roles:n,mutate:s,isLoading:r}=eb(),[i,c]=b.useState(""),[d,f]=b.useState(""),[p,m]=b.useState(!1),[g,x]=b.useState(!1),y=async()=>{const j=i.trim();if(!j){e.error(E("telegram_roles.name_required"));return}if(n_.has(j)){e.error(E("telegram_roles.builtin_error",{name:j}));return}x(!0);try{const _=p?"*":d.split(",").map(C=>C.trim()).filter(Boolean);await Tn.roles.set(j,_),e.success(E("telegram_roles.saved",{name:j})),c(""),f(""),m(!1),s()}catch(_){e.error(_.message)}finally{x(!1)}},S=async j=>{if(confirm(E("telegram_roles.delete_confirm",{name:j})))try{await Tn.roles.remove(j),e.success(E("telegram_roles.removed")),s()}catch(_){e.error(_.message)}},w=Object.entries(n);return o.jsxs(Ye,{title:E("telegram_roles.title"),description:E("telegram_roles.desc"),children:[r&&o.jsx(nt,{}),w.length===0&&!r&&o.jsx(dt,{children:E("telegram_roles.empty")}),w.length>0&&o.jsx("ul",{className:"space-y-2 text-sm",children:w.map(([j,_])=>{const C=n_.has(j),k=_?.tools==="*"?E("telegram_roles.tools_all"):Array.isArray(_?.tools)&&_.tools.length>0?_.tools.join(", "):E("telegram_roles.tools_none");return o.jsxs("li",{className:"rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium",children:j}),C&&o.jsx(Xe,{tone:"info",children:E("telegram_roles.builtin")})]}),!C&&o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>S(j),children:E("telegram_roles.delete_btn")})]}),o.jsxs("div",{className:"mt-1 text-xs text-muted-fg",children:["tools: ",k]})]},j)})}),o.jsxs("div",{className:"mt-4 space-y-3 rounded-md border border-dashed border-border p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[o.jsx(An,{size:14})," ",E("telegram_roles.new_title")]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:E("telegram_roles.name_label"),children:o.jsx(Re,{value:i,onChange:j=>c(j.target.value),placeholder:E("telegram_roles.name_ph")})}),o.jsx(fe,{label:E("telegram_roles.tools_label"),hint:E("telegram_roles.tools_hint"),children:o.jsx(Re,{value:d,onChange:j=>f(j.target.value),disabled:p,placeholder:E("telegram_roles.tools_ph")})})]}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(cn,{checked:p,onChange:m,label:E("telegram_roles.full_access")}),o.jsx(ve,{variant:"primary",loading:g,onClick:y,children:E("telegram_roles.save_btn")})]})]})]})}const IC="apx.settings.telegramTab";function rP(){if(typeof window>"u")return"default";const e=window.localStorage.getItem(IC);return e==="channels"||e==="contacts"||e==="roles"||e==="default"?e:"default"}function oP(){const[e,n]=b.useState("default");b.useEffect(()=>{n(rP())},[]);const s=r=>{const i=r==="channels"||r==="contacts"||r==="roles"||r==="default"?r:"default";n(i);try{window.localStorage.setItem(IC,i)}catch{}};return o.jsxs(Rf,{value:e,onValueChange:s,className:"w-full",children:[o.jsxs(Tf,{children:[o.jsx(Wa,{value:"default",children:E("settings.telegram_global.title")}),o.jsx(Wa,{value:"channels",children:E("telegram_channels.title")}),o.jsx(Wa,{value:"contacts",children:E("telegram_contacts.title")}),o.jsx(Wa,{value:"roles",children:E("telegram_roles.title")})]}),o.jsx(Aa,{value:"default",className:"mt-4",children:o.jsx(nP,{})}),o.jsx(Aa,{value:"channels",className:"mt-4",children:o.jsx(aP,{})}),o.jsx(Aa,{value:"contacts",className:"mt-4",children:o.jsx(Q2,{})}),o.jsx(Aa,{value:"roles",className:"mt-4",children:o.jsx(sP,{})})]})}function lP(){const{data:e,error:n,isLoading:s,mutate:r}=Je("/pair/list",()=>wl.list(),{refreshInterval:rf.pairList});return{clients:e?.clients||[],error:n,isLoading:s,mutate:r}}var ol={},Rg,a_;function iP(){return a_||(a_=1,Rg=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Rg}var Tg={},mr={},s_;function vo(){if(s_)return mr;s_=1;let e;const n=[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 mr.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},mr.getSymbolTotalCodewords=function(r){return n[r]},mr.getBCHDigit=function(s){let r=0;for(;s!==0;)r++,s>>>=1;return r},mr.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},mr.isKanjiModeEnabled=function(){return typeof e<"u"},mr.toSJIS=function(r){return e(r)},mr}var Ag={},r_;function gb(){return r_||(r_=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function n(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.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: "+s)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,i){if(e.isValid(r))return r;try{return n(r)}catch{return i}}})(Ag)),Ag}var Mg,o_;function cP(){if(o_)return Mg;o_=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(n){const s=Math.floor(n/8);return(this.buffer[s]>>>7-n%8&1)===1},put:function(n,s){for(let r=0;r<s;r++)this.putBit((n>>>s-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){const s=Math.floor(this.length/8);this.buffer.length<=s&&this.buffer.push(0),n&&(this.buffer[s]|=128>>>this.length%8),this.length++}},Mg=e,Mg}var Og,l_;function uP(){if(l_)return Og;l_=1;function e(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}return e.prototype.set=function(n,s,r,i){const c=n*this.size+s;this.data[c]=r,i&&(this.reservedBit[c]=!0)},e.prototype.get=function(n,s){return this.data[n*this.size+s]},e.prototype.xor=function(n,s,r){this.data[n*this.size+s]^=r},e.prototype.isReserved=function(n,s){return this.reservedBit[n*this.size+s]},Og=e,Og}var zg={},i_;function dP(){return i_||(i_=1,(function(e){const n=vo().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,c=n(r),d=c===145?26:Math.ceil((c-13)/(2*i-2))*2,f=[c-7];for(let p=1;p<i-1;p++)f[p]=f[p-1]-d;return f.push(6),f.reverse()},e.getPositions=function(r){const i=[],c=e.getRowColCoords(r),d=c.length;for(let f=0;f<d;f++)for(let p=0;p<d;p++)f===0&&p===0||f===0&&p===d-1||f===d-1&&p===0||i.push([c[f],c[p]]);return i}})(zg)),zg}var Dg={},c_;function fP(){if(c_)return Dg;c_=1;const e=vo().getSymbolSize,n=7;return Dg.getPositions=function(r){const i=e(r);return[[0,0],[i-n,0],[0,i-n]]},Dg}var Lg={},u_;function pP(){return u_||(u_=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n={N1:3,N2:3,N3:40,N4:10};e.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const c=i.size;let d=0,f=0,p=0,m=null,g=null;for(let x=0;x<c;x++){f=p=0,m=g=null;for(let y=0;y<c;y++){let S=i.get(x,y);S===m?f++:(f>=5&&(d+=n.N1+(f-5)),m=S,f=1),S=i.get(y,x),S===g?p++:(p>=5&&(d+=n.N1+(p-5)),g=S,p=1)}f>=5&&(d+=n.N1+(f-5)),p>=5&&(d+=n.N1+(p-5))}return d},e.getPenaltyN2=function(i){const c=i.size;let d=0;for(let f=0;f<c-1;f++)for(let p=0;p<c-1;p++){const m=i.get(f,p)+i.get(f,p+1)+i.get(f+1,p)+i.get(f+1,p+1);(m===4||m===0)&&d++}return d*n.N2},e.getPenaltyN3=function(i){const c=i.size;let d=0,f=0,p=0;for(let m=0;m<c;m++){f=p=0;for(let g=0;g<c;g++)f=f<<1&2047|i.get(m,g),g>=10&&(f===1488||f===93)&&d++,p=p<<1&2047|i.get(g,m),g>=10&&(p===1488||p===93)&&d++}return d*n.N3},e.getPenaltyN4=function(i){let c=0;const d=i.data.length;for(let p=0;p<d;p++)c+=i.data[p];return Math.abs(Math.ceil(c*100/d/5)-10)*n.N4};function s(r,i,c){switch(r){case e.Patterns.PATTERN000:return(i+c)%2===0;case e.Patterns.PATTERN001:return i%2===0;case e.Patterns.PATTERN010:return c%3===0;case e.Patterns.PATTERN011:return(i+c)%3===0;case e.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(c/3))%2===0;case e.Patterns.PATTERN101:return i*c%2+i*c%3===0;case e.Patterns.PATTERN110:return(i*c%2+i*c%3)%2===0;case e.Patterns.PATTERN111:return(i*c%3+(i+c)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(i,c){const d=c.size;for(let f=0;f<d;f++)for(let p=0;p<d;p++)c.isReserved(p,f)||c.xor(p,f,s(i,p,f))},e.getBestMask=function(i,c){const d=Object.keys(e.Patterns).length;let f=0,p=1/0;for(let m=0;m<d;m++){c(m),e.applyMask(m,i);const g=e.getPenaltyN1(i)+e.getPenaltyN2(i)+e.getPenaltyN3(i)+e.getPenaltyN4(i);e.applyMask(m,i),g<p&&(p=g,f=m)}return f}})(Lg)),Lg}var fd={},d_;function BC(){if(d_)return fd;d_=1;const e=gb(),n=[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],s=[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 fd.getBlocksCount=function(i,c){switch(c){case e.L:return n[(i-1)*4+0];case e.M:return n[(i-1)*4+1];case e.Q:return n[(i-1)*4+2];case e.H:return n[(i-1)*4+3];default:return}},fd.getTotalCodewordsCount=function(i,c){switch(c){case e.L:return s[(i-1)*4+0];case e.M:return s[(i-1)*4+1];case e.Q:return s[(i-1)*4+2];case e.H:return s[(i-1)*4+3];default:return}},fd}var Pg={},Gi={},f_;function mP(){if(f_)return Gi;f_=1;const e=new Uint8Array(512),n=new Uint8Array(256);return(function(){let r=1;for(let i=0;i<255;i++)e[i]=r,n[r]=i,r<<=1,r&256&&(r^=285);for(let i=255;i<512;i++)e[i]=e[i-255]})(),Gi.log=function(r){if(r<1)throw new Error("log("+r+")");return n[r]},Gi.exp=function(r){return e[r]},Gi.mul=function(r,i){return r===0||i===0?0:e[n[r]+n[i]]},Gi}var p_;function gP(){return p_||(p_=1,(function(e){const n=mP();e.mul=function(r,i){const c=new Uint8Array(r.length+i.length-1);for(let d=0;d<r.length;d++)for(let f=0;f<i.length;f++)c[d+f]^=n.mul(r[d],i[f]);return c},e.mod=function(r,i){let c=new Uint8Array(r);for(;c.length-i.length>=0;){const d=c[0];for(let p=0;p<i.length;p++)c[p]^=n.mul(i[p],d);let f=0;for(;f<c.length&&c[f]===0;)f++;c=c.slice(f)}return c},e.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let c=0;c<r;c++)i=e.mul(i,new Uint8Array([1,n.exp(c)]));return i}})(Pg)),Pg}var Ig,m_;function hP(){if(m_)return Ig;m_=1;const e=gP();function n(s){this.genPoly=void 0,this.degree=s,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},n.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(r.length+this.degree);i.set(r);const c=e.mod(i,this.genPoly),d=this.degree-c.length;if(d>0){const f=new Uint8Array(this.degree);return f.set(c,d),f}return c},Ig=n,Ig}var Bg={},Ug={},Hg={},g_;function UC(){return g_||(g_=1,Hg.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}),Hg}var Ka={},h_;function HC(){if(h_)return Ka;h_=1;const e="[0-9]+",n="[A-Z $%*+\\-./:]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+`)(?:.|[\r
|
|
586
|
-
]))+`;Ka.KANJI=new RegExp(s,"g"),Ka.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ka.BYTE=new RegExp(r,"g"),Ka.NUMERIC=new RegExp(e,"g"),Ka.ALPHANUMERIC=new RegExp(n,"g");const i=new RegExp("^"+s+"$"),c=new RegExp("^"+e+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ka.testKanji=function(p){return i.test(p)},Ka.testNumeric=function(p){return c.test(p)},Ka.testAlphanumeric=function(p){return d.test(p)},Ka}var x_;function yo(){return x_||(x_=1,(function(e){const n=UC(),s=HC();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(c,d){if(!c.ccBits)throw new Error("Invalid mode: "+c);if(!n.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?c.ccBits[0]:d<27?c.ccBits[1]:c.ccBits[2]},e.getBestModeForData=function(c){return s.testNumeric(c)?e.NUMERIC:s.testAlphanumeric(c)?e.ALPHANUMERIC:s.testKanji(c)?e.KANJI:e.BYTE},e.toString=function(c){if(c&&c.id)return c.id;throw new Error("Invalid mode")},e.isValid=function(c){return c&&c.bit&&c.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.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: "+i)}}e.from=function(c,d){if(e.isValid(c))return c;try{return r(c)}catch{return d}}})(Ug)),Ug}var b_;function xP(){return b_||(b_=1,(function(e){const n=vo(),s=BC(),r=gb(),i=yo(),c=UC(),d=7973,f=n.getBCHDigit(d);function p(y,S,w){for(let j=1;j<=40;j++)if(S<=e.getCapacity(j,w,y))return j}function m(y,S){return i.getCharCountIndicator(y,S)+4}function g(y,S){let w=0;return y.forEach(function(j){const _=m(j.mode,S);w+=_+j.getBitsLength()}),w}function x(y,S){for(let w=1;w<=40;w++)if(g(y,w)<=e.getCapacity(w,S,i.MIXED))return w}e.from=function(S,w){return c.isValid(S)?parseInt(S,10):w},e.getCapacity=function(S,w,j){if(!c.isValid(S))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=i.BYTE);const _=n.getSymbolTotalCodewords(S),C=s.getTotalCodewordsCount(S,w),k=(_-C)*8;if(j===i.MIXED)return k;const R=k-m(j,S);switch(j){case i.NUMERIC:return Math.floor(R/10*3);case i.ALPHANUMERIC:return Math.floor(R/11*2);case i.KANJI:return Math.floor(R/13);case i.BYTE:default:return Math.floor(R/8)}},e.getBestVersionForData=function(S,w){let j;const _=r.from(w,r.M);if(Array.isArray(S)){if(S.length>1)return x(S,_);if(S.length===0)return 1;j=S[0]}else j=S;return p(j.mode,j.getLength(),_)},e.getEncodedBits=function(S){if(!c.isValid(S)||S<7)throw new Error("Invalid QR Code version");let w=S<<12;for(;n.getBCHDigit(w)-f>=0;)w^=d<<n.getBCHDigit(w)-f;return S<<12|w}})(Bg)),Bg}var qg={},v_;function bP(){if(v_)return qg;v_=1;const e=vo(),n=1335,s=21522,r=e.getBCHDigit(n);return qg.getEncodedBits=function(c,d){const f=c.bit<<3|d;let p=f<<10;for(;e.getBCHDigit(p)-r>=0;)p^=n<<e.getBCHDigit(p)-r;return(f<<10|p)^s},qg}var Vg={},$g,y_;function vP(){if(y_)return $g;y_=1;const e=yo();function n(s){this.mode=e.NUMERIC,this.data=s.toString()}return n.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let i,c,d;for(i=0;i+3<=this.data.length;i+=3)c=this.data.substr(i,3),d=parseInt(c,10),r.put(d,10);const f=this.data.length-i;f>0&&(c=this.data.substr(i),d=parseInt(c,10),r.put(d,f*3+1))},$g=n,$g}var Gg,j_;function yP(){if(j_)return Gg;j_=1;const e=yo(),n=["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 s(r){this.mode=e.ALPHANUMERIC,this.data=r}return s.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(i){let c;for(c=0;c+2<=this.data.length;c+=2){let d=n.indexOf(this.data[c])*45;d+=n.indexOf(this.data[c+1]),i.put(d,11)}this.data.length%2&&i.put(n.indexOf(this.data[c]),6)},Gg=s,Gg}var Fg,__;function jP(){if(__)return Fg;__=1;const e=yo();function n(s){this.mode=e.BYTE,typeof s=="string"?this.data=new TextEncoder().encode(s):this.data=new Uint8Array(s)}return n.getBitsLength=function(r){return r*8},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(s){for(let r=0,i=this.data.length;r<i;r++)s.put(this.data[r],8)},Fg=n,Fg}var Yg,S_;function _P(){if(S_)return Yg;S_=1;const e=yo(),n=vo();function s(r){this.mode=e.KANJI,this.data=r}return s.getBitsLength=function(i){return i*13},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(r){let i;for(i=0;i<this.data.length;i++){let c=n.toSJIS(this.data[i]);if(c>=33088&&c<=40956)c-=33088;else if(c>=57408&&c<=60351)c-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+`
|
|
587
|
-
Make sure your charset is UTF-8`);c=(c>>>8&255)*192+(c&255),r.put(c,13)}},Yg=s,Yg}var Xg={exports:{}},w_;function SP(){return w_||(w_=1,(function(e){var n={single_source_shortest_paths:function(s,r,i){var c={},d={};d[r]=0;var f=n.PriorityQueue.make();f.push(r,0);for(var p,m,g,x,y,S,w,j,_;!f.empty();){p=f.pop(),m=p.value,x=p.cost,y=s[m]||{};for(g in y)y.hasOwnProperty(g)&&(S=y[g],w=x+S,j=d[g],_=typeof d[g]>"u",(_||j>w)&&(d[g]=w,f.push(g,w),c[g]=m))}if(typeof i<"u"&&typeof d[i]>"u"){var C=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(C)}return c},extract_shortest_path_from_predecessor_list:function(s,r){for(var i=[],c=r;c;)i.push(c),s[c],c=s[c];return i.reverse(),i},find_path:function(s,r,i){var c=n.single_source_shortest_paths(s,r,i);return n.extract_shortest_path_from_predecessor_list(c,i)},PriorityQueue:{make:function(s){var r=n.PriorityQueue,i={},c;s=s||{};for(c in r)r.hasOwnProperty(c)&&(i[c]=r[c]);return i.queue=[],i.sorter=s.sorter||r.default_sorter,i},default_sorter:function(s,r){return s.cost-r.cost},push:function(s,r){var i={value:s,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=n})(Xg)),Xg.exports}var C_;function wP(){return C_||(C_=1,(function(e){const n=yo(),s=vP(),r=yP(),i=jP(),c=_P(),d=HC(),f=vo(),p=SP();function m(C){return unescape(encodeURIComponent(C)).length}function g(C,k,R){const N=[];let A;for(;(A=C.exec(R))!==null;)N.push({data:A[0],index:A.index,mode:k,length:A[0].length});return N}function x(C){const k=g(d.NUMERIC,n.NUMERIC,C),R=g(d.ALPHANUMERIC,n.ALPHANUMERIC,C);let N,A;return f.isKanjiModeEnabled()?(N=g(d.BYTE,n.BYTE,C),A=g(d.KANJI,n.KANJI,C)):(N=g(d.BYTE_KANJI,n.BYTE,C),A=[]),k.concat(R,N,A).sort(function(O,L){return O.index-L.index}).map(function(O){return{data:O.data,mode:O.mode,length:O.length}})}function y(C,k){switch(k){case n.NUMERIC:return s.getBitsLength(C);case n.ALPHANUMERIC:return r.getBitsLength(C);case n.KANJI:return c.getBitsLength(C);case n.BYTE:return i.getBitsLength(C)}}function S(C){return C.reduce(function(k,R){const N=k.length-1>=0?k[k.length-1]:null;return N&&N.mode===R.mode?(k[k.length-1].data+=R.data,k):(k.push(R),k)},[])}function w(C){const k=[];for(let R=0;R<C.length;R++){const N=C[R];switch(N.mode){case n.NUMERIC:k.push([N,{data:N.data,mode:n.ALPHANUMERIC,length:N.length},{data:N.data,mode:n.BYTE,length:N.length}]);break;case n.ALPHANUMERIC:k.push([N,{data:N.data,mode:n.BYTE,length:N.length}]);break;case n.KANJI:k.push([N,{data:N.data,mode:n.BYTE,length:m(N.data)}]);break;case n.BYTE:k.push([{data:N.data,mode:n.BYTE,length:m(N.data)}])}}return k}function j(C,k){const R={},N={start:{}};let A=["start"];for(let M=0;M<C.length;M++){const O=C[M],L=[];for(let B=0;B<O.length;B++){const I=O[B],D=""+M+B;L.push(D),R[D]={node:I,lastCount:0},N[D]={};for(let z=0;z<A.length;z++){const H=A[z];R[H]&&R[H].node.mode===I.mode?(N[H][D]=y(R[H].lastCount+I.length,I.mode)-y(R[H].lastCount,I.mode),R[H].lastCount+=I.length):(R[H]&&(R[H].lastCount=I.length),N[H][D]=y(I.length,I.mode)+4+n.getCharCountIndicator(I.mode,k))}}A=L}for(let M=0;M<A.length;M++)N[A[M]].end=0;return{map:N,table:R}}function _(C,k){let R;const N=n.getBestModeForData(C);if(R=n.from(k,N),R!==n.BYTE&&R.bit<N.bit)throw new Error('"'+C+'" cannot be encoded with mode '+n.toString(R)+`.
|
|
588
|
-
Suggested mode is: `+n.toString(N));switch(R===n.KANJI&&!f.isKanjiModeEnabled()&&(R=n.BYTE),R){case n.NUMERIC:return new s(C);case n.ALPHANUMERIC:return new r(C);case n.KANJI:return new c(C);case n.BYTE:return new i(C)}}e.fromArray=function(k){return k.reduce(function(R,N){return typeof N=="string"?R.push(_(N,null)):N.data&&R.push(_(N.data,N.mode)),R},[])},e.fromString=function(k,R){const N=x(k,f.isKanjiModeEnabled()),A=w(N),M=j(A,R),O=p.find_path(M.map,"start","end"),L=[];for(let B=1;B<O.length-1;B++)L.push(M.table[O[B]].node);return e.fromArray(S(L))},e.rawSplit=function(k){return e.fromArray(x(k,f.isKanjiModeEnabled()))}})(Vg)),Vg}var k_;function CP(){if(k_)return Tg;k_=1;const e=vo(),n=gb(),s=cP(),r=uP(),i=dP(),c=fP(),d=pP(),f=BC(),p=hP(),m=xP(),g=bP(),x=yo(),y=wP();function S(M,O){const L=M.size,B=c.getPositions(O);for(let I=0;I<B.length;I++){const D=B[I][0],z=B[I][1];for(let H=-1;H<=7;H++)if(!(D+H<=-1||L<=D+H))for(let V=-1;V<=7;V++)z+V<=-1||L<=z+V||(H>=0&&H<=6&&(V===0||V===6)||V>=0&&V<=6&&(H===0||H===6)||H>=2&&H<=4&&V>=2&&V<=4?M.set(D+H,z+V,!0,!0):M.set(D+H,z+V,!1,!0))}}function w(M){const O=M.size;for(let L=8;L<O-8;L++){const B=L%2===0;M.set(L,6,B,!0),M.set(6,L,B,!0)}}function j(M,O){const L=i.getPositions(O);for(let B=0;B<L.length;B++){const I=L[B][0],D=L[B][1];for(let z=-2;z<=2;z++)for(let H=-2;H<=2;H++)z===-2||z===2||H===-2||H===2||z===0&&H===0?M.set(I+z,D+H,!0,!0):M.set(I+z,D+H,!1,!0)}}function _(M,O){const L=M.size,B=m.getEncodedBits(O);let I,D,z;for(let H=0;H<18;H++)I=Math.floor(H/3),D=H%3+L-8-3,z=(B>>H&1)===1,M.set(I,D,z,!0),M.set(D,I,z,!0)}function C(M,O,L){const B=M.size,I=g.getEncodedBits(O,L);let D,z;for(D=0;D<15;D++)z=(I>>D&1)===1,D<6?M.set(D,8,z,!0):D<8?M.set(D+1,8,z,!0):M.set(B-15+D,8,z,!0),D<8?M.set(8,B-D-1,z,!0):D<9?M.set(8,15-D-1+1,z,!0):M.set(8,15-D-1,z,!0);M.set(B-8,8,1,!0)}function k(M,O){const L=M.size;let B=-1,I=L-1,D=7,z=0;for(let H=L-1;H>0;H-=2)for(H===6&&H--;;){for(let V=0;V<2;V++)if(!M.isReserved(I,H-V)){let Y=!1;z<O.length&&(Y=(O[z]>>>D&1)===1),M.set(I,H-V,Y),D--,D===-1&&(z++,D=7)}if(I+=B,I<0||L<=I){I-=B,B=-B;break}}}function R(M,O,L){const B=new s;L.forEach(function(V){B.put(V.mode.bit,4),B.put(V.getLength(),x.getCharCountIndicator(V.mode,M)),V.write(B)});const I=e.getSymbolTotalCodewords(M),D=f.getTotalCodewordsCount(M,O),z=(I-D)*8;for(B.getLengthInBits()+4<=z&&B.put(0,4);B.getLengthInBits()%8!==0;)B.putBit(0);const H=(z-B.getLengthInBits())/8;for(let V=0;V<H;V++)B.put(V%2?17:236,8);return N(B,M,O)}function N(M,O,L){const B=e.getSymbolTotalCodewords(O),I=f.getTotalCodewordsCount(O,L),D=B-I,z=f.getBlocksCount(O,L),H=B%z,V=z-H,Y=Math.floor(B/z),q=Math.floor(D/z),F=q+1,Z=Y-q,$=new p(Z);let X=0;const U=new Array(z),K=new Array(z);let G=0;const W=new Uint8Array(M.buffer);for(let ee=0;ee<z;ee++){const Te=ee<V?q:F;U[ee]=W.slice(X,X+Te),K[ee]=$.encode(U[ee]),X+=Te,G=Math.max(G,Te)}const ie=new Uint8Array(B);let re=0,oe,ce;for(oe=0;oe<G;oe++)for(ce=0;ce<z;ce++)oe<U[ce].length&&(ie[re++]=U[ce][oe]);for(oe=0;oe<Z;oe++)for(ce=0;ce<z;ce++)ie[re++]=K[ce][oe];return ie}function A(M,O,L,B){let I;if(Array.isArray(M))I=y.fromArray(M);else if(typeof M=="string"){let Y=O;if(!Y){const q=y.rawSplit(M);Y=m.getBestVersionForData(q,L)}I=y.fromString(M,Y||40)}else throw new Error("Invalid data");const D=m.getBestVersionForData(I,L);if(!D)throw new Error("The amount of data is too big to be stored in a QR Code");if(!O)O=D;else if(O<D)throw new Error(`
|
|
589
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
590
|
-
Minimum version required to store current data is: `+D+`.
|
|
591
|
-
`);const z=R(O,L,I),H=e.getSymbolSize(O),V=new r(H);return S(V,O),w(V),j(V,O),C(V,L,0),O>=7&&_(V,O),k(V,z),isNaN(B)&&(B=d.getBestMask(V,C.bind(null,V,L))),d.applyMask(B,V),C(V,L,B),{modules:V,version:O,errorCorrectionLevel:L,maskPattern:B,segments:I}}return Tg.create=function(O,L){if(typeof O>"u"||O==="")throw new Error("No input text");let B=n.M,I,D;return typeof L<"u"&&(B=n.from(L.errorCorrectionLevel,n.M),I=m.from(L.version),D=d.from(L.maskPattern),L.toSJISFunc&&e.setToSJISFunction(L.toSJISFunc)),A(O,I,B,D)},Tg}var Kg={},Qg={},E_;function qC(){return E_||(E_=1,(function(e){function n(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let r=s.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+s);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(c){return[c,c]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,c=r.width&&r.width>=21?r.width:void 0,d=r.scale||4;return{width:c,scale:c?4:d,margin:i,color:{dark:n(r.color.dark||"#000000ff"),light:n(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},e.getImageWidth=function(r,i){const c=e.getScale(r,i);return Math.floor((r+i.margin*2)*c)},e.qrToImageData=function(r,i,c){const d=i.modules.size,f=i.modules.data,p=e.getScale(d,c),m=Math.floor((d+c.margin*2)*p),g=c.margin*p,x=[c.color.light,c.color.dark];for(let y=0;y<m;y++)for(let S=0;S<m;S++){let w=(y*m+S)*4,j=c.color.light;if(y>=g&&S>=g&&y<m-g&&S<m-g){const _=Math.floor((y-g)/p),C=Math.floor((S-g)/p);j=x[f[_*d+C]?1:0]}r[w++]=j.r,r[w++]=j.g,r[w++]=j.b,r[w]=j.a}}})(Qg)),Qg}var N_;function kP(){return N_||(N_=1,(function(e){const n=qC();function s(i,c,d){i.clearRect(0,0,c.width,c.height),c.style||(c.style={}),c.height=d,c.width=d,c.style.height=d+"px",c.style.width=d+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(c,d,f){let p=f,m=d;typeof p>"u"&&(!d||!d.getContext)&&(p=d,d=void 0),d||(m=r()),p=n.getOptions(p);const g=n.getImageWidth(c.modules.size,p),x=m.getContext("2d"),y=x.createImageData(g,g);return n.qrToImageData(y.data,c,p),s(x,m,g),x.putImageData(y,0,0),m},e.renderToDataURL=function(c,d,f){let p=f;typeof p>"u"&&(!d||!d.getContext)&&(p=d,d=void 0),p||(p={});const m=e.render(c,d,p),g=p.type||"image/png",x=p.rendererOpts||{};return m.toDataURL(g,x.quality)}})(Kg)),Kg}var Zg={},R_;function EP(){if(R_)return Zg;R_=1;const e=qC();function n(i,c){const d=i.a/255,f=c+'="'+i.hex+'"';return d<1?f+" "+c+'-opacity="'+d.toFixed(2).slice(1)+'"':f}function s(i,c,d){let f=i+c;return typeof d<"u"&&(f+=" "+d),f}function r(i,c,d){let f="",p=0,m=!1,g=0;for(let x=0;x<i.length;x++){const y=Math.floor(x%c),S=Math.floor(x/c);!y&&!m&&(m=!0),i[x]?(g++,x>0&&y>0&&i[x-1]||(f+=m?s("M",y+d,.5+S+d):s("m",p,0),p=0,m=!1),y+1<c&&i[x+1]||(f+=s("h",g),g=0)):p++}return f}return Zg.render=function(c,d,f){const p=e.getOptions(d),m=c.modules.size,g=c.modules.data,x=m+p.margin*2,y=p.color.light.a?"<path "+n(p.color.light,"fill")+' d="M0 0h'+x+"v"+x+'H0z"/>':"",S="<path "+n(p.color.dark,"stroke")+' d="'+r(g,m,p.margin)+'"/>',w='viewBox="0 0 '+x+" "+x+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+w+' shape-rendering="crispEdges">'+y+S+`</svg>
|
|
592
|
-
`;return typeof f=="function"&&f(null,_),_},Zg}var T_;function NP(){if(T_)return ol;T_=1;const e=iP(),n=CP(),s=kP(),r=EP();function i(c,d,f,p,m){const g=[].slice.call(arguments,1),x=g.length,y=typeof g[x-1]=="function";if(!y&&!e())throw new Error("Callback required as last argument");if(y){if(x<2)throw new Error("Too few arguments provided");x===2?(m=f,f=d,d=p=void 0):x===3&&(d.getContext&&typeof m>"u"?(m=p,p=void 0):(m=p,p=f,f=d,d=void 0))}else{if(x<1)throw new Error("Too few arguments provided");return x===1?(f=d,d=p=void 0):x===2&&!d.getContext&&(p=f,f=d,d=void 0),new Promise(function(S,w){try{const j=n.create(f,p);S(c(j,d,p))}catch(j){w(j)}})}try{const S=n.create(f,p);m(null,c(S,d,p))}catch(S){m(S)}}return ol.create=n.create,ol.toCanvas=i.bind(null,s.render),ol.toDataURL=i.bind(null,s.renderToDataURL),ol.toString=i.bind(null,function(c,d,f){return r.render(c,f)}),ol}var RP=NP();const TP=Vh(RP);function AP({value:e,size:n=200}){const[s,r]=b.useState(null);return b.useEffect(()=>{let i=!0;return TP.toDataURL(e,{margin:2,width:n*2,errorCorrectionLevel:"M"}).then(c=>{i&&r(c)}).catch(()=>{i&&r(null)}),()=>{i=!1}},[e,n]),o.jsx("div",{className:"grid place-items-center rounded-lg bg-white p-3",style:{width:n+24,height:n+24},children:s?o.jsx("img",{src:s,width:n,height:n,alt:"QR"}):o.jsx("div",{className:"size-full animate-pulse rounded bg-muted"})})}function MP(e){return e.find(n=>!n.includes("127.0.0.1")&&!n.includes("localhost"))||e[0]||window.location.origin}function OP({open:e,onClose:n,onPaired:s}){const r=lt(),[i,c]=b.useState(null),[d,f]=b.useState(null),[p,m]=b.useState(0),[g,x]=b.useState(!1),y=b.useRef(null),S=b.useCallback(async()=>{c(null),f(null),x(!1);try{const k=await wl.init();c(k),m(Math.round((k.ttl_ms||9e4)/1e3))}catch(k){k instanceof Tc&&k.status===403?f(E("settings.devices_pair_localhost_only")):f(k.message)}},[]);b.useEffect(()=>{e?S():(c(null),f(null),x(!1))},[e,S]),b.useEffect(()=>{if(!i||g||p<=0)return;const k=window.setTimeout(()=>m(R=>R-1),1e3);return()=>window.clearTimeout(k)},[i,p,g]),b.useEffect(()=>{if(!e||!i||g)return;let k=!0;const R=async()=>{try{const N=await wl.status(i.pairing_id);if(!k)return;if(N.status==="confirmed"){x(!0),r.success(E("settings.devices_pair_done")),s(),window.setTimeout(()=>{k&&n()},900);return}if(N.status==="expired"||N.status==="unknown"){m(0);return}}catch{}y.current=window.setTimeout(R,1500)};return y.current=window.setTimeout(R,1500),()=>{k=!1,y.current&&window.clearTimeout(y.current)}},[e,i,g,n,s,r]);const w=!!i&&!g&&p<=0,j=i?MP(i.lan_urls):"",_=i?`${j}/#pair=${i.pairing_id}`:"",C=async(k,R)=>{try{await navigator.clipboard.writeText(k),r.success(R)}catch{r.error(k)}};return o.jsxs(ba,{open:e,onClose:n,title:E("settings.devices_pair_title"),description:E("settings.devices_pair_desc"),footer:o.jsx(ve,{variant:"secondary",onClick:n,children:E("common.close")}),children:[d&&o.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:d}),!d&&!i&&o.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-muted-fg",children:[o.jsx(Oa,{})," ",E("common.loading")]}),!d&&i&&o.jsxs("div",{className:"flex flex-col items-center gap-4",children:[o.jsx("div",{className:w?"opacity-40":"",children:o.jsx(AP,{value:_,size:196})}),g?o.jsx("p",{className:"text-sm font-medium text-emerald-500",children:E("settings.devices_pair_done")}):w?o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-fg",children:E("settings.devices_pair_expired")}),o.jsx(ve,{variant:"primary",onClick:()=>void S(),children:E("settings.devices_pair_regen")})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-center text-xs text-muted-fg",children:E("settings.devices_pair_scan")}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-fg",children:[o.jsx(Oa,{size:12}),o.jsx("span",{children:E("settings.devices_pair_waiting")}),o.jsxs("span",{className:"tabular-nums",children:["· ",E("settings.devices_pair_expires",{s:p})]})]}),o.jsxs("div",{className:"w-full space-y-3 border-t border-border pt-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs text-muted-fg",children:E("settings.devices_pair_link")}),o.jsxs("div",{className:"flex items-stretch gap-2",children:[o.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-3 py-2 text-xs",children:_}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>C(_,E("settings.devices_pair_copied")),title:E("settings.devices_pair_copy"),children:o.jsx(Nd,{size:14})})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs text-muted-fg",children:E("settings.devices_pair_code")}),o.jsxs("div",{className:"flex items-stretch gap-2",children:[o.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-3 py-2 text-center text-sm",children:i.pairing_id}),o.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>C(i.pairing_id,E("settings.devices_pair_copied_code")),title:E("settings.devices_pair_copy"),children:o.jsx(Nd,{size:14})})]})]})]})]})]})]})}function zP(){const e=lt(),{clients:n,isLoading:s,mutate:r}=lP(),[i,c]=b.useState(!1),d=async f=>{if(confirm(E("settings.devices_revoke_confirm",{id:f})))try{await wl.revoke(f),e.success("Cliente revocado."),r()}catch(p){e.error(p.message)}};return o.jsxs(Ye,{title:E("settings.devices"),description:E("settings.devices_sub"),action:o.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>c(!0),children:[o.jsx(GT,{size:14})," ",E("settings.devices_pair_btn")]}),children:[s&&o.jsx(nt,{}),!s&&n.length===0&&o.jsx(dt,{children:E("settings.devices_empty")}),n.length>0&&o.jsx("ul",{className:"space-y-2 text-sm",children:n.map(f=>o.jsxs("li",{className:"flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2",children:[o.jsx("span",{className:"font-medium",children:f.label||f.id}),o.jsx(Xe,{tone:f.kind==="web"?"info":f.kind==="deck"?"success":"muted",children:f.kind}),o.jsxs("span",{className:"font-mono text-xs text-muted-fg",children:["…",f.token_suffix]}),o.jsxs("span",{className:"ml-auto text-xs text-muted-fg",children:["visto: ",f.last_seen?new Date(f.last_seen).toLocaleString():"nunca"]}),o.jsx(ve,{size:"sm",variant:"destructive",onClick:()=>d(f.id),children:"Revocar"})]},f.id))}),o.jsx(OP,{open:i,onClose:()=>c(!1),onPaired:()=>r()})]})}const DP=[{key:"daemon",label:"Daemon",description:"~/.apx/config.json. Config general APX.",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:"Idioma",placeholder:"es"},{path:"user.locale",label:"Locale",placeholder:"es-AR"},{path:"user.timezone",label:"Timezone",placeholder:"America/Argentina/Salta"}]},{key:"super-agent",label:"Super-agente",fields:[{path:"super_agent.enabled",label:"Super-agente habilitado",kind:"boolean"},{path:"super_agent.model",label:"Modelo",placeholder:"gemini:gemini-2.5-flash"},{path:"super_agent.permission_mode",label:"Permission mode",kind:"select",options:sx.map(e=>({value:e,label:e}))},{path:"super_agent.system",label:"Prompt extra",kind:"textarea"}]},{key:"telegram",label:"Telegram",fields:[{path:"telegram.enabled",label:"Polling habilitado",kind:"boolean"},{path:"telegram.poll_interval_ms",label:"Poll interval ms",kind:"number",placeholder:"1500"},{path:"telegram.respond_with_engine",label:"Responder con 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 LP(){const{config:e,isLoading:n,patch:s,mutate:r}=Ar();if(n)return o.jsx(nt,{});const i=async c=>{const d={};for(const[f,p]of Object.entries(ib(c)))Ua(p)||(d[f]=p);await s(d),r()};return o.jsx(Ye,{title:"Config APX",description:"Config general en ~/.apx/config.json. Editable por tabs; JSON queda separado.",children:o.jsx(Lh,{sections:DP,source:e,jsonTitle:"~/.apx/config.json",jsonDescription:"Secretos redacted no se sobrescriben.",onSaveFields:async(c,d)=>{await s(c,d),r()},onSaveJson:i})})}function PP(){const e=lt(),{health:n,isUp:s}=Y2(),r=async()=>{try{await Sl.reload(),e.success("Config recargada.")}catch(i){e.error(i.message)}};return o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ye,{title:E("daemon.version"),action:o.jsx(ve,{size:"sm",onClick:r,children:E("common.reload")}),children:o.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[o.jsx(Jg,{label:E("daemon.version"),value:n?.version||"—"}),o.jsx(Jg,{label:E("daemon.uptime"),value:n?`${n.uptime_s}s`:"—"}),o.jsx(Jg,{label:E("daemon.status"),value:E(s?"daemon.running":"daemon.down"),ok:s})]})}),o.jsx(LP,{})]})}function Jg({label:e,value:n,ok:s}){return o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[o.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-fg",children:e}),o.jsxs("div",{className:"mt-1 flex items-center gap-2 text-base font-medium",children:[s!==void 0&&o.jsx(Sf,{ok:s}),o.jsx("span",{children:n})]})]})}function IP(){const e=lt(),{theme:n,set:s}=rx(),[r,i]=b.useState(""),[c,d]=b.useState(s4()),f=()=>{const m=r.trim();if(m){eo(m);try{localStorage.setItem(Nn.token,m)}catch{}i(""),e.success(E("settings.token_saved"))}},p=m=>{n4(m),d(m),window.location.reload()};return o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ye,{title:E("settings.appearance"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ve,{variant:n==="light"?"primary":"secondary",onClick:()=>s("light"),children:E("settings.light_mode")}),o.jsx(ve,{variant:n==="dark"?"primary":"secondary",onClick:()=>s("dark"),children:E("settings.dark_mode")})]})}),o.jsx(Ye,{title:E("settings.language"),children:o.jsx("div",{className:"flex items-center gap-2",children:a4.map(m=>o.jsx(ve,{variant:c===m.value?"primary":"secondary",onClick:()=>p(m.value),children:m.label},m.value))})}),o.jsxs(Ye,{title:E("settings.token"),description:E("settings.token_sub"),children:[o.jsx(fe,{label:"Bearer",children:o.jsx(Re,{type:"password",placeholder:qx()?E("settings.token_active"):E("settings.token_paste"),value:r,onChange:m=>i(m.target.value),className:"font-mono",onKeyDown:m=>{m.key==="Enter"&&f()}})}),o.jsx("div",{className:"mt-2",children:o.jsx(ve,{variant:"primary",onClick:f,children:E("common.save")})})]})]})}const BP=[{title:E("settings.account_section"),items:[{key:"identity",label:E("settings.tabs.identity"),icon:PS},{key:"appearance",label:E("settings.appearance"),icon:qT}]},{title:E("settings.agents_section"),items:[{key:"super_agent",label:E("settings.tabs.super_agent"),icon:vn},{key:"engines",label:E("settings.tabs.engines"),icon:Wh},{key:"memory",label:"Memoria (RAG)",icon:NS}]},{title:E("settings.channels_section"),items:[{key:"telegram",label:E("settings.tabs.telegram"),icon:ss},{key:"devices",label:E("settings.tabs.devices"),icon:YT}]},{title:E("settings.advanced_section"),items:[{key:"advanced",label:E("settings.tabs.advanced"),icon:lh}]}],UP=new Set(["engines","telegram"]),HP={identity:()=>o.jsx(ZL,{}),super_agent:()=>o.jsx(JL,{}),engines:()=>o.jsx(yC,{}),memory:()=>o.jsx(tP,{}),telegram:()=>o.jsx(oP,{}),devices:()=>o.jsx(zP,{}),appearance:()=>o.jsx(IP,{}),advanced:()=>o.jsx(PP,{})};function qP(){const e=$a(),n=ra(),s=VP(n.pathname),r=HP[s],{collapsed:i,toggle:c}=Z2(Nn.sidebarCollapsed+".settings");return o.jsx(sC,{sections:BP,active:s,onChange:d=>e(d==="identity"?"/settings":`/settings/${$P(d)}`),collapsed:i,onToggleCollapse:c,contentClassName:`mx-auto w-full ${UP.has(s)?"max-w-6xl":"max-w-3xl"} space-y-6 p-6 pt-3`,testId:`settings-tab-${s}`,children:o.jsx(r,{})})}function VP(e){switch(e.split("/").filter(Boolean)[1]||"identity"){case"super-agent":return"super_agent";case"engines":return"engines";case"memory":return"memory";case"telegram":return"telegram";case"devices":return"devices";case"appearance":return"appearance";case"config":case"advanced":return"advanced";default:return"identity"}}function $P(e){return e==="super_agent"?"super-agent":e==="advanced"?"config":e}function GP({engines:e,order:n,mode:s,configuredProvider:r,onSetMode:i,onSetDefault:c,onToggleEnabled:d,onReorder:f,onConfigure:p,busy:m}){const g=new Map(e.map(w=>[w.id,w])),x=[...n.filter(w=>g.has(w)),...e.map(w=>w.id).filter(w=>!n.includes(w))],y=s==="chain",S=(w,j)=>{const _=x.indexOf(w),C=_+j;if(_<0||C<0||C>=x.length)return;const k=[...x];[k[_],k[C]]=[k[C],k[_]],f(k)};return o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"rounded-lg border border-border p-3",children:o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium",children:"Modo de selección"}),o.jsx("div",{className:"text-xs text-muted-fg",children:y?"Cadena con fallback: usa el primer motor disponible según el orden de abajo.":"Solo el motor por defecto: usa siempre el elegido; los demás quedan configurados para otras cosas."})]}),o.jsxs("div",{className:"flex shrink-0 overflow-hidden rounded-md border border-border",role:"group",children:[o.jsx("button",{type:"button",onClick:()=>i("chain"),disabled:m,"data-testid":"voice-mode-chain",className:Oe("px-3 py-1.5 text-xs font-medium transition-colors",y?"bg-emerald-500/15 text-emerald-300":"text-muted-fg hover:text-fg"),children:"Cadena (router)"}),o.jsx("button",{type:"button",onClick:()=>i("single"),disabled:m,"data-testid":"voice-mode-single",className:Oe("border-l border-border px-3 py-1.5 text-xs font-medium transition-colors",y?"text-muted-fg hover:text-fg":"bg-emerald-500/15 text-emerald-300"),children:"Solo el motor por defecto"})]})]})}),o.jsx("div",{className:"space-y-2",children:x.map((w,j)=>{const _=g.get(w),C=Gd[w]||{name:w,note:""},k=!y&&r===w,R=w==="mock";return o.jsxs("div",{"data-testid":`voice-provider-${w}`,className:Oe("flex items-center gap-3 rounded-lg border px-3 py-2.5",k?"border-emerald-500/50 bg-emerald-500/10":"border-border",y&&!R&&!_.enabled&&"opacity-60"),children:[y&&o.jsxs("div",{className:"flex flex-col",children:[o.jsx("button",{type:"button",onClick:()=>S(w,-1),disabled:m||j===0,"aria-label":"Subir","data-testid":`voice-provider-${w}-up`,className:"text-muted-fg hover:text-fg disabled:opacity-30",children:o.jsx(kS,{className:"size-3.5"})}),o.jsx("button",{type:"button",onClick:()=>S(w,1),disabled:m||j===x.length-1,"aria-label":"Bajar","data-testid":`voice-provider-${w}-down`,className:"text-muted-fg hover:text-fg disabled:opacity-30",children:o.jsx(ho,{className:"size-3.5"})})]}),o.jsx(Sf,{ok:_.available?!0:_.configured?!1:null}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium",children:C.name}),C.local&&o.jsx(Xe,{tone:"info",children:"local"}),_.available?o.jsx(Xe,{tone:"success",children:"disponible"}):_.configured?o.jsx(Xe,{tone:"warning",children:"configurado, no disponible"}):o.jsx(Xe,{tone:"muted",children:"sin configurar"}),k&&o.jsx(Xe,{tone:"success",children:"por defecto"})]}),o.jsx("div",{className:"truncate text-xs text-muted-fg",children:C.note})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[y?o.jsx(cn,{checked:R?!0:_.enabled,onChange:N=>d(w,N),disabled:m||R}):!k&&o.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>c(w),disabled:m,"data-testid":`voice-provider-${w}-default`,children:[o.jsx(dT,{className:"size-3.5"})," Usar por defecto"]}),k&&o.jsx(ES,{className:"size-4 text-emerald-400"}),o.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>p(w),"data-testid":`voice-provider-${w}-config`,children:[o.jsx(FT,{className:"size-3.5"})," Configurar"]})]})]},w)})})]})}function Ra(e){return typeof e=="string"?e:e==null?"":String(e)}function FP({open:e,providerId:n,config:s,onClose:r,onSave:i}){const[c,d]=b.useState(!1),[f,p]=b.useState(null),[m,g]=b.useState(""),[x,y]=b.useState({});if(b.useEffect(()=>{if(!e||!n)return;p(null),g("");const N=s||{};if(n==="piper"){const A=N;y({bin:Ra(A.bin),model:Ra(A.model),speaker:Ra(A.speaker)})}else if(n==="elevenlabs"){const A=N;y({model:Ra(A.model),voice_id:Ra(A.voice_id),output_format:Ra(A.output_format)})}else if(n==="openai"){const A=N;y({model:Ra(A.model)||"tts-1",voice:Ra(A.voice)||"alloy",format:Ra(A.format)||"mp3"})}else if(n==="gemini"){const A=N;y({model:Ra(A.model),voice:Ra(A.voice)||"Kore",style:Ra(A.style)})}else y({})},[e,n,s]),!n)return null;const S=Gd[n],w=`voice.tts.${n}`,j=N=>y(A=>({...A,...N})),_=n!=="piper"&&n!=="mock",C=_&&Ua(s?.api_key),k=C?`…${Cl(s?.api_key)??""} (ya seteada)`:"API key",R=async()=>{d(!0),p(null);try{const N={},A=[],M=(O,L)=>{L.trim()?N[`${w}.${O}`]=L.trim():A.push(`${w}.${O}`)};n==="piper"?(M("bin",x.bin),M("model",x.model),x.speaker.trim()?N[`${w}.speaker`]=x.speaker.trim():A.push(`${w}.speaker`)):n==="elevenlabs"?(M("model",x.model),M("voice_id",x.voice_id),M("output_format",x.output_format)):n==="openai"?(M("model",x.model),M("voice",x.voice),M("format",x.format)):n==="gemini"&&(M("model",x.model),M("voice",x.voice),M("style",x.style)),_&&m.trim()&&(N[`${w}.api_key`]=m.trim()),await i({set:N,unset:A}),r()}catch(N){p(N.message||"Error al guardar.")}finally{d(!1)}};return o.jsx(ba,{open:e,onClose:r,title:`Configurar ${S?.name||n}`,description:S?.note,size:"md",footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:r,disabled:c,children:"Cancelar"}),o.jsx(ve,{variant:"primary",onClick:R,loading:c,"data-testid":"voice-provider-save",children:"Guardar"})]}),children:o.jsxs("div",{className:"space-y-3",children:[n==="piper"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"Binario (bin)",hint:"Ruta o nombre del CLI piper (PATH).",children:o.jsx(Re,{value:x.bin,onChange:N=>j({bin:N.target.value}),placeholder:"piper"})}),o.jsx(fe,{label:"Modelo (.onnx)",hint:"Ruta absoluta al modelo de voz piper.",children:o.jsx(Re,{value:x.model,onChange:N=>j({model:N.target.value}),placeholder:"/abs/path/voz.onnx"})}),o.jsx(fe,{label:"Speaker (opcional)",hint:"Id de hablante para modelos multi-voz.",children:o.jsx(Re,{value:x.speaker,onChange:N=>j({speaker:N.target.value}),placeholder:"0"})})]}),n==="elevenlabs"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"API key",hint:C?"Dejá en blanco para mantener la actual.":"Se guarda como secreto. Env: ELEVENLABS_API_KEY",children:o.jsx(Re,{type:"password",autoComplete:"new-password",value:m,onChange:N=>g(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",children:o.jsx(kt,{value:x.model||"",onChange:N=>j({model:N}),options:XO.map(N=>({value:N,label:N})),placeholder:"eleven_multilingual_v2"})}),o.jsx(fe,{label:"Voice ID",hint:"Id de la voz de ElevenLabs (vacío = default).",children:o.jsx(Re,{value:x.voice_id,onChange:N=>j({voice_id:N.target.value}),placeholder:"EXAVITQu4vr4xnSDxMaL"})}),o.jsx(fe,{label:"Formato de salida",children:o.jsx(Re,{value:x.output_format,onChange:N=>j({output_format:N.target.value}),placeholder:"mp3_44100_128"})})]}),n==="openai"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"API key",hint:C?"Dejá en blanco para mantener la actual.":"Se reusa engines.openai.api_key si la dejás en blanco. Env: OPENAI_API_KEY",children:o.jsx(Re,{type:"password",autoComplete:"new-password",value:m,onChange:N=>g(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",children:o.jsx(kt,{value:x.model||"tts-1",onChange:N=>j({model:N}),options:KO.map(N=>({value:N,label:N}))})}),o.jsx(fe,{label:"Voz",children:o.jsx(kt,{value:x.voice||"alloy",onChange:N=>j({voice:N}),options:FO.map(N=>({value:N,label:N}))})}),o.jsx(fe,{label:"Formato",children:o.jsx(kt,{value:x.format||"mp3",onChange:N=>j({format:N}),options:["mp3","opus","aac","flac","wav"].map(N=>({value:N,label:N}))})})]}),n==="gemini"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"API key",hint:C?"Dejá en blanco para mantener la actual.":"Se reusa engines.gemini.api_key si la dejás en blanco. Env: GEMINI_API_KEY",children:o.jsx(Re,{type:"password",autoComplete:"new-password",value:m,onChange:N=>g(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",hint:"TTS de Gemini sigue en preview.",children:o.jsx(Re,{value:x.model,onChange:N=>j({model:N.target.value}),placeholder:"gemini-2.5-flash-preview-tts"})}),o.jsx(fe,{label:"Voz",children:o.jsx(kt,{value:x.voice||"Kore",onChange:N=>j({voice:N}),options:YO.map(N=>({value:N,label:N}))})}),o.jsx(fe,{label:"Estilo (cómo querés que hable)",hint:"Instrucción en lenguaje natural. Vacío = sin estilo. Ej: 'hablá en tono alegre y pausado'.",children:o.jsx(en,{rows:2,value:x.style||"",onChange:N=>j({style:N.target.value}),placeholder:"hablá en tono alegre y enérgico"})})]}),n==="mock"&&o.jsxs("p",{className:"text-sm text-muted-fg",children:["El motor ",o.jsx("strong",{children:"mock"})," genera un WAV silencioso de prueba. No tiene parámetros: sirve como fallback garantizado cuando no hay otro motor configurado."]}),f&&o.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:f})]})})}function YP(){const e=b.useRef(null),n=b.useRef(null),[s,r]=b.useState(!1),[i,c]=b.useState(!1),d=b.useCallback(()=>{n.current&&(URL.revokeObjectURL(n.current),n.current=null)},[]);b.useEffect(()=>()=>{e.current&&(e.current.pause(),e.current=null),d()},[d]);const f=b.useCallback(async m=>{c(!0);try{d();const g=await ZO(m);n.current=g,e.current||(e.current=new Audio);const x=e.current;x.src=g,x.onended=()=>r(!1),x.onerror=()=>r(!1),await x.play(),r(!0)}finally{c(!1)}},[d]),p=b.useCallback(()=>{e.current&&(e.current.pause(),e.current.currentTime=0),r(!1)},[]);return{play:f,stop:p,playing:s,loading:i}}function XP({engines:e,defaultProvider:n,mode:s}){const r=lt(),{play:i,stop:c,playing:d,loading:f}=YP(),[p,m]=b.useState("Hola, soy APX. Esto es una prueba de voz."),[g,x]=b.useState(""),[y,S]=b.useState(""),[w,j]=b.useState(!1),[_,C]=b.useState(null),R=[{value:"",label:s==="single"&&n&&n!=="auto"?`Por defecto (${Gd[n]?.name||n})`:"Por defecto (cadena)"},...e.map(A=>({value:A.id,label:`${Gd[A.id]?.name||A.id}${A.available?"":" · no disponible"}`}))],N=async()=>{const A=p.trim();if(!A){r.error("Escribí algo para decir.");return}j(!0);try{const M=await w2.say({text:A,provider:g||void 0,style:y.trim()||void 0});C(M),await i(M.audio_path)}catch(M){r.error(M.message||"No se pudo sintetizar.")}finally{j(!1)}};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsx(fe,{label:"Motor",hint:"Override del por defecto para probar.",children:o.jsx(kt,{value:g,onChange:x,options:R})}),o.jsx(fe,{label:"Estilo (solo Gemini)",hint:"Cómo querés que hable. Vacío = sin estilo.",children:o.jsx(Re,{value:y,onChange:A=>S(A.target.value),placeholder:"hablá en tono alegre y enérgico","data-testid":"voice-test-style"})})]}),o.jsx(fe,{label:"Texto a decir",children:o.jsx(en,{rows:2,value:p,onChange:A=>m(A.target.value),placeholder:"Escribí lo que querés que diga…","data-testid":"voice-test-input"})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ve,{variant:"primary",onClick:N,loading:w,disabled:f,"data-testid":"voice-test-say",children:[o.jsx(ZT,{className:"size-4"})," Decir esto"]}),d?o.jsxs(ve,{variant:"secondary",onClick:c,"data-testid":"voice-test-stop",children:[o.jsx(DS,{className:"size-4"})," Parar"]}):_?o.jsxs(ve,{variant:"secondary",onClick:()=>i(_.audio_path),loading:f,"data-testid":"voice-test-replay",children:[o.jsx(nx,{className:"size-4"})," Repetir"]}):null,_&&o.jsxs("span",{className:"text-xs text-muted-fg",children:["Motor: ",o.jsx("strong",{children:_.provider}),_.duration_s?` · ${_.duration_s.toFixed(1)}s`:""]})]})]})}const KP=[{value:"auto",label:"Automático (local, luego OpenAI)"},{value:"local",label:"Local — faster-whisper (offline)"},{value:"openai",label:"OpenAI — Whisper-1 (cloud)"}],QP=[{value:"auto",label:"Auto-detectar"},{value:"es",label:"Español"},{value:"en",label:"Inglés"},{value:"pt",label:"Portugués"},{value:"fr",label:"Francés"},{value:"it",label:"Italiano"},{value:"de",label:"Alemán"}];function ZP({config:e,onPatch:n,busy:s}){const r=e.provider||"auto",i=e.local||{},c=i.model||"small",d=i.language||"auto",f=r!=="openai";return o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"Motor de transcripción",hint:"Local usa faster-whisper (requiere python3 + faster-whisper). OpenAI usa la key de engines.openai.",children:o.jsx(kt,{value:r,onChange:p=>n({"transcription.provider":p}),options:KP,disabled:s,className:"max-w-md"})}),f&&o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsx(fe,{label:"Modelo local (whisper)",hint:"Más grande = más preciso y más lento.",children:o.jsx(kt,{value:c,onChange:p=>n({"transcription.local.model":p}),options:QO.map(p=>({value:p,label:p})),disabled:s})}),o.jsx(fe,{label:"Idioma",hint:'Para español, fijá "Español" mejora la precisión.',children:o.jsx(kt,{value:d,onChange:p=>n({"transcription.local.language":p}),options:QP,disabled:s})})]})]})}function JP(){const e=lt(),{config:n,isLoading:s,patch:r,mutate:i}=Ar(),{data:c,isLoading:d,error:f,mutate:p}=Je("/tts/providers",()=>w2.providers()),[m,g]=b.useState(null),[x,y]=b.useState(!1),S=n,w=S.voice?.tts||{},j=S.transcription||{},_=c?.configured_provider||w.provider||"auto",C=c?.mode||w.mode||"chain",k=c?.engines||[],R=c?.order||[],N=b.useMemo(()=>m?w[m]||{}:{},[m,w]),A=async D=>{y(!0);try{await r({"voice.tts.provider":D,"voice.tts.mode":"single"}),await p(),e.success(`Motor por defecto: ${D}.`)}catch(z){e.error(z.message)}finally{y(!1)}},M=async D=>{y(!0);try{const z={"voice.tts.mode":D};if(D==="single"&&(_==="auto"||!_)){const H=k.find(V=>V.available)?.id||R[0]||"mock";z["voice.tts.provider"]=H}await r(z),await p(),e.success(D==="chain"?"Modo: cadena con fallback.":"Modo: solo el motor por defecto.")}catch(z){e.error(z.message)}finally{y(!1)}},O=async(D,z)=>{y(!0);try{await r({[`voice.tts.${D}.enabled`]:z}),await p()}catch(H){e.error(H.message)}finally{y(!1)}},L=async D=>{y(!0);try{await r({"voice.tts.order":D}),await p()}catch(z){e.error(z.message)}finally{y(!1)}},B=async({set:D,unset:z})=>{await r(D,z.length?z:void 0),await p(),await i(),e.success("Configuración de voz guardada.")},I=async(D,z)=>{try{await r(D,z),e.success("Transcripción actualizada.")}catch(H){e.error(H.message)}};return o.jsxs("div",{className:"mx-auto max-w-6xl p-6","data-testid":"screen-voice",children:[o.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[o.jsx(Ye,{title:"Proveedores de voz (TTS)",description:"Motores de síntesis. El estado lo reporta el daemon en vivo. Elegí cuál usar por defecto.",children:d||s?o.jsx(nt,{}):f?o.jsxs(dt,{children:["No se pudieron cargar los proveedores: ",f.message]}):o.jsx(GP,{engines:k,order:R,mode:C,configuredProvider:_,onSetMode:M,onSetDefault:A,onToggleEnabled:O,onReorder:L,onConfigure:D=>g(D),busy:x})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ye,{title:"Probar voz",description:"Elegí con qué motor sintetizar y, si aplica, cómo querés que hable.",children:o.jsx(XP,{engines:k,defaultProvider:_,mode:C})}),o.jsx(Ye,{title:"Transcripción (STT)",description:"Motor de voz a texto que usan el deck, Telegram y la CLI al escuchar.",children:s?o.jsx(nt,{}):o.jsx(ZP,{config:j,onPatch:I})})]})]}),o.jsx(FP,{open:!!m,providerId:m,config:N,onClose:()=>g(null),onSave:B})]})}const Wg={status:()=>he.get("/desktop/status"),autostartGet:()=>he.get("/desktop/autostart"),autostartSet:e=>he.post("/desktop/autostart",{enable:e})};function WP(e=30){return he.get(`/messages/global?channel=desktop&limit=${e}`)}const A_="CommandOrControl+G",e8=[{value:"left",label:"Izquierda"},{value:"center",label:"Centro"},{value:"right",label:"Derecha"}],t8=[{value:"light",label:"Claro"},{value:"dark",label:"Oscuro"}];function n8(){const e=lt(),{config:n,isLoading:s,patch:r}=Ar(),i=n,c=i.desktop?.shortcut||i.overlay?.shortcut||A_,d=i.desktop?.enabled!==!1,f=i.desktop?.theme||"light",p=i.desktop?.position||"right",{data:m,isLoading:g,mutate:x}=Je("/desktop/status",()=>Wg.status(),{refreshInterval:5e3}),y=!!m?.running,{data:S,mutate:w}=Je("/desktop/autostart",()=>Wg.autostartGet()),{data:j,isLoading:_,mutate:C}=Je("/messages/global?channel=desktop",()=>WP(40),{refreshInterval:8e3}),[k,R]=b.useState(c),[N,A]=b.useState(!1),[M,O]=b.useState(!1);b.useEffect(()=>R(c),[c]);const L=async()=>{const D=k.trim();if(!(!D||D===c)){A(!0);try{await r({"desktop.shortcut":D}),e.success("Atajo guardado. Reiniciá la ventana (apx desktop stop && start) para aplicarlo.")}catch(z){e.error(z.message)}finally{A(!1)}}},B=async(D,z,H)=>{A(!0);try{await r({[D]:z}),e.success(H)}catch(V){e.error(V.message)}finally{A(!1)}},I=async D=>{O(!0);try{await Wg.autostartSet(D),await w(),e.success(D?"Autostart activado para el próximo login.":"Autostart desactivado.")}catch(z){e.error(z.message)}finally{O(!1)}};return o.jsx("div",{className:"mx-auto max-w-6xl space-y-6 p-6","data-testid":"screen-desktop",children:o.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1fr_1fr]",children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Ye,{title:"Estado",description:"La ventana se lanza desde la terminal o por autostart.",children:[g?o.jsx(nt,{}):o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx(Sf,{ok:y}),o.jsx("span",{className:"font-medium",children:y?"En ejecución":"Detenida"}),o.jsx("button",{type:"button",onClick:()=>x(),className:"ml-2 text-xs text-muted-fg underline-offset-2 hover:underline",children:"refrescar"})]}),o.jsxs("p",{className:"mt-3 text-xs text-muted-fg",children:["Desde terminal: ",o.jsx(Cj,{children:"apx desktop start"})," · ",o.jsx(Cj,{children:"apx desktop --debug"})]})]}),o.jsx(Ye,{title:"Arranque automático",description:"Lanza la ventana al iniciar sesión del usuario. Equivalente a `apx desktop install` (no requiere sudo).",children:S?o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(cn,{checked:S.enabled,onChange:I,disabled:M,label:S.enabled?"Activado":"Desactivado"}),o.jsxs("span",{className:"text-xs text-muted-fg",children:["platform: ",S.platform]})]}):o.jsx(nt,{})}),o.jsx(Ye,{title:"Atajo de teclado",description:"Botón de acceso rápido global que muestra/oculta la ventana y arranca a escuchar.",children:s?o.jsx(nt,{}):o.jsxs("div",{className:"flex items-end gap-3",children:[o.jsx("div",{className:"flex-1",children:o.jsx(fe,{label:"Acelerador",hint:'Formato Electron, p. ej. "CommandOrControl+G" o "CommandOrControl+Shift+Space". Reiniciá la ventana para aplicar.',children:o.jsx(Re,{value:k,onChange:D=>R(D.target.value),onKeyDown:D=>{D.key==="Enter"&&L()},placeholder:A_,className:"max-w-md font-mono",disabled:N})})}),o.jsx(ve,{variant:"primary",onClick:L,loading:N,disabled:!k.trim()||k.trim()===c,children:"Guardar"})]})}),o.jsx(Ye,{title:"Apariencia",description:"Tema y posición de la ventana en la pantalla.",children:s?o.jsx(nt,{}):o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsx(fe,{label:"Tema",hint:"Reiniciá la ventana para aplicar.",children:o.jsx(kt,{value:f,onChange:D=>B("desktop.theme",D,`Tema: ${D}.`),options:t8,disabled:N})}),o.jsx(fe,{label:"Posición",hint:'"izquierda" / "centro" / "derecha" del borde superior.',children:o.jsx(kt,{value:p,onChange:D=>B("desktop.position",D,`Posición: ${D}.`),options:e8,disabled:N})})]})}),o.jsx(Ye,{title:"Activación + transcripción",description:"El plugin del daemon procesa los mensajes. STT se configura en Voces.",children:s?o.jsx(nt,{}):o.jsxs("div",{className:"space-y-3",children:[o.jsx(cn,{checked:d,onChange:D=>B("desktop.enabled",D,D?"Desktop activado.":"Desktop desactivado."),disabled:N,label:d?"Plugin activado (responde mensajes)":"Plugin desactivado"}),o.jsxs("p",{className:"text-xs text-muted-fg",children:["Motor de voz a texto: ",o.jsx(Jh,{to:"/m/voice",className:"font-medium text-fg underline underline-offset-2",children:"Voces"})," ","(whisper local, idioma, modelo)."]})]})})]}),o.jsx("div",{children:o.jsx(Ye,{title:"Última conversación",description:"Lo último charlado con el agente desde la ventana flotante.",action:o.jsx("button",{type:"button",onClick:()=>C(),className:"text-xs text-muted-fg underline-offset-2 hover:underline",children:"refrescar"}),children:o.jsx(a8,{messages:j||[],loading:_})})})]})})}function a8({messages:e,loading:n}){const s=b.useMemo(()=>r8(e),[e]);return n?o.jsx(nt,{}):e.length?o.jsx("div",{className:"space-y-3 max-h-[560px] overflow-y-auto pr-1",children:s.slice().reverse().map((r,i)=>o.jsx("div",{className:"rounded-lg border border-border bg-card/40 p-3",children:r.map((c,d)=>o.jsx(s8,{m:c},d))},i))}):o.jsx(dt,{children:"Sin mensajes todavía. Mandale algo a la ventana de escritorio para que aparezca aquí."})}function s8({m:e}){const n=e.direction==="in",s=o8(e.ts);return o.jsxs("div",{className:"py-1",children:[o.jsxs("div",{className:"flex items-baseline gap-2 text-[11px] text-muted-fg",children:[o.jsx("span",{className:"font-semibold",children:n?"Vos":"Roby"}),o.jsx("span",{children:s})]}),o.jsx("div",{className:"mt-0.5 text-sm leading-snug whitespace-pre-wrap "+(n?"text-muted-fg":"text-fg"),children:(e.body||"").trim()||o.jsx("span",{className:"italic opacity-50",children:"(vacío)"})})]})}function r8(e){const n=[];for(const s of e)s.direction==="in"||!n.length?n.push([s]):n[n.length-1].push(s);return n}function o8(e){try{const n=new Date(e);return n.toDateString()===new Date().toDateString()?n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):n.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}function l8(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 i8({manifest:e}){const n=e.daemon,s=e.safety;return o.jsxs("div",{"data-testid":"deck-daemon-card",className:"rounded-xl border border-border bg-muted/10 px-4 py-3 text-xs",children:[o.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[o.jsxs("span",{className:"font-semibold text-foreground",children:[n.name," ",o.jsxs("span",{className:"font-normal text-muted-fg",children:["v",n.version]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"size-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-muted-fg",children:["activo · ",l8(n.uptime_s)]})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs("span",{className:"text-muted-fg",children:[n.host,":",n.port]}),o.jsx("span",{className:"text-muted-fg",children:"·"}),o.jsxs("span",{className:"text-muted-fg",children:["iniciado"," ",new Date(n.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),o.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:[s.direct_shell===!1&&o.jsx(Xe,{tone:"success",children:"sin shell directo"}),s.arbitrary_commands===!1&&o.jsx(Xe,{tone:"success",children:"comandos arbitrarios bloqueados"}),s.dangerous_actions_require_confirmation&&o.jsx(Xe,{tone:"info",children:"acciones peligrosas requieren confirmación"})]})]})}function c8(e){return e==="available"?"success":e==="configured"?"info":"muted"}function u8(e){return e==="available"?"activo":e==="configured"?"configurado":e==="disabled"?"deshabilitado":"sin configurar"}function d8(e){return e==="voice"?"warning":e==="plugin"?"info":"muted"}function f8({widget:e,onToggle:n}){const s=e.source==="external",[r,i]=b.useState(!1),c=e.user_enabled===!0,d=async f=>{if(!(!n||r)){i(!0);try{await n(f)}finally{i(!1)}}};return o.jsxs("li",{"data-testid":`deck-widget-${e.id}`,className:Oe("flex items-center gap-3 rounded-lg border px-3 py-2.5 text-sm transition-colors",s?"border-border bg-muted/20 hover:border-muted-fg/30":"border-border/50 bg-muted/10"),children:[o.jsx("span",{title:e.source==="apx"?"Widget nativo APX":"Widget externo",className:Oe("size-2 shrink-0 rounded-full",e.source==="apx"?"bg-emerald-500":"bg-sky-400")}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"font-medium",children:e.title}),o.jsx("span",{className:"ml-2 text-xs text-muted-fg",children:e.desktop})]}),o.jsx(Xe,{tone:d8(e.kind),children:e.kind}),o.jsx(Xe,{tone:c8(e.status),children:u8(e.status)}),s?o.jsx("span",{"data-testid":`deck-widget-toggle-${e.id}`,children:o.jsx(cn,{checked:c,onChange:d,disabled:r||!n})}):o.jsx("span",{className:"w-9 shrink-0","aria-hidden":!0})]})}function p8({desktop:e,widgets:n,onToggle:s}){return n.length===0?null:o.jsxs("div",{"data-testid":`deck-desktop-${e.id}`,className:"space-y-1.5",children:[o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-fg",children:e.title}),o.jsx("ul",{className:"space-y-1.5",children:n.map(r=>o.jsx(f8,{widget:r,onToggle:r.source==="external"?i=>s(r.id,i):void 0},r.id))})]})}function m8(){const e=lt(),{data:n,error:s,isLoading:r,mutate:i}=Je("/deck/manifest",()=>wj.manifest(),{refreshInterval:3e4}),c=async(x,y)=>{try{await wj.setWidget(x,{enabled:y}),await i(S=>S&&{...S,deck:{...S.deck,widgets:S.deck.widgets.map(w=>w.id===x?{...w,user_enabled:y,status:y?w.daemon_status?"available":"configured":"disabled"}:w)}},{revalidate:!1}),e.success(y?`Widget ${x} habilitado.`:`Widget ${x} deshabilitado.`),setTimeout(()=>i(),800)}catch(S){const w=S instanceof Error?S.message:"Error al guardar";e.error(w)}},d=n?.deck.desktops??[],f=n?.deck.widgets??[],p=d.map(x=>({desktop:x,widgets:f.filter(y=>y.desktop===x.id)})),g=f.filter(x=>x.source==="external").filter(x=>x.user_enabled===!0).length;return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6","data-testid":"screen-deck",children:[n&&o.jsx(i8,{manifest:n}),o.jsxs(Ye,{title:"Widgets",description:r?"Cargando manifest…":s?"Error al cargar el manifest.":`${f.length} widgets · ${g} externos habilitados`,action:o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>i(),disabled:r,title:"Recargar manifest",children:o.jsx(kr,{size:14,className:r?"animate-spin":""})}),children:[r&&o.jsx(nt,{label:"Cargando manifest del Deck…"}),!r&&s&&o.jsxs(dt,{children:["No se pudo cargar el manifest del Deck."," ",o.jsx("button",{type:"button",className:"ml-1 underline",onClick:()=>i(),children:"Reintentar"})]}),!r&&!s&&f.length===0&&o.jsx(dt,{children:"No hay widgets en el manifest."}),!r&&!s&&f.length>0&&o.jsx("div",{className:"space-y-5","data-testid":"deck-desktop-list",children:p.filter(x=>x.widgets.length>0).map(x=>o.jsx(p8,{desktop:x.desktop,widgets:x.widgets,onToggle:c},x.desktop.id))})]}),n?.apx&&o.jsx(Ye,{title:"Contexto APX",description:"Información que el Deck ve del daemon.",children:o.jsxs("div",{className:"space-y-2 text-sm","data-testid":"deck-apx-context",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-muted-fg",children:"Proyecto activo:"}),o.jsx("span",{className:"font-medium",children:n.apx.active_project?n.apx.active_project.name:"ninguno"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-muted-fg",children:"Proyectos registrados:"}),o.jsx("span",{className:"font-medium",children:n.apx.projects.length})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-muted-fg",children:"Plugins activos:"}),o.jsx("span",{className:"font-medium",children:Object.keys(n.apx.plugins).join(", ")||"—"})]})]})})]})}function g8(e,n){const s=getComputedStyle(e),r=parseFloat(s.fontSize);return n*r}function h8(e,n){const s=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(s.fontSize);return n*r}function x8(e){return e/100*window.innerHeight}function b8(e){return e/100*window.innerWidth}function v8(e){switch(typeof e){case"number":return[e,"px"];case"string":{const n=parseFloat(e);return e.endsWith("%")?[n,"%"]:e.endsWith("px")?[n,"px"]:e.endsWith("rem")?[n,"rem"]:e.endsWith("em")?[n,"em"]:e.endsWith("vh")?[n,"vh"]:e.endsWith("vw")?[n,"vw"]:[n,"%"]}}}function Wi({groupSize:e,panelElement:n,styleProp:s}){let r;const[i,c]=v8(s);switch(c){case"%":{r=i/100*e;break}case"px":{r=i;break}case"rem":{r=h8(n,i);break}case"em":{r=g8(n,i);break}case"vh":{r=x8(i);break}case"vw":{r=b8(i);break}}return r}function Gn(e){return parseFloat(e.toFixed(3))}function Nl({group:e}){const{orientation:n,panels:s}=e;return s.reduce((r,i)=>(r+=n==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function Uh(e){const{panels:n}=e,s=Nl({group:e});return s===0?n.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):n.map(r=>{const{element:i,panelConstraints:c}=r;let d=0;if(c.collapsedSize!==void 0){const g=Wi({groupSize:s,panelElement:i,styleProp:c.collapsedSize});d=Gn(g/s*100)}let f;if(c.defaultSize!==void 0){const g=Wi({groupSize:s,panelElement:i,styleProp:c.defaultSize});f=Gn(g/s*100)}let p=0;if(c.minSize!==void 0){const g=Wi({groupSize:s,panelElement:i,styleProp:c.minSize});p=Gn(g/s*100)}let m=100;if(c.maxSize!==void 0){const g=Wi({groupSize:s,panelElement:i,styleProp:c.maxSize});m=Gn(g/s*100)}return{groupResizeBehavior:c.groupResizeBehavior,collapsedSize:d,collapsible:c.collapsible===!0,defaultSize:f,disabled:c.disabled,minSize:p,maxSize:m,panelId:r.id}})}function Ut(e,n="Assertion error"){if(!e)throw Error(n)}function Hh(e,n){return Array.from(n).sort(e==="horizontal"?y8:j8)}function y8(e,n){const s=e.element.offsetLeft-n.element.offsetLeft;return s!==0?s:e.element.offsetWidth-n.element.offsetWidth}function j8(e,n){const s=e.element.offsetTop-n.element.offsetTop;return s!==0?s:e.element.offsetHeight-n.element.offsetHeight}function VC(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function $C(e,n){return{x:e.x>=n.left&&e.x<=n.right?0:Math.min(Math.abs(e.x-n.left),Math.abs(e.x-n.right)),y:e.y>=n.top&&e.y<=n.bottom?0:Math.min(Math.abs(e.y-n.top),Math.abs(e.y-n.bottom))}}function _8({orientation:e,rects:n,targetRect:s}){const r={x:s.x+s.width/2,y:s.y+s.height/2};let i,c=Number.MAX_VALUE;for(const d of n){const{x:f,y:p}=$C(r,d),m=e==="horizontal"?f:p;m<c&&(c=m,i=d)}return Ut(i,"No rect found"),i}let pd;function S8(){return pd===void 0&&(typeof matchMedia=="function"?pd=!!matchMedia("(pointer:coarse)").matches:pd=!1),pd}function GC(e){const{element:n,orientation:s,panels:r,separators:i}=e,c=Hh(s,Array.from(n.children).filter(VC).map(w=>({element:w}))).map(({element:w})=>w),d=[];let f=!1,p=!1,m=-1,g=-1,x=0,y,S=[];{let w=-1;for(const j of c)j.hasAttribute("data-panel")&&(w++,j.hasAttribute("data-disabled")||(x++,m===-1&&(m=w),g=w))}if(x>1){let w=-1;for(const j of c)if(j.hasAttribute("data-panel")){w++;const _=r.find(C=>C.element===j);if(_){if(y){const C=y.element.getBoundingClientRect(),k=j.getBoundingClientRect();let R;if(p){const N=s==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),A=s==="horizontal"?new DOMRect(k.left,k.top,0,k.height):new DOMRect(k.left,k.top,k.width,0);switch(S.length){case 0:{R=[N,A];break}case 1:{const M=S[0],O=_8({orientation:s,rects:[C,k],targetRect:M.element.getBoundingClientRect()});R=[M,O===C?A:N];break}default:{R=S;break}}}else S.length?R=S:R=[s==="horizontal"?new DOMRect(C.right,k.top,k.left-C.right,k.height):new DOMRect(k.left,C.bottom,k.width,k.top-C.bottom)];for(const N of R){let A="width"in N?N:N.element.getBoundingClientRect();const M=S8()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(A.width<M){const L=M-A.width;A=new DOMRect(A.x-L/2,A.y,A.width+L,A.height)}if(A.height<M){const L=M-A.height;A=new DOMRect(A.x,A.y-L/2,A.width,A.height+L)}const O=w<=m||w>g;!f&&!O&&d.push({group:e,groupSize:Nl({group:e}),panels:[y,_],separator:"width"in N?void 0:N,rect:A}),f=!1}}p=!1,y=_,S=[]}}else if(j.hasAttribute("data-separator")){j.ariaDisabled!==null&&(f=!0);const _=i.find(C=>C.element===j);_?S.push(_):(y=void 0,S=[])}else p=!0}return d}class FC{#e={};addListener(n,s){const r=this.#e[n];return r===void 0?this.#e[n]=[s]:r.includes(s)||r.push(s),()=>{this.removeListener(n,s)}}emit(n,s){const r=this.#e[n];if(r!==void 0)if(r.length===1)r[0].call(null,s);else{let i=!1,c=null;const d=Array.from(r);for(let f=0;f<d.length;f++){const p=d[f];try{p.call(null,s)}catch(m){c===null&&(i=!0,c=m)}}if(i)throw c}}removeAllListeners(){this.#e={}}removeListener(n,s){const r=this.#e[n];if(r!==void 0){const i=r.indexOf(s);i>=0&&r.splice(i,1)}}}let es=new Map;const YC=new FC;function w8(e){es=new Map(es),es.delete(e)}function M_(e,n){for(const[s]of es)if(s.id===e)return s}function _r(e,n){for(const[s,r]of es)if(s.id===e)return r;if(n)throw Error(`Could not find data for Group with id ${e}`)}function jo(){return es}function hb(e,n){return YC.addListener("groupChange",s=>{s.group.id===e&&n(s)})}function qs(e,n){const s=es.get(e);es=new Map(es),es.set(e,n),YC.emit("groupChange",{group:e,prev:s,next:n})}function C8(e,n,s){let r,i={x:1/0,y:1/0};for(const c of n){const d=$C(s,c.rect);switch(e){case"horizontal":{d.x<=i.x&&(r=c,i=d);break}case"vertical":{d.y<=i.y&&(r=c,i=d);break}}}return r?{distance:i,hitRegion:r}:void 0}function k8(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function E8(e,n){if(e===n)throw new Error("Cannot compare node with itself");const s={a:D_(e),b:D_(n)};let r;for(;s.a.at(-1)===s.b.at(-1);)r=s.a.pop(),s.b.pop();Ut(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:z_(O_(s.a)),b:z_(O_(s.b))};if(i.a===i.b){const c=r.childNodes,d={a:s.a.at(-1),b:s.b.at(-1)};let f=c.length;for(;f--;){const p=c[f];if(p===d.a)return 1;if(p===d.b)return-1}}return Math.sign(i.a-i.b)}const N8=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function R8(e){const n=getComputedStyle(XC(e)??e).display;return n==="flex"||n==="inline-flex"}function T8(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||R8(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||N8.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function O_(e){let n=e.length;for(;n--;){const s=e[n];if(Ut(s,"Missing node"),T8(s))return s}return null}function z_(e){return e&&Number(getComputedStyle(e).zIndex)||0}function D_(e){const n=[];for(;e;)n.push(e),e=XC(e);return n}function XC(e){const{parentNode:n}=e;return k8(n)?n.host:n}function A8(e,n){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function M8({groupElement:e,hitRegion:n,pointerEventTarget:s}){if(!VC(s)||s.contains(e)||e.contains(s))return!0;if(E8(s,e)>0){let r=s;for(;r;){if(r.contains(e))return!0;if(A8(r.getBoundingClientRect(),n))return!1;r=r.parentElement}}return!0}function xb(e,n){const s=[];return n.forEach((r,i)=>{if(i.disabled)return;const c=GC(i),d=C8(i.orientation,c,{x:e.clientX,y:e.clientY});d&&d.distance.x<=0&&d.distance.y<=0&&M8({groupElement:i.element,hitRegion:d.hitRegion.rect,pointerEventTarget:e.target})&&s.push(d.hitRegion)}),s}function O8(e,n){if(e.length!==n.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!=n[s])return!1;return!0}function In(e,n,s=0){return Math.abs(Gn(e)-Gn(n))<=s}function Qa(e,n){return In(e,n)?0:e>n?1:-1}function dl({overrideDisabledPanels:e,panelConstraints:n,prevSize:s,size:r}){const{collapsedSize:i=0,collapsible:c,disabled:d,maxSize:f=100,minSize:p=0}=n;if(d&&!e)return s;if(Qa(r,p)<0)if(c){const m=(i+p)/2;Qa(r,m)<0?r=i:r=p}else r=p;return r=Math.min(f,r),r=Gn(r),r}function yc({delta:e,initialLayout:n,panelConstraints:s,pivotIndices:r,prevLayout:i,trigger:c}){if(In(e,0))return n;const d=c==="imperative-api",f=Object.values(n),p=Object.values(i),m=[...f],[g,x]=r;Ut(g!=null,"Invalid first pivot index"),Ut(x!=null,"Invalid second pivot index");let y=0;switch(c){case"keyboard":{{const j=e<0?x:g,_=s[j];Ut(_,`Panel constraints not found for index ${j}`);const{collapsedSize:C=0,collapsible:k,minSize:R=0}=_;if(k){const N=f[j];if(Ut(N!=null,`Previous layout not found for panel index ${j}`),In(N,C)){const A=R-N;Qa(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}{const j=e<0?g:x,_=s[j];Ut(_,`No panel constraints found for index ${j}`);const{collapsedSize:C=0,collapsible:k,minSize:R=0}=_;if(k){const N=f[j];if(Ut(N!=null,`Previous layout not found for panel index ${j}`),In(N,R)){const A=N-C;Qa(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}break}default:{const j=e<0?x:g,_=s[j];Ut(_,`Panel constraints not found for index ${j}`);const C=f[j],{collapsible:k,collapsedSize:R,minSize:N}=_;if(k&&Qa(C,N)<0)if(e>0){const A=N-R,M=A/2,O=C+e;Qa(O,N)<0&&(e=Qa(e,M)<=0?0:A)}else{const A=N-R,M=100-A/2,O=C-e;Qa(O,N)<0&&(e=Qa(100+e,M)>0?0:-A)}break}}{const j=e<0?1:-1;let _=e<0?x:g,C=0;for(;;){const R=f[_];Ut(R!=null,`Previous layout not found for panel index ${_}`);const N=dl({overrideDisabledPanels:d,panelConstraints:s[_],prevSize:R,size:100})-R;if(C+=N,_+=j,_<0||_>=s.length)break}const k=Math.min(Math.abs(e),Math.abs(C));e=e<0?0-k:k}{let j=e<0?g:x;for(;j>=0&&j<s.length;){const _=Math.abs(e)-Math.abs(y),C=f[j];Ut(C!=null,`Previous layout not found for panel index ${j}`);const k=C-_,R=dl({overrideDisabledPanels:d,panelConstraints:s[j],prevSize:C,size:k});if(!In(C,R)&&(y+=C-R,m[j]=R,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?j--:j++}}if(O8(p,m))return i;{const j=e<0?x:g,_=f[j];Ut(_!=null,`Previous layout not found for panel index ${j}`);const C=_+y,k=dl({overrideDisabledPanels:d,panelConstraints:s[j],prevSize:_,size:C});if(m[j]=k,!In(k,C)){let R=C-k,N=e<0?x:g;for(;N>=0&&N<s.length;){const A=m[N];Ut(A!=null,`Previous layout not found for panel index ${N}`);const M=A+R,O=dl({overrideDisabledPanels:d,panelConstraints:s[N],prevSize:A,size:M});if(In(A,O)||(R-=O-A,m[N]=O),In(R,0))break;e>0?N--:N++}}}const S=Object.values(m).reduce((j,_)=>_+j,0);if(!In(S,100,.1))return i;const w=Object.keys(i);return m.reduce((j,_,C)=>(j[w[C]]=_,j),{})}function po(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(n[s]===void 0||Qa(e[s],n[s])!==0)return!1;return!0}function mo({layout:e,panelConstraints:n}){const s=Object.values(e),r=[...s],i=r.reduce((f,p)=>f+p,0);if(r.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${r.map(f=>`${f}%`).join(", ")}`);if(!In(i,100)&&r.length>0)for(let f=0;f<n.length;f++){const p=r[f];Ut(p!=null,`No layout data found for index ${f}`);const m=100/i*p;r[f]=m}let c=0;for(let f=0;f<n.length;f++){const p=s[f];Ut(p!=null,`No layout data found for index ${f}`);const m=r[f];Ut(m!=null,`No layout data found for index ${f}`);const g=dl({overrideDisabledPanels:!0,panelConstraints:n[f],prevSize:p,size:m});m!=g&&(c+=m-g,r[f]=g)}if(!In(c,0))for(let f=0;f<n.length;f++){const p=r[f];Ut(p!=null,`No layout data found for index ${f}`);const m=p+c,g=dl({overrideDisabledPanels:!0,panelConstraints:n[f],prevSize:p,size:m});if(p!==g&&(c-=g-p,r[f]=g,In(c,0)))break}const d=Object.keys(e);return r.reduce((f,p,m)=>(f[d[m]]=p,f),{})}function KC({groupId:e,panelId:n}){const s=()=>{const p=jo();for(const[m,{defaultLayoutDeferred:g,derivedPanelConstraints:x,layout:y,groupSize:S,separatorToPanels:w}]of p)if(m.id===e)return{defaultLayoutDeferred:g,derivedPanelConstraints:x,group:m,groupSize:S,layout:y,separatorToPanels:w};throw Error(`Group ${e} not found`)},r=()=>{const p=s().derivedPanelConstraints.find(m=>m.panelId===n);if(p!==void 0)return p;throw Error(`Panel constraints not found for Panel ${n}`)},i=()=>{const p=s().group.panels.find(m=>m.id===n);if(p!==void 0)return p;throw Error(`Layout not found for Panel ${n}`)},c=()=>{const p=s().layout[n];if(p!==void 0)return p;throw Error(`Layout not found for Panel ${n}`)},d=({nextSize:p,panels:m,prevLayout:g,derivedPanelConstraints:x})=>{const y=c(),S=m.findIndex(_=>_.id===n),w=S===0,j=S===m.length-1;if(j&&p<y&&(w||m.slice(0,S).every((_,C)=>{const k=x[C];return k?.collapsible&&In(k.collapsedSize,g[k.panelId])}))){const _=m.slice(0,S).reduce((C,k)=>C+g[k.id],0);return{...g,[n]:Gn(100-_)}}return yc({delta:j?y-p:p-y,initialLayout:g,panelConstraints:x,pivotIndices:j?[S-1,S]:[S,S+1],prevLayout:g,trigger:"imperative-api"})},f=p=>{const m=c();if(p===m)return;const{defaultLayoutDeferred:g,derivedPanelConstraints:x,group:y,groupSize:S,layout:w,separatorToPanels:j}=s(),_=d({nextSize:p,panels:y.panels,prevLayout:w,derivedPanelConstraints:x}),C=mo({layout:_,panelConstraints:x});po(w,C)||qs(y,{defaultLayoutDeferred:g,derivedPanelConstraints:x,groupSize:S,layout:C,separatorToPanels:j})};return{collapse:()=>{const{collapsible:p,collapsedSize:m}=r(),{mutableValues:g}=i(),x=c();p&&x!==m&&(g.expandToSize=x,f(m))},expand:()=>{const{collapsible:p,collapsedSize:m,minSize:g}=r(),{mutableValues:x}=i(),y=c();if(p&&y===m){let S=x.expandToSize??g;S===0&&(S=1),f(S)}},getSize:()=>{const{group:p}=s(),m=c(),{element:g}=i(),x=p.orientation==="horizontal"?g.offsetWidth:g.offsetHeight;return{asPercentage:m,inPixels:x}},isCollapsed:()=>{const{collapsible:p,collapsedSize:m}=r(),g=c();return p&&In(m,g)},resize:p=>{const{group:m}=s(),{element:g}=i(),x=Nl({group:m}),y=Wi({groupSize:x,panelElement:g,styleProp:p}),S=Gn(y/x*100);f(S)}}}function L_(e){if(e.defaultPrevented)return;const n=jo();xb(e,n).forEach(s=>{if(s.separator&&!s.separator.disableDoubleClick){const r=s.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,c=KC({groupId:s.group.id,panelId:r.id});c&&i!==void 0&&(c.resize(i),e.preventDefault())}}})}function wd(e){const n=jo();for(const[s]of n)if(s.separators.some(r=>r.element===e))return s;throw Error("Could not find parent Group for separator element")}function QC({groupId:e}){const n=()=>{const s=jo();for(const[r,i]of s)if(r.id===e)return{group:r,...i};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:s,layout:r}=n();return s?{}:r},setLayout(s){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:c,groupSize:d,layout:f,separatorToPanels:p}=n(),m=mo({layout:s,panelConstraints:i});return r?f:(po(f,m)||qs(c,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:d,layout:m,separatorToPanels:p}),m)}}}function Jr(e,n){const s=wd(e),r=_r(s.id,!0),i=s.separators.find(g=>g.element===e);Ut(i,"Matching separator not found");const c=r.separatorToPanels.get(i);Ut(c,"Matching panels not found");const d=c.map(g=>s.panels.indexOf(g)),f=QC({groupId:s.id}).getLayout(),p=yc({delta:n,initialLayout:f,panelConstraints:r.derivedPanelConstraints,pivotIndices:d,prevLayout:f,trigger:"keyboard"}),m=mo({layout:p,panelConstraints:r.derivedPanelConstraints});po(f,m)||qs(s,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:m,separatorToPanels:r.separatorToPanels})}function P_(e){if(e.defaultPrevented)return;const n=e.currentTarget,s=wd(n);if(!s.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),s.orientation==="vertical"&&Jr(n,5);break}case"ArrowLeft":{e.preventDefault(),s.orientation==="horizontal"&&Jr(n,-5);break}case"ArrowRight":{e.preventDefault(),s.orientation==="horizontal"&&Jr(n,5);break}case"ArrowUp":{e.preventDefault(),s.orientation==="vertical"&&Jr(n,-5);break}case"End":{e.preventDefault(),Jr(n,100);break}case"Enter":{e.preventDefault();const r=wd(n),i=_r(r.id,!0),{derivedPanelConstraints:c,layout:d,separatorToPanels:f}=i,p=r.separators.find(y=>y.element===n);Ut(p,"Matching separator not found");const m=f.get(p);Ut(m,"Matching panels not found");const g=m[0],x=c.find(y=>y.panelId===g.id);if(Ut(x,"Panel metadata not found"),x.collapsible){const y=d[g.id],S=x.collapsedSize===y?r.mutableState.expandedPanelSizes[g.id]??x.minSize:x.collapsedSize;Jr(n,S-y)}break}case"F6":{e.preventDefault();const r=wd(n).separators.map(d=>d.element),i=Array.from(r).findIndex(d=>d===e.currentTarget);Ut(i!==null,"Index not found");const c=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[c].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Jr(n,-100);break}}}let hl={cursorFlags:0,state:"inactive"};const bb=new FC;function go(){return hl}function z8(e){return bb.addListener("change",e)}function D8(e){const n=hl,s={...hl};s.cursorFlags=e,hl=s,bb.emit("change",{prev:n,next:s})}function xl(e){const n=hl;hl=e,bb.emit("change",{prev:n,next:e})}function I_(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const n=jo(),s=xb(e,n),r=new Map;let i=!1;s.forEach(c=>{c.separator&&(i||(i=!0,c.separator.element.focus({focusVisible:!1,preventScroll:!0})));const d=n.get(c.group);d&&r.set(c.group,d.layout)}),xl({cursorFlags:0,hitRegions:s,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),s.length&&e.preventDefault()}const L8=e=>e,eh=()=>{},ZC=1,JC=2,WC=4,ek=8,B_=3,U_=12;let md;function H_(){return md===void 0&&(md=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(md=!0)),md}function P8({cursorFlags:e,groups:n,state:s}){let r=0,i=0;switch(s){case"active":case"hover":n.forEach(c=>{if(!c.mutableState.disableCursor)switch(c.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(s){case"active":{if(e&&H_()){const c=(e&ZC)!==0,d=(e&JC)!==0,f=(e&WC)!==0,p=(e&ek)!==0;if(c)return f?"se-resize":p?"ne-resize":"e-resize";if(d)return f?"sw-resize":p?"nw-resize":"w-resize";if(f)return"s-resize";if(p)return"n-resize"}break}}return H_()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const q_=new WeakMap;function vb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:n,styleSheet:s}=q_.get(e)??{};s===void 0&&(s=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(s):e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]));const r=go();switch(r.state){case"active":case"hover":{const i=P8({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(d=>d.group),state:r.state}),c=`*, *:hover {cursor: ${i} !important; }`;if(n===c)return;n=c,i?s.cssRules.length===0?s.insertRule(c):s.replaceSync(c):s.cssRules.length===1&&s.deleteRule(0);break}case"inactive":{n=void 0,s.cssRules.length===1&&s.deleteRule(0);break}}q_.set(e,{prevStyle:n,styleSheet:s})}function tk({document:e,event:n,hitRegions:s,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:c,prevCursorFlags:d}){let f=0;s.forEach(m=>{const{group:g,groupSize:x}=m,{orientation:y,panels:S}=g,{disableCursor:w}=g.mutableState;let j=0;c?y==="horizontal"?j=(n.clientX-c.x)/x*100:j=(n.clientY-c.y)/x*100:y==="horizontal"?j=n.clientX<0?-100:100:j=n.clientY<0?-100:100;const _=r.get(g),C=i.get(g);if(!_||!C)return;const{defaultLayoutDeferred:k,derivedPanelConstraints:R,groupSize:N,layout:A,separatorToPanels:M}=C;if(R&&A&&M){const O=yc({delta:j,initialLayout:_,panelConstraints:R,pivotIndices:m.panels.map(L=>S.indexOf(L)),prevLayout:A,trigger:"mouse-or-touch"});if(po(O,A)){if(j!==0&&!w)switch(y){case"horizontal":{f|=j<0?ZC:JC;break}case"vertical":{f|=j<0?WC:ek;break}}}else qs(m.group,{defaultLayoutDeferred:k,derivedPanelConstraints:R,groupSize:N,layout:O,separatorToPanels:M})}});let p=0;n.movementX===0?p|=d&B_:p|=f&B_,n.movementY===0?p|=d&U_:p|=f&U_,D8(p),vb(e)}function V_(e){const n=jo(),s=go();switch(s.state){case"active":tk({document:e.currentTarget,event:e,hitRegions:s.hitRegions,initialLayoutMap:s.initialLayoutMap,mountedGroups:n,prevCursorFlags:s.cursorFlags})}}function $_(e){if(e.defaultPrevented)return;const n=go(),s=jo();switch(n.state){case"active":{if(e.buttons===0){xl({cursorFlags:0,state:"inactive"}),n.hitRegions.forEach(r=>{const i=_r(r.group.id,!0);qs(r.group,i)});return}for(const r of n.hitRegions)if(r.separator){const{element:i}=r.separator;i.hasPointerCapture?.(e.pointerId)||i.setPointerCapture?.(e.pointerId)}tk({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:s,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags});break}default:{const r=xb(e,s);r.length===0?n.state!=="inactive"&&xl({cursorFlags:0,state:"inactive"}):xl({cursorFlags:0,hitRegions:r,state:"hover"}),vb(e.currentTarget);break}}}function G_(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(go().state){case"hover":xl({cursorFlags:0,state:"inactive"})}}function F_(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const n=go();switch(n.state){case"active":xl({cursorFlags:0,state:"inactive"}),n.hitRegions.length>0&&(vb(e.currentTarget),n.hitRegions.forEach(s=>{const r=_r(s.group.id,!0);qs(s.group,r)}),e.preventDefault())}}function Y_(e){let n=0,s=0;const r={};for(const c of e)if(c.defaultSize!==void 0){n++;const d=Gn(c.defaultSize);s+=d,r[c.panelId]=d}else r[c.panelId]=void 0;const i=e.length-n;if(i!==0){const c=Gn((100-s)/i);for(const d of e)d.defaultSize===void 0&&(r[d.panelId]=c)}return r}function I8(e,n,s){if(!s[0])return;const r=e.panels.find(p=>p.element===n);if(!r||!r.onResize)return;const i=Nl({group:e}),c=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,d=r.mutableValues.prevSize,f={asPercentage:Gn(c/i*100),inPixels:c};r.mutableValues.prevSize=f,r.onResize(f,r.id,d)}function B8(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(e[s]!==n[s])return!1;return!0}function U8({group:e,nextGroupSize:n,prevGroupSize:s,prevLayout:r}){if(s<=0||n<=0||s===n)return r;let i=0,c=0,d=!1;const f=new Map,p=[];for(const x of e.panels){const y=r[x.id]??0;switch(x.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{d=!0;const S=y/100*s,w=Gn(S/n*100);f.set(x.id,w),i+=w;break}case"preserve-relative-size":default:{p.push(x.id),c+=y;break}}}if(!d||p.length===0)return r;const m=100-i,g={...r};if(f.forEach((x,y)=>{g[y]=x}),c>0)for(const x of p){const y=r[x]??0;g[x]=Gn(y/c*m)}else{const x=Gn(m/p.length);for(const y of p)g[y]=x}return g}function H8(e,n){const s=e.map(i=>i.id),r=Object.keys(n);if(s.length!==r.length)return!1;for(const i of s)if(!r.includes(i))return!1;return!0}const ll=new Map;function q8(e){let n=!0;Ut(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const s=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,c=new s(w=>{for(const j of w){const{borderBoxSize:_,target:C}=j;if(C===e.element){if(n){const k=Nl({group:e});if(k===0)return;const R=_r(e.id);if(!R)return;const N=Uh(e),A=R.defaultLayoutDeferred?Y_(N):R.layout,M=U8({group:e,nextGroupSize:k,prevGroupSize:R.groupSize,prevLayout:A}),O=mo({layout:M,panelConstraints:N});if(!R.defaultLayoutDeferred&&po(R.layout,O)&&B8(R.derivedPanelConstraints,N)&&R.groupSize===k)return;qs(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:N,groupSize:k,layout:O,separatorToPanels:R.separatorToPanels})}}else I8(e,C,_)}});c.observe(e.element),e.panels.forEach(w=>{Ut(!r.has(w.id),`Panel ids must be unique; id "${w.id}" was used more than once`),r.add(w.id),w.onResize&&c.observe(w.element)});const d=Nl({group:e}),f=Uh(e),p=e.panels.map(({id:w})=>w).join(",");let m=e.mutableState.defaultLayout;m&&(H8(e.panels,m)||(m=void 0));const g=e.mutableState.layouts[p]??m??Y_(f),x=mo({layout:g,panelConstraints:f}),y=e.element.ownerDocument;ll.set(y,(ll.get(y)??0)+1);const S=new Map;return GC(e).forEach(w=>{w.separator&&S.set(w.separator,w.panels)}),qs(e,{defaultLayoutDeferred:d===0,derivedPanelConstraints:f,groupSize:d,layout:x,separatorToPanels:S}),e.separators.forEach(w=>{Ut(!i.has(w.id),`Separator ids must be unique; id "${w.id}" was used more than once`),i.add(w.id),w.element.addEventListener("keydown",P_)}),ll.get(y)===1&&(y.addEventListener("dblclick",L_,!0),y.addEventListener("pointerdown",I_,!0),y.addEventListener("pointerleave",V_),y.addEventListener("pointermove",$_),y.addEventListener("pointerout",G_),y.addEventListener("pointerup",F_,!0)),function(){n=!1,ll.set(y,Math.max(0,(ll.get(y)??0)-1)),w8(e),e.separators.forEach(w=>{w.element.removeEventListener("keydown",P_)}),ll.get(y)||(y.removeEventListener("dblclick",L_,!0),y.removeEventListener("pointerdown",I_,!0),y.removeEventListener("pointerleave",V_),y.removeEventListener("pointermove",$_),y.removeEventListener("pointerout",G_),y.removeEventListener("pointerup",F_,!0)),c.disconnect()}}function V8(){const[e,n]=b.useState({}),s=b.useCallback(()=>n({}),[]);return[e,s]}function yb(e){const n=b.useId();return`${e??n}`}const _o=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ic(e){const n=b.useRef(e);return _o(()=>{n.current=e},[e]),b.useCallback((...s)=>n.current?.(...s),[n])}function jb(...e){return ic(n=>{e.forEach(s=>{if(s)switch(typeof s){case"function":{s(n);break}case"object":{s.current=n;break}}})})}function _b(e){const n=b.useRef({...e});return _o(()=>{for(const s in e)n.current[s]=e[s]},[e]),n.current}const nk=b.createContext(null);function $8(e,n){const s=b.useRef({getLayout:()=>({}),setLayout:L8});b.useImperativeHandle(n,()=>s.current,[]),_o(()=>{Object.assign(s.current,QC({groupId:e}))})}function qh({children:e,className:n,defaultLayout:s,disableCursor:r,disabled:i,elementRef:c,groupRef:d,id:f,onLayoutChange:p,onLayoutChanged:m,orientation:g="horizontal",resizeTargetMinimumSize:x={coarse:20,fine:10},style:y,...S}){const w=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),j=ic(D=>{po(w.current.onLayoutChange,D)||(w.current.onLayoutChange=D,p?.(D))}),_=ic(D=>{po(w.current.onLayoutChanged,D)||(w.current.onLayoutChanged=D,m?.(D))}),C=yb(f),k=b.useRef(null),[R,N]=V8(),A=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:x,separators:[]}),M=jb(k,c);$8(C,d);const O=ic((D,z)=>{const H=go(),V=M_(D),Y=_r(D);if(Y){let q=!1;switch(H.state){case"active":{q=H.hitRegions.some(F=>F.group===V);break}}return{flexGrow:Y.layout[z]??1,pointerEvents:q?"none":void 0}}if(s?.[z])return{flexGrow:s?.[z]}}),L=_b({defaultLayout:s,disableCursor:r}),B=b.useMemo(()=>({get disableCursor(){return!!L.disableCursor},getPanelStyles:O,id:C,orientation:g,registerPanel:D=>{const z=A.current;return z.panels=Hh(g,[...z.panels,D]),N(),()=>{z.panels=z.panels.filter(H=>H!==D),N()}},registerSeparator:D=>{const z=A.current;return z.separators=Hh(g,[...z.separators,D]),N(),()=>{z.separators=z.separators.filter(H=>H!==D),N()}},updatePanelProps:(D,{disabled:z})=>{const H=A.current.panels.find(q=>q.id===D);H&&(H.panelConstraints.disabled=z);const V=M_(C),Y=_r(C);V&&Y&&qs(V,{...Y,derivedPanelConstraints:Uh(V)})},updateSeparatorProps:(D,{disabled:z,disableDoubleClick:H})=>{const V=A.current.separators.find(Y=>Y.id===D);V&&(V.disabled=z,V.disableDoubleClick=H)}}),[O,C,N,g,L]),I=b.useRef(null);return _o(()=>{const D=k.current;if(D===null)return;const z=A.current;let H;if(L.defaultLayout!==void 0&&Object.keys(L.defaultLayout).length===z.panels.length){H={};for(const X of z.panels){const U=L.defaultLayout[X.id];U!==void 0&&(H[X.id]=U)}}const V={disabled:!!i,element:D,id:C,mutableState:{defaultLayout:H,disableCursor:!!L.disableCursor,expandedPanelSizes:A.current.lastExpandedPanelSizes,layouts:A.current.layouts},orientation:g,panels:z.panels,resizeTargetMinimumSize:z.resizeTargetMinimumSize,separators:z.separators};I.current=V;const Y=q8(V),{defaultLayoutDeferred:q,derivedPanelConstraints:F,layout:Z}=_r(V.id,!0);!q&&F.length>0&&(j(Z),_(Z));const $=hb(C,X=>{const{defaultLayoutDeferred:U,derivedPanelConstraints:K,layout:G}=X.next;if(U||K.length===0)return;const W=V.panels.map(({id:re})=>re).join(",");V.mutableState.layouts[W]=G,K.forEach(re=>{if(re.collapsible){const{layout:oe}=X.prev??{};if(oe){const ce=In(re.collapsedSize,G[re.panelId]),ee=In(re.collapsedSize,oe[re.panelId]);ce&&!ee&&(V.mutableState.expandedPanelSizes[re.panelId]=oe[re.panelId])}}});const ie=go().state!=="active";j(G),ie&&_(G)});return()=>{I.current=null,Y(),$()}},[i,C,_,j,g,R,L]),b.useEffect(()=>{const D=I.current;D&&(D.mutableState.defaultLayout=s,D.mutableState.disableCursor=!!r)}),o.jsx(nk.Provider,{value:B,children:o.jsx("div",{...S,className:n,"data-group":!0,"data-testid":C,id:C,ref:M,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:e})})}qh.displayName="Group";function Sb(){const e=b.useContext(nk);return Ut(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function G8(e,n){const{id:s}=Sb(),r=b.useRef({collapse:eh,expand:eh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:eh});b.useImperativeHandle(n,()=>r.current,[]),_o(()=>{Object.assign(r.current,KC({groupId:s,panelId:e}))})}function Wr({children:e,className:n,collapsedSize:s="0%",collapsible:r=!1,defaultSize:i,disabled:c,elementRef:d,groupResizeBehavior:f="preserve-relative-size",id:p,maxSize:m="100%",minSize:g="0%",onResize:x,panelRef:y,style:S,...w}){const j=!!p,_=yb(p),C=_b({disabled:c}),k=b.useRef(null),R=jb(k,d),{getPanelStyles:N,id:A,orientation:M,registerPanel:O,updatePanelProps:L}=Sb(),B=x!==null,I=ic((V,Y,q)=>{x?.(V,p,q)});_o(()=>{const V=k.current;if(V!==null){const Y={element:V,id:_,idIsStable:j,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:B?I:void 0,panelConstraints:{groupResizeBehavior:f,collapsedSize:s,collapsible:r,defaultSize:i,disabled:C.disabled,maxSize:m,minSize:g}};return O(Y)}},[f,s,r,i,B,_,j,m,g,I,O,C]),b.useEffect(()=>{L(_,{disabled:c})},[c,_,L]),G8(_,y);const D=()=>{const V=N(A,_);if(V)return JSON.stringify(V)},z=b.useSyncExternalStore(V=>hb(A,V),D,D);let H;return z?H=JSON.parse(z):i!==void 0?H={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:H={flexGrow:1},o.jsx("div",{...w,"data-disabled":c||void 0,"data-panel":!0,"data-testid":_,id:_,ref:R,style:{...F8,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...H},children:o.jsx("div",{className:n,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...S,touchAction:M==="horizontal"?"pan-y":"pan-x"},children:e})})}Wr.displayName="Panel";const F8={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Y8({layout:e,panelConstraints:n,panelId:s,panelIndex:r}){let i,c;const d=e[s],f=n.find(p=>p.panelId===s);if(f){const p=f.maxSize,m=f.collapsible?f.collapsedSize:f.minSize,g=[r,r+1];c=mo({layout:yc({delta:m-d,initialLayout:e,panelConstraints:n,pivotIndices:g,prevLayout:e}),panelConstraints:n})[s],i=mo({layout:yc({delta:p-d,initialLayout:e,panelConstraints:n,pivotIndices:g,prevLayout:e}),panelConstraints:n})[s]}return{valueControls:s,valueMax:i,valueMin:c,valueNow:d}}function wb({children:e,className:n,disabled:s,disableDoubleClick:r,elementRef:i,id:c,style:d,...f}){const p=yb(c),m=_b({disabled:s,disableDoubleClick:r}),[g,x]=b.useState({}),[y,S]=b.useState("inactive"),[w,j]=b.useState(!1),_=b.useRef(null),C=jb(_,i),{disableCursor:k,id:R,orientation:N,registerSeparator:A,updateSeparatorProps:M}=Sb(),O=N==="horizontal"?"vertical":"horizontal";_o(()=>{const I=_.current;if(I!==null){const D={disabled:m.disabled,disableDoubleClick:m.disableDoubleClick,element:I,id:p},z=A(D),H=z8(Y=>{S(Y.next.state!=="inactive"&&Y.next.hitRegions.some(q=>q.separator===D)?Y.next.state:"inactive")}),V=hb(R,Y=>{const{derivedPanelConstraints:q,layout:F,separatorToPanels:Z}=Y.next,$=Z.get(D);if($){const X=$[0],U=$.indexOf(X);x(Y8({layout:F,panelConstraints:q,panelId:X.id,panelIndex:U}))}});return()=>{H(),V(),z()}}},[R,p,A,m]),b.useEffect(()=>{M(p,{disabled:s,disableDoubleClick:r})},[s,r,p,M]);let L;s&&!k&&(L="not-allowed");let B;if(s)B="disabled";else switch(y){case"active":{B="active";break}default:w?B="focus":B=y}return o.jsx("div",{...f,"aria-controls":g.valueControls,"aria-disabled":s||void 0,"aria-orientation":O,"aria-valuemax":g.valueMax,"aria-valuemin":g.valueMin,"aria-valuenow":g.valueNow,children:e,className:n,"data-separator":B,"data-testid":p,id:p,onBlur:()=>j(!1),onFocus:()=>j(!0),ref:C,role:"separator",style:{flexBasis:"auto",cursor:L,...d,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:s?void 0:0})}wb.displayName="Separator";function X8({projects:e,value:n,onChange:s,disabled:r}){const i=e.map(c=>{const d=c.path?.split("/").filter(Boolean).pop()||`proyecto ${c.id}`;return{value:String(c.id),label:c.name||d,icon:wT,description:c.path}});return o.jsx("div",{className:"w-full","data-testid":"code-project-select",children:o.jsx(kt,{value:n,onChange:s,options:i,placeholder:"Elegí un proyecto…",disabled:r})})}function K8({sessions:e,activeId:n,busy:s,onSelect:r,onCreate:i,onRename:c,onDelete:d}){return o.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-session-list",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:E("code_module.sessions")}),o.jsx(Mt,{content:E("code_module.new_session"),children:o.jsxs("button",{type:"button",onClick:i,disabled:s,"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:[o.jsx(An,{className:"size-3"})," ",E("code_module.new_session")]})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-2",children:e.length===0?o.jsx("div",{className:"p-2",children:o.jsx(dt,{children:E("code_module.no_sessions")})}):o.jsx("ul",{className:"space-y-0.5",children:e.map(f=>o.jsxs("li",{className:"group/item relative",children:[o.jsxs("button",{type:"button",onClick:()=>r(f.id),className:Oe("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",f.id===n?"bg-accent text-accent-fg":"text-foreground/80 hover:bg-accent/50"),children:[o.jsx(MS,{className:"mt-0.5 size-3.5 shrink-0 opacity-60"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate font-medium",children:f.title}),o.jsxs("span",{className:"block truncate text-[10px] text-muted-foreground",children:[f.mode," · ",f.messageCount," msg",f.model?` · ${f.model}`:""]})]})]}),o.jsxs("div",{className:"absolute right-1 top-1 hidden items-center gap-0.5 group-hover/item:flex",children:[o.jsx(Mt,{content:E("code_module.rename"),children:o.jsx("button",{type:"button",onClick:()=>c(f.id,f.title),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-foreground",children:o.jsx(af,{className:"size-3"})})}),o.jsx(Mt,{content:E("code_module.delete"),children:o.jsx("button",{type:"button",onClick:()=>d(f.id),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-rose-500",children:o.jsx(rs,{className:"size-3"})})})]})]},f.id))})})]})}function Q8({mode:e,onChange:n,disabled:s}){const r=(i,c,d,f)=>o.jsx(Mt,{content:d,children:o.jsxs("button",{type:"button",disabled:s,"data-testid":`code-mode-${i}`,"aria-pressed":e===i,onClick:()=>n(i),className:Oe("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50",e===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx(f,{className:"size-3.5"})," ",c]})});return o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border border-border bg-muted/60 p-0.5",children:[r("build",E("code_module.mode_build"),E("code_module.mode_build_hint"),NT),r("plan",E("code_module.mode_plan"),E("code_module.mode_plan_hint"),fT)]})}function Z8({value:e,onValueChange:n,onSubmit:s,onStop:r,busy:i,disabled:c,mode:d,onModeChange:f,model:p,onModelChange:m}){return o.jsx(cb,{value:e,onValueChange:n,onSubmit:s,onStop:r,busy:i,disabled:c,placeholder:E("code_module.placeholder"),minRows:1,maxRows:6,footer:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Q8,{mode:d,onChange:f,disabled:i}),o.jsx(ub,{value:p,onChange:m,disabled:i})]})})}function th(e,n){let s=0;for(const r of e.parts||[])r.kind==="text"&&n.text&&(s+=r.text.length),r.kind==="tool"&&n.tool&&(r.args&&(s+=JSON.stringify(r.args).length),r.result!==void 0&&(s+=JSON.stringify(r.result).length));return Math.ceil(s/4)}function J8(e){let n=null,s=0,r=0;for(const d of e)d.role==="user"?s++:r++,d.role==="assistant"&&d.usage&&(n={input:d.usage.input_tokens,output:d.usage.output_tokens,model:d.model});const i=n?.input??0,c=n?.output??0;return{model:n?.model??null,input:i,output:c,total:i+c,hasUsage:!!n,messages:e.length,userMsgs:s,assistantMsgs:r}}function W8(e){let n=0,s=0,r=0;for(const d of e)d.role==="user"?n+=th(d,{text:!0}):s+=th(d,{text:!0}),r+=th(d,{tool:!0});const i=n+s+r||1,c=(d,f)=>({key:d,tokens:f,percent:Math.round(f/i*100)});return[c("user",n),c("assistant",s),c("tool",r)].filter(d=>d.tokens>0)}const X_={user:"bg-emerald-500",assistant:"bg-sky-500",tool:"bg-amber-500"};function Ts({label:e,value:n}){return o.jsxs("div",{className:"flex items-baseline justify-between gap-2 py-0.5",children:[o.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),o.jsx("span",{className:"min-w-0 truncate text-right font-mono text-xs text-foreground",children:n})]})}function K_(e){if(!e)return"";const n=new Date(e),s=r=>String(r).padStart(2,"0");return`${s(n.getDate())} ${n.toLocaleString("es",{month:"short"})} ${n.getFullYear()}, ${s(n.getHours())}:${s(n.getMinutes())}`}function e7({turns:e,session:n}){const s=b.useMemo(()=>J8(e),[e]),r=b.useMemo(()=>W8(e),[e]);return e.length===0?o.jsx("div",{className:"p-3",children:o.jsx(dt,{children:E("code_module.ctx_none")})}):o.jsxs("div",{className:"space-y-1 p-3","data-testid":"code-context-tab",children:[o.jsx(Ts,{label:E("code_module.ctx_model"),value:s.model||"auto"}),n?.mode&&o.jsx(Ts,{label:"Modo",value:n.mode}),n?.agentSlug&&o.jsx(Ts,{label:"Agente",value:n.agentSlug}),o.jsx(Ts,{label:E("code_module.ctx_messages"),value:`${s.userMsgs} usuario · ${s.assistantMsgs} asistente`}),o.jsx(Ts,{label:E("code_module.ctx_input"),value:s.input.toLocaleString()}),o.jsx(Ts,{label:E("code_module.ctx_output"),value:s.output.toLocaleString()}),o.jsx(Ts,{label:"Tokens Total",value:(s.input+s.output).toLocaleString()}),n?.createdAt&&o.jsx(Ts,{label:"Creado",value:K_(n.createdAt)}),n?.updatedAt&&o.jsx(Ts,{label:"Actividad",value:K_(n.updatedAt)}),o.jsx("hr",{className:"border-border my-2"}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold text-muted-foreground",children:E("code_module.ctx_breakdown")}),r.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-muted",children:r.map(i=>o.jsx(Mt,{content:`${i.key}: ${i.tokens} (${i.percent}%)`,children:o.jsx("div",{className:X_[i.key],style:{width:`${i.percent}%`}})},i.key))}),o.jsx("ul",{className:"mt-2 space-y-1",children:r.map(i=>o.jsxs("li",{className:"flex items-center gap-2 text-[11px]",children:[o.jsx("span",{className:`size-2 rounded-full ${X_[i.key]}`}),o.jsx("span",{className:"flex-1 text-foreground/80",children:E(`code_module.seg_${i.key}`)}),o.jsxs("span",{className:"font-mono text-muted-foreground",children:[i.tokens," · ",i.percent,"%"]})]},i.key))})]}):o.jsx("p",{className:"text-[11px] text-muted-foreground",children:E("code_module.ctx_none")})]})]})}function t7(e){const n=[];for(const s of(e||"").split(`
|
|
593
|
-
`))s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("new file")||s.startsWith("deleted file")||s.startsWith("similarity index")||s.startsWith("rename ")||(s.startsWith("@@")?n.push({kind:"hunk",text:s}):s.startsWith("+")?n.push({kind:"add",text:s.slice(1)}):s.startsWith("-")?n.push({kind:"del",text:s.slice(1)}):n.push({kind:"ctx",text:s.replace(/^ /,"")}));for(;n.length&&n[n.length-1].kind==="ctx"&&n[n.length-1].text==="";)n.pop();return n}function n7({patch:e}){const n=b.useMemo(()=>t7(e),[e]);return n.length?o.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-background/60 font-mono text-[11px] leading-relaxed",children:o.jsx("code",{className:"block",children:n.map((s,r)=>o.jsxs("div",{className:Oe("px-2 whitespace-pre",s.kind==="add"&&"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",s.kind==="del"&&"bg-rose-500/10 text-rose-600 dark:text-rose-400",s.kind==="hunk"&&"bg-muted/60 text-muted-foreground",s.kind==="ctx"&&"text-foreground/70"),children:[o.jsx("span",{className:"select-none opacity-50",children:s.kind==="add"?"+":s.kind==="del"?"-":" "}),s.text]},r))})}):null}const a7={added:bT,modified:Rd,deleted:jT},s7={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 r7({file:e}){const[n,s]=b.useState(!1),r=a7[e.status];return o.jsxs("li",{className:"rounded-md border border-border",children:[o.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"flex w-full items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-accent/40",children:[o.jsx(ef,{className:Oe("size-3 shrink-0 transition-transform",n&&"rotate-90")}),o.jsx(r,{className:Oe("size-3.5 shrink-0",s7[e.status])}),o.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:e.path}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:[e.additions!=null&&o.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["+",e.additions]}),e.deletions!=null&&o.jsxs("span",{className:"ml-1 text-rose-600 dark:text-rose-400",children:["-",e.deletions]})]})]}),n&&o.jsx("div",{className:"border-t border-border p-1.5",children:o.jsx(n7,{patch:e.patch})})]})}function o7({changes:e,loading:n,onRefresh:s}){const r=e?.files||[];return o.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-changes-tab",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-[11px] text-muted-foreground",children:r.length>0?E("code_module.changes_files",{n:r.length}):""}),o.jsx(Mt,{content:"Recargar",children:o.jsx("button",{type:"button",onClick:s,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:n?o.jsx(Oa,{size:12}):o.jsx(kr,{className:"size-3"})})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3",children:e&&!e.git?o.jsx(dt,{children:E("code_module.changes_no_git")}):r.length===0?o.jsx(dt,{children:E("code_module.changes_none")}):o.jsx("ul",{className:"space-y-1.5",children:r.map(i=>o.jsx(r7,{file:i},i.path))})})]})}function l7({pid:e,entry:n,onDeleted:s,onRenamed:r,onRunInTerminal:i,onEditArtifact:c}){const[d,f]=b.useState(!1),[p,m]=b.useState(null),g=lt(),[x,y]=b.useState(!1),[S,w]=b.useState(n.name),j=b.useRef(null),[_,C]=b.useState(!1),[k,R]=b.useState(!1),[N,A]=b.useState(!1),M=_?["artifact",e,n.name]:null,O=Je(M,()=>gl.read(e,n.name),{revalidateOnFocus:!1}),L=!O.data?.content||O.data.content.startsWith("#!"),B=async H=>{try{await navigator.clipboard.writeText(H),g.info("Copiado.")}catch{}},I=async()=>{A(!0);try{await gl.remove(e,n.name),R(!1),s()}catch(H){g.error(H.message)}finally{A(!1)}},D=()=>{w(n.name),y(!0),requestAnimationFrame(()=>j.current?.select())},z=async()=>{const H=S.trim();if(y(!1),!(!H||H===n.name))try{await gl.rename(e,n.name,H),r()}catch(V){g.error(V.message)}};return o.jsxs("li",{className:"rounded-md border border-border",children:[o.jsxs("div",{className:"flex w-full items-center gap-2 px-2 py-1.5 text-xs",children:[o.jsx(xT,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),x?o.jsx("input",{ref:j,value:S,onChange:H=>w(H.target.value),onBlur:()=>void z(),onKeyDown:H=>{H.key==="Enter"&&z(),H.key==="Escape"&&y(!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"}):o.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:n.name}),o.jsx(Mt,{content:"Renombrar",children:o.jsx("button",{type:"button",onClick:D,className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.jsx(af,{className:"size-3"})})}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:[n.size,"b"]})]}),o.jsxs("div",{className:"space-y-2 border-t border-border p-2",children:[o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5",children:[o.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-[10px] text-muted-foreground",children:n.path}),o.jsx(Mt,{content:E("code_module.artifacts_copy_path"),children:o.jsx("button",{type:"button",onClick:()=>void B(n.path),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.jsx(Nd,{className:"size-3"})})})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1 mt-1",children:[o.jsxs(Th,{open:_,onOpenChange:C,children:[o.jsx(Mt,{content:"Ver contenido",children:o.jsxs("button",{type:"button",onClick:()=>C(!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:[o.jsx(ex,{className:"size-3"}),"Ver"]})}),o.jsxs(Ah,{className:"sm:max-w-lg",children:[o.jsx(Mh,{children:o.jsx(Oh,{className:"font-mono text-sm",children:n.name})}),O.isLoading?o.jsx("div",{className:"flex justify-center py-6",children:o.jsx(Oa,{size:16})}):o.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:O.data?.content??""}),o.jsx(Lj,{showCloseButton:!0})]})]}),o.jsx(Mt,{content:"Editar contenido",children:o.jsxs("button",{type:"button",onClick:()=>c?.(n.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:[o.jsx(XT,{className:"size-3"}),"Editar"]})}),L&&o.jsx(Mt,{content:E("code_module.artifacts_run"),children:o.jsxs("button",{type:"button",onClick:()=>i?.(`apx artifact run ${n.name}`),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 dark:text-emerald-300",children:[o.jsx(nx,{className:"size-3"}),E("code_module.artifacts_run")]})}),o.jsxs(Th,{open:k,onOpenChange:R,children:[o.jsx(Mt,{content:E("code_module.artifacts_delete"),children:o.jsx("button",{type:"button",onClick:()=>R(!0),className:"ml-auto rounded p-1 text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950",children:o.jsx(rs,{className:"size-3"})})}),o.jsxs(Ah,{className:"sm:max-w-sm",children:[o.jsx(Mh,{children:o.jsxs(Oh,{className:"font-mono text-sm",children:[E("code_module.artifacts_delete")," — ",n.name]})}),o.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:E("code_module.artifacts_delete_confirm")}),o.jsxs(Lj,{children:[o.jsx(cz,{render:o.jsx("button",{type:"button",className:"rounded px-3 py-1.5 text-xs font-medium hover:bg-accent"}),children:"Cancelar"}),o.jsxs("button",{type:"button",onClick:()=>void I(),disabled:N,className:Oe("inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium",N?"bg-muted text-muted-foreground":"bg-rose-500/15 text-rose-700 hover:bg-rose-500/25 dark:text-rose-300"),children:[N&&o.jsx(Oa,{size:10}),"Eliminar"]})]})]})]})]}),o.jsxs("div",{className:"mt-1 text-[10px] text-muted-foreground",children:[E("code_module.artifacts_run_hint")," ",o.jsxs("code",{className:"rounded bg-muted px-1 font-mono",children:["apx artifact run ",n.name]})]}),p&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[o.jsxs("span",{className:Oe("rounded px-1.5 py-0.5 font-mono",p.ok?"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300":"bg-rose-500/15 text-rose-700 dark:text-rose-300"),children:["exit ",p.exitCode??p.signal??"?"]}),p.timedOut&&o.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 font-mono text-amber-700 dark:text-amber-300",children:"timeout"}),p.truncated&&o.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 font-mono text-amber-700 dark:text-amber-300",children:"truncated"}),o.jsxs("span",{className:"font-mono text-muted-foreground",children:[p.durationMs,"ms"]})]}),p.stdout&&o.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-background/60 p-2 text-[10px] leading-tight",children:p.stdout}),p.stderr&&o.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:p.stderr})]})]})]})}function i7({pid:e,onRunInTerminal:n,onEditArtifact:s}){const r=Je(e?["artifacts",e]:null,()=>gl.list(e)),i=r.data||[];return o.jsxs("div",{className:"flex h-full flex-col","data-testid":"code-artifacts-tab",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[o.jsx("span",{className:"text-[11px] text-muted-foreground",children:i.length>0?E("code_module.artifacts_count",{n:i.length}):""}),o.jsx(Mt,{content:"Recargar",children:o.jsx("button",{type:"button",onClick:()=>void r.mutate(),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:r.isLoading?o.jsx(Oa,{size:12}):o.jsx(kr,{className:"size-3"})})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3",children:i.length===0?o.jsx(dt,{children:E("code_module.artifacts_none")}):o.jsx("ul",{className:"space-y-1.5",children:i.map(c=>o.jsx(l7,{pid:e,entry:c,onDeleted:()=>void r.mutate(),onRenamed:()=>void r.mutate(),onRunInTerminal:n,onEditArtifact:s},c.name))})})]})}const c7=[{value:"context",icon:tf,label:"tab_context"},{value:"changes",icon:ET,label:"tab_changes"},{value:"artifacts",icon:HT,label:"tab_artifacts"}];function u7({pid:e,turns:n,changes:s,changesLoading:r,onRefreshChanges:i,session:c,onRunInTerminal:d,onEditArtifact:f}){const[p,m]=b.useState("context"),g=s?.files.length||0;return o.jsxs(Rf,{value:p,onValueChange:m,className:"flex h-full flex-col gap-0","data-testid":"code-side-panel",children:[o.jsx("div",{className:"shrink-0 border-b border-border px-2 py-2",children:o.jsx(Tf,{variant:"line",className:"w-full",children:c7.map(({value:x,icon:y,label:S})=>{const w=p===x,j=E(`code_module.${S}`);return o.jsx(Mt,{content:j,children:o.jsxs(Wa,{value:x,className:w?"flex-1 min-w-0":"w-8 shrink-0",children:[o.jsx(y,{className:"size-3.5 shrink-0"}),w&&o.jsx("span",{className:"truncate text-xs",children:j}),x==="changes"&&g>0&&o.jsx("span",{className:"ml-0.5 rounded-full bg-muted px-1 text-[10px] text-muted-foreground leading-none py-0.5",children:g})]})},x)})})}),o.jsx(Aa,{value:"context",className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(e7,{turns:n,session:c})}),o.jsx(Aa,{value:"changes",className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(o7,{changes:s,loading:r,onRefresh:i})}),o.jsx(Aa,{value:"artifacts",className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(i7,{pid:e,onRunInTerminal:d,onEditArtifact:f})})]})}function d7(e){const n=[];for(const r of e){const i=r.split("/").filter(Boolean);let c=n,d="";for(let f=0;f<i.length;f++){d=d?`${d}/${i[f]}`:i[f];const p=f===i.length-1;let m=c.find(g=>g.name===i[f]);m||(m={name:i[f],path:d,type:p?"file":"dir",children:p?void 0:[]},c.push(m)),p||(c=m.children)}}const s=r=>(r.forEach(i=>{i.children&&(i.children=s(i.children))}),r.sort((i,c)=>i.type!==c.type?i.type==="dir"?-1:1:i.name.localeCompare(c.name)));return s(n)}function ak({node:e,depth:n,onOpenFile:s,openDirs:r,toggleDir:i}){const c=e.type==="dir",d=c&&r.has(e.path);return o.jsxs("li",{children:[o.jsxs("button",{type:"button",onClick:()=>c?i(e.path):s(e.path),style:{paddingLeft:`${n*12+6}px`},className:Oe("flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[11px] rounded transition-colors","hover:bg-accent/40",c?"text-foreground/80":"text-foreground/70"),children:[c?o.jsxs(o.Fragment,{children:[o.jsx(ef,{className:Oe("size-3 shrink-0 transition-transform",d&&"rotate-90")}),d?o.jsx(TS,{className:"size-3.5 shrink-0 text-amber-400"}):o.jsx(CT,{className:"size-3.5 shrink-0 text-amber-400"})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"size-3 shrink-0"}),o.jsx(_T,{className:"size-3.5 shrink-0 text-sky-400"})]}),o.jsx("span",{className:"truncate",children:e.name})]}),c&&d&&e.children&&e.children.length>0&&o.jsx("ul",{children:e.children.map(f=>o.jsx(ak,{node:f,depth:n+1,onOpenFile:s,openDirs:r,toggleDir:i},f.path))})]})}function f7({pid:e,projectPath:n,className:s,onOpenFile:r}){const[i,c]=b.useState([]),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[g,x]=b.useState(()=>new Set),y=b.useCallback(async()=>{f(!0);try{const k=(await he.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(`
|
|
594
|
-
`).map(R=>R.trim()).filter(Boolean);c(k),m(!0)}catch{m(!0)}finally{f(!1)}},[e]);b.useEffect(()=>{x(new Set),y()},[y]);const S=b.useCallback(C=>{x(k=>{const R=new Set(k);return R.has(C)?R.delete(C):R.add(C),R})},[]),w=b.useCallback(()=>{x(new Set)},[]),j=d7(i),_=g.size>0;return o.jsxs("div",{className:Oe("flex h-full flex-col",s),"data-testid":"code-file-tree",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-3 py-2",children:[o.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Archivos"}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Mt,{content:"Colapsar todo",children:o.jsx("button",{type:"button",onClick:w,disabled:!_,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40 disabled:hover:bg-transparent",children:o.jsx(uT,{className:"size-3"})})}),o.jsx(Mt,{content:"Recargar",children:o.jsx("button",{type:"button",onClick:()=>void y(),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:d?o.jsx(Oa,{size:12}):o.jsx(kr,{className:"size-3"})})})]})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:p?j.length===0?o.jsx("div",{className:"p-3",children:o.jsx(dt,{children:"Sin archivos"})}):o.jsx("ul",{children:j.map(C=>o.jsx(ak,{node:C,depth:0,onOpenFile:r??(()=>{}),openDirs:g,toggleDir:S},C.path))}):o.jsx("div",{className:"flex justify-center pt-6",children:o.jsx(Oa,{size:14})})})]})}function p7({path:e,content:n,loading:s,onSave:r}){const i=typeof r=="function",[c,d]=b.useState(n),[f,p]=b.useState(!1);b.useEffect(()=>{d(n)},[n]);const m=i&&c!==n,g=async()=>{if(!(!r||!m)){p(!0);try{await r(c)}finally{p(!1)}}};return o.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/40","data-testid":"code-file-viewer",children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[o.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:[e,m&&o.jsx("span",{className:"ml-1 text-amber-400",children:"•"})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx(Mt,{content:"Descartar cambios",children:o.jsxs("button",{type:"button",onClick:()=>d(n),disabled:!m||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:[o.jsx(ax,{className:"size-3"}),"Descartar"]})}),o.jsx(Mt,{content:"Guardar (Cmd/Ctrl+S)",children:o.jsxs("button",{type:"button",onClick:()=>void g(),disabled:!m||f,className:Oe("inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-medium transition-colors",m&&!f?"bg-emerald-500/15 text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:[f?o.jsx(Oa,{size:10}):o.jsx(sf,{className:"size-3"}),"Guardar"]})})]})]}),s?o.jsx("div",{className:"flex flex-1 items-center justify-center",children:o.jsx(Oa,{size:16})}):i?o.jsx("textarea",{value:c,onChange:x=>d(x.target.value),onKeyDown:x=>{(x.metaKey||x.ctrlKey)&&x.key==="s"&&(x.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}):o.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:o.jsx("table",{className:"w-full border-collapse font-mono text-[12px] leading-[1.6]",children:o.jsx("tbody",{children:n.split(`
|
|
595
|
-
`).map((x,y)=>o.jsxs("tr",{className:"hover:bg-accent/20",children:[o.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:y+1}),o.jsx("td",{className:"px-4 py-0 align-top text-foreground/90 whitespace-pre",children:x||" "})]},y))})})})]})}function m7({pid:e,className:n,initCmd:s,onClose:r}){const[i,c]=b.useState([]),[d,f]=b.useState(""),[p,m]=b.useState(!1),[g,x]=b.useState([]),[y,S]=b.useState(-1),w=b.useRef(null),j=b.useRef(null);b.useEffect(()=>{w.current?.scrollIntoView({behavior:"smooth"})},[i]),b.useEffect(()=>{s&&(f(s),setTimeout(()=>j.current?.focus(),50))},[s]);const _=async k=>{const R=k.trim();if(R){x(N=>[R,...N.slice(0,49)]),S(-1),c(N=>[...N,{type:"cmd",text:`$ ${R}`}]),m(!0);try{const N=await he.post("/run",{cmd:R,project:e});N.stdout&&c(A=>[...A,{type:"out",text:N.stdout}]),N.stderr&&c(A=>[...A,{type:"err",text:N.stderr}])}catch(N){c(A=>[...A,{type:"err",text:String(N.message)}])}finally{m(!1)}}},C=k=>{if(k.key==="Enter")_(d),f("");else if(k.key==="ArrowUp"){k.preventDefault();const R=Math.min(y+1,g.length-1);S(R),f(g[R]??"")}else if(k.key==="ArrowDown"){k.preventDefault();const R=Math.max(y-1,-1);S(R),f(R===-1?"":g[R]??"")}};return o.jsxs("div",{className:Oe("flex h-full min-h-0 flex-col bg-card/60",n),"data-testid":"code-terminal",children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1",children:[o.jsx(oo,{className:"size-3 text-muted-foreground"}),o.jsx("span",{className:"flex-1 text-[11px] text-muted-foreground",children:"Terminal"}),o.jsx(Mt,{content:"Limpiar",children:o.jsx("button",{type:"button",onClick:()=>c([]),className:"rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.jsx(hT,{className:"size-3"})})}),o.jsx(Mt,{content:"Cerrar terminal",children:o.jsx("button",{type:"button",onClick:()=>r?.(),className:"rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.jsx(xo,{className:"size-3"})})})]}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-1 font-mono text-[11px] leading-snug cursor-text",onClick:()=>j.current?.focus(),children:[i.map((k,R)=>o.jsx("div",{className:Oe("whitespace-pre-wrap break-all",k.type==="cmd"&&"text-emerald-400",k.type==="err"&&"text-rose-400",k.type==="out"&&"text-foreground/90"),children:k.text},R)),o.jsx("div",{ref:w})]}),o.jsxs("div",{className:"flex shrink-0 items-center border-t border-border px-3 py-1",children:[o.jsx("span",{className:"mr-2 text-[11px] text-emerald-400 font-mono",children:"$"}),o.jsx("input",{ref:j,value:d,onChange:k=>f(k.target.value),onKeyDown:C,disabled:p,placeholder:p?"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 Fi="super-agent";function nh(){return o.jsx(wb,{className:"relative z-10 w-px shrink-0 cursor-col-resize bg-border transition-colors hover:bg-primary/50 active:bg-primary/70"})}function g7(){return o.jsx(wb,{className:"relative z-10 h-px shrink-0 cursor-row-resize bg-border transition-colors hover:bg-primary/50 active:bg-primary/70"})}function h7(){const e=lt(),n=Je("/projects",()=>ta.list()),s=b.useMemo(()=>n.data||[],[n.data]),[r,i]=b.useState(""),[c,d]=b.useState(null),[f,p]=b.useState(Fi),[m,g]=b.useState([]),[x,y]=b.useState(""),[S,w]=b.useState(!1),[j,_]=b.useState(!0),[C,k]=b.useState(!0),[R,N]=b.useState(!1),[A,M]=b.useState(""),[O,L]=b.useState(!1),B=b.useRef(null),[I,D]=b.useState([]),[z,H]=b.useState("chat"),V=b.useCallback(pe=>{N(!0),M(pe)},[]);b.useEffect(()=>{!r&&s.length&&i(String(s[0].id))},[r,s]);const Y=Je(r?["code-sessions",r]:null,()=>Rs.sessions.list(r)),q=Je(r?["agents",r]:null,()=>Wt.list(r)),F=Je(r&&c?["code-session",r,c]:null,()=>Rs.sessions.get(r,c)),Z=Je(r&&c?["code-changes",r,c]:null,()=>Rs.changes(r,c));b.useEffect(()=>{const pe=Y.data||[];!c&&pe.length&&d(pe[0].id),c&&pe.length&&!pe.some(ke=>ke.id===c)&&d(pe[0]?.id??null)},[Y.data,c]),b.useEffect(()=>{F.data&&p(F.data.agentSlug||Fi)},[F.data]),b.useEffect(()=>{S||(F.data?g(F.data.messages||[]):c||g([]))},[F.data,c,S]),b.useEffect(()=>()=>B.current?.abort(),[]);const $=F.data,X=$?.mode==="plan"?"plan":"build",U=$?.model||"",K=pe=>{pe===r||S||(i(pe),d(null),g([]))},G=pe=>{S||pe===c||(d(pe),g([]))},W=async()=>{if(!(!r||S))try{const pe=await Rs.sessions.create(r,{title:E("code_module.untitled"),agentSlug:f!==Fi?f:null});await Y.mutate(),d(pe.id),g([])}catch(pe){e.error(pe.message)}},ie=async(pe,ke)=>{const Ne=window.prompt(E("code_module.rename"),ke);if(!(!Ne||Ne===ke))try{await Rs.sessions.update(r,pe,{title:Ne}),await Y.mutate(),pe===c&&await F.mutate()}catch(qe){e.error(qe.message)}},re=async pe=>{if(!S&&window.confirm(E("code_module.delete_confirm")))try{await Rs.sessions.remove(r,pe),pe===c&&(d(null),g([])),await Y.mutate()}catch(ke){e.error(ke.message)}},oe=async pe=>{if(p(pe),!!c)try{await Rs.sessions.update(r,c,{agentSlug:pe!==Fi?pe:null}),await Promise.all([F.mutate(),Y.mutate()])}catch(ke){e.error(ke.message)}},ce=b.useCallback(async pe=>{if(c)try{await Rs.sessions.update(r,c,pe),await Promise.all([F.mutate(),Y.mutate()])}catch(ke){e.error(ke.message)}},[r,c,F,Y,e]),ee=()=>{B.current?.abort(),w(!1)},Te=pe=>g(ke=>{const Ne=[...ke],qe=Ne[Ne.length-1];return qe&&qe.role==="assistant"&&(Ne[Ne.length-1]=pe(qe)),Ne}),$e=async pe=>{const ke=(pe??x).trim();if(!ke||S||!r||!c)return;const Ne=new Date().toISOString();g(nn=>[...nn,{role:"user",parts:[{kind:"text",text:ke}],ts:Ne},{role:"assistant",parts:[],ts:Ne,pending:!0}]),y(""),w(!0);const qe=new AbortController;B.current=qe;const at=nn=>{if(nn.type==="error"){e.error(nn.error||"error");return}Te(qt=>db(qt,nn))};try{await Rs.stream(r,c,{prompt:ke},at,qe.signal),Te(nn=>({...nn,pending:!1}))}catch(nn){qe.signal.aborted?Te(qt=>({...qt,pending:!1,parts:[...qt.parts,{kind:"text",text:E("code_module.stopped")}]})):(e.error(nn.message),g(qt=>qt.filter((mt,Nt)=>Nt!==qt.length-1)))}finally{B.current===qe&&(B.current=null),w(!1),F.mutate(),Y.mutate(),Z.mutate()}},be=async pe=>{try{await navigator.clipboard.writeText(pe),e.info("Copiado.")}catch{}},Ce=b.useCallback(pe=>{H(pe),D(ke=>ke.some(Ne=>Ne.path===pe)?ke:[...ke,{path:pe,content:"",loading:!0}]),he.post("/run",{cmd:`cat "${pe}"`,project:r}).then(ke=>{const Ne=ke.stdout||ke.stderr||"(vacío)";D(qe=>qe.map(at=>at.path===pe?{...at,content:Ne,loading:!1}:at))}).catch(ke=>{D(Ne=>Ne.map(qe=>qe.path===pe?{...qe,content:`Error: ${ke.message}`,loading:!1}:qe))})},[r]),Ee=b.useCallback(pe=>{D(ke=>ke.filter(Ne=>Ne.path!==pe)),H(ke=>ke===pe?"chat":ke)},[]),Pe=b.useCallback(pe=>{const ke=`artifacts/${pe}`;H(ke),D(Ne=>Ne.some(qe=>qe.path===ke)?Ne:[...Ne,{path:ke,content:"",loading:!0,artifactName:pe}]),gl.read(r,pe).then(Ne=>{D(qe=>qe.map(at=>at.path===ke?{...at,content:Ne.content,loading:!1}:at))}).catch(Ne=>{D(qe=>qe.map(at=>at.path===ke?{...at,content:`Error: ${Ne.message}`,loading:!1}:at))})},[r]),Ie=b.useCallback(async(pe,ke)=>{const Ne=I.find(qe=>qe.path===pe);if(Ne?.artifactName)try{await gl.write(r,Ne.artifactName,ke),D(qe=>qe.map(at=>at.path===pe?{...at,content:ke}:at)),e.info("Guardado.")}catch(qe){e.error(qe.message)}},[I,r,e]),xe=!n.isLoading&&s.length>0,Ae=b.useMemo(()=>{const pe=[{value:Fi,label:"super-agent",icon:vn,description:"Agente principal con todas las herramientas"}],ke=(q.data||[]).map(Ne=>({value:Ne.slug,label:Ne.slug,icon:vn,description:Ne.description||Ne.role||void 0}));return[...pe,...ke]},[q.data]),_e=b.useMemo(()=>m,[m]),Be=b.useMemo(()=>Y.data?.find(pe=>pe.id===c)?.title||"",[Y.data,c]),Fe=b.useMemo(()=>s.find(pe=>String(pe.id)===r),[s,r]);Ez(Be);const[Ge,De]=b.useState(null),ye=S?null:TC(m),le=ye&&ye.turnKey!==Ge,je=pe=>{$e(pe)},we=b.useCallback(()=>_(pe=>!pe),[]),Ue=b.useCallback(()=>L(pe=>!pe),[]),We=b.useCallback(()=>N(pe=>!pe),[]),jt=b.useCallback(()=>k(pe=>!pe),[]),zt=b.useMemo(()=>c?o.jsx("div",{className:"flex items-center gap-0.5",children:[{Icon:OS,open:j,toggle:we,title:"Lista de sesiones"},{Icon:AS,open:O,toggle:Ue,title:"Árbol de archivos"},{Icon:oo,open:R,toggle:We,title:"Terminal"},{Icon:VT,open:C,toggle:jt,title:"Panel de contexto"}].map(({Icon:pe,open:ke,toggle:Ne,title:qe})=>o.jsx(Mt,{content:qe,children:o.jsx("button",{type:"button",onClick:Ne,"data-active":ke,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:o.jsx(pe,{className:"size-3.5"})})},qe))}):null,[c,j,O,R,C,we,Ue,We,jt]);return Rz(zt),o.jsx("div",{className:"flex h-full min-h-0 flex-col","data-testid":"screen-code",children:n.isLoading?o.jsx(nt,{}):xe?o.jsxs(qh,{orientation:"vertical",id:"code-layout-v",className:"min-h-0 flex-1",children:[o.jsx(Wr,{id:"top",defaultSize:R?"55%":"100%",minSize:"20%",children:o.jsxs(qh,{orientation:"horizontal",id:"code-layout",className:"h-full",children:[j&&o.jsxs(o.Fragment,{children:[o.jsx(Wr,{id:"left",defaultSize:"14%",minSize:"8%",children:o.jsxs("aside",{className:"flex h-full flex-col",children:[o.jsx("div",{className:"shrink-0 border-b border-border p-2",children:o.jsx(X8,{projects:s,value:r,onChange:K,disabled:S})}),o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(K8,{sessions:Y.data||[],activeId:c,busy:S,onSelect:G,onCreate:W,onRename:ie,onDelete:re})}),o.jsx("div",{className:"shrink-0 border-t border-border p-2",children:o.jsx(kt,{value:f,onChange:oe,options:Ae,disabled:S,showIcon:!0})})]})}),o.jsx(nh,{})]}),O&&o.jsxs(o.Fragment,{children:[o.jsx(Wr,{id:"tree",defaultSize:"13%",minSize:"8%",children:o.jsx("div",{className:"h-full",children:o.jsx(f7,{pid:r,projectPath:Fe?.path,onOpenFile:Ce})})}),o.jsx(nh,{})]}),o.jsx(Wr,{id:"main",defaultSize:"50%",minSize:"20%",children:o.jsxs("div",{className:"flex h-full flex-col",children:[I.length>0&&o.jsxs("div",{className:"flex shrink-0 items-center gap-0 overflow-x-auto border-b border-border",children:[o.jsxs("button",{type:"button",onClick:()=>H("chat"),"data-active":z==="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:[o.jsx(MS,{className:"size-3 shrink-0"}),"Chat"]}),I.map(pe=>{const ke=pe.path.split("/").pop()??pe.path,Ne=z===pe.path;return o.jsxs("div",{"data-active":Ne,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:[o.jsx(Mt,{content:pe.path,children:o.jsx("button",{type:"button",onClick:()=>H(pe.path),className:"min-w-0 max-w-[140px] truncate font-mono",children:ke})}),o.jsx(Mt,{content:"Cerrar",children:o.jsx("button",{type:"button",onClick:()=>Ee(pe.path),className:"shrink-0 rounded p-0.5 opacity-60 hover:bg-accent hover:opacity-100",children:o.jsx(xo,{className:"size-2.5"})})})]},pe.path)})]}),z==="chat"?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"code-transcript",children:c?m.length?o.jsx(fb,{msgs:m,onCopy:be}):o.jsx("div",{className:"grid h-full place-items-center p-6",children:o.jsx(dt,{children:E("code_module.empty_chat")})}):o.jsx("div",{className:"grid h-full place-items-center p-6",children:o.jsx(dt,{children:E("code_module.pick_project")})})}),le&&ye&&o.jsx(RC,{turnKey:ye.turnKey,questions:ye.questions,onSubmit:je,onDismiss:()=>De(ye.turnKey),disabled:S})]}):o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:(()=>{const pe=I.find(ke=>ke.path===z);return pe?o.jsx(p7,{path:pe.path,content:pe.content,loading:pe.loading,onSave:pe.artifactName?ke=>Ie(pe.path,ke):void 0}):null})()}),o.jsx("div",{className:"shrink-0 border-t border-border p-2","data-testid":"code-input",children:o.jsx(Z8,{value:x,onValueChange:y,onSubmit:()=>void $e(),onStop:ee,busy:S,disabled:!c,mode:X,onModeChange:pe=>void ce({mode:pe}),model:U,onModelChange:pe=>void ce({model:pe||null})})})]})}),C&&o.jsxs(o.Fragment,{children:[o.jsx(nh,{}),o.jsx(Wr,{id:"right",defaultSize:"22%",minSize:"15%",children:o.jsx("aside",{className:"flex h-full flex-col",children:o.jsx(u7,{pid:r,turns:_e,changes:Z.data,changesLoading:Z.isLoading,onRefreshChanges:()=>void Z.mutate(),session:F.data?{title:F.data.title,mode:F.data.mode,createdAt:F.data.createdAt,updatedAt:F.data.updatedAt,agentSlug:F.data.agentSlug??null}:null,onRunInTerminal:V,onEditArtifact:Pe})})})]})]})}),R&&r&&o.jsxs(o.Fragment,{children:[o.jsx(g7,{}),o.jsx(Wr,{id:"terminal",defaultSize:"45%",minSize:"10%",maxSize:"80%",children:o.jsx(m7,{pid:r,initCmd:A,onClose:We,className:"h-full"})})]})]}):o.jsx("div",{className:"grid flex-1 place-items-center",children:o.jsx(dt,{children:E("code_module.no_projects")})})})}function x7({open:e,onClose:n}){const{mutate:s}=j2(),r=lt(),[i,c]=b.useState(""),[d,f]=b.useState(""),[p,m]=b.useState([]),[g,x]=b.useState(null),[y,S]=b.useState(""),[w,j]=b.useState(!1),[_,C]=b.useState(!1),k=async(N,A=!1)=>{j(!0),S("");try{const M=await GO.dirs(N||"~");f(M.path),c(M.path),x(M.parent),m(M.entries)}catch(M){const O=M.message;S(O),A||r.error(O)}finally{j(!1)}};b.useEffect(()=>{e&&!d&&k(i||"~",!0)},[e]);const R=async()=>{const N=i.trim();if(!N){r.error(E("add_project.path_required"));return}C(!0);try{const A=await ta.register(N);r.success(E("add_project.registered",{id:A.id})),await s("/projects"),c(""),n()}catch(A){r.error(A.message)}finally{C(!1)}};return o.jsx(ba,{open:e,onClose:n,title:E("add_project.title"),description:E("add_project.subtitle"),footer:o.jsxs(o.Fragment,{children:[o.jsx(ve,{variant:"ghost",onClick:n,disabled:_,children:E("common.cancel")}),o.jsx(ve,{variant:"primary",onClick:R,loading:_,children:E("add_project.register")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:E("add_project.path_label"),hint:E("add_project.path_hint"),children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Re,{autoFocus:!0,placeholder:E("add_project.path_placeholder"),value:i,onChange:N=>c(N.target.value),onKeyDown:N=>{N.key==="Enter"&&R()}}),o.jsxs(ve,{onClick:()=>k(i||"~"),disabled:w,children:[o.jsx(xd,{size:14})," ",E("add_project.search_btn")]})]})}),o.jsxs("div",{className:"rounded-md border border-border bg-muted/20",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[o.jsx("span",{className:"truncate font-mono text-xs text-muted-fg",children:d||i||"~"}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>k("~"),disabled:w,children:o.jsx(TT,{size:13})}),o.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>g&&k(g),disabled:!g||w,children:".."})]})]}),o.jsxs("div",{className:"max-h-64 overflow-y-auto p-2",children:[w&&o.jsx(nt,{}),!w&&y&&o.jsx(dt,{children:E("add_project.browser_unavailable")}),!w&&!y&&p.length===0&&o.jsx(dt,{children:E("add_project.no_folders")}),!w&&!y&&p.map(N=>o.jsxs("button",{type:"button",onClick:()=>k(N),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent",children:[o.jsx(TS,{size:14,className:"text-muted-fg"}),o.jsx("span",{className:"truncate",children:N.split("/").pop()}),o.jsx("span",{className:"ml-auto truncate font-mono text-[10px] text-muted-fg",children:N})]},N))]})]})]})})}function b7({onPaired:e}){const[n,s]=b.useState(""),[r,i]=b.useState(v7()),[c,d]=b.useState(!1),[f,p]=b.useState(null);async function m(){const g=n.trim();if(!g){p(E("pairing.err_required"));return}d(!0),p(null);try{const x=await wl.confirm({pairing_id:g,label:r.trim()||void 0});eo(x.token);try{localStorage.setItem(Nn.token,x.token)}catch{}e()}catch(x){p(y7(x)),d(!1)}}return o.jsx("div",{className:"flex min-h-[100dvh] w-full items-center justify-center overflow-y-auto bg-background p-4 text-foreground",children:o.jsxs("div",{className:"my-auto w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-sm",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[o.jsx("div",{className:"grid size-10 place-items-center rounded-lg bg-primary/10 text-primary",children:o.jsx(MT,{size:20})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-base font-semibold",children:E("pairing.title")}),o.jsx("p",{className:"text-xs text-muted-fg",children:E("pairing.subtitle")})]})]}),o.jsxs("ol",{className:"mb-5 space-y-1.5 rounded-lg bg-muted/50 p-3 text-xs text-muted-fg",children:[o.jsx("li",{className:"font-medium text-foreground",children:E("pairing.steps_title")}),o.jsxs("li",{children:["1. ",E("pairing.step_1")]}),o.jsxs("li",{children:["2. ",E("pairing.step_2")]}),o.jsxs("li",{children:["3. ",E("pairing.step_3")]})]}),o.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),m()},children:[o.jsx(fe,{label:E("pairing.code_label"),children:o.jsx(Re,{value:n,onChange:g=>s(g.target.value),placeholder:E("pairing.code_ph"),spellCheck:!1,autoComplete:"off"})}),o.jsx(fe,{label:E("pairing.label_label"),hint:E("pairing.revoke_hint"),children:o.jsx(Re,{value:r,onChange:g=>i(g.target.value),placeholder:E("pairing.label_ph")})}),f&&o.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:f}),o.jsx(ve,{type:"submit",variant:"primary",size:"md",loading:c,className:"w-full justify-center",children:E(c?"pairing.linking":"pairing.submit")})]})]})})}function v7(){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 y7(e){if(e instanceof Tc){if(e.status===410)return E("pairing.err_expired");if(e.status===404||e.status===409)return E("pairing.err_unknown")}return E("pairing.err_generic")}function j7({...e}){return o.jsx($2,{"data-slot":"sheet",...e})}function _7({...e}){return o.jsx(q2,{"data-slot":"sheet-portal",...e})}function S7({className:e,...n}){return o.jsx(z2,{"data-slot":"sheet-overlay",className:Ot("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),...n})}function w7({className:e,children:n,side:s="right",showCloseButton:r=!0,...i}){return o.jsxs(_7,{children:[o.jsx(S7,{}),o.jsxs(U2,{"data-slot":"sheet-content","data-side":s,className:Ot("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),...i,children:[n,r&&o.jsxs(kf,{"data-slot":"sheet-close",render:o.jsx(uo,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[o.jsx(xo,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function C7({className:e,...n}){return o.jsx("div",{"data-slot":"sheet-header",className:Ot("flex flex-col gap-0.5 p-4",e),...n})}function k7({className:e,...n}){return o.jsx(G2,{"data-slot":"sheet-title",className:Ot("font-heading text-base font-medium text-foreground",e),...n})}function E7({className:e,...n}){return o.jsx(D2,{"data-slot":"sheet-description",className:Ot("text-sm text-muted-foreground",e),...n})}function N7({value:e,projectPath:n,onPick:s}){const r=R7(e),i=r?T7(e):"",{data:c}=Je(r?["/skills",n||""]:null,()=>JO.list(n)),d=c?.skills||[],f=b.useMemo(()=>{const p=i.toLowerCase();return p?d.filter(m=>m.slug.toLowerCase().includes(p)).slice(0,8):d.slice(0,8)},[d,i]);return!r||f.length===0?null:o.jsxs("div",{className:"rounded-xl border border-border bg-popover/95 text-sm shadow-md backdrop-blur",children:[o.jsx("ul",{role:"listbox",className:"max-h-64 overflow-y-auto py-1",children:f.map(p=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>s(p.slug),className:"flex w-full items-start gap-2 px-3 py-1.5 text-left hover:bg-accent hover:text-accent-foreground",children:[o.jsxs("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:["/",p.slug]}),o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:p.description})]})},p.slug))}),o.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 R7(e){return!!e.match(/^\s*\/([A-Za-z0-9_-]*)$/)}function T7(e){const n=e.match(/^\s*\/([A-Za-z0-9_-]*)$/);return n?n[1]:""}function A7(){try{const e=localStorage.getItem(Nn.robyChat);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.filter(s=>s&&Array.isArray(s.parts)&&!s.pending):[]}catch{return[]}}function M7({open:e,onOpenChange:n}){const s=Fx(),r=lt(),[i,c]=b.useState(A7),[d,f]=b.useState(""),[p,m]=b.useState(!1),[g,x]=b.useState(""),y=b.useRef(null);b.useEffect(()=>{const k=i.filter(R=>!R.pending);try{k.length?localStorage.setItem(Nn.robyChat,JSON.stringify(k)):localStorage.removeItem(Nn.robyChat)}catch{}},[i]);const S=()=>{if(!p){c([]),f("");try{localStorage.removeItem(Nn.robyChat)}catch{}}};b.useEffect(()=>()=>y.current?.abort(),[]);const w=()=>{y.current?.abort(),m(!1)},j=k=>c(R=>{const N=[...R],A=N[N.length-1];return A?.role==="assistant"&&(N[N.length-1]=k(A)),N}),_=async()=>{const k=d.trim();if(!k||p)return;const R=new Date().toISOString(),N=i.filter(L=>!L.pending).map(L=>({role:L.role,content:EC(L)}));c(L=>[...L,{role:"user",parts:[{kind:"text",text:k}],ts:R},{role:"assistant",parts:[],ts:R,pending:!0}]),f(""),m(!0);const A=new AbortController;y.current=A;let M=!1;const O=L=>{if(L?.type==="error"){M=!0,r.error(L.error||"error"),c(B=>{const I=[...B],D=I[I.length-1];return D?.role==="assistant"&&D.pending&&I.pop(),I});return}j(B=>db(B,L))};try{await S2.stream(0,{prompt:k,previousMessages:N,model:g||void 0,channel:"web_sidebar"},O,A.signal),j(L=>({...L,pending:!1}))}catch(L){A.signal.aborted?j(B=>({...B,pending:!1,parts:[...B.parts,{kind:"text",text:E("project.chat.stopped_marker")}]})):M||(r.error(L.message),c(B=>{const I=[...B],D=I[I.length-1];return D?.role==="assistant"&&D.pending&&I.pop(),I}))}finally{y.current===A&&(y.current=null),m(!1)}},C=async k=>{try{await navigator.clipboard.writeText(k),r.info(E("project.chat.copied"))}catch{}};return o.jsx(j7,{open:e,onOpenChange:n,children:o.jsxs(w7,{side:"right",className:"flex w-full flex-col gap-0 p-0 sm:max-w-xl data-[side=right]:sm:max-w-xl",children:[o.jsxs(C7,{className:"pr-12",children:[o.jsxs(k7,{className:"flex items-center gap-2",children:[o.jsx(vn,{size:18})," ",E("superagent.title",{persona:s}),o.jsx("span",{className:"text-xs font-normal text-muted-fg",children:E("superagent.badge")})]}),o.jsx(E7,{children:E("superagent.desc")})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:i.length===0?o.jsx("p",{className:"mt-6 text-center text-sm text-muted-fg",children:E("superagent.empty",{persona:s})}):o.jsx(fb,{msgs:i,onCopy:C})}),o.jsx(NC,{msgs:i}),o.jsxs("div",{className:"border-t border-border p-3",children:[o.jsx("div",{className:"mb-1.5",children:o.jsx(N7,{value:d,onPick:k=>f(`/${k} `)})}),o.jsx(cb,{value:d,onValueChange:f,onSubmit:()=>void _(),onStop:w,busy:p,placeholder:E("superagent.placeholder"),footer:o.jsx(ub,{value:g,onChange:x,disabled:p})}),o.jsx("div",{className:"mt-1.5 flex justify-end",children:o.jsxs(uo,{size:"xs",variant:"ghost",onClick:S,disabled:p||i.length===0,children:[o.jsx(An,{className:"size-3"})," ",E("superagent.new_chat")]})})]})]})})}function O7(){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 z7(){const[e,n]=b.useState({status:"loading"}),[s,r]=b.useState(0),i=b.useCallback(()=>{n({status:"loading"}),r(c=>c+1)},[]);return b.useEffect(()=>{let c=!1;return(async()=>{try{const g=await fetch("/health");if(!g.ok)throw new Error(`HTTP ${g.status}`)}catch(g){c||n({status:"error",reason:String(g)});return}const d=window.location.hash.replace(/^#/,""),f=new URLSearchParams(d),p=f.get("pair");if(p){history.replaceState(null,"",window.location.pathname+window.location.search);try{const g=await wl.confirm({pairing_id:p,label:O7(),kind:"web"});eo(g.token);try{localStorage.setItem(Nn.token,g.token)}catch{}c||n({status:"ok"});return}catch{}}const m=f.get("token");if(m){eo(m);try{localStorage.setItem(Nn.token,m)}catch{}history.replaceState(null,"",window.location.pathname+window.location.search)}else try{const g=localStorage.getItem(Nn.token);g&&eo(g)}catch{}try{const g=await fetch("/admin/web-token");if(g.ok){const x=await g.json();if(x?.token){eo(x.token);try{localStorage.setItem(Nn.token,x.token)}catch{}}}}catch{}if(!qx()){c||n({status:"unpaired"});return}try{await he.get("/projects"),c||n({status:"ok"})}catch(g){if(g instanceof Tc&&(g.status===401||g.status===403)){eo(null);try{localStorage.removeItem(Nn.token)}catch{}c||n({status:"unpaired"})}else c||n({status:"error",reason:String(g)})}})(),()=>{c=!0}},[s]),{...e,reload:i}}function D7(){const e=z7();return e.status==="loading"?o.jsx(Q_,{text:E("daemon.connecting")}):e.status==="error"?o.jsx(Q_,{text:E("daemon.unreachable"),sub:`${E("daemon.unreachable_hint")}
|
|
596
|
-
|
|
597
|
-
${e.reason}`}):e.status==="unpaired"?o.jsx(b7,{onPaired:e.reload}):o.jsx(hz,{children:o.jsx(rO,{delay:300,children:o.jsx(L7,{})})})}function L7(){const e=$a(),n=ra(),[s,r]=yS(),{theme:i,toggle:c}=rx(),d=s.get("action")==="add-project",[f,p]=b.useState(!1),m=()=>{const g=new URLSearchParams(s);g.delete("action"),r(g,{replace:!0})};return o.jsx(Sz,{children:o.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground","data-testid":"app-shell",children:[o.jsx(c4,{onSelect:g=>e(g),onOpenRoby:()=>p(!0)}),o.jsxs("main",{className:"m-2 ml-0 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-sm",children:[o.jsx(P7,{onToggleTheme:c,isDark:i==="dark",pathname:n.pathname}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:o.jsxs(gS,{children:[o.jsx(Gt,{path:"/",element:o.jsx(yz,{})}),o.jsx(Gt,{path:"/settings/*",element:o.jsx(qP,{})}),o.jsx(Gt,{path:"/m/voice/*",element:o.jsx(JP,{})}),o.jsx(Gt,{path:"/m/desktop/*",element:o.jsx(n8,{})}),o.jsx(Gt,{path:"/m/deck/*",element:o.jsx(m8,{})}),o.jsx(Gt,{path:"/m/code/*",element:o.jsx(h7,{})}),o.jsx(Gt,{path:"/p/:pid/*",element:o.jsx(KL,{})}),o.jsx(Gt,{path:"*",element:o.jsx(H7,{})})]})})]}),o.jsx(x7,{open:d,onClose:m}),o.jsx(M7,{open:f,onOpenChange:p})]})})}function P7({onToggleTheme:e,isDark:n,pathname:s}){const{projects:r}=Ac(),i=kz(),c=s.split("/").filter(Boolean),d=c[0]==="p"?r.find(w=>String(w.id)===c[1]):void 0,f=c[0]==="settings"?B7(c[1]):c[0]==="p"?U7(c[2]):"",p=c[0]==="p"&&c[1]==="0",m=d?.name||d?.path?.split("/").pop()||E("nav.project"),g=s==="/"?E("topbar.breadcrumb_root"):c[0]==="settings"?[E("topbar.breadcrumb_root"),E("nav.settings"),f].filter(Boolean).join(" › "):c[0]==="m"?[E("topbar.breadcrumb_root"),I7(c[1]),i].filter(Boolean).join(" › "):c[0]==="p"?p?[E("topbar.breadcrumb_root"),E("topbar.breadcrumb_base"),f].filter(Boolean).join(" › "):[E("topbar.breadcrumb_root"),E("topbar.breadcrumb_projects"),m,f].filter(Boolean).join(" › "):E("topbar.breadcrumb_root"),x=s==="/"?"":c[0]==="settings"?E("settings.subtitle"):c[0]==="p"?p?E("base.subtitle"):d?`${k2(d.kind)} · ${d.path}`:"":"",y=wz(),S=Nz();return o.jsxs("header",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border/50 px-3",children:[y&&o.jsx(jz,{collapsed:y.collapsed,onToggle:y.toggle}),o.jsxs("span",{className:"min-w-0 flex-1 truncate text-[11px] tracking-wide text-muted-fg",children:[g,x&&o.jsxs("span",{className:"text-muted-fg/50",children:[" · ",x]})]}),S,o.jsx("button",{type:"button",onClick:e,title:E(n?"topbar.light":"topbar.dark"),className:"shrink-0 rounded-md p-1.5 text-muted-fg hover:bg-accent hover:text-accent-fg",children:n?o.jsx(KT,{size:14}):o.jsx(UT,{size:14})})]})}function I7(e){switch(e){case"voice":return E("nav.modules.voice");case"desktop":return E("nav.modules.desktop");case"deck":return E("nav.modules.deck");case"code":return E("nav.modules.code");default:return e||""}}function B7(e){switch(e){case"super-agent":return E("settings.tabs.super_agent");case"engines":return E("settings.tabs.engines");case"telegram":return E("settings.tabs.telegram");case"devices":return E("settings.tabs.devices");case"appearance":return E("settings.appearance");case"config":case"advanced":return E("settings.tabs.advanced");case"identity":default:return e||""}}function U7(e){switch(e){case"chat":return E("project.nav.chat");case"threads":return E("project.nav.threads");case"telegram":return E("project.nav.telegram");case"agents":return E("project.nav.agents");case"routines":return E("project.nav.routines");case"tasks":return E("project.nav.tasks");case"mcps":return E("project.nav.mcps");case"config":return E("project.nav.config");case"workspaces":return E("base.workspaces_title");case"models":return E("settings.tabs.engines");case"agent-defaults":return E("base.defaults_title");case"sessions":return E("base.sessions_title");case"logs":return E("project.nav.logs");case"memories":return E("project.nav.memories");default:return""}}function Q_({text:e,sub:n}){return o.jsx("div",{className:"grid h-screen w-screen place-items-center bg-background text-foreground",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"font-mono text-xs text-muted-fg whitespace-pre leading-none mb-4",children:` ▄███████▄
|
|
598
|
-
█ ██ ██ █
|
|
599
|
-
█ ◔ ◔ █
|
|
600
|
-
█ ╰~╯ █
|
|
601
|
-
▀███████▀`}),o.jsx("div",{className:"text-foreground",children:e}),n&&o.jsx("pre",{className:"mt-2 max-w-xl whitespace-pre-wrap text-sm text-muted-fg",children:n})]})})}function H7(){return o.jsxs("div",{className:"p-8",children:[o.jsx("h1",{className:"text-2xl",children:E("not_found.title")}),o.jsx("p",{className:"text-muted-fg",children:E("not_found.message")})]})}kN.createRoot(document.getElementById("root")).render(o.jsx(_c.StrictMode,{children:o.jsx(XR,{children:o.jsx(eA,{children:o.jsx(D7,{})})})}));
|
|
602
|
-
//# sourceMappingURL=index-DPqtjDjh.js.map
|