@agentprojectcontext/apx 1.32.0 → 1.32.2
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 +6 -1
- package/skills/apc-context/SKILL.md +5 -2
- package/skills/apx/SKILL.md +3 -3
- package/skills/apx-agency-agents/SKILL.md +5 -5
- package/skills/apx-agent/SKILL.md +7 -7
- package/skills/apx-mcp/SKILL.md +6 -4
- package/skills/apx-mcp-builder/SKILL.md +4 -7
- package/skills/apx-project/SKILL.md +4 -5
- package/skills/apx-routine/SKILL.md +14 -12
- package/skills/apx-runtime/SKILL.md +5 -3
- package/skills/apx-sessions/SKILL.md +5 -5
- package/skills/apx-skill-builder/SKILL.md +10 -6
- package/skills/apx-task/SKILL.md +8 -8
- package/skills/apx-telegram/SKILL.md +23 -7
- package/skills/apx-voice/SKILL.md +8 -6
- package/src/core/{agent-system.js → agent/build-agent-system.js} +10 -12
- package/src/core/agent/index.js +0 -2
- package/src/core/{agent-memory.js → agent/memory.js} +2 -2
- package/src/core/agent/model-router.js +21 -43
- package/src/core/agent/prompt-builder.js +17 -63
- package/src/core/agent/prompts/action-discipline.md +17 -0
- package/src/core/agent/prompts/channels/code.md +8 -12
- package/src/core/agent/prompts/channels/desktop.md +6 -4
- package/src/core/agent/prompts/channels/routine.md +10 -1
- package/src/core/agent/prompts/channels/telegram.md +5 -0
- package/src/core/agent/prompts/channels/web_code.md +20 -0
- package/src/core/agent/prompts/modes/voice.md +2 -2
- package/src/core/agent/prompts/super-agent-base.md +2 -2
- package/src/core/agent/run-agent.js +37 -35
- package/src/core/agent/runtime-bridge.js +42 -0
- package/src/core/agent/self-memory.js +19 -9
- package/src/core/agent/skills/catalog.js +65 -0
- package/src/core/agent/skills/index.js +6 -0
- package/src/{host/daemon/skills-loader.js → core/agent/skills/loader.js} +3 -3
- package/src/core/agent/skills/rag.js +91 -0
- package/src/core/agent/skills/trigger.js +71 -0
- package/src/{host/daemon → core/agent}/super-agent.js +5 -5
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/add-project.js +3 -4
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/call-agent.js +2 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/call-mcp.js +1 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/call-runtime.js +10 -11
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/create-task.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/discover-tools.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/edit-file.js +1 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/import-agent.js +4 -5
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-agents.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-skills.js +7 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-tasks.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-vault-agents.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/load-skill.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/read-agent-memory.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/read-self-memory.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/remember.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/run-shell.js +1 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/search-messages.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/search-sessions.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/send-telegram.js +0 -2
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/set-identity.js +1 -3
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/set-permission-mode.js +1 -3
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/tail-messages.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/transcribe-audio.js +1 -1
- package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/write-file.js +1 -2
- package/src/core/agent/tools/helpers.js +74 -0
- package/src/{host/daemon/super-agent-tools → core/agent/tools}/registry-bridge.js +3 -3
- package/src/{host/daemon/super-agent-tools/index.js → core/agent/tools/registry.js} +31 -32
- package/src/core/apc/agents-vault.js +37 -0
- package/src/core/{scaffold.js → apc/scaffold.js} +4 -5
- package/src/core/{config.js → config/index.js} +21 -27
- package/src/core/config/paths.js +32 -0
- package/src/core/constants/actors.js +8 -0
- package/src/core/constants/channels.js +19 -0
- package/src/core/constants/index.js +5 -0
- package/src/core/constants/permissions.js +17 -0
- package/src/core/constants/roles.js +9 -0
- package/src/core/engines/_streaming.js +63 -0
- package/src/core/engines/anthropic.js +11 -22
- package/src/core/engines/ollama.js +7 -16
- package/src/core/identity/index.js +8 -0
- package/src/core/{identity.js → identity/self.js} +5 -5
- package/src/core/{telegram-identity.js → identity/telegram.js} +1 -1
- package/src/core/logging.js +1 -1
- package/src/core/mascot.js +1 -1
- package/src/core/memory/active-threads.js +10 -10
- package/src/core/memory/broker.js +9 -9
- package/src/core/memory/compactor.js +2 -2
- package/src/core/memory/index.js +2 -2
- package/src/core/memory/indexer.js +1 -1
- package/src/core/{code-sessions-store.js → stores/code-sessions.js} +3 -7
- package/src/core/{messages-store.js → stores/messages.js} +6 -4
- package/src/core/stores/routine-memory.js +71 -0
- package/src/core/{routines-store.js → stores/routines.js} +1 -3
- package/src/core/stores/runtime-sessions.js +99 -0
- package/src/core/{tasks-store.js → stores/tasks.js} +3 -8
- package/src/core/update-check.js +1 -1
- package/src/core/util/ids.js +14 -0
- package/src/core/util/index.js +2 -0
- package/src/core/util/text-similarity.js +52 -0
- package/src/core/util/time.js +9 -0
- package/src/core/voice/tts.js +1 -1
- package/src/host/daemon/api/admin-config.js +4 -3
- package/src/host/daemon/api/admin.js +1 -1
- package/src/host/daemon/api/agents.js +4 -25
- package/src/host/daemon/api/artifacts.js +1 -1
- package/src/host/daemon/api/code.js +48 -16
- package/src/host/daemon/api/confirm.js +1 -1
- package/src/host/daemon/api/connections.js +2 -2
- package/src/host/daemon/api/conversations.js +2 -2
- package/src/host/daemon/api/deck.js +1 -1
- package/src/host/daemon/api/desktop.js +1 -1
- package/src/host/daemon/api/embeddings.js +4 -4
- package/src/host/daemon/api/engines.js +2 -2
- package/src/host/daemon/api/exec.js +3 -3
- package/src/host/daemon/api/identity.js +1 -1
- package/src/host/daemon/api/mcps.js +1 -1
- package/src/host/daemon/api/messages.js +1 -1
- package/src/host/daemon/api/runtimes.js +9 -8
- package/src/host/daemon/api/sessions-search.js +1 -1
- package/src/host/daemon/api/sessions.js +2 -2
- package/src/host/daemon/api/shared.js +5 -4
- package/src/host/daemon/api/skills.js +30 -0
- package/src/host/daemon/api/super-agent.js +29 -9
- package/src/host/daemon/api/tasks.js +2 -2
- package/src/host/daemon/api/telegram.js +1 -1
- package/src/host/daemon/api/tools.js +6 -6
- package/src/host/daemon/api/tts.js +2 -2
- package/src/host/daemon/api/voice.js +14 -12
- package/src/host/daemon/api.js +2 -0
- package/src/host/daemon/compact.js +1 -1
- package/src/host/daemon/db.js +4 -4
- package/src/host/daemon/desktop-ws.js +1 -1
- package/src/host/daemon/index.js +4 -4
- package/src/host/daemon/plugins/{desktop.js → desktop/index.js} +11 -6
- package/src/host/daemon/plugins/index.js +2 -2
- package/src/host/daemon/plugins/{telegram.js → telegram/index.js} +66 -195
- package/src/host/daemon/plugins/telegram/media.js +162 -0
- package/src/host/daemon/projects-helpers.js +54 -0
- package/src/host/daemon/routines.js +28 -12
- package/src/host/daemon/smoke.js +2 -2
- package/src/host/daemon/token-store.js +1 -1
- package/src/host/daemon/transcription.js +2 -2
- package/src/host/daemon/wakeup.js +2 -2
- package/src/interfaces/cli/commands/agent.js +3 -3
- package/src/interfaces/cli/commands/command.js +1 -1
- package/src/interfaces/cli/commands/config.js +3 -2
- package/src/interfaces/cli/commands/desktop.js +1 -1
- package/src/interfaces/cli/commands/exec.js +2 -1
- package/src/interfaces/cli/commands/identity.js +2 -2
- package/src/interfaces/cli/commands/init.js +1 -1
- package/src/interfaces/cli/commands/mcp.js +1 -1
- package/src/interfaces/cli/commands/memory.js +2 -2
- package/src/interfaces/cli/commands/model.js +16 -6
- package/src/interfaces/cli/commands/project.js +1 -1
- package/src/interfaces/cli/commands/routine.js +58 -0
- package/src/interfaces/cli/commands/search.js +1 -1
- package/src/interfaces/cli/commands/session.js +4 -4
- package/src/interfaces/cli/commands/setup.js +4 -3
- package/src/interfaces/cli/commands/skills.js +25 -4
- package/src/interfaces/cli/commands/status.js +1 -1
- package/src/interfaces/cli/commands/sys.js +11 -4
- package/src/interfaces/cli/commands/update.js +1 -1
- package/src/interfaces/cli/index.js +4 -4
- package/src/interfaces/cli/postinstall.js +2 -2
- package/src/interfaces/mcp-server/index.js +1 -1
- package/src/interfaces/tui/component/prompt/index.tsx +3 -1
- package/src/interfaces/tui/context/sdk-apx.tsx +47 -7
- package/src/interfaces/tui/context/sync-apx.tsx +20 -2
- package/src/interfaces/tui/context/sync.tsx +2 -1
- package/src/interfaces/tui/routes/session/index.tsx +151 -136
- package/src/interfaces/tui/routes/session/sidebar-apx.tsx +37 -15
- package/src/interfaces/tui/run.ts +2 -0
- package/src/interfaces/web/dist/assets/index-34U_Mp1M.css +1 -0
- package/src/interfaces/web/dist/assets/index-BkybwwRn.js +570 -0
- package/src/interfaces/web/dist/assets/index-BkybwwRn.js.map +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +3 -3
- package/src/interfaces/web/src/App.tsx +51 -32
- package/src/interfaces/web/src/components/RobyBubble.tsx +12 -6
- package/src/interfaces/web/src/components/UiSelect.tsx +1 -1
- package/src/interfaces/web/src/components/chat/SkillPicker.tsx +77 -0
- package/src/interfaces/web/src/components/code/CodeProjectPicker.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeSidePanel.tsx +33 -18
- package/src/interfaces/web/src/components/common/TabLayout.tsx +9 -5
- package/src/interfaces/web/src/components/common/TabNav.tsx +3 -3
- package/src/interfaces/web/src/components/layout/ProjectSidebar.tsx +4 -2
- package/src/interfaces/web/src/hooks/useChat.ts +47 -2
- package/src/interfaces/web/src/hooks/useNavCollapseCtx.tsx +59 -0
- package/src/interfaces/web/src/hooks/usePersonaName.ts +11 -0
- package/src/interfaces/web/src/i18n/en.ts +7 -7
- package/src/interfaces/web/src/i18n/es.ts +7 -7
- package/src/interfaces/web/src/lib/api/skills.ts +25 -0
- package/src/interfaces/web/src/lib/api.ts +1 -0
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +18 -18
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +5 -18
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +1 -8
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +39 -40
- package/src/interfaces/web/src/screens/project/ChatTab.tsx +12 -9
- package/src/skills/apc-context/SKILL.md +159 -0
- package/src/core/agent/ghost-guard.js +0 -24
- package/src/core/agent/prompts/channels/terminal.md +0 -16
- package/src/host/daemon/apc-runtime-context.js +0 -124
- package/src/host/daemon/super-agent-tools/helpers.js +0 -124
- package/src/host/daemon/tool-call-parser.js +0 -2
- package/src/interfaces/web/dist/assets/index-63P_ji1a.js +0 -571
- package/src/interfaces/web/dist/assets/index-63P_ji1a.js.map +0 -1
- package/src/interfaces/web/dist/assets/index-DLWy6dYz.css +0 -1
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/ask-questions.js +0 -0
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-files.js +0 -0
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-mcps.js +0 -0
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/list-projects.js +0 -0
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/read-file.js +0 -0
- /package/src/{host/daemon/super-agent-tools/tools → core/agent/tools/handlers}/search-files.js +0 -0
- /package/src/core/agent/{pseudo-tools.js → tools/pseudo-tools.js} +0 -0
- /package/src/core/agent/{tool-call-parser.js → tools/tool-call-parser.js} +0 -0
- /package/src/core/{parser.js → apc/parser.js} +0 -0
- /package/src/core/{apc-skill-sync.js → apc/skill-sync.js} +0 -0
- /package/src/core/{artifacts-store.js → stores/artifacts.js} +0 -0
- /package/src/{host/daemon → core/stores}/engine-sessions.js +0 -0
- /package/src/core/{session-store.js → stores/sessions.js} +0 -0
- /package/src/host/daemon/plugins/{telegram-ask.js → telegram/ask.js} +0 -0
|
@@ -1,571 +0,0 @@
|
|
|
1
|
-
function DE(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 rh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dp={exports:{}},ri={};/**
|
|
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 _0;function LE(){if(_0)return ri;_0=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 ri.Fragment=n,ri.jsx=s,ri.jsxs=s,ri}var j0;function PE(){return j0||(j0=1,dp.exports=LE()),dp.exports}var o=PE(),fp={exports:{}},We={};/**
|
|
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 w0;function BE(){if(w0)return We;w0=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"),h=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),y=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,j={};function E(D,G,V){this.props=D,this.context=G,this.refs=j,this.updater=V||w}E.prototype.isReactComponent={},E.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,G,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function k(){}k.prototype=E.prototype;function R(D,G,V){this.props=D,this.context=G,this.refs=j,this.updater=V||w}var N=R.prototype=new k;N.constructor=R,_(N,E.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function U(D,G,V){var W=V.ref;return{$$typeof:e,type:D,key:G,ref:W!==void 0?W:null,props:V}}function I(D,G){return U(D.type,G,D.props)}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function P(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(V){return G[V]})}var H=/\/+/g;function Y(D,G){return typeof D=="object"&&D!==null&&D.key!=null?P(""+D.key):G.toString(36)}function Q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function q(D,G,V,W,ce){var oe=typeof D;(oe==="undefined"||oe==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(oe){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case n:se=!0;break;case h:return se=D._init,q(se(D._payload),G,V,W,ce)}}if(se)return ce=ce(D),se=W===""?"."+Y(D,0):W,O(ce)?(V="",se!=null&&(V=se.replace(H,"$&/")+"/"),q(ce,G,V,"",function(Re){return Re})):ce!=null&&(L(ce)&&(ce=I(ce,V+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+se)),G.push(ce)),1;se=0;var ue=W===""?".":W+":";if(O(D))for(var ee=0;ee<D.length;ee++)W=D[ee],oe=ue+Y(W,ee),se+=q(W,G,V,oe,ce);else if(ee=S(D),typeof ee=="function")for(D=ee.call(D),ee=0;!(W=D.next()).done;)W=W.value,oe=ue+Y(W,ee++),se+=q(W,G,V,oe,ce);else if(oe==="object"){if(typeof D.then=="function")return q(Q(D),G,V,W,ce);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return se}function X(D,G,V){if(D==null)return D;var W=[],ce=0;return q(D,W,"","",function(oe){return G.call(V,oe,ce++)}),W}function Z(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(V){(D._status===0||D._status===-1)&&(D._status=1,D._result=V)},function(V){(D._status===0||D._status===-1)&&(D._status=2,D._result=V)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var $=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},K={map:X,forEach:function(D,G,V){X(D,function(){G.apply(this,arguments)},V)},count:function(D){var G=0;return X(D,function(){G++}),G},toArray:function(D){return X(D,function(G){return G})||[]},only:function(D){if(!L(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return We.Activity=x,We.Children=K,We.Component=E,We.Fragment=s,We.Profiler=i,We.PureComponent=R,We.StrictMode=r,We.Suspense=p,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,We.__COMPILER_RUNTIME={__proto__:null,c:function(D){return M.H.useMemoCache(D)}},We.cache=function(D){return function(){return D.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(D,G,V){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var W=_({},D.props),ce=D.key;if(G!=null)for(oe in G.key!==void 0&&(ce=""+G.key),G)!B.call(G,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&G.ref===void 0||(W[oe]=G[oe]);var oe=arguments.length-2;if(oe===1)W.children=V;else if(1<oe){for(var se=Array(oe),ue=0;ue<oe;ue++)se[ue]=arguments[ue+2];W.children=se}return U(D.type,ce,W)},We.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},We.createElement=function(D,G,V){var W,ce={},oe=null;if(G!=null)for(W in G.key!==void 0&&(oe=""+G.key),G)B.call(G,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ce[W]=G[W]);var se=arguments.length-2;if(se===1)ce.children=V;else if(1<se){for(var ue=Array(se),ee=0;ee<se;ee++)ue[ee]=arguments[ee+2];ce.children=ue}if(D&&D.defaultProps)for(W in se=D.defaultProps,se)ce[W]===void 0&&(ce[W]=se[W]);return U(D,oe,ce)},We.createRef=function(){return{current:null}},We.forwardRef=function(D){return{$$typeof:f,render:D}},We.isValidElement=L,We.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:Z}},We.memo=function(D,G){return{$$typeof:m,type:D,compare:G===void 0?null:G}},We.startTransition=function(D){var G=M.T,V={};M.T=V;try{var W=D(),ce=M.S;ce!==null&&ce(V,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(A,$)}catch(oe){$(oe)}finally{G!==null&&V.types!==null&&(G.types=V.types),M.T=G}},We.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},We.use=function(D){return M.H.use(D)},We.useActionState=function(D,G,V){return M.H.useActionState(D,G,V)},We.useCallback=function(D,G){return M.H.useCallback(D,G)},We.useContext=function(D){return M.H.useContext(D)},We.useDebugValue=function(){},We.useDeferredValue=function(D,G){return M.H.useDeferredValue(D,G)},We.useEffect=function(D,G){return M.H.useEffect(D,G)},We.useEffectEvent=function(D){return M.H.useEffectEvent(D)},We.useId=function(){return M.H.useId()},We.useImperativeHandle=function(D,G,V){return M.H.useImperativeHandle(D,G,V)},We.useInsertionEffect=function(D,G){return M.H.useInsertionEffect(D,G)},We.useLayoutEffect=function(D,G){return M.H.useLayoutEffect(D,G)},We.useMemo=function(D,G){return M.H.useMemo(D,G)},We.useOptimistic=function(D,G){return M.H.useOptimistic(D,G)},We.useReducer=function(D,G,V){return M.H.useReducer(D,G,V)},We.useRef=function(D){return M.H.useRef(D)},We.useState=function(D){return M.H.useState(D)},We.useSyncExternalStore=function(D,G,V){return M.H.useSyncExternalStore(D,G,V)},We.useTransition=function(){return M.H.useTransition()},We.version="19.2.7",We}var S0;function Ki(){return S0||(S0=1,fp.exports=BE()),fp.exports}var v=Ki();const Qi=rh(v),IE=DE({__proto__:null,default:Qi},[v]);var mp={exports:{}},oi={},pp={exports:{}},gp={};/**
|
|
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 C0;function UE(){return C0||(C0=1,(function(e){function n(q,X){var Z=q.length;q.push(X);e:for(;0<Z;){var $=Z-1>>>1,K=q[$];if(0<i(K,X))q[$]=X,q[Z]=K,Z=$;else break e}}function s(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var X=q[0],Z=q.pop();if(Z!==X){q[0]=Z;e:for(var $=0,K=q.length,D=K>>>1;$<D;){var G=2*($+1)-1,V=q[G],W=G+1,ce=q[W];if(0>i(V,Z))W<K&&0>i(ce,V)?(q[$]=ce,q[W]=Z,$=W):(q[$]=V,q[G]=Z,$=G);else if(W<K&&0>i(ce,Z))q[$]=ce,q[W]=Z,$=W;else break e}}return X}function i(q,X){var Z=q.sortIndex-X.sortIndex;return Z!==0?Z:q.id-X.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=[],h=1,x=null,y=3,S=!1,w=!1,_=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(q){for(var X=s(m);X!==null;){if(X.callback===null)r(m);else if(X.startTime<=q)r(m),X.sortIndex=X.expirationTime,n(p,X);else break;X=s(m)}}function O(q){if(_=!1,N(q),!w)if(s(p)!==null)w=!0,A||(A=!0,P());else{var X=s(m);X!==null&&Q(O,X.startTime-q)}}var A=!1,M=-1,B=5,U=-1;function I(){return j?!0:!(e.unstable_now()-U<B)}function L(){if(j=!1,A){var q=e.unstable_now();U=q;var X=!0;try{e:{w=!1,_&&(_=!1,k(M),M=-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 K=$(x.expirationTime<=q);if(q=e.unstable_now(),typeof K=="function"){x.callback=K,N(q),X=!0;break t}x===s(p)&&r(p),N(q)}else r(p);x=s(p)}if(x!==null)X=!0;else{var D=s(m);D!==null&&Q(O,D.startTime-q),X=!1}}break e}finally{x=null,y=Z,S=!1}X=void 0}}finally{X?P():A=!1}}}var P;if(typeof R=="function")P=function(){R(L)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Y=H.port2;H.port1.onmessage=L,P=function(){Y.postMessage(null)}}else P=function(){E(L,0)};function Q(q,X){M=E(function(){q(e.unstable_now())},X)}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"):B=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 X=3;break;default:X=y}var Z=y;y=X;try{return q()}finally{y=Z}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Z=y;y=q;try{return X()}finally{y=Z}},e.unstable_scheduleCallback=function(q,X,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 K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=Z+K,q={id:h++,callback:X,priorityLevel:q,startTime:Z,expirationTime:K,sortIndex:-1},Z>$?(q.sortIndex=Z,n(m,q),s(p)===null&&q===s(m)&&(_?(k(M),M=-1):_=!0,Q(O,Z-$))):(q.sortIndex=K,n(p,q),w||S||(w=!0,A||(A=!0,P()))),q},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(q){var X=y;return function(){var Z=y;y=X;try{return q.apply(this,arguments)}finally{y=Z}}}})(gp)),gp}var E0;function HE(){return E0||(E0=1,pp.exports=UE()),pp.exports}var hp={exports:{}},Mn={};/**
|
|
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 k0;function qE(){if(k0)return Mn;k0=1;var e=Ki();function n(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)m+="&args[]="+encodeURIComponent(arguments[h])}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,h){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:h}}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 Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Mn.createPortal=function(p,m){var h=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,h)},Mn.flushSync=function(p){var m=d.T,h=r.p;try{if(d.T=null,r.p=2,p)return p()}finally{d.T=m,r.p=h,r.d.f()}},Mn.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))},Mn.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},Mn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var h=m.as,x=f(h,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;h==="style"?r.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:y,fetchPriority:S}):h==="script"&&r.d.X(p,{crossOrigin:x,integrity:y,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Mn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var h=f(m.as,m.crossOrigin);r.d.M(p,{crossOrigin:h,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)},Mn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var h=m.as,x=f(h,m.crossOrigin);r.d.L(p,h,{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})}},Mn.preloadModule=function(p,m){if(typeof p=="string")if(m){var h=f(m.as,m.crossOrigin);r.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:h,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(p)},Mn.requestFormReset=function(p){r.d.r(p)},Mn.unstable_batchedUpdates=function(p,m){return p(m)},Mn.useFormState=function(p,m,h){return d.H.useFormState(p,m,h)},Mn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Mn.version="19.2.7",Mn}var N0;function I_(){if(N0)return hp.exports;N0=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(),hp.exports=qE(),hp.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 R0;function VE(){if(R0)return oi;R0=1;var e=HE(),n=Ki(),s=I_();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 g=l.return;if(g===null)break;var b=g.alternate;if(b===null){if(u=g.return,u!==null){l=u;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===l)return p(g),t;if(b===u)return p(g),a;b=b.sibling}throw Error(r(188))}if(l.return!==u.return)l=g,u=b;else{for(var T=!1,z=g.child;z;){if(z===l){T=!0,l=g,u=b;break}if(z===u){T=!0,u=g,l=b;break}z=z.sibling}if(!T){for(z=b.child;z;){if(z===l){T=!0,l=b,u=g;break}if(z===u){T=!0,u=b,l=g;break}z=z.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 h(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=h(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"),_=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),R=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=L&&t[L]||t["@@iterator"],typeof t=="function"?t:null)}var H=Symbol.for("react.client.reference");function Y(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 _:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case U: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 M:return a=t.displayName||null,a!==null?a:Y(t.type)||"Memo";case B:a=t._payload,t=t._init;try{return Y(t(a))}catch{}}return null}var Q=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},$=[],K=-1;function D(t){return{current:t}}function G(t){0>K||(t.current=$[K],$[K]=null,K--)}function V(t,a){K++,$[K]=t.current,t.current=a}var W=D(null),ce=D(null),oe=D(null),se=D(null);function ue(t,a){switch(V(oe,a),V(ce,t),V(W,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?$y(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=$y(a),t=Gy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(W),V(W,t)}function ee(){G(W),G(ce),G(oe)}function Re(t){t.memoizedState!==null&&V(se,t);var a=W.current,l=Gy(a,t.type);a!==l&&(V(ce,t),V(W,l))}function $e(t){ce.current===t&&(G(W),G(ce)),se.current===t&&(G(se),ti._currentValue=Z)}var be,Se;function Ee(t){if(be===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);be=a&&a[1]||"",Se=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+be+t+Se}var ze=!1;function De(t,a){if(!t||ze)return"";ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var re=ie}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(ie){re=ie}t.call(pe.prototype)}}else{try{throw Error()}catch(ie){re=ie}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),T=b[0],z=b[1];if(T&&z){var F=T.split(`
|
|
44
|
-
`),ae=z.split(`
|
|
45
|
-
`);for(g=u=0;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;for(;g<ae.length&&!ae[g].includes("DetermineComponentFrameRoot");)g++;if(u===F.length||g===ae.length)for(u=F.length-1,g=ae.length-1;1<=u&&0<=g&&F[u]!==ae[g];)g--;for(;1<=u&&0<=g;u--,g--)if(F[u]!==ae[g]){if(u!==1||g!==1)do if(u--,g--,0>g||F[u]!==ae[g]){var de=`
|
|
46
|
-
`+F[u].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=u&&0<=g);break}}}finally{ze=!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 De(t.type,!1);case 11:return De(t.type.render,!1);case 1:return De(t.type,!0);case 31:return Ee("Activity");default:return""}}function ke(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,Le=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,qe=e.unstable_shouldYield,Oe=e.unstable_requestPaint,ve=e.unstable_now,le=e.unstable_getCurrentPriorityLevel,ye=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,_t=e.unstable_IdlePriority,Ht=e.log,vt=e.unstable_setDisableYieldValue,ut=null,it=null;function Et(t){if(typeof Ht=="function"&&vt(t),it&&typeof it.setStrictMode=="function")try{it.setStrictMode(ut,t)}catch{}}var Bt=Math.clz32?Math.clz32:dt,pa=Math.log,gn=Math.LN2;function dt(t){return t>>>=0,t===0?32:31-(pa(t)/gn|0)|0}var Tt=256,Xt=262144,yt=4194304;function Wt(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 Vt(t,a,l){var u=t.pendingLanes;if(u===0)return 0;var g=0,b=t.suspendedLanes,T=t.pingedLanes;t=t.warmLanes;var z=u&134217727;return z!==0?(u=z&~b,u!==0?g=Wt(u):(T&=z,T!==0?g=Wt(T):l||(l=z&~t,l!==0&&(g=Wt(l))))):(z=u&~b,z!==0?g=Wt(z):T!==0?g=Wt(T):l||(l=u&~t,l!==0&&(g=Wt(l)))),g===0?0:a!==0&&a!==g&&(a&b)===0&&(b=g&-g,l=a&-a,b>=l||b===32&&(l&4194048)!==0)?a:g}function rn(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Tn(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 qn(){var t=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),t}function ta(t){for(var a=[],l=0;31>l;l++)a.push(t);return a}function Vn(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ts(t,a,l,u,g,b){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 z=t.entanglements,F=t.expirationTimes,ae=t.hiddenUpdates;for(l=T&~l;0<l;){var de=31-Bt(l),pe=1<<de;z[de]=0,F[de]=-1;var re=ae[de];if(re!==null)for(ae[de]=null,de=0;de<re.length;de++){var ie=re[de];ie!==null&&(ie.lane&=-536870913)}l&=~pe}u!==0&&An(t,u,0),b!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=b&~(T&~a))}function An(t,a,l){t.pendingLanes|=a,t.suspendedLanes&=~a;var u=31-Bt(a);t.entangledLanes|=a,t.entanglements[u]=t.entanglements[u]|1073741824|l&261930}function na(t,a){var l=t.entangledLanes|=a;for(t=t.entanglements;l;){var u=31-Bt(l),g=1<<u;g&a|t[u]&a&&(t[u]|=a),l&=~g}}function Aa(t,a){var l=a&-a;return l=(l&42)!==0?1:ns(l),(l&(t.suspendedLanes|a))!==0?0:l}function ns(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 at(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function At(){var t=X.p;return t!==0?t:(t=window.event,t===void 0?32:p0(t.type))}function yn(t,a){var l=X.p;try{return X.p=t,a()}finally{X.p=l}}var en=Math.random().toString(36).slice(2),kt="__reactFiber$"+en,un="__reactProps$"+en,_r="__reactContainer$"+en,ic="__reactEvents$"+en,S2="__reactListeners$"+en,C2="__reactHandles$"+en,Ax="__reactResources$"+en,hl="__reactMarker$"+en;function nf(t){delete t[kt],delete t[un],delete t[ic],delete t[S2],delete t[C2]}function ao(t){var a=t[kt];if(a)return a;for(var l=t.parentNode;l;){if(a=l[_r]||l[kt]){if(l=a.alternate,a.child!==null||l!==null&&l.child!==null)for(t=Jy(t);t!==null;){if(l=t[kt])return l;t=Jy(t)}return a}t=l,l=t.parentNode}return null}function so(t){if(t=t[kt]||t[_r]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function xl(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function ro(t){var a=t[Ax];return a||(a=t[Ax]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function xn(t){t[hl]=!0}var Mx=new Set,Ox={};function jr(t,a){oo(t,a),oo(t+"Capture",a)}function oo(t,a){for(Ox[t]=a,t=0;t<a.length;t++)Mx.add(a[t])}var E2=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]*$"),zx={},Dx={};function k2(t){return _e.call(Dx,t)?!0:_e.call(zx,t)?!1:E2.test(t)?Dx[t]=!0:(zx[t]=!0,!1)}function cc(t,a,l){if(k2(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 uc(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 as(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 ga(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Lx(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function N2(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 g=u.get,b=u.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return g.call(this)},set:function(T){l=""+T,b.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 af(t){if(!t._valueTracker){var a=Lx(t)?"checked":"value";t._valueTracker=N2(t,a,""+t[a])}}function Px(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var l=a.getValue(),u="";return t&&(u=Lx(t)?t.checked?"true":"false":t.value),t=u,t!==l?(a.setValue(t),!0):!1}function dc(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 R2=/[\n"\\]/g;function ha(t){return t.replace(R2,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function sf(t,a,l,u,g,b,T,z){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=""+ga(a)):t.value!==""+ga(a)&&(t.value=""+ga(a)):T!=="submit"&&T!=="reset"||t.removeAttribute("value"),a!=null?rf(t,T,ga(a)):l!=null?rf(t,T,ga(l)):u!=null&&t.removeAttribute("value"),g==null&&b!=null&&(t.defaultChecked=!!b),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+ga(z):t.removeAttribute("name")}function Bx(t,a,l,u,g,b,T,z){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),a!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){af(t);return}l=l!=null?""+ga(l):"",a=a!=null?""+ga(a):l,z||a===t.value||(t.value=a),t.defaultValue=a}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=z?t.checked:!!u,t.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(t.name=T),af(t)}function rf(t,a,l){a==="number"&&dc(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function lo(t,a,l,u){if(t=t.options,a){a={};for(var g=0;g<l.length;g++)a["$"+l[g]]=!0;for(l=0;l<t.length;l++)g=a.hasOwnProperty("$"+t[l].value),t[l].selected!==g&&(t[l].selected=g),g&&u&&(t[l].defaultSelected=!0)}else{for(l=""+ga(l),a=null,g=0;g<t.length;g++){if(t[g].value===l){t[g].selected=!0,u&&(t[g].defaultSelected=!0);return}a!==null||t[g].disabled||(a=t[g])}a!==null&&(a.selected=!0)}}function Ix(t,a,l){if(a!=null&&(a=""+ga(a),a!==t.value&&(t.value=a),l==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=l!=null?""+ga(l):""}function Ux(t,a,l,u){if(a==null){if(u!=null){if(l!=null)throw Error(r(92));if(Q(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),a=l}l=ga(a),t.defaultValue=l,u=t.textContent,u===l&&u!==""&&u!==null&&(t.value=u),af(t)}function io(t,a){if(a){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=a;return}}t.textContent=a}var T2=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 Hx(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||T2.has(a)?a==="float"?t.cssFloat=l:t[a]=(""+l).trim():t[a]=l+"px"}function qx(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 g in a)u=a[g],a.hasOwnProperty(g)&&l[g]!==u&&Hx(t,g,u)}else for(var b in a)a.hasOwnProperty(b)&&Hx(t,b,a[b])}function of(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 A2=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"]]),M2=/^[\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 fc(t){return M2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ss(){}var lf=null;function cf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var co=null,uo=null;function Vx(t){var a=so(t);if(a&&(t=a.stateNode)){var l=t[un]||null;e:switch(t=a.stateNode,a.type){case"input":if(sf(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="'+ha(""+a)+'"][type="radio"]'),a=0;a<l.length;a++){var u=l[a];if(u!==t&&u.form===t.form){var g=u[un]||null;if(!g)throw Error(r(90));sf(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<l.length;a++)u=l[a],u.form===t.form&&Px(u)}break e;case"textarea":Ix(t,l.value,l.defaultValue);break e;case"select":a=l.value,a!=null&&lo(t,!!l.multiple,a,!1)}}}var uf=!1;function $x(t,a,l){if(uf)return t(a,l);uf=!0;try{var u=t(a);return u}finally{if(uf=!1,(co!==null||uo!==null)&&(Wc(),co&&(a=co,t=uo,uo=co=null,Vx(a),t)))for(a=0;a<t.length;a++)Vx(t[a])}}function bl(t,a){var l=t.stateNode;if(l===null)return null;var u=l[un]||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 rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),df=!1;if(rs)try{var vl={};Object.defineProperty(vl,"passive",{get:function(){df=!0}}),window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{df=!1}var Os=null,ff=null,mc=null;function Gx(){if(mc)return mc;var t,a=ff,l=a.length,u,g="value"in Os?Os.value:Os.textContent,b=g.length;for(t=0;t<l&&a[t]===g[t];t++);var T=l-t;for(u=1;u<=T&&a[l-u]===g[b-u];u++);return mc=g.slice(t,1<u?1-u:void 0)}function pc(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 gc(){return!0}function Yx(){return!1}function $n(t){function a(l,u,g,b,T){this._reactName=l,this._targetInst=g,this.type=u,this.nativeEvent=b,this.target=T,this.currentTarget=null;for(var z in t)t.hasOwnProperty(z)&&(l=t[z],this[z]=l?l(b):b[z]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?gc:Yx,this.isPropagationStopped=Yx,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=gc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gc)},persist:function(){},isPersistent:gc}),a}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hc=$n(wr),yl=x({},wr,{view:0,detail:0}),O2=$n(yl),mf,pf,_l,xc=x({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hf,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"?(mf=t.screenX-_l.screenX,pf=t.screenY-_l.screenY):pf=mf=0,_l=t),mf)},movementY:function(t){return"movementY"in t?t.movementY:pf}}),Fx=$n(xc),z2=x({},xc,{dataTransfer:0}),D2=$n(z2),L2=x({},yl,{relatedTarget:0}),gf=$n(L2),P2=x({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),B2=$n(P2),I2=x({},wr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),U2=$n(I2),H2=x({},wr,{data:0}),Xx=$n(H2),q2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},V2={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"},$2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G2(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=$2[t])?!!a[t]:!1}function hf(){return G2}var Y2=x({},yl,{key:function(t){if(t.key){var a=q2[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=pc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?V2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hf,charCode:function(t){return t.type==="keypress"?pc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),F2=$n(Y2),X2=x({},xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kx=$n(X2),K2=x({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hf}),Q2=$n(K2),Z2=x({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),J2=$n(Z2),W2=x({},xc,{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}),eC=$n(W2),tC=x({},wr,{newState:0,oldState:0}),nC=$n(tC),aC=[9,13,27,32],xf=rs&&"CompositionEvent"in window,jl=null;rs&&"documentMode"in document&&(jl=document.documentMode);var sC=rs&&"TextEvent"in window&&!jl,Qx=rs&&(!xf||jl&&8<jl&&11>=jl),Zx=" ",Jx=!1;function Wx(t,a){switch(t){case"keyup":return aC.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eb(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fo=!1;function rC(t,a){switch(t){case"compositionend":return eb(a);case"keypress":return a.which!==32?null:(Jx=!0,Zx);case"textInput":return t=a.data,t===Zx&&Jx?null:t;default:return null}}function oC(t,a){if(fo)return t==="compositionend"||!xf&&Wx(t,a)?(t=Gx(),mc=ff=Os=null,fo=!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 Qx&&a.locale!=="ko"?null:a.data;default:return null}}var lC={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 tb(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!lC[t.type]:a==="textarea"}function nb(t,a,l,u){co?uo?uo.push(u):uo=[u]:co=u,a=ou(a,"onChange"),0<a.length&&(l=new hc("onChange","change",null,l,u),t.push({event:l,listeners:a}))}var wl=null,Sl=null;function iC(t){By(t,0)}function bc(t){var a=xl(t);if(Px(a))return t}function ab(t,a){if(t==="change")return a}var sb=!1;if(rs){var bf;if(rs){var vf="oninput"in document;if(!vf){var rb=document.createElement("div");rb.setAttribute("oninput","return;"),vf=typeof rb.oninput=="function"}bf=vf}else bf=!1;sb=bf&&(!document.documentMode||9<document.documentMode)}function ob(){wl&&(wl.detachEvent("onpropertychange",lb),Sl=wl=null)}function lb(t){if(t.propertyName==="value"&&bc(Sl)){var a=[];nb(a,Sl,t,cf(t)),$x(iC,a)}}function cC(t,a,l){t==="focusin"?(ob(),wl=a,Sl=l,wl.attachEvent("onpropertychange",lb)):t==="focusout"&&ob()}function uC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return bc(Sl)}function dC(t,a){if(t==="click")return bc(a)}function fC(t,a){if(t==="input"||t==="change")return bc(a)}function mC(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var aa=typeof Object.is=="function"?Object.is:mC;function Cl(t,a){if(aa(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 g=l[u];if(!_e.call(a,g)||!aa(t[g],a[g]))return!1}return!0}function ib(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function cb(t,a){var l=ib(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=ib(l)}}function ub(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?ub(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function db(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=dc(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=dc(t.document)}return a}function yf(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 pC=rs&&"documentMode"in document&&11>=document.documentMode,mo=null,_f=null,El=null,jf=!1;function fb(t,a,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;jf||mo==null||mo!==dc(u)||(u=mo,"selectionStart"in u&&yf(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}),El&&Cl(El,u)||(El=u,u=ou(_f,"onSelect"),0<u.length&&(a=new hc("onSelect","select",null,a,l),t.push({event:a,listeners:u}),a.target=mo)))}function Sr(t,a){var l={};return l[t.toLowerCase()]=a.toLowerCase(),l["Webkit"+t]="webkit"+a,l["Moz"+t]="moz"+a,l}var po={animationend:Sr("Animation","AnimationEnd"),animationiteration:Sr("Animation","AnimationIteration"),animationstart:Sr("Animation","AnimationStart"),transitionrun:Sr("Transition","TransitionRun"),transitionstart:Sr("Transition","TransitionStart"),transitioncancel:Sr("Transition","TransitionCancel"),transitionend:Sr("Transition","TransitionEnd")},wf={},mb={};rs&&(mb=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);function Cr(t){if(wf[t])return wf[t];if(!po[t])return t;var a=po[t],l;for(l in a)if(a.hasOwnProperty(l)&&l in mb)return wf[t]=a[l];return t}var pb=Cr("animationend"),gb=Cr("animationiteration"),hb=Cr("animationstart"),gC=Cr("transitionrun"),hC=Cr("transitionstart"),xC=Cr("transitioncancel"),xb=Cr("transitionend"),bb=new Map,Sf="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(" ");Sf.push("scrollEnd");function Ma(t,a){bb.set(t,a),jr(a,[t])}var vc=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)},xa=[],go=0,Cf=0;function yc(){for(var t=go,a=Cf=go=0;a<t;){var l=xa[a];xa[a++]=null;var u=xa[a];xa[a++]=null;var g=xa[a];xa[a++]=null;var b=xa[a];if(xa[a++]=null,u!==null&&g!==null){var T=u.pending;T===null?g.next=g:(g.next=T.next,T.next=g),u.pending=g}b!==0&&vb(l,g,b)}}function _c(t,a,l,u){xa[go++]=t,xa[go++]=a,xa[go++]=l,xa[go++]=u,Cf|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Ef(t,a,l,u){return _c(t,a,l,u),jc(t)}function Er(t,a){return _c(t,null,null,a),jc(t)}function vb(t,a,l){t.lanes|=l;var u=t.alternate;u!==null&&(u.lanes|=l);for(var g=!1,b=t.return;b!==null;)b.childLanes|=l,u=b.alternate,u!==null&&(u.childLanes|=l),b.tag===22&&(t=b.stateNode,t===null||t._visibility&1||(g=!0)),t=b,b=b.return;return t.tag===3?(b=t.stateNode,g&&a!==null&&(g=31-Bt(l),t=b.hiddenUpdates,u=t[g],u===null?t[g]=[a]:u.push(a),a.lane=l|536870912),b):null}function jc(t){if(50<Xl)throw Xl=0,Dm=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ho={};function bC(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 sa(t,a,l,u){return new bC(t,a,l,u)}function kf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function os(t,a){var l=t.alternate;return l===null?(l=sa(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 yb(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 wc(t,a,l,u,g,b){var T=0;if(u=t,typeof t=="function")kf(t)&&(T=1);else if(typeof t=="string")T=wE(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case U:return t=sa(31,l,a,g),t.elementType=U,t.lanes=b,t;case _:return kr(l.children,g,b,a);case j:T=8,g|=24;break;case E:return t=sa(12,l,a,g|2),t.elementType=E,t.lanes=b,t;case O:return t=sa(13,l,a,g),t.elementType=O,t.lanes=b,t;case A:return t=sa(19,l,a,g),t.elementType=A,t.lanes=b,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 M:T=14;break e;case B:T=16,u=null;break e}T=29,l=Error(r(130,t===null?"null":typeof t,"")),u=null}return a=sa(T,l,a,g),a.elementType=t,a.type=u,a.lanes=b,a}function kr(t,a,l,u){return t=sa(7,t,u,a),t.lanes=l,t}function Nf(t,a,l){return t=sa(6,t,null,a),t.lanes=l,t}function _b(t){var a=sa(18,null,null,0);return a.stateNode=t,a}function Rf(t,a,l){return a=sa(4,t.children!==null?t.children:[],t.key,a),a.lanes=l,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var jb=new WeakMap;function ba(t,a){if(typeof t=="object"&&t!==null){var l=jb.get(t);return l!==void 0?l:(a={value:t,source:a,stack:ke(a)},jb.set(t,a),a)}return{value:t,source:a,stack:ke(a)}}var xo=[],bo=0,Sc=null,kl=0,va=[],ya=0,zs=null,Ha=1,qa="";function ls(t,a){xo[bo++]=kl,xo[bo++]=Sc,Sc=t,kl=a}function wb(t,a,l){va[ya++]=Ha,va[ya++]=qa,va[ya++]=zs,zs=t;var u=Ha;t=qa;var g=32-Bt(u)-1;u&=~(1<<g),l+=1;var b=32-Bt(a)+g;if(30<b){var T=g-g%5;b=(u&(1<<T)-1).toString(32),u>>=T,g-=T,Ha=1<<32-Bt(a)+g|l<<g|u,qa=b+t}else Ha=1<<b|l<<g|u,qa=t}function Tf(t){t.return!==null&&(ls(t,1),wb(t,1,0))}function Af(t){for(;t===Sc;)Sc=xo[--bo],xo[bo]=null,kl=xo[--bo],xo[bo]=null;for(;t===zs;)zs=va[--ya],va[ya]=null,qa=va[--ya],va[ya]=null,Ha=va[--ya],va[ya]=null}function Sb(t,a){va[ya++]=Ha,va[ya++]=qa,va[ya++]=zs,Ha=a.id,qa=a.overflow,zs=t}var _n=null,$t=null,bt=!1,Ds=null,_a=!1,Mf=Error(r(519));function Ls(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nl(ba(a,t)),Mf}function Cb(t){var a=t.stateNode,l=t.type,u=t.memoizedProps;switch(a[kt]=t,a[un]=u,l){case"dialog":mt("cancel",a),mt("close",a);break;case"iframe":case"object":case"embed":mt("load",a);break;case"video":case"audio":for(l=0;l<Ql.length;l++)mt(Ql[l],a);break;case"source":mt("error",a);break;case"img":case"image":case"link":mt("error",a),mt("load",a);break;case"details":mt("toggle",a);break;case"input":mt("invalid",a),Bx(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":mt("invalid",a);break;case"textarea":mt("invalid",a),Ux(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||qy(a.textContent,l)?(u.popover!=null&&(mt("beforetoggle",a),mt("toggle",a)),u.onScroll!=null&&mt("scroll",a),u.onScrollEnd!=null&&mt("scrollend",a),u.onClick!=null&&(a.onclick=ss),a=!0):a=!1,a||Ls(t,!0)}function Eb(t){for(_n=t.return;_n;)switch(_n.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:_n=_n.return}}function vo(t){if(t!==_n)return!1;if(!bt)return Eb(t),bt=!0,!1;var a=t.tag,l;if((l=a!==3&&a!==27)&&((l=a===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Qm(t.type,t.memoizedProps)),l=!l),l&&$t&&Ls(t),Eb(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));$t=Zy(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));$t=Zy(t)}else a===27?(a=$t,Qs(t.type)?(t=tp,tp=null,$t=t):$t=a):$t=_n?wa(t.stateNode.nextSibling):null;return!0}function Nr(){$t=_n=null,bt=!1}function Of(){var t=Ds;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),Ds=null),t}function Nl(t){Ds===null?Ds=[t]:Ds.push(t)}var zf=D(null),Rr=null,is=null;function Ps(t,a,l){V(zf,a._currentValue),a._currentValue=l}function cs(t){t._currentValue=zf.current,G(zf)}function Df(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 Lf(t,a,l,u){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var b=g.dependencies;if(b!==null){var T=g.child;b=b.firstContext;e:for(;b!==null;){var z=b;b=g;for(var F=0;F<a.length;F++)if(z.context===a[F]){b.lanes|=l,z=b.alternate,z!==null&&(z.lanes|=l),Df(b.return,l,t),u||(T=null);break e}b=z.next}}else if(g.tag===18){if(T=g.return,T===null)throw Error(r(341));T.lanes|=l,b=T.alternate,b!==null&&(b.lanes|=l),Df(T,l,t),T=null}else T=g.child;if(T!==null)T.return=g;else for(T=g;T!==null;){if(T===t){T=null;break}if(g=T.sibling,g!==null){g.return=T.return,T=g;break}T=T.return}g=T}}function yo(t,a,l,u){t=null;for(var g=a,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var T=g.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var z=g.type;aa(g.pendingProps.value,T.value)||(t!==null?t.push(z):t=[z])}}else if(g===se.current){if(T=g.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(ti):t=[ti])}g=g.return}t!==null&&Lf(a,t,l,u),a.flags|=262144}function Cc(t){for(t=t.firstContext;t!==null;){if(!aa(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Tr(t){Rr=t,is=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jn(t){return kb(Rr,t)}function Ec(t,a){return Rr===null&&Tr(t),kb(t,a)}function kb(t,a){var l=a._currentValue;if(a={context:a,memoizedValue:l,next:null},is===null){if(t===null)throw Error(r(308));is=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else is=is.next=a;return l}var vC=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()})}},yC=e.unstable_scheduleCallback,_C=e.unstable_NormalPriority,dn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new vC,data:new Map,refCount:0}}function Rl(t){t.refCount--,t.refCount===0&&yC(_C,function(){t.controller.abort()})}var Tl=null,Bf=0,_o=0,jo=null;function jC(t,a){if(Tl===null){var l=Tl=[];Bf=0,_o=Hm(),jo={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Bf++,a.then(Nb,Nb),a}function Nb(){if(--Bf===0&&Tl!==null){jo!==null&&(jo.status="fulfilled");var t=Tl;Tl=null,_o=0,jo=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function wC(t,a){var l=[],u={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return t.then(function(){u.status="fulfilled",u.value=a;for(var g=0;g<l.length;g++)(0,l[g])(a)},function(g){for(u.status="rejected",u.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),u}var Rb=q.S;q.S=function(t,a){fy=ve(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&jC(t,a),Rb!==null&&Rb(t,a)};var Ar=D(null);function If(){var t=Ar.current;return t!==null?t:It.pooledCache}function kc(t,a){a===null?V(Ar,Ar.current):V(Ar,a.pool)}function Tb(){var t=If();return t===null?null:{parent:dn._currentValue,pool:t}}var wo=Error(r(460)),Uf=Error(r(474)),Nc=Error(r(542)),Rc={then:function(){}};function Ab(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Mb(t,a,l){switch(l=t[l],l===void 0?t.push(a):l!==a&&(a.then(ss,ss),a=l),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,zb(t),t;default:if(typeof a.status=="string")a.then(ss,ss);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(u){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=u}},function(u){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,zb(t),t}throw Or=a,wo}}function Mr(t){try{var a=t._init;return a(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Or=l,wo):l}}var Or=null;function Ob(){if(Or===null)throw Error(r(459));var t=Or;return Or=null,t}function zb(t){if(t===wo||t===Nc)throw Error(r(483))}var So=null,Al=0;function Tc(t){var a=Al;return Al+=1,So===null&&(So=[]),Mb(So,t,a)}function Ml(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Ac(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 Db(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 g(te,J){return te=os(te,J),te.index=0,te.sibling=null,te}function b(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 z(te,J,ne,me){return J===null||J.tag!==6?(J=Nf(ne,te.mode,me),J.return=te,J):(J=g(J,ne),J.return=te,J)}function F(te,J,ne,me){var Ve=ne.type;return Ve===_?de(te,J,ne.props.children,me,ne.key):J!==null&&(J.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Mr(Ve)===J.type)?(J=g(J,ne.props),Ml(J,ne),J.return=te,J):(J=wc(ne.type,ne.key,ne.props,null,te.mode,me),Ml(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=Rf(ne,te.mode,me),J.return=te,J):(J=g(J,ne.children||[]),J.return=te,J)}function de(te,J,ne,me,Ve){return J===null||J.tag!==7?(J=kr(ne,te.mode,me,Ve),J.return=te,J):(J=g(J,ne),J.return=te,J)}function pe(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Nf(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case S:return ne=wc(J.type,J.key,J.props,null,te.mode,ne),Ml(ne,J),ne.return=te,ne;case w:return J=Rf(J,te.mode,ne),J.return=te,J;case B:return J=Mr(J),pe(te,J,ne)}if(Q(J)||P(J))return J=kr(J,te.mode,ne,null),J.return=te,J;if(typeof J.then=="function")return pe(te,Tc(J),ne);if(J.$$typeof===R)return pe(te,Ec(te,J),ne);Ac(te,J)}return null}function re(te,J,ne,me){var Ve=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ve!==null?null:z(te,J,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ve?F(te,J,ne,me):null;case w:return ne.key===Ve?ae(te,J,ne,me):null;case B:return ne=Mr(ne),re(te,J,ne,me)}if(Q(ne)||P(ne))return Ve!==null?null:de(te,J,ne,me,null);if(typeof ne.then=="function")return re(te,J,Tc(ne),me);if(ne.$$typeof===R)return re(te,J,Ec(te,ne),me);Ac(te,ne)}return null}function ie(te,J,ne,me,Ve){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return te=te.get(ne)||null,z(J,te,""+me,Ve);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return te=te.get(me.key===null?ne:me.key)||null,F(J,te,me,Ve);case w:return te=te.get(me.key===null?ne:me.key)||null,ae(J,te,me,Ve);case B:return me=Mr(me),ie(te,J,ne,me,Ve)}if(Q(me)||P(me))return te=te.get(ne)||null,de(J,te,me,Ve,null);if(typeof me.then=="function")return ie(te,J,ne,Tc(me),Ve);if(me.$$typeof===R)return ie(te,J,ne,Ec(J,me),Ve);Ac(J,me)}return null}function Pe(te,J,ne,me){for(var Ve=null,jt=null,Ie=J,st=J=0,gt=null;Ie!==null&&st<ne.length;st++){Ie.index>st?(gt=Ie,Ie=null):gt=Ie.sibling;var wt=re(te,Ie,ne[st],me);if(wt===null){Ie===null&&(Ie=gt);break}t&&Ie&&wt.alternate===null&&a(te,Ie),J=b(wt,J,st),jt===null?Ve=wt:jt.sibling=wt,jt=wt,Ie=gt}if(st===ne.length)return l(te,Ie),bt&&ls(te,st),Ve;if(Ie===null){for(;st<ne.length;st++)Ie=pe(te,ne[st],me),Ie!==null&&(J=b(Ie,J,st),jt===null?Ve=Ie:jt.sibling=Ie,jt=Ie);return bt&&ls(te,st),Ve}for(Ie=u(Ie);st<ne.length;st++)gt=ie(Ie,te,st,ne[st],me),gt!==null&&(t&>.alternate!==null&&Ie.delete(gt.key===null?st:gt.key),J=b(gt,J,st),jt===null?Ve=gt:jt.sibling=gt,jt=gt);return t&&Ie.forEach(function(tr){return a(te,tr)}),bt&&ls(te,st),Ve}function Xe(te,J,ne,me){if(ne==null)throw Error(r(151));for(var Ve=null,jt=null,Ie=J,st=J=0,gt=null,wt=ne.next();Ie!==null&&!wt.done;st++,wt=ne.next()){Ie.index>st?(gt=Ie,Ie=null):gt=Ie.sibling;var tr=re(te,Ie,wt.value,me);if(tr===null){Ie===null&&(Ie=gt);break}t&&Ie&&tr.alternate===null&&a(te,Ie),J=b(tr,J,st),jt===null?Ve=tr:jt.sibling=tr,jt=tr,Ie=gt}if(wt.done)return l(te,Ie),bt&&ls(te,st),Ve;if(Ie===null){for(;!wt.done;st++,wt=ne.next())wt=pe(te,wt.value,me),wt!==null&&(J=b(wt,J,st),jt===null?Ve=wt:jt.sibling=wt,jt=wt);return bt&&ls(te,st),Ve}for(Ie=u(Ie);!wt.done;st++,wt=ne.next())wt=ie(Ie,te,st,wt.value,me),wt!==null&&(t&&wt.alternate!==null&&Ie.delete(wt.key===null?st:wt.key),J=b(wt,J,st),jt===null?Ve=wt:jt.sibling=wt,jt=wt);return t&&Ie.forEach(function(zE){return a(te,zE)}),bt&&ls(te,st),Ve}function zt(te,J,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===_&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:e:{for(var Ve=ne.key;J!==null;){if(J.key===Ve){if(Ve=ne.type,Ve===_){if(J.tag===7){l(te,J.sibling),me=g(J,ne.props.children),me.return=te,te=me;break e}}else if(J.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Mr(Ve)===J.type){l(te,J.sibling),me=g(J,ne.props),Ml(me,ne),me.return=te,te=me;break e}l(te,J);break}else a(te,J);J=J.sibling}ne.type===_?(me=kr(ne.props.children,te.mode,me,ne.key),me.return=te,te=me):(me=wc(ne.type,ne.key,ne.props,null,te.mode,me),Ml(me,ne),me.return=te,te=me)}return T(te);case w:e:{for(Ve=ne.key;J!==null;){if(J.key===Ve)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){l(te,J.sibling),me=g(J,ne.children||[]),me.return=te,te=me;break e}else{l(te,J);break}else a(te,J);J=J.sibling}me=Rf(ne,te.mode,me),me.return=te,te=me}return T(te);case B:return ne=Mr(ne),zt(te,J,ne,me)}if(Q(ne))return Pe(te,J,ne,me);if(P(ne)){if(Ve=P(ne),typeof Ve!="function")throw Error(r(150));return ne=Ve.call(ne),Xe(te,J,ne,me)}if(typeof ne.then=="function")return zt(te,J,Tc(ne),me);if(ne.$$typeof===R)return zt(te,J,Ec(te,ne),me);Ac(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=g(J,ne),me.return=te,te=me):(l(te,J),me=Nf(ne,te.mode,me),me.return=te,te=me),T(te)):l(te,J)}return function(te,J,ne,me){try{Al=0;var Ve=zt(te,J,ne,me);return So=null,Ve}catch(Ie){if(Ie===wo||Ie===Nc)throw Ie;var jt=sa(29,Ie,null,te.mode);return jt.lanes=me,jt.return=te,jt}finally{}}}var zr=Db(!0),Lb=Db(!1),Bs=!1;function Hf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qf(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 Is(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Us(t,a,l){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(St&2)!==0){var g=u.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),u.pending=a,a=jc(t),vb(t,null,l),a}return _c(t,u,a,l),jc(t)}function Ol(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,na(t,l)}}function Vf(t,a){var l=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var g=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?g=b=T:b=b.next=T,l=l.next}while(l!==null);b===null?g=b=a:b=b.next=a}else g=b=a;l={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:b,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 $f=!1;function zl(){if($f){var t=jo;if(t!==null)throw t}}function Dl(t,a,l,u){$f=!1;var g=t.updateQueue;Bs=!1;var b=g.firstBaseUpdate,T=g.lastBaseUpdate,z=g.shared.pending;if(z!==null){g.shared.pending=null;var F=z,ae=F.next;F.next=null,T===null?b=ae:T.next=ae,T=F;var de=t.alternate;de!==null&&(de=de.updateQueue,z=de.lastBaseUpdate,z!==T&&(z===null?de.firstBaseUpdate=ae:z.next=ae,de.lastBaseUpdate=F))}if(b!==null){var pe=g.baseState;T=0,de=ae=F=null,z=b;do{var re=z.lane&-536870913,ie=re!==z.lane;if(ie?(pt&re)===re:(u&re)===re){re!==0&&re===_o&&($f=!0),de!==null&&(de=de.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Pe=t,Xe=z;re=a;var zt=l;switch(Xe.tag){case 1:if(Pe=Xe.payload,typeof Pe=="function"){pe=Pe.call(zt,pe,re);break e}pe=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Xe.payload,re=typeof Pe=="function"?Pe.call(zt,pe,re):Pe,re==null)break e;pe=x({},pe,re);break e;case 2:Bs=!0}}re=z.callback,re!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=g.callbacks,ie===null?g.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},de===null?(ae=de=ie,F=pe):de=de.next=ie,T|=re;if(z=z.next,z===null){if(z=g.shared.pending,z===null)break;ie=z,z=ie.next,ie.next=null,g.lastBaseUpdate=ie,g.shared.pending=null}}while(!0);de===null&&(F=pe),g.baseState=F,g.firstBaseUpdate=ae,g.lastBaseUpdate=de,b===null&&(g.shared.lanes=0),Gs|=T,t.lanes=T,t.memoizedState=pe}}function Pb(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Bb(t,a){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Pb(l[t],a)}var Co=D(null),Mc=D(0);function Ib(t,a){t=bs,V(Mc,t),V(Co,a),bs=t|a.baseLanes}function Gf(){V(Mc,bs),V(Co,Co.current)}function Yf(){bs=Mc.current,G(Co),G(Mc)}var ra=D(null),ja=null;function Hs(t){var a=t.alternate;V(on,on.current&1),V(ra,t),ja===null&&(a===null||Co.current!==null||a.memoizedState!==null)&&(ja=t)}function Ff(t){V(on,on.current),V(ra,t),ja===null&&(ja=t)}function Ub(t){t.tag===22?(V(on,on.current),V(ra,t),ja===null&&(ja=t)):qs()}function qs(){V(on,on.current),V(ra,ra.current)}function oa(t){G(ra),ja===t&&(ja=null),G(on)}var on=D(0);function Oc(t){for(var a=t;a!==null;){if(a.tag===13){var l=a.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Wm(l)||ep(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 us=0,et=null,Mt=null,fn=null,zc=!1,Eo=!1,Dr=!1,Dc=0,Ll=0,ko=null,SC=0;function tn(){throw Error(r(321))}function Xf(t,a){if(a===null)return!1;for(var l=0;l<a.length&&l<t.length;l++)if(!aa(t[l],a[l]))return!1;return!0}function Kf(t,a,l,u,g,b){return us=b,et=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,q.H=t===null||t.memoizedState===null?wv:um,Dr=!1,b=l(u,g),Dr=!1,Eo&&(b=qb(a,l,u,g)),Hb(t),b}function Hb(t){q.H=Il;var a=Mt!==null&&Mt.next!==null;if(us=0,fn=Mt=et=null,zc=!1,Ll=0,ko=null,a)throw Error(r(300));t===null||mn||(t=t.dependencies,t!==null&&Cc(t)&&(mn=!0))}function qb(t,a,l,u){et=t;var g=0;do{if(Eo&&(ko=null),Ll=0,Eo=!1,25<=g)throw Error(r(301));if(g+=1,fn=Mt=null,t.updateQueue!=null){var b=t.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}q.H=Sv,b=a(l,u)}while(Eo);return b}function CC(){var t=q.H,a=t.useState()[0];return a=typeof a.then=="function"?Pl(a):a,t=t.useState()[0],(Mt!==null?Mt.memoizedState:null)!==t&&(et.flags|=1024),a}function Qf(){var t=Dc!==0;return Dc=0,t}function Zf(t,a,l){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~l}function Jf(t){if(zc){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}zc=!1}us=0,fn=Mt=et=null,Eo=!1,Ll=Dc=0,ko=null}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?et.memoizedState=fn=t:fn=fn.next=t,fn}function ln(){if(Mt===null){var t=et.alternate;t=t!==null?t.memoizedState:null}else t=Mt.next;var a=fn===null?et.memoizedState:fn.next;if(a!==null)fn=a,Mt=t;else{if(t===null)throw et.alternate===null?Error(r(467)):Error(r(310));Mt=t,t={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},fn===null?et.memoizedState=fn=t:fn=fn.next=t}return fn}function Lc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pl(t){var a=Ll;return Ll+=1,ko===null&&(ko=[]),t=Mb(ko,t,a),a=et,(fn===null?a.memoizedState:fn.next)===null&&(a=a.alternate,q.H=a===null||a.memoizedState===null?wv:um),t}function Pc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Pl(t);if(t.$$typeof===R)return jn(t)}throw Error(r(438,String(t)))}function Wf(t){var a=null,l=et.updateQueue;if(l!==null&&(a=l.memoCache),a==null){var u=et.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),l===null&&(l=Lc(),et.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 ds(t,a){return typeof a=="function"?a(t):a}function Bc(t){var a=ln();return em(a,Mt,t)}function em(t,a,l){var u=t.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var g=t.baseQueue,b=u.pending;if(b!==null){if(g!==null){var T=g.next;g.next=b.next,b.next=T}a.baseQueue=g=b,u.pending=null}if(b=t.baseState,g===null)t.memoizedState=b;else{a=g.next;var z=T=null,F=null,ae=a,de=!1;do{var pe=ae.lane&-536870913;if(pe!==ae.lane?(pt&pe)===pe:(us&pe)===pe){var re=ae.revertLane;if(re===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),pe===_o&&(de=!0);else if((us&re)===re){ae=ae.next,re===_o&&(de=!0);continue}else pe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},F===null?(z=F=pe,T=b):F=F.next=pe,et.lanes|=re,Gs|=re;pe=ae.action,Dr&&l(b,pe),b=ae.hasEagerState?ae.eagerState:l(b,pe)}else re={lane:pe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},F===null?(z=F=re,T=b):F=F.next=re,et.lanes|=pe,Gs|=pe;ae=ae.next}while(ae!==null&&ae!==a);if(F===null?T=b:F.next=z,!aa(b,t.memoizedState)&&(mn=!0,de&&(l=jo,l!==null)))throw l;t.memoizedState=b,t.baseState=T,t.baseQueue=F,u.lastRenderedState=b}return g===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function tm(t){var a=ln(),l=a.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var u=l.dispatch,g=l.pending,b=a.memoizedState;if(g!==null){l.pending=null;var T=g=g.next;do b=t(b,T.action),T=T.next;while(T!==g);aa(b,a.memoizedState)||(mn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),l.lastRenderedState=b}return[b,u]}function Vb(t,a,l){var u=et,g=ln(),b=bt;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=a();var T=!aa((Mt||g).memoizedState,l);if(T&&(g.memoizedState=l,mn=!0),g=g.queue,sm(Yb.bind(null,u,g,t),[t]),g.getSnapshot!==a||T||fn!==null&&fn.memoizedState.tag&1){if(u.flags|=2048,No(9,{destroy:void 0},Gb.bind(null,u,g,l,a),null),It===null)throw Error(r(349));b||(us&127)!==0||$b(u,a,l)}return l}function $b(t,a,l){t.flags|=16384,t={getSnapshot:a,value:l},a=et.updateQueue,a===null?(a=Lc(),et.updateQueue=a,a.stores=[t]):(l=a.stores,l===null?a.stores=[t]:l.push(t))}function Gb(t,a,l,u){a.value=l,a.getSnapshot=u,Fb(a)&&Xb(t)}function Yb(t,a,l){return l(function(){Fb(a)&&Xb(t)})}function Fb(t){var a=t.getSnapshot;t=t.value;try{var l=a();return!aa(t,l)}catch{return!0}}function Xb(t){var a=Er(t,2);a!==null&&Kn(a,t,2)}function nm(t){var a=Bn();if(typeof t=="function"){var l=t;if(t=l(),Dr){Et(!0);try{l()}finally{Et(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:t},a}function Kb(t,a,l,u){return t.baseState=l,em(t,Mt,typeof u=="function"?u:ds)}function EC(t,a,l,u,g){if(Hc(t))throw Error(r(485));if(t=a.action,t!==null){var b={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){b.listeners.push(T)}};q.T!==null?l(!0):b.isTransition=!1,u(b),l=a.pending,l===null?(b.next=a.pending=b,Qb(a,b)):(b.next=l.next,a.pending=l.next=b)}}function Qb(t,a){var l=a.action,u=a.payload,g=t.state;if(a.isTransition){var b=q.T,T={};q.T=T;try{var z=l(g,u),F=q.S;F!==null&&F(T,z),Zb(t,a,z)}catch(ae){am(t,a,ae)}finally{b!==null&&T.types!==null&&(b.types=T.types),q.T=b}}else try{b=l(g,u),Zb(t,a,b)}catch(ae){am(t,a,ae)}}function Zb(t,a,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Jb(t,a,u)},function(u){return am(t,a,u)}):Jb(t,a,l)}function Jb(t,a,l){a.status="fulfilled",a.value=l,Wb(a),t.state=l,a=t.pending,a!==null&&(l=a.next,l===a?t.pending=null:(l=l.next,a.next=l,Qb(t,l)))}function am(t,a,l){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=l,Wb(a),a=a.next;while(a!==u)}t.action=null}function Wb(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function ev(t,a){return a}function tv(t,a){if(bt){var l=It.formState;if(l!==null){e:{var u=et;if(bt){if($t){t:{for(var g=$t,b=_a;g.nodeType!==8;){if(!b){g=null;break t}if(g=wa(g.nextSibling),g===null){g=null;break t}}b=g.data,g=b==="F!"||b==="F"?g:null}if(g){$t=wa(g.nextSibling),u=g.data==="F!";break e}}Ls(u)}u=!1}u&&(a=l[0])}}return l=Bn(),l.memoizedState=l.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ev,lastRenderedState:a},l.queue=u,l=yv.bind(null,et,u),u.dispatch=l,u=nm(!1),b=cm.bind(null,et,!1,u.queue),u=Bn(),g={state:a,dispatch:null,action:t,pending:null},u.queue=g,l=EC.bind(null,et,g,b,l),g.dispatch=l,u.memoizedState=t,[a,l,!1]}function nv(t){var a=ln();return av(a,Mt,t)}function av(t,a,l){if(a=em(t,a,ev)[0],t=Bc(ds)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=Pl(a)}catch(T){throw T===wo?Nc:T}else u=a;a=ln();var g=a.queue,b=g.dispatch;return l!==a.memoizedState&&(et.flags|=2048,No(9,{destroy:void 0},kC.bind(null,g,l),null)),[u,b,t]}function kC(t,a){t.action=a}function sv(t){var a=ln(),l=Mt;if(l!==null)return av(a,l,t);ln(),a=a.memoizedState,l=ln();var u=l.queue.dispatch;return l.memoizedState=t,[a,u,!1]}function No(t,a,l,u){return t={tag:t,create:l,deps:u,inst:a,next:null},a=et.updateQueue,a===null&&(a=Lc(),et.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 rv(){return ln().memoizedState}function Ic(t,a,l,u){var g=Bn();et.flags|=t,g.memoizedState=No(1|a,{destroy:void 0},l,u===void 0?null:u)}function Uc(t,a,l,u){var g=ln();u=u===void 0?null:u;var b=g.memoizedState.inst;Mt!==null&&u!==null&&Xf(u,Mt.memoizedState.deps)?g.memoizedState=No(a,b,l,u):(et.flags|=t,g.memoizedState=No(1|a,b,l,u))}function ov(t,a){Ic(8390656,8,t,a)}function sm(t,a){Uc(2048,8,t,a)}function NC(t){et.flags|=4;var a=et.updateQueue;if(a===null)a=Lc(),et.updateQueue=a,a.events=[t];else{var l=a.events;l===null?a.events=[t]:l.push(t)}}function lv(t){var a=ln().memoizedState;return NC({ref:a,nextImpl:t}),function(){if((St&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function iv(t,a){return Uc(4,2,t,a)}function cv(t,a){return Uc(4,4,t,a)}function uv(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 dv(t,a,l){l=l!=null?l.concat([t]):null,Uc(4,4,uv.bind(null,a,t),l)}function rm(){}function fv(t,a){var l=ln();a=a===void 0?null:a;var u=l.memoizedState;return a!==null&&Xf(a,u[1])?u[0]:(l.memoizedState=[t,a],t)}function mv(t,a){var l=ln();a=a===void 0?null:a;var u=l.memoizedState;if(a!==null&&Xf(a,u[1]))return u[0];if(u=t(),Dr){Et(!0);try{t()}finally{Et(!1)}}return l.memoizedState=[u,a],u}function om(t,a,l){return l===void 0||(us&1073741824)!==0&&(pt&261930)===0?t.memoizedState=a:(t.memoizedState=l,t=py(),et.lanes|=t,Gs|=t,l)}function pv(t,a,l,u){return aa(l,a)?l:Co.current!==null?(t=om(t,l,u),aa(t,a)||(mn=!0),t):(us&42)===0||(us&1073741824)!==0&&(pt&261930)===0?(mn=!0,t.memoizedState=l):(t=py(),et.lanes|=t,Gs|=t,a)}function gv(t,a,l,u,g){var b=X.p;X.p=b!==0&&8>b?b:8;var T=q.T,z={};q.T=z,cm(t,!1,a,l);try{var F=g(),ae=q.S;if(ae!==null&&ae(z,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var de=wC(F,u);Bl(t,a,de,ca(t))}else Bl(t,a,u,ca(t))}catch(pe){Bl(t,a,{then:function(){},status:"rejected",reason:pe},ca())}finally{X.p=b,T!==null&&z.types!==null&&(T.types=z.types),q.T=T}}function RC(){}function lm(t,a,l,u){if(t.tag!==5)throw Error(r(476));var g=hv(t).queue;gv(t,g,a,Z,l===null?RC:function(){return xv(t),l(u)})}function hv(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:ds,lastRenderedState:Z},next:null};var l={};return a.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:l},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function xv(t){var a=hv(t);a.next===null&&(a=t.alternate.memoizedState),Bl(t,a.next.queue,{},ca())}function im(){return jn(ti)}function bv(){return ln().memoizedState}function vv(){return ln().memoizedState}function TC(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var l=ca();t=Is(l);var u=Us(a,t,l);u!==null&&(Kn(u,a,l),Ol(u,a,l)),a={cache:Pf()},t.payload=a;return}a=a.return}}function AC(t,a,l){var u=ca();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hc(t)?_v(a,l):(l=Ef(t,a,l,u),l!==null&&(Kn(l,t,u),jv(l,a,u)))}function yv(t,a,l){var u=ca();Bl(t,a,l,u)}function Bl(t,a,l,u){var g={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hc(t))_v(a,g);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var T=a.lastRenderedState,z=b(T,l);if(g.hasEagerState=!0,g.eagerState=z,aa(z,T))return _c(t,a,g,0),It===null&&yc(),!1}catch{}finally{}if(l=Ef(t,a,g,u),l!==null)return Kn(l,t,u),jv(l,a,u),!0}return!1}function cm(t,a,l,u){if(u={lane:2,revertLane:Hm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Hc(t)){if(a)throw Error(r(479))}else a=Ef(t,l,u,2),a!==null&&Kn(a,t,2)}function Hc(t){var a=t.alternate;return t===et||a!==null&&a===et}function _v(t,a){Eo=zc=!0;var l=t.pending;l===null?a.next=a:(a.next=l.next,l.next=a),t.pending=a}function jv(t,a,l){if((l&4194048)!==0){var u=a.lanes;u&=t.pendingLanes,l|=u,a.lanes=l,na(t,l)}}var Il={readContext:jn,use:Pc,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};Il.useEffectEvent=tn;var wv={readContext:jn,use:Pc,useCallback:function(t,a){return Bn().memoizedState=[t,a===void 0?null:a],t},useContext:jn,useEffect:ov,useImperativeHandle:function(t,a,l){l=l!=null?l.concat([t]):null,Ic(4194308,4,uv.bind(null,a,t),l)},useLayoutEffect:function(t,a){return Ic(4194308,4,t,a)},useInsertionEffect:function(t,a){Ic(4,2,t,a)},useMemo:function(t,a){var l=Bn();a=a===void 0?null:a;var u=t();if(Dr){Et(!0);try{t()}finally{Et(!1)}}return l.memoizedState=[u,a],u},useReducer:function(t,a,l){var u=Bn();if(l!==void 0){var g=l(a);if(Dr){Et(!0);try{l(a)}finally{Et(!1)}}}else g=a;return u.memoizedState=u.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},u.queue=t,t=t.dispatch=AC.bind(null,et,t),[u.memoizedState,t]},useRef:function(t){var a=Bn();return t={current:t},a.memoizedState=t},useState:function(t){t=nm(t);var a=t.queue,l=yv.bind(null,et,a);return a.dispatch=l,[t.memoizedState,l]},useDebugValue:rm,useDeferredValue:function(t,a){var l=Bn();return om(l,t,a)},useTransition:function(){var t=nm(!1);return t=gv.bind(null,et,t.queue,!0,!1),Bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,l){var u=et,g=Bn();if(bt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=a(),It===null)throw Error(r(349));(pt&127)!==0||$b(u,a,l)}g.memoizedState=l;var b={value:l,getSnapshot:a};return g.queue=b,ov(Yb.bind(null,u,b,t),[t]),u.flags|=2048,No(9,{destroy:void 0},Gb.bind(null,u,b,l,a),null),l},useId:function(){var t=Bn(),a=It.identifierPrefix;if(bt){var l=qa,u=Ha;l=(u&~(1<<32-Bt(u)-1)).toString(32)+l,a="_"+a+"R_"+l,l=Dc++,0<l&&(a+="H"+l.toString(32)),a+="_"}else l=SC++,a="_"+a+"r_"+l.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:im,useFormState:tv,useActionState:tv,useOptimistic:function(t){var a=Bn();a.memoizedState=a.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=l,a=cm.bind(null,et,!0,l),l.dispatch=a,[t,a]},useMemoCache:Wf,useCacheRefresh:function(){return Bn().memoizedState=TC.bind(null,et)},useEffectEvent:function(t){var a=Bn(),l={impl:t};return a.memoizedState=l,function(){if((St&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},um={readContext:jn,use:Pc,useCallback:fv,useContext:jn,useEffect:sm,useImperativeHandle:dv,useInsertionEffect:iv,useLayoutEffect:cv,useMemo:mv,useReducer:Bc,useRef:rv,useState:function(){return Bc(ds)},useDebugValue:rm,useDeferredValue:function(t,a){var l=ln();return pv(l,Mt.memoizedState,t,a)},useTransition:function(){var t=Bc(ds)[0],a=ln().memoizedState;return[typeof t=="boolean"?t:Pl(t),a]},useSyncExternalStore:Vb,useId:bv,useHostTransitionStatus:im,useFormState:nv,useActionState:nv,useOptimistic:function(t,a){var l=ln();return Kb(l,Mt,t,a)},useMemoCache:Wf,useCacheRefresh:vv};um.useEffectEvent=lv;var Sv={readContext:jn,use:Pc,useCallback:fv,useContext:jn,useEffect:sm,useImperativeHandle:dv,useInsertionEffect:iv,useLayoutEffect:cv,useMemo:mv,useReducer:tm,useRef:rv,useState:function(){return tm(ds)},useDebugValue:rm,useDeferredValue:function(t,a){var l=ln();return Mt===null?om(l,t,a):pv(l,Mt.memoizedState,t,a)},useTransition:function(){var t=tm(ds)[0],a=ln().memoizedState;return[typeof t=="boolean"?t:Pl(t),a]},useSyncExternalStore:Vb,useId:bv,useHostTransitionStatus:im,useFormState:sv,useActionState:sv,useOptimistic:function(t,a){var l=ln();return Mt!==null?Kb(l,Mt,t,a):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Wf,useCacheRefresh:vv};Sv.useEffectEvent=lv;function dm(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 fm={enqueueSetState:function(t,a,l){t=t._reactInternals;var u=ca(),g=Is(u);g.payload=a,l!=null&&(g.callback=l),a=Us(t,g,u),a!==null&&(Kn(a,t,u),Ol(a,t,u))},enqueueReplaceState:function(t,a,l){t=t._reactInternals;var u=ca(),g=Is(u);g.tag=1,g.payload=a,l!=null&&(g.callback=l),a=Us(t,g,u),a!==null&&(Kn(a,t,u),Ol(a,t,u))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var l=ca(),u=Is(l);u.tag=2,a!=null&&(u.callback=a),a=Us(t,u,l),a!==null&&(Kn(a,t,l),Ol(a,t,l))}};function Cv(t,a,l,u,g,b,T){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,b,T):a.prototype&&a.prototype.isPureReactComponent?!Cl(l,u)||!Cl(g,b):!0}function Ev(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&&fm.enqueueReplaceState(a,a.state,null)}function Lr(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 g in t)l[g]===void 0&&(l[g]=t[g])}return l}function kv(t){vc(t)}function Nv(t){console.error(t)}function Rv(t){vc(t)}function qc(t,a){try{var l=t.onUncaughtError;l(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function Tv(t,a,l){try{var u=t.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function mm(t,a,l){return l=Is(l),l.tag=3,l.payload={element:null},l.callback=function(){qc(t,a)},l}function Av(t){return t=Is(t),t.tag=3,t}function Mv(t,a,l,u){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var b=u.value;t.payload=function(){return g(b)},t.callback=function(){Tv(a,l,u)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(t.callback=function(){Tv(a,l,u),typeof g!="function"&&(Ys===null?Ys=new Set([this]):Ys.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function MC(t,a,l,u,g){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=l.alternate,a!==null&&yo(a,l,g,!0),l=ra.current,l!==null){switch(l.tag){case 31:case 13:return ja===null?eu():l.alternate===null&&nn===0&&(nn=3),l.flags&=-257,l.flags|=65536,l.lanes=g,u===Rc?l.flags|=16384:(a=l.updateQueue,a===null?l.updateQueue=new Set([u]):a.add(u),Bm(t,u,g)),!1;case 22:return l.flags|=65536,u===Rc?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)),Bm(t,u,g)),!1}throw Error(r(435,l.tag))}return Bm(t,u,g),eu(),!1}if(bt)return a=ra.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,u!==Mf&&(t=Error(r(422),{cause:u}),Nl(ba(t,l)))):(u!==Mf&&(a=Error(r(423),{cause:u}),Nl(ba(a,l))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,u=ba(u,l),g=mm(t.stateNode,u,g),Vf(t,g),nn!==4&&(nn=2)),!1;var b=Error(r(520),{cause:u});if(b=ba(b,l),Fl===null?Fl=[b]:Fl.push(b),nn!==4&&(nn=2),a===null)return!0;u=ba(u,l),l=a;do{switch(l.tag){case 3:return l.flags|=65536,t=g&-g,l.lanes|=t,t=mm(l.stateNode,u,t),Vf(l,t),!1;case 1:if(a=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ys===null||!Ys.has(b))))return l.flags|=65536,g&=-g,l.lanes|=g,g=Av(g),Mv(g,t,l,u),Vf(l,g),!1}l=l.return}while(l!==null);return!1}var pm=Error(r(461)),mn=!1;function wn(t,a,l,u){a.child=t===null?Lb(a,null,l,u):zr(a,t.child,l,u)}function Ov(t,a,l,u,g){l=l.render;var b=a.ref;if("ref"in u){var T={};for(var z in u)z!=="ref"&&(T[z]=u[z])}else T=u;return Tr(a),u=Kf(t,a,l,T,b,g),z=Qf(),t!==null&&!mn?(Zf(t,a,g),fs(t,a,g)):(bt&&z&&Tf(a),a.flags|=1,wn(t,a,u,g),a.child)}function zv(t,a,l,u,g){if(t===null){var b=l.type;return typeof b=="function"&&!kf(b)&&b.defaultProps===void 0&&l.compare===null?(a.tag=15,a.type=b,Dv(t,a,b,u,g)):(t=wc(l.type,null,u,a,a.mode,g),t.ref=a.ref,t.return=a,a.child=t)}if(b=t.child,!jm(t,g)){var T=b.memoizedProps;if(l=l.compare,l=l!==null?l:Cl,l(T,u)&&t.ref===a.ref)return fs(t,a,g)}return a.flags|=1,t=os(b,u),t.ref=a.ref,t.return=a,a.child=t}function Dv(t,a,l,u,g){if(t!==null){var b=t.memoizedProps;if(Cl(b,u)&&t.ref===a.ref)if(mn=!1,a.pendingProps=u=b,jm(t,g))(t.flags&131072)!==0&&(mn=!0);else return a.lanes=t.lanes,fs(t,a,g)}return gm(t,a,l,u,g)}function Lv(t,a,l,u){var g=u.children,b=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(b=b!==null?b.baseLanes|l:l,t!==null){for(u=a.child=t.child,g=0;u!==null;)g=g|u.lanes|u.childLanes,u=u.sibling;u=g&~b}else u=0,a.child=null;return Pv(t,a,b,l,u)}if((l&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&kc(a,b!==null?b.cachePool:null),b!==null?Ib(a,b):Gf(),Ub(a);else return u=a.lanes=536870912,Pv(t,a,b!==null?b.baseLanes|l:l,l,u)}else b!==null?(kc(a,b.cachePool),Ib(a,b),qs(),a.memoizedState=null):(t!==null&&kc(a,null),Gf(),qs());return wn(t,a,g,l),a.child}function Ul(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Pv(t,a,l,u,g){var b=If();return b=b===null?null:{parent:dn._currentValue,pool:b},a.memoizedState={baseLanes:l,cachePool:b},t!==null&&kc(a,null),Gf(),Ub(a),t!==null&&yo(t,a,u,!0),a.childLanes=g,null}function Vc(t,a){return a=Gc({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Bv(t,a,l){return zr(a,t.child,null,l),t=Vc(a,a.pendingProps),t.flags|=2,oa(a),a.memoizedState=null,t}function OC(t,a,l){var u=a.pendingProps,g=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(bt){if(u.mode==="hidden")return t=Vc(a,u),a.lanes=536870912,Ul(null,t);if(Ff(a),(t=$t)?(t=Qy(t,_a),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:zs!==null?{id:Ha,overflow:qa}:null,retryLane:536870912,hydrationErrors:null},l=_b(t),l.return=a,a.child=l,_n=a,$t=null)):t=null,t===null)throw Ls(a);return a.lanes=536870912,null}return Vc(a,u)}var b=t.memoizedState;if(b!==null){var T=b.dehydrated;if(Ff(a),g)if(a.flags&256)a.flags&=-257,a=Bv(t,a,l);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(mn||yo(t,a,l,!1),g=(l&t.childLanes)!==0,mn||g){if(u=It,u!==null&&(T=Aa(u,l),T!==0&&T!==b.retryLane))throw b.retryLane=T,Er(t,T),Kn(u,t,T),pm;eu(),a=Bv(t,a,l)}else t=b.treeContext,$t=wa(T.nextSibling),_n=a,bt=!0,Ds=null,_a=!1,t!==null&&Sb(a,t),a=Vc(a,u),a.flags|=4096;return a}return t=os(t.child,{mode:u.mode,children:u.children}),t.ref=a.ref,a.child=t,t.return=a,t}function $c(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 gm(t,a,l,u,g){return Tr(a),l=Kf(t,a,l,u,void 0,g),u=Qf(),t!==null&&!mn?(Zf(t,a,g),fs(t,a,g)):(bt&&u&&Tf(a),a.flags|=1,wn(t,a,l,g),a.child)}function Iv(t,a,l,u,g,b){return Tr(a),a.updateQueue=null,l=qb(a,u,l,g),Hb(t),u=Qf(),t!==null&&!mn?(Zf(t,a,b),fs(t,a,b)):(bt&&u&&Tf(a),a.flags|=1,wn(t,a,l,b),a.child)}function Uv(t,a,l,u,g){if(Tr(a),a.stateNode===null){var b=ho,T=l.contextType;typeof T=="object"&&T!==null&&(b=jn(T)),b=new l(u,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=fm,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=u,b.state=a.memoizedState,b.refs={},Hf(a),T=l.contextType,b.context=typeof T=="object"&&T!==null?jn(T):ho,b.state=a.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(dm(a,l,T,u),b.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(T=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),T!==b.state&&fm.enqueueReplaceState(b,b.state,null),Dl(a,u,b,g),zl(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(t===null){b=a.stateNode;var z=a.memoizedProps,F=Lr(l,z);b.props=F;var ae=b.context,de=l.contextType;T=ho,typeof de=="object"&&de!==null&&(T=jn(de));var pe=l.getDerivedStateFromProps;de=typeof pe=="function"||typeof b.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,de||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(z||ae!==T)&&Ev(a,b,u,T),Bs=!1;var re=a.memoizedState;b.state=re,Dl(a,u,b,g),zl(),ae=a.memoizedState,z||re!==ae||Bs?(typeof pe=="function"&&(dm(a,l,pe,u),ae=a.memoizedState),(F=Bs||Cv(a,l,F,u,re,ae,T))?(de||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=ae),b.props=u,b.state=ae,b.context=T,u=F):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{b=a.stateNode,qf(t,a),T=a.memoizedProps,de=Lr(l,T),b.props=de,pe=a.pendingProps,re=b.context,ae=l.contextType,F=ho,typeof ae=="object"&&ae!==null&&(F=jn(ae)),z=l.getDerivedStateFromProps,(ae=typeof z=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==pe||re!==F)&&Ev(a,b,u,F),Bs=!1,re=a.memoizedState,b.state=re,Dl(a,u,b,g),zl();var ie=a.memoizedState;T!==pe||re!==ie||Bs||t!==null&&t.dependencies!==null&&Cc(t.dependencies)?(typeof z=="function"&&(dm(a,l,z,u),ie=a.memoizedState),(de=Bs||Cv(a,l,de,u,re,ie,F)||t!==null&&t.dependencies!==null&&Cc(t.dependencies))?(ae||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(u,ie,F),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(u,ie,F)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||T===t.memoizedProps&&re===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&re===t.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ie),b.props=u,b.state=ie,b.context=F,u=de):(typeof b.componentDidUpdate!="function"||T===t.memoizedProps&&re===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&re===t.memoizedState||(a.flags|=1024),u=!1)}return b=u,$c(t,a),u=(a.flags&128)!==0,b||u?(b=a.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,t!==null&&u?(a.child=zr(a,t.child,null,g),a.child=zr(a,null,l,g)):wn(t,a,l,g),a.memoizedState=b.state,t=a.child):t=fs(t,a,g),t}function Hv(t,a,l,u){return Nr(),a.flags|=256,wn(t,a,l,u),a.child}var hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xm(t){return{baseLanes:t,cachePool:Tb()}}function bm(t,a,l){return t=t!==null?t.childLanes&~l:0,a&&(t|=ia),t}function qv(t,a,l){var u=a.pendingProps,g=!1,b=(a.flags&128)!==0,T;if((T=b)||(T=t!==null&&t.memoizedState===null?!1:(on.current&2)!==0),T&&(g=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,t===null){if(bt){if(g?Hs(a):qs(),(t=$t)?(t=Qy(t,_a),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:zs!==null?{id:Ha,overflow:qa}:null,retryLane:536870912,hydrationErrors:null},l=_b(t),l.return=a,a.child=l,_n=a,$t=null)):t=null,t===null)throw Ls(a);return ep(t)?a.lanes=32:a.lanes=536870912,null}var z=u.children;return u=u.fallback,g?(qs(),g=a.mode,z=Gc({mode:"hidden",children:z},g),u=kr(u,g,l,null),z.return=a,u.return=a,z.sibling=u,a.child=z,u=a.child,u.memoizedState=xm(l),u.childLanes=bm(t,T,l),a.memoizedState=hm,Ul(null,u)):(Hs(a),vm(a,z))}var F=t.memoizedState;if(F!==null&&(z=F.dehydrated,z!==null)){if(b)a.flags&256?(Hs(a),a.flags&=-257,a=ym(t,a,l)):a.memoizedState!==null?(qs(),a.child=t.child,a.flags|=128,a=null):(qs(),z=u.fallback,g=a.mode,u=Gc({mode:"visible",children:u.children},g),z=kr(z,g,l,null),z.flags|=2,u.return=a,z.return=a,u.sibling=z,a.child=u,zr(a,t.child,null,l),u=a.child,u.memoizedState=xm(l),u.childLanes=bm(t,T,l),a.memoizedState=hm,a=Ul(null,u));else if(Hs(a),ep(z)){if(T=z.nextSibling&&z.nextSibling.dataset,T)var ae=T.dgst;T=ae,u=Error(r(419)),u.stack="",u.digest=T,Nl({value:u,source:null,stack:null}),a=ym(t,a,l)}else if(mn||yo(t,a,l,!1),T=(l&t.childLanes)!==0,mn||T){if(T=It,T!==null&&(u=Aa(T,l),u!==0&&u!==F.retryLane))throw F.retryLane=u,Er(t,u),Kn(T,t,u),pm;Wm(z)||eu(),a=ym(t,a,l)}else Wm(z)?(a.flags|=192,a.child=t.child,a=null):(t=F.treeContext,$t=wa(z.nextSibling),_n=a,bt=!0,Ds=null,_a=!1,t!==null&&Sb(a,t),a=vm(a,u.children),a.flags|=4096);return a}return g?(qs(),z=u.fallback,g=a.mode,F=t.child,ae=F.sibling,u=os(F,{mode:"hidden",children:u.children}),u.subtreeFlags=F.subtreeFlags&65011712,ae!==null?z=os(ae,z):(z=kr(z,g,l,null),z.flags|=2),z.return=a,u.return=a,u.sibling=z,a.child=u,Ul(null,u),u=a.child,z=t.child.memoizedState,z===null?z=xm(l):(g=z.cachePool,g!==null?(F=dn._currentValue,g=g.parent!==F?{parent:F,pool:F}:g):g=Tb(),z={baseLanes:z.baseLanes|l,cachePool:g}),u.memoizedState=z,u.childLanes=bm(t,T,l),a.memoizedState=hm,Ul(t.child,u)):(Hs(a),l=t.child,t=l.sibling,l=os(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 vm(t,a){return a=Gc({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function Gc(t,a){return t=sa(22,t,null,a),t.lanes=0,t}function ym(t,a,l){return zr(a,t.child,null,l),t=vm(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Vv(t,a,l){t.lanes|=a;var u=t.alternate;u!==null&&(u.lanes|=a),Df(t.return,a,l)}function _m(t,a,l,u,g,b){var T=t.memoizedState;T===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:g,treeForkCount:b}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=l,T.tailMode=g,T.treeForkCount=b)}function $v(t,a,l){var u=a.pendingProps,g=u.revealOrder,b=u.tail;u=u.children;var T=on.current,z=(T&2)!==0;if(z?(T=T&1|2,a.flags|=128):T&=1,V(on,T),wn(t,a,u,l),u=bt?kl:0,!z&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Vv(t,l,a);else if(t.tag===19)Vv(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(g){case"forwards":for(l=a.child,g=null;l!==null;)t=l.alternate,t!==null&&Oc(t)===null&&(g=l),l=l.sibling;l=g,l===null?(g=a.child,a.child=null):(g=l.sibling,l.sibling=null),_m(a,!1,g,l,b,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=a.child,a.child=null;g!==null;){if(t=g.alternate,t!==null&&Oc(t)===null){a.child=g;break}t=g.sibling,g.sibling=l,l=g,g=t}_m(a,!0,l,null,b,u);break;case"together":_m(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function fs(t,a,l){if(t!==null&&(a.dependencies=t.dependencies),Gs|=a.lanes,(l&a.childLanes)===0)if(t!==null){if(yo(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=os(t,t.pendingProps),a.child=l,l.return=a;t.sibling!==null;)t=t.sibling,l=l.sibling=os(t,t.pendingProps),l.return=a;l.sibling=null}return a.child}function jm(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Cc(t)))}function zC(t,a,l){switch(a.tag){case 3:ue(a,a.stateNode.containerInfo),Ps(a,dn,t.memoizedState.cache),Nr();break;case 27:case 5:Re(a);break;case 4:ue(a,a.stateNode.containerInfo);break;case 10:Ps(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ff(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(Hs(a),a.flags|=128,null):(l&a.child.childLanes)!==0?qv(t,a,l):(Hs(a),t=fs(t,a,l),t!==null?t.sibling:null);Hs(a);break;case 19:var g=(t.flags&128)!==0;if(u=(l&a.childLanes)!==0,u||(yo(t,a,l,!1),u=(l&a.childLanes)!==0),g){if(u)return $v(t,a,l);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),V(on,on.current),u)break;return null;case 22:return a.lanes=0,Lv(t,a,l,a.pendingProps);case 24:Ps(a,dn,t.memoizedState.cache)}return fs(t,a,l)}function Gv(t,a,l){if(t!==null)if(t.memoizedProps!==a.pendingProps)mn=!0;else{if(!jm(t,l)&&(a.flags&128)===0)return mn=!1,zC(t,a,l);mn=(t.flags&131072)!==0}else mn=!1,bt&&(a.flags&1048576)!==0&&wb(a,kl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(t=Mr(a.elementType),a.type=t,typeof t=="function")kf(t)?(u=Lr(t,u),a.tag=1,a=Uv(null,a,t,u,l)):(a.tag=0,a=gm(null,a,t,u,l));else{if(t!=null){var g=t.$$typeof;if(g===N){a.tag=11,a=Ov(null,a,t,u,l);break e}else if(g===M){a.tag=14,a=zv(null,a,t,u,l);break e}}throw a=Y(t)||t,Error(r(306,a,""))}}return a;case 0:return gm(t,a,a.type,a.pendingProps,l);case 1:return u=a.type,g=Lr(u,a.pendingProps),Uv(t,a,u,g,l);case 3:e:{if(ue(a,a.stateNode.containerInfo),t===null)throw Error(r(387));u=a.pendingProps;var b=a.memoizedState;g=b.element,qf(t,a),Dl(a,u,null,l);var T=a.memoizedState;if(u=T.cache,Ps(a,dn,u),u!==b.cache&&Lf(a,[dn],l,!0),zl(),u=T.element,b.isDehydrated)if(b={element:u,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=Hv(t,a,u,l);break e}else if(u!==g){g=ba(Error(r(424)),a),Nl(g),a=Hv(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($t=wa(t.firstChild),_n=a,bt=!0,Ds=null,_a=!0,l=Lb(a,null,u,l),a.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Nr(),u===g){a=fs(t,a,l);break e}wn(t,a,u,l)}a=a.child}return a;case 26:return $c(t,a),t===null?(l=n0(a.type,null,a.pendingProps,null))?a.memoizedState=l:bt||(l=a.type,t=a.pendingProps,u=lu(oe.current).createElement(l),u[kt]=a,u[un]=t,Sn(u,l,t),xn(u),a.stateNode=u):a.memoizedState=n0(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Re(a),t===null&&bt&&(u=a.stateNode=Wy(a.type,a.pendingProps,oe.current),_n=a,_a=!0,g=$t,Qs(a.type)?(tp=g,$t=wa(u.firstChild)):$t=g),wn(t,a,a.pendingProps.children,l),$c(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&bt&&((g=u=$t)&&(u=uE(u,a.type,a.pendingProps,_a),u!==null?(a.stateNode=u,_n=a,$t=wa(u.firstChild),_a=!1,g=!0):g=!1),g||Ls(a)),Re(a),g=a.type,b=a.pendingProps,T=t!==null?t.memoizedProps:null,u=b.children,Qm(g,b)?u=null:T!==null&&Qm(g,T)&&(a.flags|=32),a.memoizedState!==null&&(g=Kf(t,a,CC,null,null,l),ti._currentValue=g),$c(t,a),wn(t,a,u,l),a.child;case 6:return t===null&&bt&&((t=l=$t)&&(l=dE(l,a.pendingProps,_a),l!==null?(a.stateNode=l,_n=a,$t=null,t=!0):t=!1),t||Ls(a)),null;case 13:return qv(t,a,l);case 4:return ue(a,a.stateNode.containerInfo),u=a.pendingProps,t===null?a.child=zr(a,null,u,l):wn(t,a,u,l),a.child;case 11:return Ov(t,a,a.type,a.pendingProps,l);case 7:return wn(t,a,a.pendingProps,l),a.child;case 8:return wn(t,a,a.pendingProps.children,l),a.child;case 12:return wn(t,a,a.pendingProps.children,l),a.child;case 10:return u=a.pendingProps,Ps(a,a.type,u.value),wn(t,a,u.children,l),a.child;case 9:return g=a.type._context,u=a.pendingProps.children,Tr(a),g=jn(g),u=u(g),a.flags|=1,wn(t,a,u,l),a.child;case 14:return zv(t,a,a.type,a.pendingProps,l);case 15:return Dv(t,a,a.type,a.pendingProps,l);case 19:return $v(t,a,l);case 31:return OC(t,a,l);case 22:return Lv(t,a,l,a.pendingProps);case 24:return Tr(a),u=jn(dn),t===null?(g=If(),g===null&&(g=It,b=Pf(),g.pooledCache=b,b.refCount++,b!==null&&(g.pooledCacheLanes|=l),g=b),a.memoizedState={parent:u,cache:g},Hf(a),Ps(a,dn,g)):((t.lanes&l)!==0&&(qf(t,a),Dl(a,null,null,l),zl()),g=t.memoizedState,b=a.memoizedState,g.parent!==u?(g={parent:u,cache:u},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),Ps(a,dn,u)):(u=b.cache,Ps(a,dn,u),u!==g.cache&&Lf(a,[dn],l,!0))),wn(t,a,a.pendingProps.children,l),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ms(t){t.flags|=4}function wm(t,a,l,u,g){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(by())t.flags|=8192;else throw Or=Rc,Uf}else t.flags&=-16777217}function Yv(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!l0(a))if(by())t.flags|=8192;else throw Or=Rc,Uf}function Yc(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?qn():536870912,t.lanes|=a,Mo|=a)}function Hl(t,a){if(!bt)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 Gt(t){var a=t.alternate!==null&&t.alternate.child===t.child,l=0,u=0;if(a)for(var g=t.child;g!==null;)l|=g.lanes|g.childLanes,u|=g.subtreeFlags&65011712,u|=g.flags&65011712,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)l|=g.lanes|g.childLanes,u|=g.subtreeFlags,u|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=u,t.childLanes=l,a}function DC(t,a,l){var u=a.pendingProps;switch(Af(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(a),null;case 1:return Gt(a),null;case 3:return l=a.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),cs(dn),ee(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(vo(a)?ms(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Of())),Gt(a),null;case 26:var g=a.type,b=a.memoizedState;return t===null?(ms(a),b!==null?(Gt(a),Yv(a,b)):(Gt(a),wm(a,g,null,u,l))):b?b!==t.memoizedState?(ms(a),Gt(a),Yv(a,b)):(Gt(a),a.flags&=-16777217):(t=t.memoizedProps,t!==u&&ms(a),Gt(a),wm(a,g,t,u,l)),null;case 27:if($e(a),l=oe.current,g=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&ms(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}t=W.current,vo(a)?Cb(a):(t=Wy(g,u,l),a.stateNode=t,ms(a))}return Gt(a),null;case 5:if($e(a),g=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&ms(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}if(b=W.current,vo(a))Cb(a);else{var T=lu(oe.current);switch(b){case 1:b=T.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:b=T.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":b=T.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":b=T.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":b=T.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?T.createElement(g,{is:u.is}):T.createElement(g)}}b[kt]=a,b[un]=u;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)b.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=b;e:switch(Sn(b,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ms(a)}}return Gt(a),wm(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,l),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==u&&ms(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(t=oe.current,vo(a)){if(t=a.stateNode,l=a.memoizedProps,u=null,g=_n,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}t[kt]=a,t=!!(t.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||qy(t.nodeValue,l)),t||Ls(a,!0)}else t=lu(t).createTextNode(u),t[kt]=a,a.stateNode=t}return Gt(a),null;case 31:if(l=a.memoizedState,t===null||t.memoizedState!==null){if(u=vo(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[kt]=a}else Nr(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),t=!1}else l=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return a.flags&256?(oa(a),a):(oa(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Gt(a),null;case 13:if(u=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=vo(a),u!==null&&u.dehydrated!==null){if(t===null){if(!g)throw Error(r(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[kt]=a}else Nr(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),g=!1}else g=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(oa(a),a):(oa(a),null)}return oa(a),(a.flags&128)!==0?(a.lanes=l,a):(l=u!==null,t=t!==null&&t.memoizedState!==null,l&&(u=a.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==g&&(u.flags|=2048)),l!==t&&l&&(a.child.flags|=8192),Yc(a,a.updateQueue),Gt(a),null);case 4:return ee(),t===null&&Gm(a.stateNode.containerInfo),Gt(a),null;case 10:return cs(a.type),Gt(a),null;case 19:if(G(on),u=a.memoizedState,u===null)return Gt(a),null;if(g=(a.flags&128)!==0,b=u.rendering,b===null)if(g)Hl(u,!1);else{if(nn!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(b=Oc(t),b!==null){for(a.flags|=128,Hl(u,!1),t=b.updateQueue,a.updateQueue=t,Yc(a,t),a.subtreeFlags=0,t=l,l=a.child;l!==null;)yb(l,t),l=l.sibling;return V(on,on.current&1|2),bt&&ls(a,u.treeForkCount),a.child}t=t.sibling}u.tail!==null&&ve()>Zc&&(a.flags|=128,g=!0,Hl(u,!1),a.lanes=4194304)}else{if(!g)if(t=Oc(b),t!==null){if(a.flags|=128,g=!0,t=t.updateQueue,a.updateQueue=t,Yc(a,t),Hl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!bt)return Gt(a),null}else 2*ve()-u.renderingStartTime>Zc&&l!==536870912&&(a.flags|=128,g=!0,Hl(u,!1),a.lanes=4194304);u.isBackwards?(b.sibling=a.child,a.child=b):(t=u.last,t!==null?t.sibling=b:a.child=b,u.last=b)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ve(),t.sibling=null,l=on.current,V(on,g?l&1|2:l&1),bt&&ls(a,u.treeForkCount),t):(Gt(a),null);case 22:case 23:return oa(a),Yf(),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&&(Gt(a),a.subtreeFlags&6&&(a.flags|=8192)):Gt(a),l=a.updateQueue,l!==null&&Yc(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&&G(Ar),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),cs(dn),Gt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function LC(t,a){switch(Af(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return cs(dn),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(oa(a),a.alternate===null)throw Error(r(340));Nr()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(oa(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Nr()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return G(on),null;case 4:return ee(),null;case 10:return cs(a.type),null;case 22:case 23:return oa(a),Yf(),t!==null&&G(Ar),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return cs(dn),null;case 25:return null;default:return null}}function Fv(t,a){switch(Af(a),a.tag){case 3:cs(dn),ee();break;case 26:case 27:case 5:$e(a);break;case 4:ee();break;case 31:a.memoizedState!==null&&oa(a);break;case 13:oa(a);break;case 19:G(on);break;case 10:cs(a.type);break;case 22:case 23:oa(a),Yf(),t!==null&&G(Ar);break;case 24:cs(dn)}}function ql(t,a){try{var l=a.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var g=u.next;l=g;do{if((l.tag&t)===t){u=void 0;var b=l.create,T=l.inst;u=b(),T.destroy=u}l=l.next}while(l!==g)}}catch(z){Rt(a,a.return,z)}}function Vs(t,a,l){try{var u=a.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var b=g.next;u=b;do{if((u.tag&t)===t){var T=u.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,g=a;var F=l,ae=z;try{ae()}catch(de){Rt(g,F,de)}}}u=u.next}while(u!==b)}}catch(de){Rt(a,a.return,de)}}function Xv(t){var a=t.updateQueue;if(a!==null){var l=t.stateNode;try{Bb(a,l)}catch(u){Rt(t,t.return,u)}}}function Kv(t,a,l){l.props=Lr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(u){Rt(t,a,u)}}function Vl(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(g){Rt(t,a,g)}}function Va(t,a){var l=t.ref,u=t.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(g){Rt(t,a,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){Rt(t,a,g)}else l.current=null}function Qv(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(g){Rt(t,t.return,g)}}function Sm(t,a,l){try{var u=t.stateNode;sE(u,t.type,l,a),u[un]=a}catch(g){Rt(t,t.return,g)}}function Zv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Qs(t.type)||t.tag===4}function Cm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zv(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&&Qs(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 Em(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=ss));else if(u!==4&&(u===27&&Qs(t.type)&&(l=t.stateNode,a=null),t=t.child,t!==null))for(Em(t,a,l),t=t.sibling;t!==null;)Em(t,a,l),t=t.sibling}function Fc(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&&Qs(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Fc(t,a,l),t=t.sibling;t!==null;)Fc(t,a,l),t=t.sibling}function Jv(t){var a=t.stateNode,l=t.memoizedProps;try{for(var u=t.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);Sn(a,u,l),a[kt]=t,a[un]=l}catch(b){Rt(t,t.return,b)}}var ps=!1,pn=!1,km=!1,Wv=typeof WeakSet=="function"?WeakSet:Set,bn=null;function PC(t,a){if(t=t.containerInfo,Xm=pu,t=db(t),yf(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 g=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var T=0,z=-1,F=-1,ae=0,de=0,pe=t,re=null;t:for(;;){for(var ie;pe!==l||g!==0&&pe.nodeType!==3||(z=T+g),pe!==b||u!==0&&pe.nodeType!==3||(F=T+u),pe.nodeType===3&&(T+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)re=pe,pe=ie;for(;;){if(pe===t)break t;if(re===l&&++ae===g&&(z=T),re===b&&++de===u&&(F=T),(ie=pe.nextSibling)!==null)break;pe=re,re=pe.parentNode}pe=ie}l=z===-1||F===-1?null:{start:z,end:F}}else l=null}l=l||{start:0,end:0}}else l=null;for(Km={focusedElem:t,selectionRange:l},pu=!1,bn=a;bn!==null;)if(a=bn,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,bn=t;else for(;bn!==null;){switch(a=bn,b=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++)g=t[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&b!==null){t=void 0,l=a,g=b.memoizedProps,b=b.memoizedState,u=l.stateNode;try{var Pe=Lr(l.type,g);t=u.getSnapshotBeforeUpdate(Pe,b),u.__reactInternalSnapshotBeforeUpdate=t}catch(Xe){Rt(l,l.return,Xe)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,l=t.nodeType,l===9)Jm(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Jm(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,bn=t;break}bn=a.return}}function ey(t,a,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:hs(t,l),u&4&&ql(5,l);break;case 1:if(hs(t,l),u&4)if(t=l.stateNode,a===null)try{t.componentDidMount()}catch(T){Rt(l,l.return,T)}else{var g=Lr(l.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(g,a,t.__reactInternalSnapshotBeforeUpdate)}catch(T){Rt(l,l.return,T)}}u&64&&Xv(l),u&512&&Vl(l,l.return);break;case 3:if(hs(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{Bb(t,a)}catch(T){Rt(l,l.return,T)}}break;case 27:a===null&&u&4&&Jv(l);case 26:case 5:hs(t,l),a===null&&u&4&&Qv(l),u&512&&Vl(l,l.return);break;case 12:hs(t,l);break;case 31:hs(t,l),u&4&&ay(t,l);break;case 13:hs(t,l),u&4&&sy(t,l),u&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=YC.bind(null,l),fE(t,l))));break;case 22:if(u=l.memoizedState!==null||ps,!u){a=a!==null&&a.memoizedState!==null||pn,g=ps;var b=pn;ps=u,(pn=a)&&!b?xs(t,l,(l.subtreeFlags&8772)!==0):hs(t,l),ps=g,pn=b}break;case 30:break;default:hs(t,l)}}function ty(t){var a=t.alternate;a!==null&&(t.alternate=null,ty(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&nf(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 Kt=null,Gn=!1;function gs(t,a,l){for(l=l.child;l!==null;)ny(t,a,l),l=l.sibling}function ny(t,a,l){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(ut,l)}catch{}switch(l.tag){case 26:pn||Va(l,a),gs(t,a,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:pn||Va(l,a);var u=Kt,g=Gn;Qs(l.type)&&(Kt=l.stateNode,Gn=!1),gs(t,a,l),Jl(l.stateNode),Kt=u,Gn=g;break;case 5:pn||Va(l,a);case 6:if(u=Kt,g=Gn,Kt=null,gs(t,a,l),Kt=u,Gn=g,Kt!==null)if(Gn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(l.stateNode)}catch(b){Rt(l,a,b)}else try{Kt.removeChild(l.stateNode)}catch(b){Rt(l,a,b)}break;case 18:Kt!==null&&(Gn?(t=Kt,Xy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Uo(t)):Xy(Kt,l.stateNode));break;case 4:u=Kt,g=Gn,Kt=l.stateNode.containerInfo,Gn=!0,gs(t,a,l),Kt=u,Gn=g;break;case 0:case 11:case 14:case 15:Vs(2,l,a),pn||Vs(4,l,a),gs(t,a,l);break;case 1:pn||(Va(l,a),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Kv(l,a,u)),gs(t,a,l);break;case 21:gs(t,a,l);break;case 22:pn=(u=pn)||l.memoizedState!==null,gs(t,a,l),pn=u;break;default:gs(t,a,l)}}function ay(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Uo(t)}catch(l){Rt(a,a.return,l)}}}function sy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Uo(t)}catch(l){Rt(a,a.return,l)}}function BC(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new Wv),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new Wv),a;default:throw Error(r(435,t.tag))}}function Xc(t,a){var l=BC(t);a.forEach(function(u){if(!l.has(u)){l.add(u);var g=FC.bind(null,t,u);u.then(g,g)}})}function Yn(t,a){var l=a.deletions;if(l!==null)for(var u=0;u<l.length;u++){var g=l[u],b=t,T=a,z=T;e:for(;z!==null;){switch(z.tag){case 27:if(Qs(z.type)){Kt=z.stateNode,Gn=!1;break e}break;case 5:Kt=z.stateNode,Gn=!1;break e;case 3:case 4:Kt=z.stateNode.containerInfo,Gn=!0;break e}z=z.return}if(Kt===null)throw Error(r(160));ny(b,T,g),Kt=null,Gn=!1,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)ry(a,t),a=a.sibling}var Oa=null;function ry(t,a){var l=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yn(a,t),Fn(t),u&4&&(Vs(3,t,t.return),ql(3,t),Vs(5,t,t.return));break;case 1:Yn(a,t),Fn(t),u&512&&(pn||l===null||Va(l,l.return)),u&64&&ps&&(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 g=Oa;if(Yn(a,t),Fn(t),u&512&&(pn||l===null||Va(l,l.return)),u&4){var b=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,g=g.ownerDocument||g;t:switch(u){case"title":b=g.getElementsByTagName("title")[0],(!b||b[hl]||b[kt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=g.createElement(u),g.head.insertBefore(b,g.querySelector("head > title"))),Sn(b,u,l),b[kt]=t,xn(b),u=b;break e;case"link":var T=r0("link","href",g).get(u+(l.href||""));if(T){for(var z=0;z<T.length;z++)if(b=T[z],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(z,1);break t}}b=g.createElement(u),Sn(b,u,l),g.head.appendChild(b);break;case"meta":if(T=r0("meta","content",g).get(u+(l.content||""))){for(z=0;z<T.length;z++)if(b=T[z],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(z,1);break t}}b=g.createElement(u),Sn(b,u,l),g.head.appendChild(b);break;default:throw Error(r(468,u))}b[kt]=t,xn(b),u=b}t.stateNode=u}else o0(g,t.type,t.stateNode);else t.stateNode=s0(g,u,t.memoizedProps);else b!==u?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,u===null?o0(g,t.type,t.stateNode):s0(g,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Sm(t,t.memoizedProps,l.memoizedProps)}break;case 27:Yn(a,t),Fn(t),u&512&&(pn||l===null||Va(l,l.return)),l!==null&&u&4&&Sm(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Yn(a,t),Fn(t),u&512&&(pn||l===null||Va(l,l.return)),t.flags&32){g=t.stateNode;try{io(g,"")}catch(Pe){Rt(t,t.return,Pe)}}u&4&&t.stateNode!=null&&(g=t.memoizedProps,Sm(t,g,l!==null?l.memoizedProps:g)),u&1024&&(km=!0);break;case 6:if(Yn(a,t),Fn(t),u&4){if(t.stateNode===null)throw Error(r(162));u=t.memoizedProps,l=t.stateNode;try{l.nodeValue=u}catch(Pe){Rt(t,t.return,Pe)}}break;case 3:if(uu=null,g=Oa,Oa=iu(a.containerInfo),Yn(a,t),Oa=g,Fn(t),u&4&&l!==null&&l.memoizedState.isDehydrated)try{Uo(a.containerInfo)}catch(Pe){Rt(t,t.return,Pe)}km&&(km=!1,oy(t));break;case 4:u=Oa,Oa=iu(t.stateNode.containerInfo),Yn(a,t),Fn(t),Oa=u;break;case 12:Yn(a,t),Fn(t);break;case 31:Yn(a,t),Fn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Xc(t,u)));break;case 13:Yn(a,t),Fn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Qc=ve()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Xc(t,u)));break;case 22:g=t.memoizedState!==null;var F=l!==null&&l.memoizedState!==null,ae=ps,de=pn;if(ps=ae||g,pn=de||F,Yn(a,t),pn=de,ps=ae,Fn(t),u&8192)e:for(a=t.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(l===null||F||ps||pn||Pr(t)),l=null,a=t;;){if(a.tag===5||a.tag===26){if(l===null){F=l=a;try{if(b=F.stateNode,g)T=b.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{z=F.stateNode;var pe=F.memoizedProps.style,re=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Pe){Rt(F,F.return,Pe)}}}else if(a.tag===6){if(l===null){F=a;try{F.stateNode.nodeValue=g?"":F.memoizedProps}catch(Pe){Rt(F,F.return,Pe)}}}else if(a.tag===18){if(l===null){F=a;try{var ie=F.stateNode;g?Ky(ie,!0):Ky(F.stateNode,!1)}catch(Pe){Rt(F,F.return,Pe)}}}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,Xc(t,l))));break;case 19:Yn(a,t),Fn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Xc(t,u)));break;case 30:break;case 21:break;default:Yn(a,t),Fn(t)}}function Fn(t){var a=t.flags;if(a&2){try{for(var l,u=t.return;u!==null;){if(Zv(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,b=Cm(t);Fc(t,b,g);break;case 5:var T=l.stateNode;l.flags&32&&(io(T,""),l.flags&=-33);var z=Cm(t);Fc(t,z,T);break;case 3:case 4:var F=l.stateNode.containerInfo,ae=Cm(t);Em(t,ae,F);break;default:throw Error(r(161))}}catch(de){Rt(t,t.return,de)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function oy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;oy(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function hs(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)ey(t,a.alternate,a),a=a.sibling}function Pr(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Vs(4,a,a.return),Pr(a);break;case 1:Va(a,a.return);var l=a.stateNode;typeof l.componentWillUnmount=="function"&&Kv(a,a.return,l),Pr(a);break;case 27:Jl(a.stateNode);case 26:case 5:Va(a,a.return),Pr(a);break;case 22:a.memoizedState===null&&Pr(a);break;case 30:Pr(a);break;default:Pr(a)}t=t.sibling}}function xs(t,a,l){for(l=l&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,g=t,b=a,T=b.flags;switch(b.tag){case 0:case 11:case 15:xs(g,b,l),ql(4,b);break;case 1:if(xs(g,b,l),u=b,g=u.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ae){Rt(u,u.return,ae)}if(u=b,g=u.updateQueue,g!==null){var z=u.stateNode;try{var F=g.shared.hiddenCallbacks;if(F!==null)for(g.shared.hiddenCallbacks=null,g=0;g<F.length;g++)Pb(F[g],z)}catch(ae){Rt(u,u.return,ae)}}l&&T&64&&Xv(b),Vl(b,b.return);break;case 27:Jv(b);case 26:case 5:xs(g,b,l),l&&u===null&&T&4&&Qv(b),Vl(b,b.return);break;case 12:xs(g,b,l);break;case 31:xs(g,b,l),l&&T&4&&ay(g,b);break;case 13:xs(g,b,l),l&&T&4&&sy(g,b);break;case 22:b.memoizedState===null&&xs(g,b,l),Vl(b,b.return);break;case 30:break;default:xs(g,b,l)}a=a.sibling}}function Nm(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&&Rl(l))}function Rm(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Rl(t))}function za(t,a,l,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)ly(t,a,l,u),a=a.sibling}function ly(t,a,l,u){var g=a.flags;switch(a.tag){case 0:case 11:case 15:za(t,a,l,u),g&2048&&ql(9,a);break;case 1:za(t,a,l,u);break;case 3:za(t,a,l,u),g&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Rl(t)));break;case 12:if(g&2048){za(t,a,l,u),t=a.stateNode;try{var b=a.memoizedProps,T=b.id,z=b.onPostCommit;typeof z=="function"&&z(T,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(F){Rt(a,a.return,F)}}else za(t,a,l,u);break;case 31:za(t,a,l,u);break;case 13:za(t,a,l,u);break;case 23:break;case 22:b=a.stateNode,T=a.alternate,a.memoizedState!==null?b._visibility&2?za(t,a,l,u):$l(t,a):b._visibility&2?za(t,a,l,u):(b._visibility|=2,Ro(t,a,l,u,(a.subtreeFlags&10256)!==0||!1)),g&2048&&Nm(T,a);break;case 24:za(t,a,l,u),g&2048&&Rm(a.alternate,a);break;default:za(t,a,l,u)}}function Ro(t,a,l,u,g){for(g=g&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=t,T=a,z=l,F=u,ae=T.flags;switch(T.tag){case 0:case 11:case 15:Ro(b,T,z,F,g),ql(8,T);break;case 23:break;case 22:var de=T.stateNode;T.memoizedState!==null?de._visibility&2?Ro(b,T,z,F,g):$l(b,T):(de._visibility|=2,Ro(b,T,z,F,g)),g&&ae&2048&&Nm(T.alternate,T);break;case 24:Ro(b,T,z,F,g),g&&ae&2048&&Rm(T.alternate,T);break;default:Ro(b,T,z,F,g)}a=a.sibling}}function $l(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var l=t,u=a,g=u.flags;switch(u.tag){case 22:$l(l,u),g&2048&&Nm(u.alternate,u);break;case 24:$l(l,u),g&2048&&Rm(u.alternate,u);break;default:$l(l,u)}a=a.sibling}}var Gl=8192;function To(t,a,l){if(t.subtreeFlags&Gl)for(t=t.child;t!==null;)iy(t,a,l),t=t.sibling}function iy(t,a,l){switch(t.tag){case 26:To(t,a,l),t.flags&Gl&&t.memoizedState!==null&&SE(l,Oa,t.memoizedState,t.memoizedProps);break;case 5:To(t,a,l);break;case 3:case 4:var u=Oa;Oa=iu(t.stateNode.containerInfo),To(t,a,l),Oa=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Gl,Gl=16777216,To(t,a,l),Gl=u):To(t,a,l));break;default:To(t,a,l)}}function cy(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 Yl(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];bn=u,dy(u,t)}cy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)uy(t),t=t.sibling}function uy(t){switch(t.tag){case 0:case 11:case 15:Yl(t),t.flags&2048&&Vs(9,t,t.return);break;case 3:Yl(t);break;case 12:Yl(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,Kc(t)):Yl(t);break;default:Yl(t)}}function Kc(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];bn=u,dy(u,t)}cy(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Vs(8,a,a.return),Kc(a);break;case 22:l=a.stateNode,l._visibility&2&&(l._visibility&=-3,Kc(a));break;default:Kc(a)}t=t.sibling}}function dy(t,a){for(;bn!==null;){var l=bn;switch(l.tag){case 0:case 11:case 15:Vs(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:Rl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,bn=u;else e:for(l=t;bn!==null;){u=bn;var g=u.sibling,b=u.return;if(ty(u),u===l){bn=null;break e}if(g!==null){g.return=b,bn=g;break e}bn=b}}}var IC={getCacheForType:function(t){var a=jn(dn),l=a.data.get(t);return l===void 0&&(l=t(),a.data.set(t,l)),l},cacheSignal:function(){return jn(dn).controller.signal}},UC=typeof WeakMap=="function"?WeakMap:Map,St=0,It=null,ft=null,pt=0,Nt=0,la=null,$s=!1,Ao=!1,Tm=!1,bs=0,nn=0,Gs=0,Br=0,Am=0,ia=0,Mo=0,Fl=null,Xn=null,Mm=!1,Qc=0,fy=0,Zc=1/0,Jc=null,Ys=null,hn=0,Fs=null,Oo=null,vs=0,Om=0,zm=null,my=null,Xl=0,Dm=null;function ca(){return(St&2)!==0&&pt!==0?pt&-pt:q.T!==null?Hm():At()}function py(){if(ia===0)if((pt&536870912)===0||bt){var t=Xt;Xt<<=1,(Xt&3932160)===0&&(Xt=262144),ia=t}else ia=536870912;return t=ra.current,t!==null&&(t.flags|=32),ia}function Kn(t,a,l){(t===It&&(Nt===2||Nt===9)||t.cancelPendingCommit!==null)&&(zo(t,0),Xs(t,pt,ia,!1)),Vn(t,l),((St&2)===0||t!==It)&&(t===It&&((St&2)===0&&(Br|=l),nn===4&&Xs(t,pt,ia,!1)),$a(t))}function gy(t,a,l){if((St&6)!==0)throw Error(r(327));var u=!l&&(a&127)===0&&(a&t.expiredLanes)===0||rn(t,a),g=u?VC(t,a):Pm(t,a,!0),b=u;do{if(g===0){Ao&&!u&&Xs(t,a,0,!1);break}else{if(l=t.current.alternate,b&&!HC(l)){g=Pm(t,a,!1),b=!1;continue}if(g===2){if(b=a,t.errorRecoveryDisabledLanes&b)var T=0;else T=t.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var z=t;g=Fl;var F=z.current.memoizedState.isDehydrated;if(F&&(zo(z,T).flags|=256),T=Pm(z,T,!1),T!==2){if(Tm&&!F){z.errorRecoveryDisabledLanes|=b,Br|=b,g=4;break e}b=Xn,Xn=g,b!==null&&(Xn===null?Xn=b:Xn.push.apply(Xn,b))}g=T}if(b=!1,g!==2)continue}}if(g===1){zo(t,0),Xs(t,a,0,!0);break}e:{switch(u=t,b=g,b){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Xs(u,a,ia,!$s);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(g=Qc+300-ve(),10<g)){if(Xs(u,a,ia,!$s),Vt(u,0,!0)!==0)break e;vs=a,u.timeoutHandle=Yy(hy.bind(null,u,l,Xn,Jc,Mm,a,ia,Br,Mo,$s,b,"Throttled",-0,0),g);break e}hy(u,l,Xn,Jc,Mm,a,ia,Br,Mo,$s,b,null,-0,0)}}break}while(!0);$a(t)}function hy(t,a,l,u,g,b,T,z,F,ae,de,pe,re,ie){if(t.timeoutHandle=-1,pe=a.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ss},iy(a,b,pe);var Pe=(b&62914560)===b?Qc-ve():(b&4194048)===b?fy-ve():0;if(Pe=CE(pe,Pe),Pe!==null){vs=b,t.cancelPendingCommit=Pe(Sy.bind(null,t,a,b,l,u,g,T,z,F,de,pe,null,re,ie)),Xs(t,b,T,!ae);return}}Sy(t,a,b,l,u,g,T,z,F)}function HC(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 g=l[u],b=g.getSnapshot;g=g.value;try{if(!aa(b(),g))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 Xs(t,a,l,u){a&=~Am,a&=~Br,t.suspendedLanes|=a,t.pingedLanes&=~a,u&&(t.warmLanes|=a),u=t.expirationTimes;for(var g=a;0<g;){var b=31-Bt(g),T=1<<b;u[b]=-1,g&=~T}l!==0&&An(t,l,a)}function Wc(){return(St&6)===0?(Kl(0),!1):!0}function Lm(){if(ft!==null){if(Nt===0)var t=ft.return;else t=ft,is=Rr=null,Jf(t),So=null,Al=0,t=ft;for(;t!==null;)Fv(t.alternate,t),t=t.return;ft=null}}function zo(t,a){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,lE(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),vs=0,Lm(),It=t,ft=l=os(t.current,null),pt=a,Nt=0,la=null,$s=!1,Ao=rn(t,a),Tm=!1,Mo=ia=Am=Br=Gs=nn=0,Xn=Fl=null,Mm=!1,(a&8)!==0&&(a|=a&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=a;0<u;){var g=31-Bt(u),b=1<<g;a|=t[g],u&=~b}return bs=a,yc(),l}function xy(t,a){et=null,q.H=Il,a===wo||a===Nc?(a=Ob(),Nt=3):a===Uf?(a=Ob(),Nt=4):Nt=a===pm?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,la=a,ft===null&&(nn=1,qc(t,ba(a,t.current)))}function by(){var t=ra.current;return t===null?!0:(pt&4194048)===pt?ja===null:(pt&62914560)===pt||(pt&536870912)!==0?t===ja:!1}function vy(){var t=q.H;return q.H=Il,t===null?Il:t}function yy(){var t=q.A;return q.A=IC,t}function eu(){nn=4,$s||(pt&4194048)!==pt&&ra.current!==null||(Ao=!0),(Gs&134217727)===0&&(Br&134217727)===0||It===null||Xs(It,pt,ia,!1)}function Pm(t,a,l){var u=St;St|=2;var g=vy(),b=yy();(It!==t||pt!==a)&&(Jc=null,zo(t,a)),a=!1;var T=nn;e:do try{if(Nt!==0&&ft!==null){var z=ft,F=la;switch(Nt){case 8:Lm(),T=6;break e;case 3:case 2:case 9:case 6:ra.current===null&&(a=!0);var ae=Nt;if(Nt=0,la=null,Do(t,z,F,ae),l&&Ao){T=0;break e}break;default:ae=Nt,Nt=0,la=null,Do(t,z,F,ae)}}qC(),T=nn;break}catch(de){xy(t,de)}while(!0);return a&&t.shellSuspendCounter++,is=Rr=null,St=u,q.H=g,q.A=b,ft===null&&(It=null,pt=0,yc()),T}function qC(){for(;ft!==null;)_y(ft)}function VC(t,a){var l=St;St|=2;var u=vy(),g=yy();It!==t||pt!==a?(Jc=null,Zc=ve()+500,zo(t,a)):Ao=rn(t,a);e:do try{if(Nt!==0&&ft!==null){a=ft;var b=la;t:switch(Nt){case 1:Nt=0,la=null,Do(t,a,b,1);break;case 2:case 9:if(Ab(b)){Nt=0,la=null,jy(a);break}a=function(){Nt!==2&&Nt!==9||It!==t||(Nt=7),$a(t)},b.then(a,a);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:Ab(b)?(Nt=0,la=null,jy(a)):(Nt=0,la=null,Do(t,a,b,7));break;case 5:var T=null;switch(ft.tag){case 26:T=ft.memoizedState;case 5:case 27:var z=ft;if(T?l0(T):z.stateNode.complete){Nt=0,la=null;var F=z.sibling;if(F!==null)ft=F;else{var ae=z.return;ae!==null?(ft=ae,tu(ae)):ft=null}break t}}Nt=0,la=null,Do(t,a,b,5);break;case 6:Nt=0,la=null,Do(t,a,b,6);break;case 8:Lm(),nn=6;break e;default:throw Error(r(462))}}$C();break}catch(de){xy(t,de)}while(!0);return is=Rr=null,q.H=u,q.A=g,St=l,ft!==null?0:(It=null,pt=0,yc(),nn)}function $C(){for(;ft!==null&&!qe();)_y(ft)}function _y(t){var a=Gv(t.alternate,t,bs);t.memoizedProps=t.pendingProps,a===null?tu(t):ft=a}function jy(t){var a=t,l=a.alternate;switch(a.tag){case 15:case 0:a=Iv(l,a,a.pendingProps,a.type,void 0,pt);break;case 11:a=Iv(l,a,a.pendingProps,a.type.render,a.ref,pt);break;case 5:Jf(a);default:Fv(l,a),a=ft=yb(a,bs),a=Gv(l,a,bs)}t.memoizedProps=t.pendingProps,a===null?tu(t):ft=a}function Do(t,a,l,u){is=Rr=null,Jf(a),So=null,Al=0;var g=a.return;try{if(MC(t,g,a,l,pt)){nn=1,qc(t,ba(l,t.current)),ft=null;return}}catch(b){if(g!==null)throw ft=g,b;nn=1,qc(t,ba(l,t.current)),ft=null;return}a.flags&32768?(bt||u===1?t=!0:Ao||(pt&536870912)!==0?t=!1:($s=t=!0,(u===2||u===9||u===3||u===6)&&(u=ra.current,u!==null&&u.tag===13&&(u.flags|=16384))),wy(a,t)):tu(a)}function tu(t){var a=t;do{if((a.flags&32768)!==0){wy(a,$s);return}t=a.return;var l=DC(a.alternate,a,bs);if(l!==null){ft=l;return}if(a=a.sibling,a!==null){ft=a;return}ft=a=t}while(a!==null);nn===0&&(nn=5)}function wy(t,a){do{var l=LC(t.alternate,t);if(l!==null){l.flags&=32767,ft=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!a&&(t=t.sibling,t!==null)){ft=t;return}ft=t=l}while(t!==null);nn=6,ft=null}function Sy(t,a,l,u,g,b,T,z,F){t.cancelPendingCommit=null;do nu();while(hn!==0);if((St&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(b=a.lanes|a.childLanes,b|=Cf,ts(t,l,b,T,z,F),t===It&&(ft=It=null,pt=0),Oo=a,Fs=t,vs=l,Om=b,zm=g,my=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,XC(Be,function(){return Ry(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=q.T,q.T=null,g=X.p,X.p=2,T=St,St|=4;try{PC(t,a,l)}finally{St=T,X.p=g,q.T=u}}hn=1,Cy(),Ey(),ky()}}function Cy(){if(hn===1){hn=0;var t=Fs,a=Oo,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=q.T,q.T=null;var u=X.p;X.p=2;var g=St;St|=4;try{ry(a,t);var b=Km,T=db(t.containerInfo),z=b.focusedElem,F=b.selectionRange;if(T!==z&&z&&z.ownerDocument&&ub(z.ownerDocument.documentElement,z)){if(F!==null&&yf(z)){var ae=F.start,de=F.end;if(de===void 0&&(de=ae),"selectionStart"in z)z.selectionStart=ae,z.selectionEnd=Math.min(de,z.value.length);else{var pe=z.ownerDocument||document,re=pe&&pe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Pe=z.textContent.length,Xe=Math.min(F.start,Pe),zt=F.end===void 0?Xe:Math.min(F.end,Pe);!ie.extend&&Xe>zt&&(T=zt,zt=Xe,Xe=T);var te=cb(z,Xe),J=cb(z,zt);if(te&&J&&(ie.rangeCount!==1||ie.anchorNode!==te.node||ie.anchorOffset!==te.offset||ie.focusNode!==J.node||ie.focusOffset!==J.offset)){var ne=pe.createRange();ne.setStart(te.node,te.offset),ie.removeAllRanges(),Xe>zt?(ie.addRange(ne),ie.extend(J.node,J.offset)):(ne.setEnd(J.node,J.offset),ie.addRange(ne))}}}}for(pe=[],ie=z;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<pe.length;z++){var me=pe[z];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}pu=!!Xm,Km=Xm=null}finally{St=g,X.p=u,q.T=l}}t.current=a,hn=2}}function Ey(){if(hn===2){hn=0;var t=Fs,a=Oo,l=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||l){l=q.T,q.T=null;var u=X.p;X.p=2;var g=St;St|=4;try{ey(t,a.alternate,a)}finally{St=g,X.p=u,q.T=l}}hn=3}}function ky(){if(hn===4||hn===3){hn=0,Oe();var t=Fs,a=Oo,l=vs,u=my;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?hn=5:(hn=0,Oo=Fs=null,Ny(t,t.pendingLanes));var g=t.pendingLanes;if(g===0&&(Ys=null),at(l),a=a.stateNode,it&&typeof it.onCommitFiberRoot=="function")try{it.onCommitFiberRoot(ut,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=q.T,g=X.p,X.p=2,q.T=null;try{for(var b=t.onRecoverableError,T=0;T<u.length;T++){var z=u[T];b(z.value,{componentStack:z.stack})}}finally{q.T=a,X.p=g}}(vs&3)!==0&&nu(),$a(t),g=t.pendingLanes,(l&261930)!==0&&(g&42)!==0?t===Dm?Xl++:(Xl=0,Dm=t):Xl=0,Kl(0)}}function Ny(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Rl(a)))}function nu(){return Cy(),Ey(),ky(),Ry()}function Ry(){if(hn!==5)return!1;var t=Fs,a=Om;Om=0;var l=at(vs),u=q.T,g=X.p;try{X.p=32>l?32:l,q.T=null,l=zm,zm=null;var b=Fs,T=vs;if(hn=0,Oo=Fs=null,vs=0,(St&6)!==0)throw Error(r(331));var z=St;if(St|=4,uy(b.current),ly(b,b.current,T,l),St=z,Kl(0,!1),it&&typeof it.onPostCommitFiberRoot=="function")try{it.onPostCommitFiberRoot(ut,b)}catch{}return!0}finally{X.p=g,q.T=u,Ny(t,a)}}function Ty(t,a,l){a=ba(l,a),a=mm(t.stateNode,a,2),t=Us(t,a,2),t!==null&&(Vn(t,2),$a(t))}function Rt(t,a,l){if(t.tag===3)Ty(t,t,l);else for(;a!==null;){if(a.tag===3){Ty(a,t,l);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ys===null||!Ys.has(u))){t=ba(l,t),l=Av(2),u=Us(a,l,2),u!==null&&(Mv(l,u,a,t),Vn(u,2),$a(u));break}}a=a.return}}function Bm(t,a,l){var u=t.pingCache;if(u===null){u=t.pingCache=new UC;var g=new Set;u.set(a,g)}else g=u.get(a),g===void 0&&(g=new Set,u.set(a,g));g.has(l)||(Tm=!0,g.add(l),t=GC.bind(null,t,a,l),a.then(t,t))}function GC(t,a,l){var u=t.pingCache;u!==null&&u.delete(a),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,It===t&&(pt&l)===l&&(nn===4||nn===3&&(pt&62914560)===pt&&300>ve()-Qc?(St&2)===0&&zo(t,0):Am|=l,Mo===pt&&(Mo=0)),$a(t)}function Ay(t,a){a===0&&(a=qn()),t=Er(t,a),t!==null&&(Vn(t,a),$a(t))}function YC(t){var a=t.memoizedState,l=0;a!==null&&(l=a.retryLane),Ay(t,l)}function FC(t,a){var l=0;switch(t.tag){case 31:case 13:var u=t.stateNode,g=t.memoizedState;g!==null&&(l=g.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),Ay(t,l)}function XC(t,a){return Le(t,a)}var au=null,Lo=null,Im=!1,su=!1,Um=!1,Ks=0;function $a(t){t!==Lo&&t.next===null&&(Lo===null?au=Lo=t:Lo=Lo.next=t),su=!0,Im||(Im=!0,QC())}function Kl(t,a){if(!Um&&su){Um=!0;do for(var l=!1,u=au;u!==null;){if(t!==0){var g=u.pendingLanes;if(g===0)var b=0;else{var T=u.suspendedLanes,z=u.pingedLanes;b=(1<<31-Bt(42|t)+1)-1,b&=g&~(T&~z),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,Dy(u,b))}else b=pt,b=Vt(u,u===It?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||rn(u,b)||(l=!0,Dy(u,b));u=u.next}while(l);Um=!1}}function KC(){My()}function My(){su=Im=!1;var t=0;Ks!==0&&oE()&&(t=Ks);for(var a=ve(),l=null,u=au;u!==null;){var g=u.next,b=Oy(u,a);b===0?(u.next=null,l===null?au=g:l.next=g,g===null&&(Lo=l)):(l=u,(t!==0||(b&3)!==0)&&(su=!0)),u=g}hn!==0&&hn!==5||Kl(t),Ks!==0&&(Ks=0)}function Oy(t,a){for(var l=t.suspendedLanes,u=t.pingedLanes,g=t.expirationTimes,b=t.pendingLanes&-62914561;0<b;){var T=31-Bt(b),z=1<<T,F=g[T];F===-1?((z&l)===0||(z&u)!==0)&&(g[T]=Tn(z,a)):F<=a&&(t.expiredLanes|=z),b&=~z}if(a=It,l=pt,l=Vt(t,t===a?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,l===0||t===a&&(Nt===2||Nt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Ge(u),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||rn(t,l)){if(a=l&-l,a===t.callbackPriority)return a;switch(u!==null&&Ge(u),at(l)){case 2:case 8:l=je;break;case 32:l=Be;break;case 268435456:l=_t;break;default:l=Be}return u=zy.bind(null,t),l=Le(l,u),t.callbackPriority=a,t.callbackNode=l,a}return u!==null&&u!==null&&Ge(u),t.callbackPriority=2,t.callbackNode=null,2}function zy(t,a){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(nu()&&t.callbackNode!==l)return null;var u=pt;return u=Vt(t,t===It?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(gy(t,u,a),Oy(t,ve()),t.callbackNode!=null&&t.callbackNode===l?zy.bind(null,t):null)}function Dy(t,a){if(nu())return null;gy(t,a,!0)}function QC(){iE(function(){(St&6)!==0?Le(ye,KC):My()})}function Hm(){if(Ks===0){var t=_o;t===0&&(t=Tt,Tt<<=1,(Tt&261888)===0&&(Tt=256)),Ks=t}return Ks}function Ly(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:fc(""+t)}function Py(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 ZC(t,a,l,u,g){if(a==="submit"&&l&&l.stateNode===g){var b=Ly((g[un]||null).action),T=u.submitter;T&&(a=(a=T[un]||null)?Ly(a.formAction):T.getAttribute("formAction"),a!==null&&(b=a,T=null));var z=new hc("action","action",null,u,g);t.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ks!==0){var F=T?Py(g,T):new FormData(g);lm(l,{pending:!0,data:F,method:g.method,action:b},null,F)}}else typeof b=="function"&&(z.preventDefault(),F=T?Py(g,T):new FormData(g),lm(l,{pending:!0,data:F,method:g.method,action:b},b,F))},currentTarget:g}]})}}for(var qm=0;qm<Sf.length;qm++){var Vm=Sf[qm],JC=Vm.toLowerCase(),WC=Vm[0].toUpperCase()+Vm.slice(1);Ma(JC,"on"+WC)}Ma(pb,"onAnimationEnd"),Ma(gb,"onAnimationIteration"),Ma(hb,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(gC,"onTransitionRun"),Ma(hC,"onTransitionStart"),Ma(xC,"onTransitionCancel"),Ma(xb,"onTransitionEnd"),oo("onMouseEnter",["mouseout","mouseover"]),oo("onMouseLeave",["mouseout","mouseover"]),oo("onPointerEnter",["pointerout","pointerover"]),oo("onPointerLeave",["pointerout","pointerover"]),jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="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(" "),eE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ql));function By(t,a){a=(a&4)!==0;for(var l=0;l<t.length;l++){var u=t[l],g=u.event;u=u.listeners;e:{var b=void 0;if(a)for(var T=u.length-1;0<=T;T--){var z=u[T],F=z.instance,ae=z.currentTarget;if(z=z.listener,F!==b&&g.isPropagationStopped())break e;b=z,g.currentTarget=ae;try{b(g)}catch(de){vc(de)}g.currentTarget=null,b=F}else for(T=0;T<u.length;T++){if(z=u[T],F=z.instance,ae=z.currentTarget,z=z.listener,F!==b&&g.isPropagationStopped())break e;b=z,g.currentTarget=ae;try{b(g)}catch(de){vc(de)}g.currentTarget=null,b=F}}}}function mt(t,a){var l=a[ic];l===void 0&&(l=a[ic]=new Set);var u=t+"__bubble";l.has(u)||(Iy(a,t,2,!1),l.add(u))}function $m(t,a,l){var u=0;a&&(u|=4),Iy(l,t,u,a)}var ru="_reactListening"+Math.random().toString(36).slice(2);function Gm(t){if(!t[ru]){t[ru]=!0,Mx.forEach(function(l){l!=="selectionchange"&&(eE.has(l)||$m(l,!1,t),$m(l,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[ru]||(a[ru]=!0,$m("selectionchange",!1,a))}}function Iy(t,a,l,u){switch(p0(a)){case 2:var g=NE;break;case 8:g=RE;break;default:g=op}l=g.bind(null,a,l,t),g=void 0,!df||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),u?g!==void 0?t.addEventListener(a,l,{capture:!0,passive:g}):t.addEventListener(a,l,!0):g!==void 0?t.addEventListener(a,l,{passive:g}):t.addEventListener(a,l,!1)}function Ym(t,a,l,u,g){var b=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 z=u.stateNode.containerInfo;if(z===g)break;if(T===4)for(T=u.return;T!==null;){var F=T.tag;if((F===3||F===4)&&T.stateNode.containerInfo===g)return;T=T.return}for(;z!==null;){if(T=ao(z),T===null)return;if(F=T.tag,F===5||F===6||F===26||F===27){u=b=T;continue e}z=z.parentNode}}u=u.return}$x(function(){var ae=b,de=cf(l),pe=[];e:{var re=bb.get(t);if(re!==void 0){var ie=hc,Pe=t;switch(t){case"keypress":if(pc(l)===0)break e;case"keydown":case"keyup":ie=F2;break;case"focusin":Pe="focus",ie=gf;break;case"focusout":Pe="blur",ie=gf;break;case"beforeblur":case"afterblur":ie=gf;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":ie=Fx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=D2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Q2;break;case pb:case gb:case hb:ie=B2;break;case xb:ie=J2;break;case"scroll":case"scrollend":ie=O2;break;case"wheel":ie=eC;break;case"copy":case"cut":case"paste":ie=U2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Kx;break;case"toggle":case"beforetoggle":ie=nC}var Xe=(a&4)!==0,zt=!Xe&&(t==="scroll"||t==="scrollend"),te=Xe?re!==null?re+"Capture":null:re;Xe=[];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=bl(J,te),me!=null&&Xe.push(Zl(J,me,ne))),zt)break;J=J.return}0<Xe.length&&(re=new ie(re,Pe,null,l,de),pe.push({event:re,listeners:Xe}))}}if((a&7)===0){e:{if(re=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",re&&l!==lf&&(Pe=l.relatedTarget||l.fromElement)&&(ao(Pe)||Pe[_r]))break e;if((ie||re)&&(re=de.window===de?de:(re=de.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Pe=l.relatedTarget||l.toElement,ie=ae,Pe=Pe?ao(Pe):null,Pe!==null&&(zt=c(Pe),Xe=Pe.tag,Pe!==zt||Xe!==5&&Xe!==27&&Xe!==6)&&(Pe=null)):(ie=null,Pe=ae),ie!==Pe)){if(Xe=Fx,me="onMouseLeave",te="onMouseEnter",J="mouse",(t==="pointerout"||t==="pointerover")&&(Xe=Kx,me="onPointerLeave",te="onPointerEnter",J="pointer"),zt=ie==null?re:xl(ie),ne=Pe==null?re:xl(Pe),re=new Xe(me,J+"leave",ie,l,de),re.target=zt,re.relatedTarget=ne,me=null,ao(de)===ae&&(Xe=new Xe(te,J+"enter",Pe,l,de),Xe.target=ne,Xe.relatedTarget=zt,me=Xe),zt=me,ie&&Pe)t:{for(Xe=tE,te=ie,J=Pe,ne=0,me=te;me;me=Xe(me))ne++;me=0;for(var Ve=J;Ve;Ve=Xe(Ve))me++;for(;0<ne-me;)te=Xe(te),ne--;for(;0<me-ne;)J=Xe(J),me--;for(;ne--;){if(te===J||J!==null&&te===J.alternate){Xe=te;break t}te=Xe(te),J=Xe(J)}Xe=null}else Xe=null;ie!==null&&Uy(pe,re,ie,Xe,!1),Pe!==null&&zt!==null&&Uy(pe,zt,Pe,Xe,!0)}}e:{if(re=ae?xl(ae):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var jt=ab;else if(tb(re))if(sb)jt=fC;else{jt=uC;var Ie=cC}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ae&&of(ae.elementType)&&(jt=ab):jt=dC;if(jt&&(jt=jt(t,ae))){nb(pe,jt,l,de);break e}Ie&&Ie(t,re,ae),t==="focusout"&&ae&&re.type==="number"&&ae.memoizedProps.value!=null&&rf(re,"number",re.value)}switch(Ie=ae?xl(ae):window,t){case"focusin":(tb(Ie)||Ie.contentEditable==="true")&&(mo=Ie,_f=ae,El=null);break;case"focusout":El=_f=mo=null;break;case"mousedown":jf=!0;break;case"contextmenu":case"mouseup":case"dragend":jf=!1,fb(pe,l,de);break;case"selectionchange":if(pC)break;case"keydown":case"keyup":fb(pe,l,de)}var st;if(xf)e:{switch(t){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else fo?Wx(t,l)&&(gt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(gt="onCompositionStart");gt&&(Qx&&l.locale!=="ko"&&(fo||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&fo&&(st=Gx()):(Os=de,ff="value"in Os?Os.value:Os.textContent,fo=!0)),Ie=ou(ae,gt),0<Ie.length&&(gt=new Xx(gt,t,null,l,de),pe.push({event:gt,listeners:Ie}),st?gt.data=st:(st=eb(l),st!==null&&(gt.data=st)))),(st=sC?rC(t,l):oC(t,l))&&(gt=ou(ae,"onBeforeInput"),0<gt.length&&(Ie=new Xx("onBeforeInput","beforeinput",null,l,de),pe.push({event:Ie,listeners:gt}),Ie.data=st)),ZC(pe,t,ae,l,de)}By(pe,a)})}function Zl(t,a,l){return{instance:t,listener:a,currentTarget:l}}function ou(t,a){for(var l=a+"Capture",u=[];t!==null;){var g=t,b=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||b===null||(g=bl(t,l),g!=null&&u.unshift(Zl(t,g,b)),g=bl(t,a),g!=null&&u.push(Zl(t,g,b))),t.tag===3)return u;t=t.return}return[]}function tE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Uy(t,a,l,u,g){for(var b=a._reactName,T=[];l!==null&&l!==u;){var z=l,F=z.alternate,ae=z.stateNode;if(z=z.tag,F!==null&&F===u)break;z!==5&&z!==26&&z!==27||ae===null||(F=ae,g?(ae=bl(l,b),ae!=null&&T.unshift(Zl(l,ae,F))):g||(ae=bl(l,b),ae!=null&&T.push(Zl(l,ae,F)))),l=l.return}T.length!==0&&t.push({event:a,listeners:T})}var nE=/\r\n?/g,aE=/\u0000|\uFFFD/g;function Hy(t){return(typeof t=="string"?t:""+t).replace(nE,`
|
|
49
|
-
`).replace(aE,"")}function qy(t,a){return a=Hy(a),Hy(t)===a}function Ot(t,a,l,u,g,b){switch(l){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||io(t,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&io(t,""+u);break;case"className":uc(t,"class",u);break;case"tabIndex":uc(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":uc(t,l,u);break;case"style":qx(t,u,b);break;case"data":if(a!=="object"){uc(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=fc(""+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 b=="function"&&(l==="formAction"?(a!=="input"&&Ot(t,a,"name",g.name,g,null),Ot(t,a,"formEncType",g.formEncType,g,null),Ot(t,a,"formMethod",g.formMethod,g,null),Ot(t,a,"formTarget",g.formTarget,g,null)):(Ot(t,a,"encType",g.encType,g,null),Ot(t,a,"method",g.method,g,null),Ot(t,a,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=fc(""+u),t.setAttribute(l,u);break;case"onClick":u!=null&&(t.onclick=ss);break;case"onScroll":u!=null&&mt("scroll",t);break;case"onScrollEnd":u!=null&&mt("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(g.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=fc(""+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":mt("beforetoggle",t),mt("toggle",t),cc(t,"popover",u);break;case"xlinkActuate":as(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":as(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":as(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":as(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":as(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":as(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":as(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":as(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":as(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":cc(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=A2.get(l)||l,cc(t,l,u))}}function Fm(t,a,l,u,g,b){switch(l){case"style":qx(t,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(g.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof u=="string"?io(t,u):(typeof u=="number"||typeof u=="bigint")&&io(t,""+u);break;case"onScroll":u!=null&&mt("scroll",t);break;case"onScrollEnd":u!=null&&mt("scrollend",t);break;case"onClick":u!=null&&(t.onclick=ss);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ox.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),a=l.slice(2,g?l.length-7:void 0),b=t[un]||null,b=b!=null?b[l]:null,typeof b=="function"&&t.removeEventListener(a,b,g),typeof u=="function")){typeof b!="function"&&b!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(a,u,g);break e}l in t?t[l]=u:u===!0?t.setAttribute(l,""):cc(t,l,u)}}}function Sn(t,a,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",t),mt("load",t);var u=!1,g=!1,b;for(b in l)if(l.hasOwnProperty(b)){var T=l[b];if(T!=null)switch(b){case"src":u=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Ot(t,a,b,T,l,null)}}g&&Ot(t,a,"srcSet",l.srcSet,l,null),u&&Ot(t,a,"src",l.src,l,null);return;case"input":mt("invalid",t);var z=b=T=g=null,F=null,ae=null;for(u in l)if(l.hasOwnProperty(u)){var de=l[u];if(de!=null)switch(u){case"name":g=de;break;case"type":T=de;break;case"checked":F=de;break;case"defaultChecked":ae=de;break;case"value":b=de;break;case"defaultValue":z=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,a));break;default:Ot(t,a,u,de,l,null)}}Bx(t,b,z,F,ae,T,g,!1);return;case"select":mt("invalid",t),u=T=b=null;for(g in l)if(l.hasOwnProperty(g)&&(z=l[g],z!=null))switch(g){case"value":b=z;break;case"defaultValue":T=z;break;case"multiple":u=z;default:Ot(t,a,g,z,l,null)}a=b,l=T,t.multiple=!!u,a!=null?lo(t,!!u,a,!1):l!=null&&lo(t,!!u,l,!0);return;case"textarea":mt("invalid",t),b=g=u=null;for(T in l)if(l.hasOwnProperty(T)&&(z=l[T],z!=null))switch(T){case"value":u=z;break;case"defaultValue":g=z;break;case"children":b=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Ot(t,a,T,z,l,null)}Ux(t,u,g,b);return;case"option":for(F in l)if(l.hasOwnProperty(F)&&(u=l[F],u!=null))switch(F){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ot(t,a,F,u,l,null)}return;case"dialog":mt("beforetoggle",t),mt("toggle",t),mt("cancel",t),mt("close",t);break;case"iframe":case"object":mt("load",t);break;case"video":case"audio":for(u=0;u<Ql.length;u++)mt(Ql[u],t);break;case"image":mt("error",t),mt("load",t);break;case"details":mt("toggle",t);break;case"embed":case"source":case"link":mt("error",t),mt("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:Ot(t,a,ae,u,l,null)}return;default:if(of(a)){for(de in l)l.hasOwnProperty(de)&&(u=l[de],u!==void 0&&Fm(t,a,de,u,l,void 0));return}}for(z in l)l.hasOwnProperty(z)&&(u=l[z],u!=null&&Ot(t,a,z,u,l,null))}function sE(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 g=null,b=null,T=null,z=null,F=null,ae=null,de=null;for(ie in l){var pe=l[ie];if(l.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":F=pe;default:u.hasOwnProperty(ie)||Ot(t,a,ie,null,u,pe)}}for(var re in u){var ie=u[re];if(pe=l[re],u.hasOwnProperty(re)&&(ie!=null||pe!=null))switch(re){case"type":b=ie;break;case"name":g=ie;break;case"checked":ae=ie;break;case"defaultChecked":de=ie;break;case"value":T=ie;break;case"defaultValue":z=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:ie!==pe&&Ot(t,a,re,ie,u,pe)}}sf(t,T,z,F,ae,de,b,g);return;case"select":ie=T=z=re=null;for(b in l)if(F=l[b],l.hasOwnProperty(b)&&F!=null)switch(b){case"value":break;case"multiple":ie=F;default:u.hasOwnProperty(b)||Ot(t,a,b,null,u,F)}for(g in u)if(b=u[g],F=l[g],u.hasOwnProperty(g)&&(b!=null||F!=null))switch(g){case"value":re=b;break;case"defaultValue":z=b;break;case"multiple":T=b;default:b!==F&&Ot(t,a,g,b,u,F)}a=z,l=T,u=ie,re!=null?lo(t,!!l,re,!1):!!u!=!!l&&(a!=null?lo(t,!!l,a,!0):lo(t,!!l,l?[]:"",!1));return;case"textarea":ie=re=null;for(z in l)if(g=l[z],l.hasOwnProperty(z)&&g!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Ot(t,a,z,null,u,g)}for(T in u)if(g=u[T],b=l[T],u.hasOwnProperty(T)&&(g!=null||b!=null))switch(T){case"value":re=g;break;case"defaultValue":ie=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==b&&Ot(t,a,T,g,u,b)}Ix(t,re,ie);return;case"option":for(var Pe in l)if(re=l[Pe],l.hasOwnProperty(Pe)&&re!=null&&!u.hasOwnProperty(Pe))switch(Pe){case"selected":t.selected=!1;break;default:Ot(t,a,Pe,null,u,re)}for(F in u)if(re=u[F],ie=l[F],u.hasOwnProperty(F)&&re!==ie&&(re!=null||ie!=null))switch(F){case"selected":t.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ot(t,a,F,re,u,ie)}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 Xe in l)re=l[Xe],l.hasOwnProperty(Xe)&&re!=null&&!u.hasOwnProperty(Xe)&&Ot(t,a,Xe,null,u,re);for(ae in u)if(re=u[ae],ie=l[ae],u.hasOwnProperty(ae)&&re!==ie&&(re!=null||ie!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,a));break;default:Ot(t,a,ae,re,u,ie)}return;default:if(of(a)){for(var zt in l)re=l[zt],l.hasOwnProperty(zt)&&re!==void 0&&!u.hasOwnProperty(zt)&&Fm(t,a,zt,void 0,u,re);for(de in u)re=u[de],ie=l[de],!u.hasOwnProperty(de)||re===ie||re===void 0&&ie===void 0||Fm(t,a,de,re,u,ie);return}}for(var te in l)re=l[te],l.hasOwnProperty(te)&&re!=null&&!u.hasOwnProperty(te)&&Ot(t,a,te,null,u,re);for(pe in u)re=u[pe],ie=l[pe],!u.hasOwnProperty(pe)||re===ie||re==null&&ie==null||Ot(t,a,pe,re,u,ie)}function Vy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var g=l[u],b=g.transferSize,T=g.initiatorType,z=g.duration;if(b&&z&&Vy(T)){for(T=0,z=g.responseEnd,u+=1;u<l.length;u++){var F=l[u],ae=F.startTime;if(ae>z)break;var de=F.transferSize,pe=F.initiatorType;de&&Vy(pe)&&(F=F.responseEnd,T+=de*(F<z?1:(z-ae)/(F-ae)))}if(--u,a+=8*(b+T)/(g.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 Xm=null,Km=null;function lu(t){return t.nodeType===9?t:t.ownerDocument}function $y(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 Gy(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 Qm(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 Zm=null;function oE(){var t=window.event;return t&&t.type==="popstate"?t===Zm?!1:(Zm=t,!0):(Zm=null,!1)}var Yy=typeof setTimeout=="function"?setTimeout:void 0,lE=typeof clearTimeout=="function"?clearTimeout:void 0,Fy=typeof Promise=="function"?Promise:void 0,iE=typeof queueMicrotask=="function"?queueMicrotask:typeof Fy<"u"?function(t){return Fy.resolve(null).then(t).catch(cE)}:Yy;function cE(t){setTimeout(function(){throw t})}function Qs(t){return t==="head"}function Xy(t,a){var l=a,u=0;do{var g=l.nextSibling;if(t.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(u===0){t.removeChild(g),Uo(a);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Jl(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Jl(l);for(var b=l.firstChild;b;){var T=b.nextSibling,z=b.nodeName;b[hl]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=T}}else l==="body"&&Jl(t.ownerDocument.body);l=g}while(l);Uo(a)}function Ky(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 Jm(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":Jm(l),nf(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function uE(t,a,l,u){for(;t.nodeType===1;){var g=l;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[hl])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(b=t.getAttribute("rel"),b==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(b!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(b=t.getAttribute("src"),(b!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&b&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var b=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===b)return t}else return t;if(t=wa(t.nextSibling),t===null)break}return null}function dE(t,a,l){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=wa(t.nextSibling),t===null))return null;return t}function Qy(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=wa(t.nextSibling),t===null))return null;return t}function Wm(t){return t.data==="$?"||t.data==="$~"}function ep(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 wa(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 tp=null;function Zy(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(a===0)return wa(t.nextSibling);a--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||a++}t=t.nextSibling}return null}function Jy(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 Wy(t,a,l){switch(a=lu(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 Jl(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);nf(t)}var Sa=new Map,e0=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ys=X.d;X.d={f:mE,r:pE,D:gE,C:hE,L:xE,m:bE,X:yE,S:vE,M:_E};function mE(){var t=ys.f(),a=Wc();return t||a}function pE(t){var a=so(t);a!==null&&a.tag===5&&a.type==="form"?xv(a):ys.r(t)}var Po=typeof document>"u"?null:document;function t0(t,a,l){var u=Po;if(u&&typeof a=="string"&&a){var g=ha(a);g='link[rel="'+t+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),e0.has(g)||(e0.add(g),t={rel:t,crossOrigin:l,href:a},u.querySelector(g)===null&&(a=u.createElement("link"),Sn(a,"link",t),xn(a),u.head.appendChild(a)))}}function gE(t){ys.D(t),t0("dns-prefetch",t,null)}function hE(t,a){ys.C(t,a),t0("preconnect",t,a)}function xE(t,a,l){ys.L(t,a,l);var u=Po;if(u&&t&&a){var g='link[rel="preload"][as="'+ha(a)+'"]';a==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+ha(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+ha(l.imageSizes)+'"]')):g+='[href="'+ha(t)+'"]';var b=g;switch(a){case"style":b=Bo(t);break;case"script":b=Io(t)}Sa.has(b)||(t=x({rel:"preload",href:a==="image"&&l&&l.imageSrcSet?void 0:t,as:a},l),Sa.set(b,t),u.querySelector(g)!==null||a==="style"&&u.querySelector(Wl(b))||a==="script"&&u.querySelector(ei(b))||(a=u.createElement("link"),Sn(a,"link",t),xn(a),u.head.appendChild(a)))}}function bE(t,a){ys.m(t,a);var l=Po;if(l&&t){var u=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+ha(u)+'"][href="'+ha(t)+'"]',b=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Io(t)}if(!Sa.has(b)&&(t=x({rel:"modulepreload",href:t},a),Sa.set(b,t),l.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ei(b)))return}u=l.createElement("link"),Sn(u,"link",t),xn(u),l.head.appendChild(u)}}}function vE(t,a,l){ys.S(t,a,l);var u=Po;if(u&&t){var g=ro(u).hoistableStyles,b=Bo(t);a=a||"default";var T=g.get(b);if(!T){var z={loading:0,preload:null};if(T=u.querySelector(Wl(b)))z.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},l),(l=Sa.get(b))&&np(t,l);var F=T=u.createElement("link");xn(F),Sn(F,"link",t),F._p=new Promise(function(ae,de){F.onload=ae,F.onerror=de}),F.addEventListener("load",function(){z.loading|=1}),F.addEventListener("error",function(){z.loading|=2}),z.loading|=4,cu(T,a,u)}T={type:"stylesheet",instance:T,count:1,state:z},g.set(b,T)}}}function yE(t,a){ys.X(t,a);var l=Po;if(l&&t){var u=ro(l).hoistableScripts,g=Io(t),b=u.get(g);b||(b=l.querySelector(ei(g)),b||(t=x({src:t,async:!0},a),(a=Sa.get(g))&&ap(t,a),b=l.createElement("script"),xn(b),Sn(b,"link",t),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function _E(t,a){ys.M(t,a);var l=Po;if(l&&t){var u=ro(l).hoistableScripts,g=Io(t),b=u.get(g);b||(b=l.querySelector(ei(g)),b||(t=x({src:t,async:!0,type:"module"},a),(a=Sa.get(g))&&ap(t,a),b=l.createElement("script"),xn(b),Sn(b,"link",t),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(g,b))}}function n0(t,a,l,u){var g=(g=oe.current)?iu(g):null;if(!g)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(a=Bo(l.href),l=ro(g).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=Bo(l.href);var b=ro(g).hoistableStyles,T=b.get(t);if(T||(g=g.ownerDocument||g,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,T),(b=g.querySelector(Wl(t)))&&!b._p&&(T.instance=b,T.state.loading=5),Sa.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},Sa.set(t,l),b||jE(g,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=Io(l),l=ro(g).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 Bo(t){return'href="'+ha(t)+'"'}function Wl(t){return'link[rel="stylesheet"]['+t+"]"}function a0(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function jE(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}),Sn(a,"link",l),xn(a),t.head.appendChild(a))}function Io(t){return'[src="'+ha(t)+'"]'}function ei(t){return"script[async]"+t}function s0(t,a,l){if(a.count++,a.instance===null)switch(a.type){case"style":var u=t.querySelector('style[data-href~="'+ha(l.href)+'"]');if(u)return a.instance=u,xn(u),u;var g=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),xn(u),Sn(u,"style",g),cu(u,l.precedence,t),a.instance=u;case"stylesheet":g=Bo(l.href);var b=t.querySelector(Wl(g));if(b)return a.state.loading|=4,a.instance=b,xn(b),b;u=a0(l),(g=Sa.get(g))&&np(u,g),b=(t.ownerDocument||t).createElement("link"),xn(b);var T=b;return T._p=new Promise(function(z,F){T.onload=z,T.onerror=F}),Sn(b,"link",u),a.state.loading|=4,cu(b,l.precedence,t),a.instance=b;case"script":return b=Io(l.src),(g=t.querySelector(ei(b)))?(a.instance=g,xn(g),g):(u=l,(g=Sa.get(b))&&(u=x({},l),ap(u,g)),t=t.ownerDocument||t,g=t.createElement("script"),xn(g),Sn(g,"link",u),t.head.appendChild(g),a.instance=g);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,cu(u,l.precedence,t));return a.instance}function cu(t,a,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,b=g,T=0;T<u.length;T++){var z=u[T];if(z.dataset.precedence===a)b=z;else if(b!==g)break}b?b.parentNode.insertBefore(t,b.nextSibling):(a=l.nodeType===9?l.head:l,a.insertBefore(t,a.firstChild))}function np(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function ap(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var uu=null;function r0(t,a,l){if(uu===null){var u=new Map,g=uu=new Map;g.set(l,u)}else g=uu,u=g.get(l),u||(u=new Map,g.set(l,u));if(u.has(t))return u;for(u.set(t,null),l=l.getElementsByTagName(t),g=0;g<l.length;g++){var b=l[g];if(!(b[hl]||b[kt]||t==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var T=b.getAttribute(a)||"";T=t+T;var z=u.get(T);z?z.push(b):u.set(T,[b])}}return u}function o0(t,a,l){t=t.ownerDocument||t,t.head.insertBefore(l,a==="title"?t.querySelector("head > title"):null)}function wE(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 l0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function SE(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 g=Bo(u.href),b=a.querySelector(Wl(g));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=du.bind(t),a.then(t,t)),l.state.loading|=4,l.instance=b,xn(b);return}b=a.ownerDocument||a,u=a0(u),(g=Sa.get(g))&&np(u,g),b=b.createElement("link"),xn(b);var T=b;T._p=new Promise(function(z,F){T.onload=z,T.onerror=F}),Sn(b,"link",u),l.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=du.bind(t),a.addEventListener("load",l),a.addEventListener("error",l))}}var sp=0;function CE(t,a){return t.stylesheets&&t.count===0&&mu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var u=setTimeout(function(){if(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend){var b=t.unsuspend;t.unsuspend=null,b()}},6e4+a);0<t.imgBytes&&sp===0&&(sp=62500*rE());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend)){var b=t.unsuspend;t.unsuspend=null,b()}},(t.imgBytes>sp?50:800)+a);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function du(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var fu=null;function mu(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,fu=new Map,a.forEach(EE,t),fu=null,du.call(t))}function EE(t,a){if(!(a.state.loading&4)){var l=fu.get(t);if(l)var u=l.get(null);else{l=new Map,fu.set(t,l);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<g.length;b++){var T=g[b];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),u=T)}u&&l.set(null,u)}g=a.instance,T=g.getAttribute("data-precedence"),b=l.get(T)||u,b===u&&l.set(null,g),l.set(T,g),this.count++,u=du.bind(this),g.addEventListener("load",u),g.addEventListener("error",u),b?b.parentNode.insertBefore(g,b.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),a.state.loading|=4}}var ti={$$typeof:R,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function kE(t,a,l,u,g,b,T,z,F){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=ta(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ta(0),this.hiddenUpdates=ta(null),this.identifierPrefix=u,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function i0(t,a,l,u,g,b,T,z,F,ae,de,pe){return t=new kE(t,a,l,T,F,ae,de,pe,z),a=1,b===!0&&(a|=24),b=sa(3,null,null,a),t.current=b,b.stateNode=t,a=Pf(),a.refCount++,t.pooledCache=a,a.refCount++,b.memoizedState={element:u,isDehydrated:l,cache:a},Hf(b),t}function c0(t){return t?(t=ho,t):ho}function u0(t,a,l,u,g,b){g=c0(g),u.context===null?u.context=g:u.pendingContext=g,u=Is(a),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=Us(t,u,a),l!==null&&(Kn(l,t,a),Ol(l,t,a))}function d0(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<a?l:a}}function rp(t,a){d0(t,a),(t=t.alternate)&&d0(t,a)}function f0(t){if(t.tag===13||t.tag===31){var a=Er(t,67108864);a!==null&&Kn(a,t,67108864),rp(t,67108864)}}function m0(t){if(t.tag===13||t.tag===31){var a=ca();a=ns(a);var l=Er(t,a);l!==null&&Kn(l,t,a),rp(t,a)}}var pu=!0;function NE(t,a,l,u){var g=q.T;q.T=null;var b=X.p;try{X.p=2,op(t,a,l,u)}finally{X.p=b,q.T=g}}function RE(t,a,l,u){var g=q.T;q.T=null;var b=X.p;try{X.p=8,op(t,a,l,u)}finally{X.p=b,q.T=g}}function op(t,a,l,u){if(pu){var g=lp(u);if(g===null)Ym(t,a,u,gu,l),g0(t,u);else if(AE(g,t,a,l,u))u.stopPropagation();else if(g0(t,u),a&4&&-1<TE.indexOf(t)){for(;g!==null;){var b=so(g);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var T=Wt(b.pendingLanes);if(T!==0){var z=b;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var F=1<<31-Bt(T);z.entanglements[1]|=F,T&=~F}$a(b),(St&6)===0&&(Zc=ve()+500,Kl(0))}}break;case 31:case 13:z=Er(b,2),z!==null&&Kn(z,b,2),Wc(),rp(b,2)}if(b=lp(u),b===null&&Ym(t,a,u,gu,l),b===g)break;g=b}g!==null&&u.stopPropagation()}else Ym(t,a,u,null,l)}}function lp(t){return t=cf(t),ip(t)}var gu=null;function ip(t){if(gu=null,t=ao(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 gu=t,null}function p0(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 ye:return 2;case je:return 8;case Be:case Ze:return 32;case _t:return 268435456;default:return 32}default:return 32}}var cp=!1,Zs=null,Js=null,Ws=null,ni=new Map,ai=new Map,er=[],TE="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 g0(t,a){switch(t){case"focusin":case"focusout":Zs=null;break;case"dragenter":case"dragleave":Js=null;break;case"mouseover":case"mouseout":Ws=null;break;case"pointerover":case"pointerout":ni.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(a.pointerId)}}function si(t,a,l,u,g,b){return t===null||t.nativeEvent!==b?(t={blockedOn:a,domEventName:l,eventSystemFlags:u,nativeEvent:b,targetContainers:[g]},a!==null&&(a=so(a),a!==null&&f0(a)),t):(t.eventSystemFlags|=u,a=t.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),t)}function AE(t,a,l,u,g){switch(a){case"focusin":return Zs=si(Zs,t,a,l,u,g),!0;case"dragenter":return Js=si(Js,t,a,l,u,g),!0;case"mouseover":return Ws=si(Ws,t,a,l,u,g),!0;case"pointerover":var b=g.pointerId;return ni.set(b,si(ni.get(b)||null,t,a,l,u,g)),!0;case"gotpointercapture":return b=g.pointerId,ai.set(b,si(ai.get(b)||null,t,a,l,u,g)),!0}return!1}function h0(t){var a=ao(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,yn(t.priority,function(){m0(l)});return}}else if(a===31){if(a=f(l),a!==null){t.blockedOn=a,yn(t.priority,function(){m0(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=lp(t.nativeEvent);if(l===null){l=t.nativeEvent;var u=new l.constructor(l.type,l);lf=u,l.target.dispatchEvent(u),lf=null}else return a=so(l),a!==null&&f0(a),t.blockedOn=l,!1;a.shift()}return!0}function x0(t,a,l){hu(t)&&l.delete(a)}function ME(){cp=!1,Zs!==null&&hu(Zs)&&(Zs=null),Js!==null&&hu(Js)&&(Js=null),Ws!==null&&hu(Ws)&&(Ws=null),ni.forEach(x0),ai.forEach(x0)}function xu(t,a){t.blockedOn===a&&(t.blockedOn=null,cp||(cp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ME)))}var bu=null;function b0(t){bu!==t&&(bu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bu===t&&(bu=null);for(var a=0;a<t.length;a+=3){var l=t[a],u=t[a+1],g=t[a+2];if(typeof u!="function"){if(ip(u||l)===null)continue;break}var b=so(l);b!==null&&(t.splice(a,3),a-=3,lm(b,{pending:!0,data:g,method:l.method,action:u},u,g))}}))}function Uo(t){function a(F){return xu(F,t)}Zs!==null&&xu(Zs,t),Js!==null&&xu(Js,t),Ws!==null&&xu(Ws,t),ni.forEach(a),ai.forEach(a);for(var l=0;l<er.length;l++){var u=er[l];u.blockedOn===t&&(u.blockedOn=null)}for(;0<er.length&&(l=er[0],l.blockedOn===null);)h0(l),l.blockedOn===null&&er.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var g=l[u],b=l[u+1],T=g[un]||null;if(typeof b=="function")T||b0(l);else if(T){var z=null;if(b&&b.hasAttribute("formAction")){if(g=b,T=b[un]||null)z=T.formAction;else if(ip(g)!==null)continue}else z=T.action;typeof z=="function"?l[u+1]=z:(l.splice(u,3),u-=3),b0(l)}}}function v0(){function t(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(T){return g=T})},focusReset:"manual",scroll:"manual"})}function a(){g!==null&&(g(),g=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,g=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),g!==null&&(g(),g=null)}}}function up(t){this._internalRoot=t}vu.prototype.render=up.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var l=a.current,u=ca();u0(l,u,t,a,null,null)},vu.prototype.unmount=up.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;u0(t.current,2,null,t,null,null),Wc(),a[_r]=null}};function vu(t){this._internalRoot=t}vu.prototype.unstable_scheduleHydration=function(t){if(t){var a=At();t={blockedOn:null,target:t,priority:a};for(var l=0;l<er.length&&a!==0&&a<er[l].priority;l++);er.splice(l,0,t),l===0&&h0(t)}};var y0=n.version;if(y0!=="19.2.7")throw Error(r(527,y0,"19.2.7"));X.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?h(t):null,t=t===null?null:t.stateNode,t};var OE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yu.isDisabled&&yu.supportsFiber)try{ut=yu.inject(OE),it=yu}catch{}}return oi.createRoot=function(t,a){if(!i(t))throw Error(r(299));var l=!1,u="",g=kv,b=Nv,T=Rv;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=i0(t,1,!1,null,null,l,u,null,g,b,T,v0),t[_r]=a.current,Gm(t),new up(a)},oi.hydrateRoot=function(t,a,l){if(!i(t))throw Error(r(299));var u=!1,g="",b=kv,T=Nv,z=Rv,F=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError),l.formState!==void 0&&(F=l.formState)),a=i0(t,1,!0,a,l??null,u,g,F,b,T,z,v0),a.context=c0(null),l=a.current,u=ca(),u=ns(u),g=Is(u),g.callback=null,Us(l,g,u),l=u,a.current.lanes=l,Vn(a,l),$a(a),t[_r]=a.current,Gm(t),new vu(a)},oi.version="19.2.7",oi}var T0;function $E(){if(T0)return mp.exports;T0=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(),mp.exports=VE(),mp.exports}var GE=$E();const YE=rh(GE);/**
|
|
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 A0="popstate";function M0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function FE(e={}){function n(r,i){let c=i.state?.masked,{pathname:d,search:f,hash:p}=c||r.location;return Eg("",{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:Pi(i)}return KE(n,s,null,e)}function Zt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Ba(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function XE(){return Math.random().toString(36).substring(2,10)}function O0(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 Eg(e,n,s=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ol(n):n,state:s,key:n&&n.key||r||XE(),mask:i}}function Pi({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 ol(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 KE(e,n,s,r={}){let{window:i=document.defaultView,v5Compat:c=!1}=r,d=i.history,f="POP",p=null,m=h();m==null&&(m=0,d.replaceState({...d.state,idx:m},""));function h(){return(d.state||{idx:null}).idx}function x(){f="POP";let j=h(),E=j==null?null:j-m;m=j,p&&p({action:f,location:_.location,delta:E})}function y(j,E){f="PUSH";let k=M0(j)?j:Eg(_.location,j,E);m=h()+1;let R=O0(k,m),N=_.createHref(k.mask||k);try{d.pushState(R,"",N)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(N)}c&&p&&p({action:f,location:_.location,delta:1})}function S(j,E){f="REPLACE";let k=M0(j)?j:Eg(_.location,j,E);m=h();let R=O0(k,m),N=_.createHref(k.mask||k);d.replaceState(R,"",N),c&&p&&p({action:f,location:_.location,delta:0})}function w(j){return QE(i,j)}let _={get action(){return f},get location(){return e(i,d)},listen(j){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(A0,x),p=j,()=>{i.removeEventListener(A0,x),p=null}},createHref(j){return n(i,j)},createURL:w,encodeLocation(j){let E=w(j);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:S,go(j){return d.go(j)}};return _}function QE(e,n,s=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Zt(r,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:Pi(n);return i=i.replace(/ $/,"%20"),!s&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function U_(e,n,s="/"){return ZE(e,n,s,!1)}function ZE(e,n,s,r,i){let c=typeof n=="string"?ol(n):n,d=ks(c.pathname||"/",s);if(d==null)return null;let f=JE(e),p=null,m=uk(d);for(let h=0;p==null&&h<f.length;++h)p=ik(f[h],m,r);return p}function JE(e){let n=H_(e);return WE(n),n}function H_(e,n=[],s=[],r="",i=!1){let c=(d,f,p=i,m)=>{let h={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&p)return;Zt(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let x=Pa([r,h.relativePath]),y=s.concat(h);d.children&&d.children.length>0&&(Zt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),H_(d.children,n,y,x,p)),!(d.path==null&&!d.index)&&n.push({path:x,score:ok(x,d.index),routesMeta:y})};return e.forEach((d,f)=>{if(d.path===""||!d.path?.includes("?"))c(d,f);else for(let p of q_(d.path))c(d,f,!0,p)}),n}function q_(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=q_(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 WE(e){e.sort((n,s)=>n.score!==s.score?s.score-n.score:lk(n.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}var ek=/^:[\w-]+$/,tk=3,nk=2,ak=1,sk=10,rk=-2,z0=e=>e==="*";function ok(e,n){let s=e.split("/"),r=s.length;return s.some(z0)&&(r+=rk),n&&(r+=nk),s.filter(i=>!z0(i)).reduce((i,c)=>i+(ek.test(c)?tk:c===""?ak:sk),r)}function lk(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 ik(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,h=c==="/"?n:n.slice(c.length)||"/",x=Wu({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),y=p.route;if(!x&&m&&s&&!r[r.length-1].route.index&&(x=Wu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(i,x.params),d.push({params:i,pathname:Pa([c,x.pathname]),pathnameBase:pk(Pa([c,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(c=Pa([c,x.pathnameBase]))}return d}function Wu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[s,r]=ck(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:h,isOptional:x},y)=>{if(h==="*"){let w=f[y]||"";d=c.slice(0,c.length-w.length).replace(/(.)\/+$/,"$1")}const S=f[y];return x&&!S?m[h]=void 0:m[h]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:d,pattern:e}}function ck(e,n=!1,s=!0){Ba(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,h)=>{if(r.push({paramName:f,isOptional:p!=null}),p){let x=h.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 uk(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Ba(!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 ks(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 dk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function fk(e,n="/"){let{pathname:s,search:r="",hash:i=""}=typeof e=="string"?ol(e):e,c;return s?(s=$_(s),s.startsWith("/")?c=D0(s.substring(1),"/"):c=D0(s,n)):c=n,{pathname:c,search:gk(r),hash:hk(i)}}function D0(e,n){let s=ed(n).split("/");return e.split("/").forEach(i=>{i===".."?s.length>1&&s.pop():i!=="."&&s.push(i)}),s.length>1?s.join("/"):"/"}function xp(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 mk(e){return e.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function V_(e){let n=mk(e);return n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase)}function oh(e,n,s,r=!1){let i;typeof e=="string"?i=ol(e):(i={...e},Zt(!i.pathname||!i.pathname.includes("?"),xp("?","pathname","search",i)),Zt(!i.pathname||!i.pathname.includes("#"),xp("#","pathname","hash",i)),Zt(!i.search||!i.search.includes("#"),xp("#","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=fk(i,f),m=d&&d!=="/"&&d.endsWith("/"),h=(c||d===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var $_=e=>e.replace(/\/\/+/g,"/"),Pa=e=>$_(e.join("/")),ed=e=>e.replace(/\/+$/,""),pk=e=>ed(e).replace(/^\/*/,"/"),gk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xk=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 bk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function vk(e){let n=e.map(s=>s.route.path).filter(Boolean);return Pa(n)||"/"}var G_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Y_(e,n){let s=e;if(typeof s!="string"||!dk.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let r=s,i=!1;if(G_)try{let c=new URL(window.location.href),d=s.startsWith("//")?new URL(c.protocol+s):new URL(s),f=ks(d.pathname,n);d.origin===c.origin&&f!=null?s=f+d.search+d.hash:i=!0}catch{Ba(!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 F_=["POST","PUT","PATCH","DELETE"];new Set(F_);var yk=["GET",...F_];new Set(yk);var ll=v.createContext(null);ll.displayName="DataRouter";var Ed=v.createContext(null);Ed.displayName="DataRouterState";var X_=v.createContext(!1);function _k(){return v.useContext(X_)}var K_=v.createContext({isTransitioning:!1});K_.displayName="ViewTransition";var jk=v.createContext(new Map);jk.displayName="Fetchers";var wk=v.createContext(null);wk.displayName="Await";var Ta=v.createContext(null);Ta.displayName="Navigation";var Zi=v.createContext(null);Zi.displayName="Location";var Qa=v.createContext({outlet:null,matches:[],isDataRoute:!1});Qa.displayName="Route";var lh=v.createContext(null);lh.displayName="RouteError";var Q_="REACT_ROUTER_ERROR",Sk="REDIRECT",Ck="ROUTE_ERROR_RESPONSE";function Ek(e){if(e.startsWith(`${Q_}:${Sk}:{`))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 kk(e){if(e.startsWith(`${Q_}:${Ck}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new xk(n.status,n.statusText,n.data)}catch{}}function Nk(e,{relative:n}={}){Zt(Ji(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:r}=v.useContext(Ta),{hash:i,pathname:c,search:d}=Wi(e,{relative:n}),f=c;return s!=="/"&&(f=c==="/"?s:Pa([s,c])),r.createHref({pathname:f,search:d,hash:i})}function Ji(){return v.useContext(Zi)!=null}function ea(){return Zt(Ji(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Zi).location}var Z_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function J_(e){v.useContext(Ta).static||v.useLayoutEffect(e)}function Ua(){let{isDataRoute:e}=v.useContext(Qa);return e?Hk():Rk()}function Rk(){Zt(Ji(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(ll),{basename:n,navigator:s}=v.useContext(Ta),{matches:r}=v.useContext(Qa),{pathname:i}=ea(),c=JSON.stringify(V_(r)),d=v.useRef(!1);return J_(()=>{d.current=!0}),v.useCallback((p,m={})=>{if(Ba(d.current,Z_),!d.current)return;if(typeof p=="number"){s.go(p);return}let h=oh(p,JSON.parse(c),i,m.relative==="path");e==null&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Pa([n,h.pathname])),(m.replace?s.replace:s.push)(h,m.state,m)},[n,s,c,i,e])}v.createContext(null);function W_(){let{matches:e}=v.useContext(Qa);return e[e.length-1]?.params??{}}function Wi(e,{relative:n}={}){let{matches:s}=v.useContext(Qa),{pathname:r}=ea(),i=JSON.stringify(V_(s));return v.useMemo(()=>oh(e,JSON.parse(i),r,n==="path"),[e,i,r,n])}function Tk(e,n){return ej(e,n)}function ej(e,n,s){Zt(Ji(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=v.useContext(Ta),{matches:i}=v.useContext(Qa),c=i[i.length-1],d=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let j=m&&m.path||"";nj(f,!m||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let h=ea(),x;if(n){let j=typeof n=="string"?ol(n):n;Zt(p==="/"||j.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 "${j.pathname}" was given in the \`location\` prop.`),x=j}else x=h;let y=x.pathname||"/",S=y;if(p!=="/"){let j=p.replace(/^\//,"").split("/");S="/"+y.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=s&&s.state.matches.length?s.state.matches.map(j=>Object.assign(j,{route:s.manifest[j.route.id]||j.route})):U_(e,{pathname:S});Ba(m||w!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Ba(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 _=Dk(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},d,j.params),pathname:Pa([p,r.encodeLocation?r.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:Pa([p,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,s);return n&&_?v.createElement(Zi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},_):_}function Ak(){let e=Uk(),n=bk(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=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:c},"ErrorBoundary")," or"," ",v.createElement("code",{style:c},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},n),s?v.createElement("pre",{style:i},s):null,d)}var Mk=v.createElement(Ak,null),tj=class extends v.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=kk(e.digest);s&&(e=s)}let n=e!==void 0?v.createElement(Qa.Provider,{value:this.props.routeContext},v.createElement(lh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Ok,{error:e},n):n}};tj.contextType=X_;var bp=new WeakMap;function Ok({children:e,error:n}){let{basename:s}=v.useContext(Ta);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let r=Ek(n.digest);if(r){let i=bp.get(n);if(i)throw i;let c=Y_(r.location,s);if(G_&&!bp.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 bp.set(n,d),d}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function zk({routeContext:e,match:n,children:s}){let r=v.useContext(ll);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Qa.Provider,{value:e},s)}function Dk(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 h=i.findIndex(x=>x.route.id&&c?.[x.route.id]!==void 0);Zt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let d=!1,f=-1;if(s&&r){d=r.renderFallback;for(let h=0;h<i.length;h++){let x=i[h];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(f=h),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?(h,x)=>{p(h,{location:r.location,params:r.matches?.[0]?.params??{},pattern:vk(r.matches),errorInfo:x})}:void 0;return i.reduceRight((h,x,y)=>{let S,w=!1,_=null,j=null;r&&(S=c&&x.route.id?c[x.route.id]:void 0,_=x.route.errorElement||Mk,d&&(f<0&&y===0?(nj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,j=null):f===y&&(w=!0,j=x.route.hydrateFallbackElement||null)));let E=n.concat(i.slice(0,y+1)),k=()=>{let R;return S?R=_:w?R=j:x.route.Component?R=v.createElement(x.route.Component,null):x.route.element?R=x.route.element:R=h,v.createElement(zk,{match:x,routeContext:{outlet:h,matches:E,isDataRoute:r!=null},children:R})};return r&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?v.createElement(tj,{location:r.location,revalidation:r.revalidation,component:_,error:S,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:m}):k()},null)}function ih(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lk(e){let n=v.useContext(ll);return Zt(n,ih(e)),n}function Pk(e){let n=v.useContext(Ed);return Zt(n,ih(e)),n}function Bk(e){let n=v.useContext(Qa);return Zt(n,ih(e)),n}function ch(e){let n=Bk(e),s=n.matches[n.matches.length-1];return Zt(s.route.id,`${e} can only be used on routes that contain a unique "id"`),s.route.id}function Ik(){return ch("useRouteId")}function Uk(){let e=v.useContext(lh),n=Pk("useRouteError"),s=ch("useRouteError");return e!==void 0?e:n.errors?.[s]}function Hk(){let{router:e}=Lk("useNavigate"),n=ch("useNavigate"),s=v.useRef(!1);return J_(()=>{s.current=!0}),v.useCallback(async(i,c={})=>{Ba(s.current,Z_),s.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:n,...c}))},[e,n])}var L0={};function nj(e,n,s){!n&&!L0[e]&&(L0[e]=!0,Ba(!1,s))}v.memo(qk);function qk({routes:e,manifest:n,future:s,state:r,isStatic:i,onError:c}){return ej(e,void 0,{manifest:n,state:r,isStatic:i,onError:c})}function qt(e){Zt(!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 Vk({basename:e="/",children:n=null,location:s,navigationType:r="POP",navigator:i,static:c=!1,useTransitions:d}){Zt(!Ji(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:f,navigator:i,static:c,useTransitions:d,future:{}}),[f,i,c,d]);typeof s=="string"&&(s=ol(s));let{pathname:m="/",search:h="",hash:x="",state:y=null,key:S="default",mask:w}=s,_=v.useMemo(()=>{let j=ks(m,f);return j==null?null:{location:{pathname:j,search:h,hash:x,state:y,key:S,mask:w},navigationType:r}},[f,m,h,x,y,S,r,w]);return Ba(_!=null,`<Router basename="${f}"> is not able to match the URL "${m}${h}${x}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:v.createElement(Ta.Provider,{value:p},v.createElement(Zi.Provider,{children:n,value:_}))}function aj({children:e,location:n}){return Tk(kg(e),n)}function kg(e,n=[]){let s=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let c=[...n,i];if(r.type===v.Fragment){s.push.apply(s,kg(r.props.children,c));return}Zt(r.type===qt,`[${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>`),Zt(!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=kg(r.props.children,c)),s.push(d)}),s}var Vu="get",$u="application/x-www-form-urlencoded";function kd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $k(e){return kd(e)&&e.tagName.toLowerCase()==="button"}function Gk(e){return kd(e)&&e.tagName.toLowerCase()==="form"}function Yk(e){return kd(e)&&e.tagName.toLowerCase()==="input"}function Fk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xk(e,n){return e.button===0&&(!n||n==="_self")&&!Fk(e)}function Ng(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 Kk(e,n){let s=Ng(e);return n&&n.forEach((r,i)=>{s.has(i)||n.getAll(i).forEach(c=>{s.append(i,c)})}),s}var _u=null;function Qk(){if(_u===null)try{new FormData(document.createElement("form"),0),_u=!1}catch{_u=!0}return _u}var Zk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vp(e){return e!=null&&!Zk.has(e)?(Ba(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$u}"`),null):e}function Jk(e,n){let s,r,i,c,d;if(Gk(e)){let f=e.getAttribute("action");r=f?ks(f,n):null,s=e.getAttribute("method")||Vu,i=vp(e.getAttribute("enctype"))||$u,c=new FormData(e)}else if($k(e)||Yk(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?ks(p,n):null,s=e.getAttribute("formmethod")||f.getAttribute("method")||Vu,i=vp(e.getAttribute("formenctype"))||vp(f.getAttribute("enctype"))||$u,c=new FormData(f,e),!Qk()){let{name:m,type:h,value:x}=e;if(h==="image"){let y=m?`${m}.`:"";c.append(`${y}x`,"0"),c.append(`${y}y`,"0")}else m&&c.append(m,x)}}else{if(kd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Vu,r=null,i=$u,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 uh(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function sj(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&&ks(i.pathname,n)==="/"?i.pathname=`${ed(n)}/_root.${r}`:i.pathname=`${ed(i.pathname)}.${r}`,i}async function Wk(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 eN(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 tN(e,n,s){let r=await Promise.all(e.map(async i=>{let c=n.routes[i.route.id];if(c){let d=await Wk(c,s);return d.links?d.links():[]}return[]}));return rN(r.flat(1).filter(eN).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function P0(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 h=r.routes[p.route.id];if(!h||!h.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 nN(e,n,{includeHydrateFallback:s}={}){return aN(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 aN(e){return[...new Set(e)]}function sN(e){let n={},s=Object.keys(e).sort();for(let r of s)n[r]=e[r];return n}function rN(e,n){let s=new Set;return new Set(n),e.reduce((r,i)=>{let c=JSON.stringify(sN(i));return s.has(c)||(s.add(c),r.push({key:c,link:i})),r},[])}function dh(){let e=v.useContext(ll);return uh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oN(){let e=v.useContext(Ed);return uh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var fh=v.createContext(void 0);fh.displayName="FrameworkContext";function mh(){let e=v.useContext(fh);return uh(e,"You must render this element inside a <HydratedRouter> element"),e}function lN(e,n){let s=v.useContext(fh),[r,i]=v.useState(!1),[c,d]=v.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:x}=n,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let _=E=>{E.forEach(k=>{d(k.isIntersecting)})},j=new IntersectionObserver(_,{threshold:.5});return y.current&&j.observe(y.current),()=>{j.disconnect()}}},[e]),v.useEffect(()=>{if(r){let _=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(_)}}},[r]);let S=()=>{i(!0)},w=()=>{i(!1),d(!1)};return s?e!=="intent"?[c,y,{}]:[c,y,{onFocus:li(f,S),onBlur:li(p,w),onMouseEnter:li(m,S),onMouseLeave:li(h,w),onTouchStart:li(x,S)}]:[!1,y,{}]}function li(e,n){return s=>{e&&e(s),s.defaultPrevented||n(s)}}function iN({page:e,...n}){let s=_k(),{router:r}=dh(),i=v.useMemo(()=>U_(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?s?v.createElement(uN,{page:e,matches:i,...n}):v.createElement(dN,{page:e,matches:i,...n}):null}function cN(e){let{manifest:n,routeModules:s}=mh(),[r,i]=v.useState([]);return v.useEffect(()=>{let c=!1;return tN(e,n,s).then(d=>{c||i(d)}),()=>{c=!0}},[e,n,s]),r}function uN({page:e,matches:n,...s}){let r=ea(),{future:i}=mh(),{basename:c}=dh(),d=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let f=sj(e,c,i.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let h of n)typeof h.route.shouldRevalidate=="function"?p=!0:m.push(h.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 v.createElement(v.Fragment,null,d.map(f=>v.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...s})))}function dN({page:e,matches:n,...s}){let r=ea(),{future:i,manifest:c,routeModules:d}=mh(),{basename:f}=dh(),{loaderData:p,matches:m}=oN(),h=v.useMemo(()=>P0(e,n,m,c,r,"data"),[e,n,m,c,r]),x=v.useMemo(()=>P0(e,n,m,c,r,"assets"),[e,n,m,c,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let _=new Set,j=!1;if(n.forEach(k=>{let R=c.routes[k.route.id];!R||!R.hasLoader||(!h.some(N=>N.route.id===k.route.id)&&k.route.id in p&&d[k.route.id]?.shouldRevalidate||R.hasClientLoader?j=!0:_.add(k.route.id))}),_.size===0)return[];let E=sj(e,f,i.v8_trailingSlashAwareDataRequests,"data");return j&&_.size>0&&E.searchParams.set("_routes",n.filter(k=>_.has(k.route.id)).map(k=>k.route.id).join(",")),[E.pathname+E.search]},[f,i.v8_trailingSlashAwareDataRequests,p,r,c,h,n,e,d]),S=v.useMemo(()=>nN(x,c),[x,c]),w=cN(x);return v.createElement(v.Fragment,null,y.map(_=>v.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...s})),S.map(_=>v.createElement("link",{key:_,rel:"modulepreload",href:_,...s})),w.map(({key:_,link:j})=>v.createElement("link",{key:_,nonce:s.nonce,...j,crossOrigin:j.crossOrigin??s.crossOrigin})))}function fN(...e){return n=>{e.forEach(s=>{typeof s=="function"?s(n):s!=null&&(s.current=n)})}}var mN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{mN&&(window.__reactRouterVersion="7.17.0")}catch{}function pN({basename:e,children:n,useTransitions:s,window:r}){let i=v.useRef();i.current==null&&(i.current=FE({window:r,v5Compat:!0}));let c=i.current,[d,f]=v.useState({action:c.action,location:c.location}),p=v.useCallback(m=>{s===!1?f(m):v.startTransition(()=>f(m))},[s]);return v.useLayoutEffect(()=>c.listen(p),[c,p]),v.createElement(Vk,{basename:e,children:n,location:d.location,navigationType:d.action,navigator:c,useTransitions:s})}var rj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ph=v.forwardRef(function({onClick:n,discover:s="render",prefetch:r="none",relative:i,reloadDocument:c,replace:d,mask:f,state:p,target:m,to:h,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S,...w},_){let{basename:j,navigator:E,useTransitions:k}=v.useContext(Ta),R=typeof h=="string"&&rj.test(h),N=Y_(h,j);h=N.to;let O=Nk(h,{relative:i}),A=ea(),M=null;if(f){let Q=oh(f,[],A.mask?A.mask.pathname:"/",!0);j!=="/"&&(Q.pathname=Q.pathname==="/"?j:Pa([j,Q.pathname])),M=E.createHref(Q)}let[B,U,I]=lN(r,w),L=xN(h,{replace:d,mask:f,state:p,target:m,preventScrollReset:x,relative:i,viewTransition:y,defaultShouldRevalidate:S,useTransitions:k});function P(Q){n&&n(Q),Q.defaultPrevented||L(Q)}let H=!(N.isExternal||c),Y=v.createElement("a",{...w,...I,href:(H?M:void 0)||N.absoluteURL||O,onClick:H?P:n,ref:fN(_,U),target:m,"data-discover":!R&&s==="render"?"true":void 0});return B&&!R?v.createElement(v.Fragment,null,Y,v.createElement(iN,{page:O})):Y});ph.displayName="Link";var oj=v.forwardRef(function({"aria-current":n="page",caseSensitive:s=!1,className:r="",end:i=!1,style:c,to:d,viewTransition:f,children:p,...m},h){let x=Wi(d,{relative:m.relative}),y=ea(),S=v.useContext(Ed),{navigator:w,basename:_}=v.useContext(Ta),j=S!=null&&jN(x)&&f===!0,E=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,E=E.toLowerCase()),R&&_&&(R=ks(R,_)||R);const N=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let O=k===E||!i&&k.startsWith(E)&&k.charAt(N)==="/",A=R!=null&&(R===E||!i&&R.startsWith(E)&&R.charAt(E.length)==="/"),M={isActive:O,isPending:A,isTransitioning:j},B=O?n:void 0,U;typeof r=="function"?U=r(M):U=[r,O?"active":null,A?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let I=typeof c=="function"?c(M):c;return v.createElement(ph,{...m,"aria-current":B,className:U,ref:h,style:I,to:d,viewTransition:f},typeof p=="function"?p(M):p)});oj.displayName="NavLink";var gN=v.forwardRef(({discover:e="render",fetcherKey:n,navigate:s,reloadDocument:r,replace:i,state:c,method:d=Vu,action:f,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,defaultShouldRevalidate:y,...S},w)=>{let{useTransitions:_}=v.useContext(Ta),j=yN(),E=_N(f,{relative:m}),k=d.toLowerCase()==="get"?"get":"post",R=typeof f=="string"&&rj.test(f),N=O=>{if(p&&p(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,M=A?.getAttribute("formmethod")||d,B=()=>j(A||O.currentTarget,{fetcherKey:n,method:M,navigate:s,replace:i,state:c,relative:m,preventScrollReset:h,viewTransition:x,defaultShouldRevalidate:y});_&&s!==!1?v.startTransition(()=>B()):B()};return v.createElement("form",{ref:w,method:k,action:E,onSubmit:r?p:N,...S,"data-discover":!R&&e==="render"?"true":void 0})});gN.displayName="Form";function hN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lj(e){let n=v.useContext(ll);return Zt(n,hN(e)),n}function xN(e,{target:n,replace:s,mask:r,state:i,preventScrollReset:c,relative:d,viewTransition:f,defaultShouldRevalidate:p,useTransitions:m}={}){let h=Ua(),x=ea(),y=Wi(e,{relative:d});return v.useCallback(S=>{if(Xk(S,n)){S.preventDefault();let w=s!==void 0?s:Pi(x)===Pi(y),_=()=>h(e,{replace:w,mask:r,state:i,preventScrollReset:c,relative:d,viewTransition:f,defaultShouldRevalidate:p});m?v.startTransition(()=>_()):_()}},[x,h,y,s,r,i,n,e,c,d,f,p,m])}function ij(e){Ba(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=v.useRef(Ng(e)),s=v.useRef(!1),r=ea(),i=v.useMemo(()=>Kk(r.search,s.current?null:n.current),[r.search]),c=Ua(),d=v.useCallback((f,p)=>{const m=Ng(typeof f=="function"?f(new URLSearchParams(i)):f);s.current=!0,c("?"+m,p)},[c,i]);return[i,d]}var bN=0,vN=()=>`__${String(++bN)}__`;function yN(){let{router:e}=lj("useSubmit"),{basename:n}=v.useContext(Ta),s=Ik(),r=e.fetch,i=e.navigate;return v.useCallback(async(c,d={})=>{let{action:f,method:p,encType:m,formData:h,body:x}=Jk(c,n);if(d.navigate===!1){let y=d.fetcherKey||vN();await r(y,s,d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:h,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:h,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 _N(e,{relative:n}={}){let{basename:s}=v.useContext(Ta),r=v.useContext(Qa);Zt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),c={...Wi(e||".",{relative:n})},d=ea();if(e==null){c.search=d.search;let f=new URLSearchParams(c.search),p=f.getAll("index");if(p.some(h=>h==="")){f.delete("index"),p.filter(x=>x).forEach(x=>f.append("index",x));let h=f.toString();c.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(c.pathname=c.pathname==="/"?s:Pa([s,c.pathname])),Pi(c)}function jN(e,{relative:n}={}){let s=v.useContext(K_);Zt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=lj("useViewTransitionState"),i=Wi(e,{relative:n});if(!s.isTransitioning)return!1;let c=ks(s.currentLocation.pathname,r)||s.currentLocation.pathname,d=ks(s.nextLocation.pathname,r)||s.nextLocation.pathname;return Wu(i.pathname,d)!=null||Wu(i.pathname,c)!=null}var Zr=I_();/**
|
|
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 wN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cj=(...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 SN={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 CN=v.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:i="",children:c,iconNode:d,...f},p)=>v.createElement("svg",{ref:p,...SN,width:n,height:n,stroke:e,strokeWidth:r?Number(s)*24/Number(n):s,className:cj("lucide",i),...f},[...d.map(([m,h])=>v.createElement(m,h)),...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 we=(e,n)=>{const s=v.forwardRef(({className:r,...i},c)=>v.createElement(CN,{ref:c,iconNode:n,className:cj(`lucide-${wN(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 uj=we("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 dj=we("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 EN=we("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 fj=we("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 mj=we("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 kN=we("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=we("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 NN=we("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 RN=we("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 td=we("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 Bi=we("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 Jr=we("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 Nd=we("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 pj=we("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 gj=we("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 TN=we("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 AN=we("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"}]]);/**
|
|
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 MN=we("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 ON=we("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
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=we("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 zN=we("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 DN=we("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 gh=we("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 Ns=we("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 hj=we("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 xj=we("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"}]]);/**
|
|
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 LN=we("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"}]]);/**
|
|
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 ad=we("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"}]]);/**
|
|
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 PN=we("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"}]]);/**
|
|
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 BN=we("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"}]]);/**
|
|
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 IN=we("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"}]]);/**
|
|
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 UN=we("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"}]]);/**
|
|
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 HN=we("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"}]]);/**
|
|
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 qN=we("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"}]]);/**
|
|
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 bj=we("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"}]]);/**
|
|
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 VN=we("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"}]]);/**
|
|
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 $N=we("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"}]]);/**
|
|
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 Rd=we("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 GN=we("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"}]]);/**
|
|
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 hh=we("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"}]]);/**
|
|
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 YN=we("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"}]]);/**
|
|
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 FN=we("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"}]]);/**
|
|
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 Xo=we("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"}]]);/**
|
|
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 XN=we("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"}]]);/**
|
|
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 KN=we("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"}]]);/**
|
|
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 QN=we("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 ZN=we("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"}]]);/**
|
|
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 JN=we("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"}]]);/**
|
|
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 WN=we("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"}]]);/**
|
|
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 eR=we("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"}]]);/**
|
|
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 tR=we("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"}]]);/**
|
|
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 Td=we("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 nR=we("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"}]]);/**
|
|
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 aR=we("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"}]]);/**
|
|
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 Ri=we("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"}]]);/**
|
|
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 sR=we("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"}]]);/**
|
|
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 rR=we("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"}]]);/**
|
|
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 oR=we("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 lR=we("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"}]]);/**
|
|
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 iR=we("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"}]]);/**
|
|
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 cR=we("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 xh=we("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"}]]);/**
|
|
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 bh=we("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 uR=we("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"}]]);/**
|
|
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 Nn=we("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Rg=we("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"}]]);/**
|
|
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 dR=we("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"}]]);/**
|
|
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 Wr=we("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"}]]);/**
|
|
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 vj=we("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"}]]);/**
|
|
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 vh=we("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"}]]);/**
|
|
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 Tg=we("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"}]]);/**
|
|
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 Gu=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 Za=we("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"}]]);/**
|
|
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 yj=we("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"}]]);/**
|
|
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 fR=we("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"}]]);/**
|
|
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 sd=we("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"}]]);/**
|
|
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 mR=we("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
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 il=we("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"}]]);/**
|
|
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 _j=we("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 pR=we("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"}]]);/**
|
|
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 Ii=we("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 Ja=we("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"}]]);/**
|
|
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 jj=we("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"}]]);/**
|
|
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 gR=we("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"}]]);/**
|
|
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 wj=we("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"}]]);/**
|
|
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 hR=we("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"}]]);/**
|
|
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 cl=we("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"}]]);/**
|
|
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 ec=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 Ui=we("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"}]]),Ad={health:5e3,projects:15e3,telegramStatus:8e3,pairList:12e3},Cn={theme:"apx.theme",token:"apx.token",sidebarCollapsed:"apx.sidebar.collapsed",language:"apx.lang",robyChat:"apx.roby.chat"},yh=["total","automatico","permiso"],B0=["sky","violet","emerald","amber","rose","indigo","teal","fuchsia"],xR={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 bR(){if(typeof window>"u")return"dark";const e=localStorage.getItem(Cn.theme);return e==="light"||e==="dark"?e:document.documentElement.classList.contains("dark")?"dark":"light"}const Sj=v.createContext(null);function vR({children:e}){const[n,s]=v.useState(bR);v.useEffect(()=>{document.documentElement.classList.toggle("dark",n==="dark");try{localStorage.setItem(Cn.theme,n)}catch{}},[n]);const r=v.useCallback(()=>{s(c=>c==="dark"?"light":"dark")},[]),i=v.useMemo(()=>({theme:n,toggle:r,set:s}),[n,r]);return o.jsx(Sj.Provider,{value:i,children:e})}function _h(){const e=v.useContext(Sj);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const yR=1367/458,_R=735/1016;function jR({size:e=32,title:n="APX",variant:s="icon"}){const{theme:r}=_h(),i=xR[s][r];if(s==="full"){const c=e,d=Math.round(e*yR);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/_R);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 Cj(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=Cj(e[n]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function jh(){for(var e,n,s=0,r="",i=arguments.length;s<i;s++)(e=arguments[s])&&(n=Cj(e))&&(r&&(r+=" "),r+=n);return r}const wh="-",wR=e=>{const n=CR(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{const f=d.split(wh);return f[0]===""&&f.length!==1&&f.shift(),Ej(f,n)||SR(d)},getConflictingClassGroupIds:(d,f)=>{const p=s[d]||[];return f&&r[d]?[...p,...r[d]]:p}}},Ej=(e,n)=>{if(e.length===0)return n.classGroupId;const s=e[0],r=n.nextPart.get(s),i=r?Ej(e.slice(1),r):void 0;if(i)return i;if(n.validators.length===0)return;const c=e.join(wh);return n.validators.find(({validator:d})=>d(c))?.classGroupId},I0=/^\[(.+)\]$/,SR=e=>{if(I0.test(e)){const n=I0.exec(e)[1],s=n?.substring(0,n.indexOf(":"));if(s)return"arbitrary.."+s}},CR=e=>{const{theme:n,prefix:s}=e,r={nextPart:new Map,validators:[]};return kR(Object.entries(e.classGroups),s).forEach(([c,d])=>{Ag(d,r,c,n)}),r},Ag=(e,n,s,r)=>{e.forEach(i=>{if(typeof i=="string"){const c=i===""?n:U0(n,i);c.classGroupId=s;return}if(typeof i=="function"){if(ER(i)){Ag(i(r),n,s,r);return}n.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([c,d])=>{Ag(d,U0(n,c),s,r)})})},U0=(e,n)=>{let s=e;return n.split(wh).forEach(r=>{s.nextPart.has(r)||s.nextPart.set(r,{nextPart:new Map,validators:[]}),s=s.nextPart.get(r)}),s},ER=e=>e.isThemeGetter,kR=(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,NR=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)}}},kj="!",RR=e=>{const{separator:n,experimentalParseClassName:s}=e,r=n.length===1,i=n[0],c=n.length,d=f=>{const p=[];let m=0,h=0,x;for(let j=0;j<f.length;j++){let E=f[j];if(m===0){if(E===i&&(r||f.slice(j,j+c)===n)){p.push(f.slice(h,j)),h=j+c;continue}if(E==="/"){x=j;continue}}E==="["?m++:E==="]"&&m--}const y=p.length===0?f:f.substring(h),S=y.startsWith(kj),w=S?y.substring(1):y,_=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:_}};return s?f=>s({className:f,parseClassName:d}):d},TR=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},AR=e=>({cache:NR(e.cacheSize),parseClassName:RR(e),...wR(e)}),MR=/\s+/,OR=(e,n)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:i}=n,c=[],d=e.trim().split(MR);let f="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:S}=s(m);let w=!!S,_=r(w?y.substring(0,S):y);if(!_){if(!w){f=m+(f.length>0?" "+f:f);continue}if(_=r(y),!_){f=m+(f.length>0?" "+f:f);continue}w=!1}const j=TR(h).join(":"),E=x?j+kj:j,k=E+_;if(c.includes(k))continue;c.push(k);const R=i(_,w);for(let N=0;N<R.length;++N){const O=R[N];c.push(E+O)}f=m+(f.length>0?" "+f:f)}return f};function zR(){let e=0,n,s,r="";for(;e<arguments.length;)(n=arguments[e++])&&(s=Nj(n))&&(r&&(r+=" "),r+=s);return r}const Nj=e=>{if(typeof e=="string")return e;let n,s="";for(let r=0;r<e.length;r++)e[r]&&(n=Nj(e[r]))&&(s&&(s+=" "),s+=n);return s};function DR(e,...n){let s,r,i,c=d;function d(p){const m=n.reduce((h,x)=>x(h),e());return s=AR(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 h=OR(p,s);return i(p,h),h}return function(){return c(zR.apply(null,arguments))}}const Yt=e=>{const n=s=>s[e]||[];return n.isThemeGetter=!0,n},Rj=/^\[(?:([a-z-]+):)?(.+)\]$/i,LR=/^\d+\/\d+$/,PR=new Set(["px","full","screen"]),BR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IR=/\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$/,UR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_s=e=>Go(e)||PR.has(e)||LR.test(e),nr=e=>ul(e,"length",QR),Go=e=>!!e&&!Number.isNaN(Number(e)),yp=e=>ul(e,"number",Go),ii=e=>!!e&&Number.isInteger(Number(e)),VR=e=>e.endsWith("%")&&Go(e.slice(0,-1)),rt=e=>Rj.test(e),ar=e=>BR.test(e),$R=new Set(["length","size","percentage"]),GR=e=>ul(e,$R,Tj),YR=e=>ul(e,"position",Tj),FR=new Set(["image","url"]),XR=e=>ul(e,FR,JR),KR=e=>ul(e,"",ZR),ci=()=>!0,ul=(e,n,s)=>{const r=Rj.exec(e);return r?r[1]?typeof n=="string"?r[1]===n:n.has(r[1]):s(r[2]):!1},QR=e=>IR.test(e)&&!UR.test(e),Tj=()=>!1,ZR=e=>HR.test(e),JR=e=>qR.test(e),WR=()=>{const e=Yt("colors"),n=Yt("spacing"),s=Yt("blur"),r=Yt("brightness"),i=Yt("borderColor"),c=Yt("borderRadius"),d=Yt("borderSpacing"),f=Yt("borderWidth"),p=Yt("contrast"),m=Yt("grayscale"),h=Yt("hueRotate"),x=Yt("invert"),y=Yt("gap"),S=Yt("gradientColorStops"),w=Yt("gradientColorStopPositions"),_=Yt("inset"),j=Yt("margin"),E=Yt("opacity"),k=Yt("padding"),R=Yt("saturate"),N=Yt("scale"),O=Yt("sepia"),A=Yt("skew"),M=Yt("space"),B=Yt("translate"),U=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",rt,n],P=()=>[rt,n],H=()=>["",_s,nr],Y=()=>["auto",Go,rt],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],X=()=>["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",rt],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[Go,rt];return{cacheSize:500,separator:":",theme:{colors:[ci],spacing:[_s,nr],blur:["none","",ar,rt],brightness:D(),borderColor:[e],borderRadius:["none","","full",ar,rt],borderSpacing:P(),borderWidth:H(),contrast:D(),grayscale:$(),hueRotate:D(),invert:$(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[VR,nr],inset:L(),margin:L(),opacity:D(),padding:P(),saturate:D(),scale:D(),sepia:$(),skew:D(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",rt]}],container:["container"],columns:[{columns:[ar]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...Q(),rt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ii,rt]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",rt]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",ii,rt]}],"grid-cols":[{"grid-cols":[ci]}],"col-start-end":[{col:["auto",{span:["full",ii,rt]},rt]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[ci]}],"row-start-end":[{row:["auto",{span:[ii,rt]},rt]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",rt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",rt]}],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:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",rt,n]}],"min-w":[{"min-w":[rt,n,"min","max","fit"]}],"max-w":[{"max-w":[rt,n,"none","full","min","max","fit","prose",{screen:[ar]},ar]}],h:[{h:[rt,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[rt,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[rt,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[rt,n,"auto","min","max","fit"]}],"font-size":[{text:["base",ar,nr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",yp]}],"font-family":[{font:[ci]}],"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",rt]}],"line-clamp":[{"line-clamp":["none",Go,yp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_s,rt]}],"list-image":[{"list-image":["none",rt]}],"list-style-type":[{list:["none","disc","decimal",rt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_s,nr]}],"underline-offset":[{"underline-offset":["auto",_s,rt]}],"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:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt]}],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",rt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),YR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",GR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},XR]}],"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":[E]}],"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":[E]}],"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":[_s,rt]}],"outline-w":[{outline:[_s,nr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[_s,nr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ar,KR]}],"shadow-color":[{shadow:[ci]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[r]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",ar,rt]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[R]}],sepia:[{sepia:[O]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",rt]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",rt]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",rt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[ii,rt]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",rt]}],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",rt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",rt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_s,nr,yp]}],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"]}}},Aj=DR(WR);function Ae(...e){return Aj(jh(e))}const H0={};function fa(e,n){const s=v.useRef(H0);return s.current===H0&&(s.current=e(n)),s}const Mg=[];let Og;function eT(){return Og}function tT(e){Mg.push(e)}function Mj(e){const n=(s,r)=>{const i=fa(aT).current;let c;try{Og=i;for(const d of Mg)d.before(i);c=e(s,r);for(const d of Mg)d.after(i);i.didInitialize=!0}finally{Og=void 0}return c};return n.displayName=e.displayName||e.name,n}function nT(e){return v.forwardRef(Mj(e))}function aT(){return{didInitialize:!1}}function Sh(e){const n=v.useRef(!0);n.current&&(n.current=!1,e())}const sT=()=>{},Ne=typeof document<"u"?v.useLayoutEffect:sT;function rT(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 Rn=rT("https://base-ui.com/production-error","Base UI"),Oj=v.createContext(void 0);function tc(e){const n=v.useContext(Oj);if(n===void 0&&!e)throw new Error(Rn(72));return n}const oT=[];function Ch(e){v.useEffect(e,oT)}const ui=0;class Ia{static create(){return new Ia}currentId=ui;start(n,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ui,s()},n)}isStarted(){return this.currentId!==ui}clear=()=>{this.currentId!==ui&&(clearTimeout(this.currentId),this.currentId=ui)};disposeEffect=()=>this.clear}function Zn(){const e=fa(Ia.create).current;return Ch(e.disposeEffect),e}const dl=typeof navigator<"u",_p=iT(),zj=uT(),Dj=cT(),Eh=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Lj=_p.platform==="MacIntel"&&_p.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(_p.platform),Pj=dl&&/apple/i.test(navigator.vendor),zg=dl&&/android/i.test(zj)||/android/i.test(Dj),lT=dl&&zj.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Bj=Dj.includes("jsdom/");function iT(){if(!dl)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 cT(){if(!dl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:n,version:s})=>`${n}/${s}`).join(" "):navigator.userAgent}function uT(){if(!dl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}function ua(e){e.preventDefault(),e.stopPropagation()}function dT(e){return"nativeEvent"in e}function kh(e){return e.pointerType===""&&e.isTrusted?!0:zg&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ij(e){return Bj?!1:!zg&&e.width===0&&e.height===0||zg&&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 Fr(e,n){const s=["mouse","pen"];return n||s.push("",void 0),s.includes(e)}function fT(e){const n=e.type;return n==="click"||n==="mousedown"||n==="keydown"||n==="keyup"}function Md(){return typeof window<"u"}function Pn(e){return Nh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Wa(e){var n;return(n=(Nh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Nh(e){return Md()?e instanceof Node||e instanceof Ft(e).Node:!1}function lt(e){return Md()?e instanceof Element||e instanceof Ft(e).Element:!1}function Ut(e){return Md()?e instanceof HTMLElement||e instanceof Ft(e).HTMLElement:!1}function Ko(e){return!Md()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot}function hr(e){const{overflow:n,overflowX:s,overflowY:r,display:i}=Wn(e);return/auto|scroll|overlay|hidden|clip/.test(n+r+s)&&i!=="inline"&&i!=="contents"}function mT(e){return/^(table|td|th)$/.test(Pn(e))}function Od(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const pT=/transform|translate|scale|rotate|perspective|filter/,gT=/paint|layout|strict|content/,Ir=e=>!!e&&e!=="none";let jp;function Rh(e){const n=lt(e)?Wn(e):e;return Ir(n.transform)||Ir(n.translate)||Ir(n.scale)||Ir(n.rotate)||Ir(n.perspective)||!zd()&&(Ir(n.backdropFilter)||Ir(n.filter))||pT.test(n.willChange||"")||gT.test(n.contain||"")}function hT(e){let n=Rs(e);for(;Ut(n)&&!Cs(n);){if(Rh(n))return n;if(Od(n))return null;n=Rs(n)}return null}function zd(){return jp==null&&(jp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),jp}function Cs(e){return/^(html|body|#document)$/.test(Pn(e))}function Wn(e){return Ft(e).getComputedStyle(e)}function Dd(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rs(e){if(Pn(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Ko(e)&&e.host||Wa(e);return Ko(n)?n.host:n}function Uj(e){const n=Rs(e);return Cs(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ut(n)&&hr(n)?n:Uj(n)}function Hi(e,n,s){var r;n===void 0&&(n=[]),s===void 0&&(s=!0);const i=Uj(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),d=Ft(i);if(c){const f=Dg(d);return n.concat(d,d.visualViewport||[],hr(i)?i:[],f&&s?Hi(f):[])}else return n.concat(i,Hi(i,[],s))}function Dg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Lg="data-base-ui-focusable",Hj="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ur="ArrowLeft",dr="ArrowRight",Th="ArrowUp",nc="ArrowDown";function zn(e){let n=e.activeElement;for(;n?.shadowRoot?.activeElement!=null;)n=n.shadowRoot.activeElement;return n}function Ye(e,n){if(!e||!n)return!1;const s=n.getRootNode?.();if(e.contains(n))return!0;if(s&&Ko(s)){let r=n;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function En(e){return"composedPath"in e?e.composedPath()[0]:e.target}function rd(e,n){if(!lt(e))return!1;const s=e;if(n.hasElement(s))return!s.hasAttribute("data-trigger-disabled");for(const[,r]of n.entries())if(Ye(r,s))return!r.hasAttribute("data-trigger-disabled");return!1}function wp(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 xT(e){return e.matches("html,body")}function Ld(e){return Ut(e)&&e.matches(Hj)}function bT(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Hj}`)!=null}function Pg(e){return e?e.getAttribute("role")==="combobox"&&Ld(e):!1}function vT(e){if(!e||Bj)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function od(e){return e?e.hasAttribute(Lg)?e:e.querySelector(`[${Lg}]`)||e:null}function yT(e,n){return n!=null&&!Fr(n)?0:typeof e=="function"?e():e}function ld(e,n,s){const r=yT(e,s);return typeof r=="number"?r:r?.[n]}function q0(e){return typeof e=="function"?e():e}function qj(e,n){return n||e==="click"||e==="mousedown"}function _T(e){return e?.includes("mouse")&&e!=="mousedown"}function Dn(){}const qi=Object.freeze([]),an=Object.freeze({}),Ts="none",Vi="trigger-press",In="trigger-hover",Yu="trigger-focus",Ah="outside-press",Sp="item-press",jT="close-press",Pd="focus-out",Mh="escape-key",V0="list-navigation",wT="cancel-open",Vj="disabled",$0="missing",G0="initial",$j="imperative-action",ST="window-resize";function tt(e,n,s,r){let i=!1,c=!1;const d=r??an;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 Gj=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ia,currentIdRef:{current:null},currentContextRef:{current:null}});function CT(e){const{children:n,delay:s,timeoutMs:r=0}=e,i=v.useRef(s),c=v.useRef(s),d=v.useRef(null),f=v.useRef(null),p=Zn();return o.jsx(Gj.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:c,currentIdRef:d,timeoutMs:r,currentContextRef:f,timeout:p}),[r,p]),children:n})}function ET(e,n={open:!1}){const{open:s}=n,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),c=v.useContext(Gj),{currentIdRef:d,delayRef:f,timeoutMs:p,initialDelayRef:m,currentContextRef:h,hasProvider:x,timeout:y}=c,[S,w]=v.useState(!1);return Ne(()=>{function _(){w(!1),h.current?.setIsInstantPhase(!1),d.current=null,h.current=null,f.current=m.current}if(d.current&&!s&&d.current===i){if(w(!1),p){const j=i;return y.start(p,()=>{r.select("open")||d.current&&d.current!==j||_()}),()=>{y.clear()}}_()}},[s,i,d,f,p,m,h,y,r]),Ne(()=>{if(!s)return;const _=h.current,j=d.current;y.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:w},d.current=i,f.current={open:0,close:ld(m.current,"close")},j!==null&&j!==i?(w(!0),_?.setIsInstantPhase(!0),_?.onOpenChange(!1,tt(Ts))):(w(!1),_?.setIsInstantPhase(!1))},[s,i,r,d,f,m,h,y]),Ne(()=>()=>{h.current=null},[h]),v.useMemo(()=>({hasProvider:x,delayRef:f,isInstantPhase:S}),[x,f,S])}function ct(e,n,s,r){return e.addEventListener(n,s,r),()=>{e.removeEventListener(n,s,r)}}function Xa(...e){return()=>{for(let n=0;n<e.length;n+=1){const s=e[n];s&&s()}}}function As(e,n,s,r){const i=fa(Yj).current;return NT(i,e,n,s,r)&&Fj(i,[e,n,s,r]),i.callback}function kT(e){const n=fa(Yj).current;return RT(n,e)&&Fj(n,e),n.callback}function Yj(){return{callback:null,cleanup:null,refs:[]}}function NT(e,n,s,r,i){return e.refs[0]!==n||e.refs[1]!==s||e.refs[2]!==r||e.refs[3]!==i}function RT(e,n){return e.refs.length!==n.length||e.refs.some((s,r)=>s!==n[r])}function Fj(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 cn(e){const n=fa(TT,e).current;return n.next=e,Ne(n.effect),n}function TT(e){const n={current:e,next:e,effect:()=>{n.current=n.next}};return n}const Oh={...IE},Cp=Oh.useInsertionEffect,AT=Cp&&Cp!==Oh.useLayoutEffect?Cp:e=>e();function Me(e){const n=fa(MT).current;return n.next=e,AT(n.effect),n.trampoline}function MT(){const e={next:void 0,callback:OT,trampoline:(...n)=>e.callback?.(...n),effect:()=>{e.callback=e.next}};return e}function OT(){}const ju=null;class zT{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 wu=new zT;class Ya{static create(){return new Ya}static request(n){return wu.request(n)}static cancel(n){return wu.cancel(n)}currentId=ju;request(n){this.cancel(),this.currentId=wu.request(()=>{this.currentId=ju,n()})}cancel=()=>{this.currentId!==ju&&(wu.cancel(this.currentId),this.currentId=ju)};disposeEffect=()=>this.cancel}function Qo(){const e=fa(Ya.create).current;return Ch(e.disposeEffect),e}function xt(e){return e?.ownerDocument||document}const Xj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},zh={...Xj,position:"fixed",top:0,left:0},Kj={...Xj,position:"absolute"},id=v.forwardRef(function(n,s){const[r,i]=v.useState();Ne(()=>{Pj&&i("button")},[]);const c={tabIndex:0,role:r};return o.jsx("span",{...n,ref:s,style:zh,"aria-hidden":r?void 0:!0,...c,"data-base-ui-focus-guard":""})}),DT=["top","right","bottom","left"],Zo=Math.min,da=Math.max,cd=Math.round,qr=Math.floor,Ka=e=>({x:e,y:e}),LT={left:"right",right:"left",bottom:"top",top:"bottom"};function Bg(e,n,s){return da(e,Zo(n,s))}function Ms(e,n){return typeof e=="function"?e(n):e}function Jn(e){return e.split("-")[0]}function xr(e){return e.split("-")[1]}function Dh(e){return e==="x"?"y":"x"}function Lh(e){return e==="y"?"height":"width"}function Ea(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Ph(e){return Dh(Ea(e))}function PT(e,n,s){s===void 0&&(s=!1);const r=xr(e),i=Ph(e),c=Lh(i);let d=i==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(d=ud(d)),[d,ud(d)]}function BT(e){const n=ud(e);return[Ig(e),n,Ig(n)]}function Ig(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Y0=["left","right"],F0=["right","left"],IT=["top","bottom"],UT=["bottom","top"];function HT(e,n,s){switch(e){case"top":case"bottom":return s?n?F0:Y0:n?Y0:F0;case"left":case"right":return n?IT:UT;default:return[]}}function qT(e,n,s,r){const i=xr(e);let c=HT(Jn(e),s==="start",r);return i&&(c=c.map(d=>d+"-"+i),n&&(c=c.concat(c.map(Ig)))),c}function ud(e){const n=Jn(e);return LT[n]+e.slice(n.length)}function VT(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qj(e){return typeof e!="number"?VT(e):{top:e,right:e,bottom:e,left:e}}function $i(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 Su(e,n,s){return Math.floor(e/n)!==s}function Gi(e,n){return n<0||n>=e.length}function Fu(e,n){return On(e.current,{disabledIndices:n})}function Ug(e,n){return On(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function On(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&&Es(e,c,r));return c}function Zj(e,{event:n,orientation:s,loopFocus:r,onLoop:i,rtl:c,cols:d,disabledIndices:f,minIndex:p,maxIndex:m,prevIndex:h,stopEvent:x=!1}){let y=h,S;if(n.key===Th?S="up":n.key===nc&&(S="down"),S){const w=[],_=[];let j=!1,E=0;{let U=null,I=-1;e.forEach((L,P)=>{if(L==null)return;E+=1;const H=L.closest('[role="row"]');H&&(j=!0),(H!==U||I===-1)&&(U=H,I+=1,w[I]=[]),w[I].push(P),_[P]=I})}let k=!1,R=0;if(j)for(const U of w){const I=U.length;I>R&&(R=I),I!==d&&(k=!0)}const N=k&&E<e.length,O=R||d,A=U=>{if(!k||h===-1)return;const I=_[h];if(I==null)return;const L=w[I].indexOf(h),P=U==="up"?-1:1;for(let H=I+P,Y=0;Y<w.length;Y+=1,H+=P){if(H<0||H>=w.length){if(!r||N)return;if(H=H<0?w.length-1:0,i){const q=Math.min(L,w[H].length-1),X=w[H][q]??w[H][0],Z=i(n,h,X);H=_[Z]??H}}const Q=w[H];for(let q=Math.min(L,Q.length-1);q>=0;q-=1){const X=Q[q];if(!Es(e,X,f))return X}}},M=U=>{if(!N||h===-1)return;const I=h%O,L=U==="up"?-O:O,P=m-m%O,H=qr(m/O)+1;for(let Y=h-I+L,Q=0;Q<H;Q+=1,Y+=L){if(Y<0||Y>m){if(!r)return;Y=Y<0?P:0}const q=Math.min(Y+O-1,m);for(let X=Math.min(Y+I,q);X>=Y;X-=1)if(!Es(e,X,f))return X}};x&&ua(n);const B=A(S)??M(S);if(B!==void 0)y=B;else if(h===-1)y=S==="up"?m:p;else if(y=On(e,{startingIndex:h,amount:O,decrement:S==="up",disabledIndices:f}),r){if(S==="up"&&(h-O<p||y<0)){const U=h%O,I=m%O,L=m-(I-U);I===U?y=m:y=I>U?L:L-O,i&&(y=i(n,h,y))}S==="down"&&h+O>m&&(y=On(e,{startingIndex:h%O-O,amount:O,disabledIndices:f}),i&&(y=i(n,h,y)))}Gi(e,y)&&(y=h)}if(s==="both"){const w=qr(h/d);n.key===(c?ur:dr)&&(x&&ua(n),h%d!==d-1?(y=On(e,{startingIndex:h,disabledIndices:f}),r&&Su(y,d,w)&&(y=On(e,{startingIndex:h-h%d-1,disabledIndices:f}),i&&(y=i(n,h,y)))):r&&(y=On(e,{startingIndex:h-h%d-1,disabledIndices:f}),i&&(y=i(n,h,y))),Su(y,d,w)&&(y=h)),n.key===(c?dr:ur)&&(x&&ua(n),h%d!==0?(y=On(e,{startingIndex:h,decrement:!0,disabledIndices:f}),r&&Su(y,d,w)&&(y=On(e,{startingIndex:h+(d-h%d),decrement:!0,disabledIndices:f}),i&&(y=i(n,h,y)))):r&&(y=On(e,{startingIndex:h+(d-h%d),decrement:!0,disabledIndices:f}),i&&(y=i(n,h,y))),Su(y,d,w)&&(y=h));const _=qr(m/d)===w;Gi(e,y)&&(r&&_?(y=n.key===(c?dr:ur)?m:On(e,{startingIndex:h-h%d-1,disabledIndices:f}),i&&(y=i(n,h,y))):y=h)}return y}function Jj(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 h=0;h<c;h+=1)for(let x=0;x<d;x+=1)m.push(i+h+x*n);i%n+c<=n&&m.every(h=>r[h]==null)?(m.forEach(h=>{r[h]=f}),p=!0):i+=1}}),[...r]}function Wj(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 ew(e,n){return n.flatMap((s,r)=>e.includes(s)?[r]:[])}function Es(e,n,s){if(typeof s=="function"?s(n):s?.includes(n)??!1)return!0;const i=e[n];return i?Bd(i)?!s&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function $T(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Bd(e,n=e?Wn(e):null){return!e||!e.isConnected||!n||$T(n)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():n.display!=="none"&&n.display!=="contents"}const GT='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function YT(e){const n=e.assignedSlot;if(n)return n;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return Ko(s)?s.host:null}function Hg(e){for(const n of Array.from(e.children))if(Pn(n)==="summary")return n;return null}function FT(e,n){const s=Hg(n);return!!s&&(e===s||Ye(s,e))}function tw(e){const n=e?Pn(e):"";return e!=null&&e.matches(GT)&&(n!=="summary"||e.parentElement!=null&&Pn(e.parentElement)==="details"&&Hg(e.parentElement)===e)&&(n!=="details"||Hg(e)==null)&&(n!=="input"||e.type!=="hidden")}function nw(e){if(!tw(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let n=e;n;n=YT(n)){const s=n!==e,r=Pn(n)==="slot";if(n.hasAttribute("inert")||s&&Pn(n)==="details"&&!n.open&&!FT(e,n)||n.hasAttribute("hidden")||!r&&!XT(n,s))return!1}return!0}function XT(e,n){const s=Wn(e);return n?s.display!=="none":Bd(e,s)}function aw(e){const n=e.tabIndex;if(n<0){const s=Pn(e);if(s==="details"||s==="audio"||s==="video"||Ut(e)&&e.isContentEditable)return 0}return n}function Ep(e){if(Pn(e)!=="input")return null;const n=e;return n.type==="radio"&&n.name!==""?n:null}function KT(e,n){const s=Ep(e);if(!s)return!0;const r=n.find(i=>{const c=Ep(i);return c?.name===s.name&&c.form===s.form&&c.checked});return r?r===s:n.find(i=>{const c=Ep(i);return c?.name===s.name&&c.form===s.form})===s}function sw(e){if(Ut(e)&&Pn(e)==="slot"){const n=e.assignedElements({flatten:!0});if(n.length>0)return n}return Ut(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function rw(e,n){sw(e).forEach(s=>{tw(s)&&n.push(s),rw(s,n)})}function ow(e,n,s){sw(e).forEach(r=>{Ut(r)&&r.matches(n)&&s.push(r),ow(r,n,s)})}function Bh(e){return nw(e)&&aw(e)>=0}function lw(e){const n=[];return rw(e,n),n.filter(nw)}function Id(e){const n=lw(e);return n.filter(s=>aw(s)>=0&&KT(s,n))}function iw(e,n){const s=Id(e),r=s.length;if(r===0)return;const i=zn(xt(e)),c=s.indexOf(i),d=c===-1?n===1?0:r-1:c+n;return s[d]}function cw(e){return iw(xt(e).body,1)||e}function uw(e){return iw(xt(e).body,-1)||e}function Ti(e,n){const s=n||e.currentTarget,r=e.relatedTarget;return!r||!Ye(s,r)}function QT(e){Id(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function X0(e){const n=[];ow(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 mr(e,n,s=!0){return e.filter(i=>i.parentId===n).flatMap(i=>[...!s||i.context?.open?[i]:[],...mr(e,i.id,s)])}function K0(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 Yi(e){return`data-base-ui-${e}`}let Cu=0;function Xu(e,n={}){const{preventScroll:s=!1,sync:r=!1,shouldFocus:i}=n;cancelAnimationFrame(Cu);function c(){i&&!i()||e?.focus({preventScroll:s})}if(r)return c(),Dn;const d=requestAnimationFrame(c);return Cu=d,()=>{Cu===d&&(cancelAnimationFrame(d),Cu=0)}}const kp={inert:new WeakMap,"aria-hidden":new WeakMap},Q0="data-base-ui-inert",qg={inert:new WeakSet,"aria-hidden":new WeakSet};let di=new WeakMap,Np=0;function ZT(e){return qg[e]}function dw(e){return e?Ko(e)?e.host:dw(e.parentNode):null}const Rp=(e,n)=>n.map(s=>{if(e.contains(s))return s;const r=dw(s);return e.contains(r)?r:null}).filter(s=>s!=null),Z0=e=>{const n=new Set;return e.forEach(s=>{let r=s;for(;r&&!n.has(r);)n.add(r),r=r.parentNode}),n},J0=(e,n,s)=>{const r=[],i=c=>{!c||s.has(c)||Array.from(c.children).forEach(d=>{Pn(d)!=="script"&&(n.has(d)?i(d):r.push(d))})};return i(e),r};function JT(e,n,s,r,{mark:i=!0,markerIgnoreElements:c=[]}){const d=r?"inert":s?"aria-hidden":null;let f=null,p=null;const m=Rp(n,e),h=i?Rp(n,c):[],x=new Set(h),y=i?J0(n,Z0(m),new Set(m)).filter(_=>!x.has(_)):[],S=[],w=[];if(d){const _=kp[d],j=ZT(d);p=j,f=_;const E=Rp(n,Array.from(n.querySelectorAll("[aria-live]"))),k=m.concat(E);J0(n,Z0(k),new Set(k)).forEach(N=>{const O=N.getAttribute(d),A=O!==null&&O!=="false",M=(_.get(N)||0)+1;_.set(N,M),S.push(N),M===1&&A&&j.add(N),A||N.setAttribute(d,d==="inert"?"":"true")})}return i&&y.forEach(_=>{const j=(di.get(_)||0)+1;di.set(_,j),w.push(_),j===1&&_.setAttribute(Q0,"")}),Np+=1,()=>{f&&S.forEach(_=>{const E=(f.get(_)||0)-1;f.set(_,E),E||(!p?.has(_)&&d&&_.removeAttribute(d),p?.delete(_))}),i&&w.forEach(_=>{const j=(di.get(_)||0)-1;di.set(_,j),j||_.removeAttribute(Q0)}),Np-=1,Np||(kp.inert=new WeakMap,kp["aria-hidden"]=new WeakMap,qg.inert=new WeakSet,qg["aria-hidden"]=new WeakSet,di=new WeakMap)}}function W0(e,n={}){const{ariaHidden:s=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:c=[]}=n,d=xt(e[0]).body;return JT(e,d,s,r,{mark:i,markerIgnoreElements:c})}let e1=0;function WT(e,n="mui"){const[s,r]=v.useState(e),i=e||s;return v.useEffect(()=>{s==null&&(e1+=1,r(`${n}-${e1}`))},[s,n]),i}const t1=Oh.useId;function Ud(e,n){if(t1!==void 0){const s=t1();return e??(n?`${n}-${s}`:s)}return WT(e,n)}const eA=parseInt(v.version,10);function Ih(e){return eA>=e}function n1(e){if(!v.isValidElement(e))return null;const n=e,s=n.props;return(Ih(19)?s?.ref:n.ref)??null}function Vg(e,n){if(e&&!n)return e;if(!e&&n)return n;if(e||n)return{...e,...n}}function tA(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 nA(e,n){return typeof e=="function"?e(n):e}function aA(e,n){return typeof e=="function"?e(n):e}const Uh={};function Ra(e,n,s,r,i){if(!s&&!r&&!i&&!e)return dd(n);let c=dd(e);return n&&(c=wi(c,n)),s&&(c=wi(c,s)),r&&(c=wi(c,r)),i&&(c=wi(c,i)),c}function sA(e){if(e.length===0)return Uh;if(e.length===1)return dd(e[0]);let n=dd(e[0]);for(let s=1;s<e.length;s+=1)n=wi(n,e[s]);return n}function dd(e){return Hh(e)?{...mw(e,Uh)}:rA(e)}function wi(e,n){return Hh(n)?mw(n,e):oA(e,n)}function rA(e){const n={...e};for(const s in n){const r=n[s];fw(s,r)&&(n[s]=pw(r))}return n}function oA(e,n){if(!n)return e;for(const s in n){const r=n[s];switch(s){case"style":{e[s]=Vg(e.style,r);break}case"className":{e[s]=gw(e.className,r);break}default:fw(s,r)?e[s]=lA(e[s],r):e[s]=r}}return e}function fw(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 Hh(e){return typeof e=="function"}function mw(e,n){return Hh(e)?e(n):e??Uh}function lA(e,n){return n?e?(...s)=>{const r=s[0];if(hw(r)){const c=r;fd(c);const d=n(...s);return c.baseUIHandlerPrevented||e?.(...s),d}const i=n(...s);return e?.(...s),i}:pw(n):e}function pw(e){return e&&((...n)=>{const s=n[0];return hw(s)&&fd(s),e(...n)})}function fd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gw(e,n){return n?e?n+" "+e:n:e}function hw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Lt(e,n,s={}){const r=n.render,i=iA(n,s);if(s.enabled===!1)return null;const c=s.state??an;return dA(e,r,i,c)}function iA(e,n={}){const{className:s,style:r,render:i}=e,{state:c=an,ref:d,props:f,stateAttributesMapping:p,enabled:m=!0}=n,h=m?nA(s,c):void 0,x=m?aA(r,c):void 0,y=m?tA(c,p):an,S=m&&f?cA(f):void 0,w=m?Vg(y,S)??{}:an;return typeof document<"u"&&(m?Array.isArray(d)?w.ref=kT([w.ref,n1(i),...d]):w.ref=As(w.ref,n1(i),d):As(null,null)),m?(h!==void 0&&(w.className=gw(w.className,h)),x!==void 0&&(w.style=Vg(w.style,x)),w):an}function cA(e){return Array.isArray(e)?sA(e):Ra(void 0,e)}const uA=Symbol.for("react.lazy");function dA(e,n,s,r){if(n){if(typeof n=="function")return n(s,r);const i=Ra(s,n.props);i.ref=s.ref;let c=n;return c?.$$typeof===uA&&(c=v.Children.toArray(n)[0]),v.cloneElement(c,i)}if(e&&typeof e=="string")return fA(e,s);throw new Error(Rn(8))}function fA(e,n){return e==="button"?v.createElement("button",{type:"button",...n,key:n.key}):e==="img"?v.createElement("img",{alt:"",...n,key:n.key}):v.createElement(e,n)}const mA={style:{transition:"none"}},pA="data-base-ui-click-trigger",gA={fallbackAxisSide:"none"},hA={fallbackAxisSide:"end"},xA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},xw=v.createContext(null),bw=()=>v.useContext(xw),bA=Yi("portal");function vw(e={}){const{ref:n,container:s,componentProps:r=an,elementProps:i}=e,c=Ud(),f=bw()?.portalNode,[p,m]=v.useState(null),[h,x]=v.useState(null),y=Me(j=>{j!==null&&x(j)}),S=v.useRef(null);Ne(()=>{if(s===null){S.current&&(S.current=null,x(null),m(null));return}if(c==null)return;const j=(s&&(Nh(s)?s:s.current))??f??document.body;if(j==null){S.current&&(S.current=null,x(null),m(null));return}S.current!==j&&(S.current=j,x(null),m(j))},[s,f,c]);const w=Lt("div",r,{ref:[n,y],props:[{id:c,[bA]:""},i]});return{portalNode:h,portalSubtree:p&&w?Zr.createPortal(w,p):null}}const yw=v.forwardRef(function(n,s){const{render:r,className:i,style:c,children:d,container:f,renderGuards:p,...m}=n,{portalNode:h,portalSubtree:x}=vw({container:f,ref:s,componentProps:n,elementProps:m}),y=v.useRef(null),S=v.useRef(null),w=v.useRef(null),_=v.useRef(null),[j,E]=v.useState(null),k=v.useRef(!1),R=j?.modal,N=j?.open,O=typeof p=="boolean"?p:!!j&&!j.modal&&j.open&&!!h;v.useEffect(()=>{if(!h||R)return;function M(B){h&&B.relatedTarget&&Ti(B)&&(B.type==="focusin"?k.current&&(X0(h),k.current=!1):(QT(h),k.current=!0))}return Xa(ct(h,"focusin",M,!0),ct(h,"focusout",M,!0))},[h,R]),v.useEffect(()=>{!h||N!==!1||(X0(h),k.current=!1)},[N,h]);const A=v.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:S,beforeInsideRef:w,afterInsideRef:_,portalNode:h,setFocusManagerState:E}),[h]);return o.jsxs(v.Fragment,{children:[x,o.jsxs(xw.Provider,{value:A,children:[O&&h&&o.jsx(id,{"data-type":"outside",ref:y,onFocus:M=>{if(Ti(M,h))w.current?.focus();else{const B=j?j.domReference:null;uw(B)?.focus()}}}),O&&h&&o.jsx("span",{"aria-owns":h.id,style:xA}),h&&Zr.createPortal(d,h),O&&h&&o.jsx(id,{"data-type":"outside",ref:S,onFocus:M=>{if(Ti(M,h))_.current?.focus();else{const B=j?j.domReference:null;cw(B)?.focus(),j?.closeOnFocusOut&&j?.onOpenChange(!1,tt(Pd,M.nativeEvent))}}})]})]})});function vA(){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 yA=v.createContext(null),_A=v.createContext(null),Hd=()=>v.useContext(yA)?.id||null,fl=e=>{const n=v.useContext(_A);return e??n};function js(e){return e==null?e:"current"in e?e.current:e}function jA(e,n){const s=Ft(En(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 a1=20;let ir=[];function qh(){ir=ir.filter(e=>e.deref()?.isConnected)}function wA(e){qh(),e&&Pn(e)!=="body"&&(ir.push(new WeakRef(e)),ir.length>a1&&(ir=ir.slice(-a1)))}function Tp(){return qh(),ir[ir.length-1]?.deref()}function SA(e){return e?Bh(e)?e:Id(e)[0]||e:null}function s1(e,n){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!n.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=lw(e).filter(c=>{const d=c.getAttribute("data-tabindex")||"";return Bh(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 _w(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:h,previousFocusableElement:x,beforeContentFocusGuardRef:y,externalTree:S,getInsideElements:w}=e,_="rootStore"in n?n.rootStore:n,j=_.useState("open"),E=_.useState("domReferenceElement"),k=_.useState("floatingElement"),{events:R,dataRef:N}=_.context,O=Me(()=>N.current.floatingContext?.nodeId),A=i===!1,M=Pg(E)&&A,B=v.useRef(["content"]),U=cn(i),I=cn(c),L=cn(m),P=fl(S),H=bw(),Y=v.useRef(!1),Q=v.useRef(!1),q=v.useRef(!1),X=v.useRef(null),Z=v.useRef(""),$=v.useRef(""),K=v.useRef(null),D=v.useRef(null),G=As(K,y,H?.beforeInsideRef),V=As(D,H?.afterInsideRef),W=Zn(),ce=Zn(),oe=Qo(),se=H!=null,ue=od(k),ee=Me((be=ue)=>be?Id(be):[]),Re=Me(()=>w?.().filter(be=>be!=null)??[]);v.useEffect(()=>{if(r||!f)return;function be(Ee){Ee.key==="Tab"&&Ye(ue,zn(xt(ue)))&&ee().length===0&&!M&&ua(Ee)}const Se=xt(ue);return ct(Se,"keydown",be)},[r,ue,f,M,ee]),v.useEffect(()=>{if(r||!j)return;const be=xt(ue);function Se(){q.current=!1}function Ee(De){const xe=En(De),ke=Re(),_e=Ye(k,xe)||Ye(E,xe)||Ye(H?.portalNode,xe)||ke.some(Le=>Le===xe||Ye(Le,xe));q.current=!_e,$.current=De.pointerType||"keyboard",xe?.closest(`[${pA}]`)&&(Q.current=!0)}function ze(){$.current="keyboard"}return Xa(ct(be,"pointerdown",Ee,!0),ct(be,"pointerup",Se,!0),ct(be,"pointercancel",Se,!0),ct(be,"keydown",ze,!0))},[r,k,E,ue,j,H,Re]),v.useEffect(()=>{if(r||!p)return;const be=xt(ue);function Se(){Q.current=!0,ce.start(0,()=>{Q.current=!1})}function Ee(ke){const _e=En(ke);Bh(_e)&&(X.current=_e)}function ze(ke){const _e=ke.relatedTarget,Le=ke.currentTarget,Ge=En(ke);queueMicrotask(()=>{const qe=O(),Oe=_.context.triggerElements,ve=Re(),le=_e?.hasAttribute(Yi("focus-guard"))&&[K.current,D.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,js(x),js(h)].includes(_e),ye=!(Ye(E,_e)||Ye(k,_e)||Ye(_e,k)||Ye(H?.portalNode,_e)||ve.some(je=>je===_e||Ye(je,_e))||_e!=null&&Oe.hasElement(_e)||Oe.hasMatchingElement(je=>Ye(je,_e))||le||P&&(mr(P.nodesRef.current,qe).find(je=>Ye(je.context?.elements.floating,_e)||Ye(je.context?.elements.domReference,_e))||K0(P.nodesRef.current,qe).find(je=>[je.context?.elements.floating,od(je.context?.elements.floating)].includes(_e)||je.context?.elements.domReference===_e)));if(Le===E&&ue&&s1(ue,B),d&&Le!==E&&!Bd(Ge)&&zn(be)===be.body){if(Ut(ue)&&(ue.focus(),d==="popup")){oe.request(()=>{ue.focus()});return}const je=ee(),Be=X.current,Ze=(Be&&je.includes(Be)?Be:null)||je[je.length-1]||ue;Ut(Ze)&&Ze.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(M||!f)&&_e&&ye&&!Q.current&&(M||_e!==Tp())&&(Y.current=!0,_.setOpen(!1,tt(Pd,ke)))})}function De(){q.current||(N.current.insideReactTree=!0,W.start(0,()=>{N.current.insideReactTree=!1}))}const xe=Ut(E)?E:null;if(!(!k&&!xe))return Xa(xe&&ct(xe,"focusout",ze),xe&&ct(xe,"pointerdown",Se),k&&ct(k,"focusin",Ee),k&&ct(k,"focusout",ze),k&&H&&ct(k,"focusout",De,!0))},[r,E,k,ue,f,P,H,_,p,d,ee,M,O,B,N,W,ce,oe,h,x,Re]),v.useEffect(()=>{if(r||!k||!j)return;const be=Array.from(H?.portalNode?.querySelectorAll(`[${Yi("portal")}]`)||[]),Ee=(P?K0(P.nodesRef.current,O()):[]).find(Le=>Pg(Le.context?.elements.domReference||null))?.context?.elements.domReference,De=[...[k,...be,K.current,D.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...Re()],Ee,js(x),js(h),M?E:null].filter(Le=>Le!=null),xe=W0(De,{ariaHidden:f||M,mark:!1}),ke=[k,...be].filter(Le=>Le!=null),_e=W0(ke);return()=>{_e(),xe()}},[j,r,E,k,f,H,M,P,O,h,x,Re]),Ne(()=>{if(!j||r||!Ut(ue))return;const be=xt(ue),Se=zn(be);queueMicrotask(()=>{const Ee=U.current,ze=typeof Ee=="function"?Ee(L.current||""):Ee;if(ze===void 0||ze===!1||Ye(ue,Se))return;let xe=null;const ke=()=>(xe==null&&(xe=ee(ue)),xe[0]||ue);let _e;ze===!0||ze===null?_e=ke():_e=js(ze),_e=_e||ke();const Le=Ye(ue,zn(be));Xu(_e,{preventScroll:_e===ue,shouldFocus(){if(Le)return!0;const Ge=zn(be);return!(Ge!==_e&&Ye(ue,Ge))}})})},[r,j,ue,ee,U,L]),Ne(()=>{if(r||!ue)return;const be=xt(ue),Se=zn(be);wA(Se);function Ee(De){if(De.open||(Z.current=jA(De.nativeEvent,$.current)),De.reason===In&&De.nativeEvent.type==="mouseleave"&&(Y.current=!0),De.reason===Ah)if(De.nested)Y.current=!1;else if(kh(De.nativeEvent)||Ij(De.nativeEvent))Y.current=!1;else{let xe=!1;xt(ue).createElement("div").focus({get preventScroll(){return xe=!0,!1}}),xe?Y.current=!1:Y.current=!0}}R.on("openchange",Ee);function ze(){const De=I.current;let xe=typeof De=="function"?De(Z.current):De;if(xe===void 0||xe===!1)return null;if(xe===null&&(xe=!0),typeof xe=="boolean")return E?.isConnected?E:Tp()||null;const ke=E?.isConnected?E:Tp();return js(xe)||ke||null}return()=>{R.off("openchange",Ee);const De=zn(be),xe=Re(),ke=Ye(k,De)||xe.some(Ge=>Ge===De||Ye(Ge,De))||P&&mr(P.nodesRef.current,O(),!1).some(Ge=>Ye(Ge.context?.elements.floating,De)),_e=I.current,Le=ze();queueMicrotask(()=>{const Ge=SA(Le),qe=typeof _e!="boolean";_e&&!Y.current&&Ut(Ge)&&(!(!qe&&Ge!==De&&De!==be.body)||ke)&&Ge.focus({preventScroll:!0}),Y.current=!1})}},[r,k,ue,I,R,P,E,O,Re]),Ne(()=>{if(!Eh||j||!k)return;const be=zn(xt(k));!Ut(be)||!Ld(be)||Ye(k,be)&&be.blur()},[j,k]),Ne(()=>{if(!(r||!H))return H.setFocusManagerState({modal:f,closeOnFocusOut:p,open:j,onOpenChange:_.setOpen,domReference:E}),()=>{H.setFocusManagerState(null)}},[r,H,f,j,_,p,E]),Ne(()=>{if(!(r||!ue))return s1(ue,B),()=>{queueMicrotask(qh)}},[r,ue,B]);const $e=!r&&(f?!M:!0)&&(se||f);return o.jsxs(v.Fragment,{children:[$e&&o.jsx(id,{"data-type":"inside",ref:G,onFocus:be=>{if(f){const Se=ee();Xu(Se[Se.length-1])}else H?.portalNode&&(Y.current=!1,Ti(be,H.portalNode)?cw(E)?.focus():js(x??H.beforeOutsideRef)?.focus())}}),s,$e&&o.jsx(id,{"data-type":"inside",ref:V,onFocus:be=>{f?Xu(ee()[0]):H?.portalNode&&(p&&(Y.current=!0),Ti(be,H.portalNode)?uw(E)?.focus():js(h??H.afterOutsideRef)?.focus())}})]})}function CA(e,n={}){const{enabled:s=!0,event:r="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:f=0,reason:p=Vi}=n,m="rootStore"in e?e.rootStore:e,h=m.context.dataRef,x=v.useRef(void 0),y=Qo(),S=Zn(),w=v.useMemo(()=>{function _(E,k,R,N){const O=tt(p,k,R);E&&N==="touch"&&f>0?S.start(f,()=>{m.setOpen(!0,O)}):m.setOpen(E,O)}function j(E,k,R){const N=h.current.openEvent,O=m.select("domReferenceElement")!==k;return E&&O||!E||!i?!0:N&&d?!R(N.type):!1}return{onPointerDown(E){x.current=E.pointerType},onMouseDown(E){const k=x.current,R=E.nativeEvent,N=m.select("open");if(E.button!==0||r==="click"||Fr(k,!0)&&c)return;const O=j(N,E.currentTarget,B=>B==="click"||B==="mousedown"),A=En(R);if(Ld(A)){_(O,R,A,k);return}const M=E.currentTarget;y.request(()=>{_(O,R,M,k)})},onClick(E){if(r==="mousedown-only")return;const k=x.current;if(r==="mousedown"&&k){x.current=void 0;return}if(Fr(k,!0)&&c)return;const R=m.select("open"),N=j(R,E.currentTarget,O=>O==="click"||O==="mousedown"||O==="keydown"||O==="keyup");_(N,E.nativeEvent,E.currentTarget,k)},onKeyDown(){x.current=void 0}}},[h,r,c,p,m,d,i,y,S,f]);return v.useMemo(()=>s?{reference:w}:an,[s,w])}function EA(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,h=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,h=0,!i||p?(m=n.axis==="y"?c.width:0,h=n.axis==="x"?c.height:0,x=d&&n.x!=null?n.x:x,y=f&&n.y!=null?n.y:y):i&&!p&&(h=n.axis==="x"?c.height:h,m=n.axis==="y"?c.width:m),i=!0,{width:m,height:h,x,y,top:y,right:x+m,bottom:y+h,left:x}}}}function r1(e){return e!=null&&e.clientX!=null}function kA(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=v.useRef(!1),h=v.useRef(null),[x,y]=v.useState(),[S,w]=v.useState([]),_=Me(N=>{i.set("positionReference",N)}),j=Me((N,O,A)=>{m.current||p.current.openEvent&&!r1(p.current.openEvent)||i.set("positionReference",EA(A??f,{x:N,y:O,axis:r,dataRef:p,pointerType:x}))}),E=Me(N=>{c?h.current||(j(N.clientX,N.clientY,N.currentTarget),w([])):j(N.clientX,N.clientY,N.currentTarget)}),k=Fr(x)?d:c;v.useEffect(()=>{if(!s){_(f);return}if(!k)return;function N(){h.current?.(),h.current=null}const O=Ft(d);function A(M){const B=En(M);Ye(d,B)?N():j(M.clientX,M.clientY)}return!p.current.openEvent||r1(p.current.openEvent)?h.current=ct(O,"mousemove",A):_(f),N},[k,s,d,p,f,i,j,_,S]),v.useEffect(()=>()=>{i.set("positionReference",null)},[i]),v.useEffect(()=>{s&&!d&&(m.current=!1)},[s,d]),v.useEffect(()=>{!s&&c&&(m.current=!0)},[s,c]);const R=v.useMemo(()=>{function N(O){y(O.pointerType)}return{onPointerDown:N,onPointerEnter:N,onMouseMove:E,onMouseEnter:E}},[E]);return v.useMemo(()=>s?{reference:R,trigger:R}:{},[s,R])}const NA={intentional:"onClick",sloppy:"onPointerDown"};function RA(){return!1}function TA(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Vh(e,n={}){const{enabled:s=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:c="sloppy",referencePress:d=RA,referencePressEvent:f="sloppy",bubbles:p,externalTree:m}=n,h="rootStore"in e?e.rootStore:e,x=h.useState("open"),y=h.useState("floatingElement"),{dataRef:S}=h.context,w=fl(m),_=Me(typeof i=="function"?i:()=>!1),j=typeof i=="function"?_:i,E=j!==!1,k=Me(()=>c),{escapeKey:R,outsidePress:N}=TA(p),O=v.useRef(!1),A=v.useRef(!1),M=v.useRef(!1),B=v.useRef(!1),U=v.useRef(""),I=v.useRef(null),L=Zn(),P=Zn(),H=Me(()=>{P.clear(),S.current.insideReactTree=!1}),Y=Me(V=>{const W=S.current.floatingContext?.nodeId;return(w?mr(w.nodesRef.current,W):[]).some(oe=>oe.context?.open&&!oe.context.dataRef.current[V])}),Q=Me(V=>wp(V,h.select("floatingElement"))||wp(V,h.select("domReferenceElement"))),q=Me(V=>{d()&&h.setOpen(!1,tt(Vi,V.nativeEvent))}),X=Me(V=>{if(!x||!s||!r||V.key!=="Escape"||B.current||!R&&Y("__escapeKeyBubbles"))return;const W=dT(V)?V.nativeEvent:V,ce=tt(Mh,W);h.setOpen(!1,ce),ce.isCanceled||V.preventDefault(),!R&&!ce.isPropagationAllowed&&V.stopPropagation()}),Z=Me(()=>{S.current.insideReactTree=!0,P.start(0,H)}),$=Me(V=>{if(!x||!s||V.button!==0)return;const W=En(V.nativeEvent);Ye(h.select("floatingElement"),W)&&(O.current||(O.current=!0,A.current=!1))}),K=Me(V=>{!x||!s||(V.defaultPrevented||V.nativeEvent.defaultPrevented)&&O.current&&(A.current=!0)});v.useEffect(()=>{if(!x||!s)return;S.current.__escapeKeyBubbles=R,S.current.__outsidePressBubbles=N;const V=new Ia,W=new Ia;function ce(){V.clear(),B.current=!0}function oe(){V.start(zd()?5:0,()=>{B.current=!1})}function se(){M.current=!0,W.start(0,()=>{M.current=!1})}function ue(){O.current=!1,A.current=!1}function ee(){const le=U.current,ye=le==="pen"||!le?"mouse":le,je=k(),Be=typeof je=="function"?je():je;return typeof Be=="string"?Be:Be[ye]}function Re(le){const ye=ee();return ye==="intentional"&&le.type!=="click"||ye==="sloppy"&&le.type==="click"}function $e(le){const ye=S.current.floatingContext?.nodeId,je=w&&mr(w.nodesRef.current,ye).some(Be=>wp(le,Be.context?.elements.floating));return Q(le)||je}function be(le){if(Re(le)){le.type!=="click"&&!Q(le)&&(W.clear(),M.current=!1),H();return}if(S.current.insideReactTree){H();return}const ye=En(le),je=`[${Yi("inert")}]`,Be=lt(ye)?ye.getRootNode():null,Ze=Array.from((Ko(Be)?Be:xt(h.select("floatingElement"))).querySelectorAll(je)),_t=h.context.triggerElements;if(ye&&(_t.hasElement(ye)||_t.hasMatchingElement(vt=>Ye(vt,ye))))return;let Ht=lt(ye)?ye:null;for(;Ht&&!Cs(Ht);){const vt=Rs(Ht);if(Cs(vt)||!lt(vt))break;Ht=vt}if(!(Ze.length&<(ye)&&!xT(ye)&&!Ye(ye,h.select("floatingElement"))&&Ze.every(vt=>!Ye(Ht,vt)))){if(Ut(ye)&&!("touches"in le)){const vt=Cs(ye),ut=Wn(ye),it=/auto|scroll/,Et=vt||it.test(ut.overflowX),Bt=vt||it.test(ut.overflowY),pa=Et&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,gn=Bt&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,dt=ut.direction==="rtl",Tt=gn&&(dt?le.offsetX<=ye.offsetWidth-ye.clientWidth:le.offsetX>ye.clientWidth),Xt=pa&&le.offsetY>ye.clientHeight;if(Tt||Xt)return}if(!$e(le)){if(ee()==="intentional"&&M.current){W.clear(),M.current=!1;return}typeof j=="function"&&!j(le)||Y("__outsidePressBubbles")||(h.setOpen(!1,tt(Ah,le)),H())}}}function Se(le){ee()!=="sloppy"||le.pointerType==="touch"||!h.select("open")||!s||Q(le)||be(le)}function Ee(le){if(ee()!=="sloppy"||!h.select("open")||!s||Q(le))return;const ye=le.touches[0];ye&&(I.current={startTime:Date.now(),startX:ye.clientX,startY:ye.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},L.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function ze(le,ye){const je=En(le);if(!je)return;const Be=ct(je,le.type,()=>{ye(le),Be()})}function De(le){U.current="touch",ze(le,Ee)}function xe(le){L.clear(),le.type==="pointerdown"&&(U.current=le.pointerType),!(le.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&ze(le,ye=>{ye.type==="pointerdown"?Se(ye):be(ye)})}function ke(le){if(!O.current)return;const ye=A.current;if(ue(),ee()==="intentional"){if(le.type==="pointercancel"){ye&&se();return}if(!$e(le)){if(ye){se();return}typeof j=="function"&&!j(le)||(W.clear(),M.current=!0,H())}}}function _e(le){if(ee()!=="sloppy"||!I.current||Q(le))return;const ye=le.touches[0];if(!ye)return;const je=Math.abs(ye.clientX-I.current.startX),Be=Math.abs(ye.clientY-I.current.startY),Ze=Math.sqrt(je*je+Be*Be);Ze>5&&(I.current.dismissOnTouchEnd=!0),Ze>10&&(be(le),L.clear(),I.current=null)}function Le(le){ze(le,_e)}function Ge(le){ee()!=="sloppy"||!I.current||Q(le)||(I.current.dismissOnTouchEnd&&be(le),L.clear(),I.current=null)}function qe(le){ze(le,Ge)}const Oe=xt(y),ve=Xa(r&&Xa(ct(Oe,"keydown",X),ct(Oe,"compositionstart",ce),ct(Oe,"compositionend",oe)),E&&Xa(ct(Oe,"click",xe,!0),ct(Oe,"pointerdown",xe,!0),ct(Oe,"pointerup",ke,!0),ct(Oe,"pointercancel",ke,!0),ct(Oe,"mousedown",xe,!0),ct(Oe,"mouseup",ke,!0),ct(Oe,"touchstart",De,!0),ct(Oe,"touchmove",Le,!0),ct(Oe,"touchend",qe,!0)));return()=>{ve(),V.clear(),W.clear(),ue(),M.current=!1}},[S,y,r,E,j,x,s,R,N,X,H,k,Y,Q,w,h,L]),v.useEffect(H,[j,H]);const D=v.useMemo(()=>({onKeyDown:X,[NA[f]]:q,...f!=="intentional"&&{onClick:q}}),[X,q,f]),G=v.useMemo(()=>({onKeyDown:X,onPointerDown:K,onMouseDown:K,onClickCapture:Z,onMouseDownCapture(V){Z(),$(V)},onPointerDownCapture(V){Z(),$(V)},onMouseUpCapture:Z,onTouchEndCapture:Z,onTouchMoveCapture:Z}),[X,Z,$,K]);return v.useMemo(()=>s?{reference:D,floating:G,trigger:D}:{},[s,D,G])}function o1(e,n,s){let{reference:r,floating:i}=e;const c=Ea(n),d=Ph(n),f=Lh(d),p=Jn(n),m=c==="y",h=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:h,y:r.y-i.height};break;case"bottom":S={x:h,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(xr(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 AA(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:h="viewport",elementContext:x="floating",altBoundary:y=!1,padding:S=0}=Ms(n,e),w=Qj(S),j=f[y?x==="floating"?"reference":"floating":x],E=$i(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(j)))==null||s?j:j.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:h,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},O=$i(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:R,strategy:p}):k);return{top:(E.top-O.top+w.top)/N.y,bottom:(O.bottom-E.bottom+w.bottom)/N.y,left:(E.left-O.left+w.left)/N.x,right:(O.right-E.right+w.right)/N.x}}const MA=50,OA=async(e,n,s)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:d}=s,f=d.detectOverflow?d:{...d,detectOverflow:AA},p=await(d.isRTL==null?void 0:d.isRTL(n));let m=await d.getElementRects({reference:e,floating:n,strategy:i}),{x:h,y:x}=o1(m,r,p),y=r,S=0;const w={};for(let _=0;_<c.length;_++){const j=c[_];if(!j)continue;const{name:E,fn:k}=j,{x:R,y:N,data:O,reset:A}=await k({x:h,y:x,initialPlacement:r,placement:y,strategy:i,middlewareData:w,rects:m,platform:f,elements:{reference:e,floating:n}});h=R??h,x=N??x,w[E]={...w[E],...O},A&&S<MA&&(S++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(m=A.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:i}):A.rects),{x:h,y:x}=o1(m,y,p)),_=-1)}return{x:h,y:x,placement:y,strategy:i,middlewareData:w}},zA=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:h=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...j}=Ms(e,n);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const E=Jn(i),k=Ea(f),R=Jn(f)===f,N=await(p.isRTL==null?void 0:p.isRTL(m.floating)),O=y||(R||!_?[ud(f)]:BT(f)),A=w!=="none";!y&&A&&O.push(...qT(f,_,w,N));const M=[f,...O],B=await p.detectOverflow(n,j),U=[];let I=((r=c.flip)==null?void 0:r.overflows)||[];if(h&&U.push(B[E]),x){const Y=PT(i,d,N);U.push(B[Y[0]],B[Y[1]])}if(I=[...I,{placement:i,overflows:U}],!U.every(Y=>Y<=0)){var L,P;const Y=(((L=c.flip)==null?void 0:L.index)||0)+1,Q=M[Y];if(Q&&(!(x==="alignment"?k!==Ea(Q):!1)||I.every(Z=>Ea(Z.placement)===k?Z.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:Q}};let q=(P=I.filter(X=>X.overflows[0]<=0).sort((X,Z)=>X.overflows[1]-Z.overflows[1])[0])==null?void 0:P.placement;if(!q)switch(S){case"bestFit":{var H;const X=(H=I.filter(Z=>{if(A){const $=Ea(Z.placement);return $===k||$==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter($=>$>0).reduce(($,K)=>$+K,0)]).sort((Z,$)=>Z[1]-$[1])[0])==null?void 0:H[0];X&&(q=X);break}case"initialPlacement":q=f;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function l1(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function i1(e){return DT.some(n=>e[n]>=0)}const DA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:s,platform:r}=n,{strategy:i="referenceHidden",...c}=Ms(e,n);switch(i){case"referenceHidden":{const d=await r.detectOverflow(n,{...c,elementContext:"reference"}),f=l1(d,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:i1(f)}}}case"escaped":{const d=await r.detectOverflow(n,{...c,altBoundary:!0}),f=l1(d,s.floating);return{data:{escapedOffsets:f,escaped:i1(f)}}}default:return{}}}}},jw=new Set(["left","top"]);async function LA(e,n){const{placement:s,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),d=Jn(s),f=xr(s),p=Ea(s)==="y",m=jw.has(d)?-1:1,h=c&&p?-1:1,x=Ms(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*h,y:y*m}:{x:y*m,y:S*h}}const PA=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 LA(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}}}}},BA=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:E=>{let{x:k,y:R}=E;return{x:k,y:R}}},...m}=Ms(e,n),h={x:s,y:r},x=await c.detectOverflow(n,m),y=Ea(Jn(i)),S=Dh(y);let w=h[S],_=h[y];if(d){const E=S==="y"?"top":"left",k=S==="y"?"bottom":"right",R=w+x[E],N=w-x[k];w=Bg(R,w,N)}if(f){const E=y==="y"?"top":"left",k=y==="y"?"bottom":"right",R=_+x[E],N=_-x[k];_=Bg(R,_,N)}const j=p.fn({...n,[S]:w,[y]:_});return{...j,data:{x:j.x-s,y:j.y-r,enabled:{[S]:d,[y]:f}}}}}},IA=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}=Ms(e,n),h={x:s,y:r},x=Ea(i),y=Dh(x);let S=h[y],w=h[x];const _=Ms(f,n),j=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(p){const R=y==="y"?"height":"width",N=c.reference[y]-c.floating[R]+j.mainAxis,O=c.reference[y]+c.reference[R]-j.mainAxis;S<N?S=N:S>O&&(S=O)}if(m){var E,k;const R=y==="y"?"width":"height",N=jw.has(Jn(i)),O=c.reference[x]-c.floating[R]+(N&&((E=d.offset)==null?void 0:E[x])||0)+(N?0:j.crossAxis),A=c.reference[x]+c.reference[R]+(N?0:((k=d.offset)==null?void 0:k[x])||0)-(N?j.crossAxis:0);w<O?w=O:w>A&&(w=A)}return{[y]:S,[x]:w}}}},UA=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}=Ms(e,n),h=await d.detectOverflow(n,m),x=Jn(i),y=xr(i),S=Ea(i)==="y",{width:w,height:_}=c.floating;let j,E;x==="top"||x==="bottom"?(j=x,E=y===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(E=x,j=y==="end"?"top":"bottom");const k=_-h.top-h.bottom,R=w-h.left-h.right,N=Zo(_-h[j],k),O=Zo(w-h[E],R),A=!n.middlewareData.shift;let M=N,B=O;if((s=n.middlewareData.shift)!=null&&s.enabled.x&&(B=R),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(M=k),A&&!y){const I=da(h.left,0),L=da(h.right,0),P=da(h.top,0),H=da(h.bottom,0);S?B=w-2*(I!==0||L!==0?I+L:da(h.left,h.right)):M=_-2*(P!==0||H!==0?P+H:da(h.top,h.bottom))}await p({...n,availableWidth:B,availableHeight:M});const U=await d.getDimensions(f.floating);return w!==U.width||_!==U.height?{reset:{rects:!0}}:{}}}};function ww(e){const n=Wn(e);let s=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const i=Ut(e),c=i?e.offsetWidth:s,d=i?e.offsetHeight:r,f=cd(s)!==c||cd(r)!==d;return f&&(s=c,r=d),{width:s,height:r,$:f}}function $h(e){return lt(e)?e:e.contextElement}function Yo(e){const n=$h(e);if(!Ut(n))return Ka(1);const s=n.getBoundingClientRect(),{width:r,height:i,$:c}=ww(n);let d=(c?cd(s.width):s.width)/r,f=(c?cd(s.height):s.height)/i;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const HA=Ka(0);function Sw(e){const n=Ft(e);return!zd()||!n.visualViewport?HA:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function qA(e,n,s){return n===void 0&&(n=!1),!s||n&&s!==Ft(e)?!1:n}function Xr(e,n,s,r){n===void 0&&(n=!1),s===void 0&&(s=!1);const i=e.getBoundingClientRect(),c=$h(e);let d=Ka(1);n&&(r?lt(r)&&(d=Yo(r)):d=Yo(e));const f=qA(c,s,r)?Sw(c):Ka(0);let p=(i.left+f.x)/d.x,m=(i.top+f.y)/d.y,h=i.width/d.x,x=i.height/d.y;if(c){const y=Ft(c),S=r&<(r)?Ft(r):r;let w=y,_=Dg(w);for(;_&&r&&S!==w;){const j=Yo(_),E=_.getBoundingClientRect(),k=Wn(_),R=E.left+(_.clientLeft+parseFloat(k.paddingLeft))*j.x,N=E.top+(_.clientTop+parseFloat(k.paddingTop))*j.y;p*=j.x,m*=j.y,h*=j.x,x*=j.y,p+=R,m+=N,w=Ft(_),_=Dg(w)}}return $i({width:h,height:x,x:p,y:m})}function qd(e,n){const s=Dd(e).scrollLeft;return n?n.left+s:Xr(Wa(e)).left+s}function Cw(e,n){const s=e.getBoundingClientRect(),r=s.left+n.scrollLeft-qd(e,s),i=s.top+n.scrollTop;return{x:r,y:i}}function VA(e){let{elements:n,rect:s,offsetParent:r,strategy:i}=e;const c=i==="fixed",d=Wa(r),f=n?Od(n.floating):!1;if(r===d||f&&c)return s;let p={scrollLeft:0,scrollTop:0},m=Ka(1);const h=Ka(0),x=Ut(r);if((x||!x&&!c)&&((Pn(r)!=="body"||hr(d))&&(p=Dd(r)),x)){const S=Xr(r);m=Yo(r),h.x=S.x+r.clientLeft,h.y=S.y+r.clientTop}const y=d&&!x&&!c?Cw(d,p):Ka(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-p.scrollLeft*m.x+h.x+y.x,y:s.y*m.y-p.scrollTop*m.y+h.y+y.y}}function $A(e){return Array.from(e.getClientRects())}function GA(e){const n=Wa(e),s=Dd(e),r=e.ownerDocument.body,i=da(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),c=da(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let d=-s.scrollLeft+qd(e);const f=-s.scrollTop;return Wn(r).direction==="rtl"&&(d+=da(n.clientWidth,r.clientWidth)-i),{width:i,height:c,x:d,y:f}}const c1=25;function YA(e,n){const s=Ft(e),r=Wa(e),i=s.visualViewport;let c=r.clientWidth,d=r.clientHeight,f=0,p=0;if(i){c=i.width,d=i.height;const h=zd();(!h||h&&n==="fixed")&&(f=i.offsetLeft,p=i.offsetTop)}const m=qd(r);if(m<=0){const h=r.ownerDocument,x=h.body,y=getComputedStyle(x),S=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-x.clientWidth-S);w<=c1&&(c-=w)}else m<=c1&&(c+=m);return{width:c,height:d,x:f,y:p}}function FA(e,n){const s=Xr(e,!0,n==="fixed"),r=s.top+e.clientTop,i=s.left+e.clientLeft,c=Ut(e)?Yo(e):Ka(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 u1(e,n,s){let r;if(n==="viewport")r=YA(e,s);else if(n==="document")r=GA(Wa(e));else if(lt(n))r=FA(n,s);else{const i=Sw(e);r={x:n.x-i.x,y:n.y-i.y,width:n.width,height:n.height}}return $i(r)}function Ew(e,n){const s=Rs(e);return s===n||!lt(s)||Cs(s)?!1:Wn(s).position==="fixed"||Ew(s,n)}function XA(e,n){const s=n.get(e);if(s)return s;let r=Hi(e,[],!1).filter(f=>lt(f)&&Pn(f)!=="body"),i=null;const c=Wn(e).position==="fixed";let d=c?Rs(e):e;for(;lt(d)&&!Cs(d);){const f=Wn(d),p=Rh(d);!p&&f.position==="fixed"&&(i=null),(c?!p&&!i:!p&&f.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||hr(d)&&!p&&Ew(e,d))?r=r.filter(h=>h!==d):i=f,d=Rs(d)}return n.set(e,r),r}function KA(e){let{element:n,boundary:s,rootBoundary:r,strategy:i}=e;const d=[...s==="clippingAncestors"?Od(n)?[]:XA(n,this._c):[].concat(s),r],f=u1(n,d[0],i);let p=f.top,m=f.right,h=f.bottom,x=f.left;for(let y=1;y<d.length;y++){const S=u1(n,d[y],i);p=da(S.top,p),m=Zo(S.right,m),h=Zo(S.bottom,h),x=da(S.left,x)}return{width:m-x,height:h-p,x,y:p}}function QA(e){const{width:n,height:s}=ww(e);return{width:n,height:s}}function ZA(e,n,s){const r=Ut(n),i=Wa(n),c=s==="fixed",d=Xr(e,!0,c,n);let f={scrollLeft:0,scrollTop:0};const p=Ka(0);function m(){p.x=qd(i)}if(r||!r&&!c)if((Pn(n)!=="body"||hr(i))&&(f=Dd(n)),r){const S=Xr(n,!0,c,n);p.x=S.x+n.clientLeft,p.y=S.y+n.clientTop}else i&&m();c&&!r&&i&&m();const h=i&&!r&&!c?Cw(i,f):Ka(0),x=d.left+f.scrollLeft-p.x-h.x,y=d.top+f.scrollTop-p.y-h.y;return{x,y,width:d.width,height:d.height}}function Ap(e){return Wn(e).position==="static"}function d1(e,n){if(!Ut(e)||Wn(e).position==="fixed")return null;if(n)return n(e);let s=e.offsetParent;return Wa(e)===s&&(s=s.ownerDocument.body),s}function kw(e,n){const s=Ft(e);if(Od(e))return s;if(!Ut(e)){let i=Rs(e);for(;i&&!Cs(i);){if(lt(i)&&!Ap(i))return i;i=Rs(i)}return s}let r=d1(e,n);for(;r&&mT(r)&&Ap(r);)r=d1(r,n);return r&&Cs(r)&&Ap(r)&&!Rh(r)?s:r||hT(e)||s}const JA=async function(e){const n=this.getOffsetParent||kw,s=this.getDimensions,r=await s(e.floating);return{reference:ZA(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WA(e){return Wn(e).direction==="rtl"}const Nw={convertOffsetParentRelativeRectToViewportRelativeRect:VA,getDocumentElement:Wa,getClippingRect:KA,getOffsetParent:kw,getElementRects:JA,getClientRects:$A,getDimensions:QA,getScale:Yo,isElement:lt,isRTL:WA};function Rw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function e3(e,n){let s=null,r;const i=Wa(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:h,top:x,width:y,height:S}=m;if(f||n(),!y||!S)return;const w=qr(x),_=qr(i.clientWidth-(h+y)),j=qr(i.clientHeight-(x+S)),E=qr(h),R={rootMargin:-w+"px "+-_+"px "+-j+"px "+-E+"px",threshold:da(0,Zo(1,p))||1};let N=!0;function O(A){const M=A[0].intersectionRatio;if(M!==p){if(!N)return d();M?d(!1,M):r=setTimeout(()=>{d(!1,1e-7)},1e3)}M===1&&!Rw(m,e.getBoundingClientRect())&&d(),N=!1}try{s=new IntersectionObserver(O,{...R,root:i.ownerDocument})}catch{s=new IntersectionObserver(O,R)}s.observe(e)}return d(!0),c}function f1(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=$h(e),h=i||c?[...m?Hi(m):[],...n?Hi(n):[]]:[];h.forEach(E=>{i&&E.addEventListener("scroll",s,{passive:!0}),c&&E.addEventListener("resize",s)});const x=m&&f?e3(m,s):null;let y=-1,S=null;d&&(S=new ResizeObserver(E=>{let[k]=E;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,_=p?Xr(e):null;p&&j();function j(){const E=Xr(e);_&&!Rw(_,E)&&s(),_=E,w=requestAnimationFrame(j)}return s(),()=>{var E;h.forEach(k=>{i&&k.removeEventListener("scroll",s),c&&k.removeEventListener("resize",s)}),x?.(),(E=S)==null||E.disconnect(),S=null,p&&cancelAnimationFrame(w)}}const t3=PA,n3=BA,a3=zA,s3=UA,r3=DA,o3=IA,l3=(e,n,s)=>{const r=new Map,i={platform:Nw,...s},c={...i.platform,_c:r};return OA(e,n,{...i,platform:c})};var i3=typeof document<"u",c3=function(){},Ku=i3?v.useLayoutEffect:c3;function md(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(!md(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)&&!md(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function Tw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function m1(e,n){const s=Tw(e);return Math.round(n*s)/s}function Mp(e){const n=v.useRef(e);return Ku(()=>{n.current=e}),n}function u3(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,[h,x]=v.useState({x:0,y:0,strategy:s,placement:n,middlewareData:{},isPositioned:!1}),[y,S]=v.useState(r);md(y,r)||S(r);const[w,_]=v.useState(null),[j,E]=v.useState(null),k=v.useCallback(Z=>{Z!==A.current&&(A.current=Z,_(Z))},[]),R=v.useCallback(Z=>{Z!==M.current&&(M.current=Z,E(Z))},[]),N=c||w,O=d||j,A=v.useRef(null),M=v.useRef(null),B=v.useRef(h),U=p!=null,I=Mp(p),L=Mp(i),P=Mp(m),H=v.useCallback(()=>{if(!A.current||!M.current)return;const Z={placement:n,strategy:s,middleware:y};L.current&&(Z.platform=L.current),l3(A.current,M.current,Z).then($=>{const K={...$,isPositioned:P.current!==!1};Y.current&&!md(B.current,K)&&(B.current=K,Zr.flushSync(()=>{x(K)}))})},[y,n,s,L,P]);Ku(()=>{m===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,x(Z=>({...Z,isPositioned:!1})))},[m]);const Y=v.useRef(!1);Ku(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Ku(()=>{if(N&&(A.current=N),O&&(M.current=O),N&&O){if(I.current)return I.current(N,O,H);H()}},[N,O,H,I,U]);const Q=v.useMemo(()=>({reference:A,floating:M,setReference:k,setFloating:R}),[k,R]),q=v.useMemo(()=>({reference:N,floating:O}),[N,O]),X=v.useMemo(()=>{const Z={position:s,left:0,top:0};if(!q.floating)return Z;const $=m1(q.floating,h.x),K=m1(q.floating,h.y);return f?{...Z,transform:"translate("+$+"px, "+K+"px)",...Tw(q.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:$,top:K}},[s,f,q.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:H,refs:Q,elements:q,floatingStyles:X}),[h,H,Q,q,X])}const d3=(e,n)=>{const s=t3(e);return{name:s.name,fn:s.fn,options:[e,n]}},f3=(e,n)=>{const s=n3(e);return{name:s.name,fn:s.fn,options:[e,n]}},m3=(e,n)=>({fn:o3(e).fn,options:[e,n]}),p3=(e,n)=>{const s=a3(e);return{name:s.name,fn:s.fn,options:[e,n]}},g3=(e,n)=>{const s=s3(e);return{name:s.name,fn:s.fn,options:[e,n]}},h3=(e,n)=>{const s=r3(e);return{name:s.name,fn:s.fn,options:[e,n]}},Te=(e,n,s,r,i,c,...d)=>{if(d.length>0)throw new Error(Rn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var Op={exports:{}},zp={};/**
|
|
526
|
-
* @license React
|
|
527
|
-
* use-sync-external-store-shim.production.js
|
|
528
|
-
*
|
|
529
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
530
|
-
*
|
|
531
|
-
* This source code is licensed under the MIT license found in the
|
|
532
|
-
* LICENSE file in the root directory of this source tree.
|
|
533
|
-
*/var p1;function x3(){if(p1)return zp;p1=1;var e=Ki();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}}),_=w[0].inst,j=w[1];return c(function(){_.value=S,_.getSnapshot=y,p(_)&&j({inst:_})},[x,S,y]),i(function(){return p(_)&&j({inst:_}),x(function(){p(_)&&j({inst:_})})},[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 h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return zp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,zp}var g1;function Aw(){return g1||(g1=1,Op.exports=x3()),Op.exports}var pd=Aw(),Dp={exports:{}},Lp={};/**
|
|
534
|
-
* @license React
|
|
535
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
536
|
-
*
|
|
537
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
538
|
-
*
|
|
539
|
-
* This source code is licensed under the MIT license found in the
|
|
540
|
-
* LICENSE file in the root directory of this source tree.
|
|
541
|
-
*/var h1;function b3(){if(h1)return Lp;h1=1;var e=Ki(),n=Aw();function s(m,h){return m===h&&(m!==0||1/m===1/h)||m!==m&&h!==h}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 Lp.useSyncExternalStoreWithSelector=function(m,h,x,y,S){var w=c(null);if(w.current===null){var _={hasValue:!1,value:null};w.current=_}else _=w.current;w=f(function(){function E(A){if(!k){if(k=!0,R=A,A=y(A),S!==void 0&&_.hasValue){var M=_.value;if(S(M,A))return N=M}return N=A}if(M=N,r(R,A))return M;var B=y(A);return S!==void 0&&S(M,B)?(R=A,M):(R=A,N=B)}var k=!1,R,N,O=x===void 0?null:x;return[function(){return E(h())},O===null?void 0:function(){return E(O())}]},[h,x,y,S]);var j=i(m,w[0],w[1]);return d(function(){_.hasValue=!0,_.value=j},[j]),p(j),j},Lp}var x1;function v3(){return x1||(x1=1,Dp.exports=b3()),Dp.exports}var y3=v3();const _3=Ih(19),j3=_3?S3:C3;function Ke(e,n,s,r,i){return j3(e,n,s,r,i)}function w3(e,n,s,r,i){const c=v.useCallback(()=>n(e.getSnapshot(),s,r,i),[e,n,s,r,i]);return pd.useSyncExternalStore(e.subscribe,c,c)}tT({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()}}),pd.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function S3(e,n,s,r,i){const c=eT();if(!c)return w3(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 C3(e,n,s,r,i){return y3.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>n(c,s,r,i))}class Mw{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 Ke(this,n,s,r,i)}}class Gh extends Mw{constructor(n,s={},r){super(n),this.context=s,this.selectors=r}useSyncedValue(n,s){v.useDebugValue(n);const r=this;Ne(()=>{r.state[n]!==s&&r.set(n,s)},[r,n,s])}useSyncedValueWithCleanup(n,s){const r=this;Ne(()=>(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);Ne(()=>{s.update(n)},[s,...r])}useControlledProp(n,s){v.useDebugValue(n);const r=this,i=s!==void 0;Ne(()=>{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 v.useDebugValue(n),Ke(this,this.selectors[n],s,r,i)}useContextCallback(n,s){v.useDebugValue(n);const r=Me(s??Dn);this.context[n]=r}useStateSetter(n){const s=v.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 E3={open:Te(e=>e.open),transitionStatus:Te(e=>e.transitionStatus),domReferenceElement:Te(e=>e.domReferenceElement),referenceElement:Te(e=>e.positionReference??e.referenceElement),floatingElement:Te(e=>e.floatingElement),floatingId:Te(e=>e.floatingId)};class Vd extends Gh{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:vA(),nested:r,triggerElements:c},E3),this.syncOnly=s}syncOpenEvent=(n,s)=>{(!n||!this.state.open||s!=null&&fT(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 k3(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"),h=n.context.triggerElements,x=d,y=v.useRef(null);r===void 0&&y.current===null&&(y.current=new Vd({open:f,transitionStatus:void 0,referenceElement:p,floatingElement:m,triggerElements:h,onOpenChange:x,floatingId:i,syncOnly:!0,nested:c}));const S=r??y.current;return n.useSyncedValue("floatingId",i),Ne(()=>{const w={open:f,floatingId:i,referenceElement:p,floatingElement:m};lt(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 ac(e,n=!1,s=!1){const[r,i]=v.useState(e&&n?"idle":void 0),[c,d]=v.useState(e);return e&&!c&&(d(!0),i("starting")),!e&&c&&r!=="ending"&&!s&&i("ending"),!e&&!c&&r==="ending"&&i(void 0),Ne(()=>{if(!e&&c&&r!=="ending"&&s){const f=Ya.request(()=>{i("ending")});return()=>{Ya.cancel(f)}}},[e,c,r,s]),Ne(()=>{if(!e||n)return;const f=Ya.request(()=>{i(void 0)});return()=>{Ya.cancel(f)}},[n,e]),Ne(()=>{if(!e||!n)return;e&&c&&r!=="idle"&&i("starting");const f=Ya.request(()=>{i("idle")});return()=>{Ya.cancel(f)}},[n,e,c,r]),{mounted:c,setMounted:d,transitionStatus:r}}let Kr=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const N3={[Kr.startingStyle]:""},R3={[Kr.endingStyle]:""},ml={transitionStatus(e){return e==="starting"?N3:e==="ending"?R3:null}};function T3(e,n=!1,s=!0){const r=Qo();return Me((i,c=null)=>{r.cancel();const d=js(e);if(d==null)return;const f=d,p=()=>{Zr.flushSync(i)};if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function m(){Promise.all(f.getAnimations().map(h=>h.finished)).then(()=>{c?.aborted||p()}).catch(()=>{if(s){c?.aborted||p();return}const h=f.getAnimations();!c?.aborted&&h.length>0&&h.some(x=>x.pending||x.playState!=="finished")&&m()})}if(n){const h=Kr.startingStyle;if(!f.hasAttribute(h)){r.request(m);return}const x=new MutationObserver(()=>{f.hasAttribute(h)||(x.disconnect(),m())});x.observe(f,{attributes:!0,attributeFilter:[h]}),c?.addEventListener("abort",()=>x.disconnect(),{once:!0});return}r.request(m)})}function br(e){const{enabled:n=!0,open:s,ref:r,onComplete:i}=e,c=Me(i),d=T3(r,s,!1);v.useEffect(()=>{if(!n)return;const f=new AbortController;return d(c,f.signal),()=>{f.abort()}},[n,s,c,d])}const $d={tabIndex:-1,[Lg]:""};function Ow(e,n,s=!1){const r=Ud(),i=Hd()!=null,c=v.useRef(null);e===void 0&&c.current===null&&(c.current=n(r,i));const d=e??c.current;return k3({popupStore:d,treatPopupAsFloatingElement:s,floatingRootContext:d.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:d.setOpen}),{store:d,internalStore:c.current}}function A3(e,n){const s=v.useRef(null),r=v.useRef(null);return v.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 zw(e,n,s){const r=s?.id??null;(r||n)&&(e.activeTriggerId=r,e.activeTriggerElement=s??null)}function M3(e,n,s,r){const i=s.useState("isMountedByTrigger",e),c=A3(e,s),d=Me(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 Ne(()=>{i&&s.update({activeTriggerElement:n.current,...r})},[i,s,n,...Object.values(r)]),{registerTrigger:d,isMountedByThisTrigger:i}}function Dw(e){const n=e.useState("open"),s=e.useState("triggerCount");Ne(()=>{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 Lw(e,n,s){const{mounted:r,setMounted:i,transitionStatus:c}=ac(e);n.useSyncedValues({mounted:r,transitionStatus:c});const d=Me(()=>{i(!1),n.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n.context.onOpenChangeComplete?.(!1)}),f=n.useState("preventUnmountingOnClose");return br({enabled:r&&!e&&!f,open:e,ref:n.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:c}}function Pw(e,n){e.useSyncedValues(n),Ne(()=>()=>{e.update({activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an})},[e])}function O3(e,n){Ne(()=>{!n&&e.state.openMethod!==null&&e.set("openMethod",null)},[n,e]),Ne(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Gd{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 z3(){return new Vd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Gd,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Bw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:z3(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}function Iw(e,n,s=!1){return new Vd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:s,onOpenChange:void 0})}const Ai=Te(e=>e.triggerIdProp??e.activeTriggerId),Yh=Te(e=>e.openProp??e.open),b1=Te(e=>(e.popupElement?.id??e.floatingId)||void 0);function Uw(e,n){return n!==void 0&&Yh(e)&&Ai(e)===n}function D3(e,n){return Uw(e,n)?!0:n!==void 0&&Yh(e)&&Ai(e)==null&&e.triggerCount===1}const Hw={open:Yh,mounted:Te(e=>e.mounted),transitionStatus:Te(e=>e.transitionStatus),floatingRootContext:Te(e=>e.floatingRootContext),triggerCount:Te(e=>e.triggerCount),preventUnmountingOnClose:Te(e=>e.preventUnmountingOnClose),payload:Te(e=>e.payload),activeTriggerId:Ai,activeTriggerElement:Te(e=>e.mounted?e.activeTriggerElement:null),popupId:b1,isTriggerActive:Te((e,n)=>n!==void 0&&Ai(e)===n),isOpenedByTrigger:Te((e,n)=>Uw(e,n)),isMountedByTrigger:Te((e,n)=>n!==void 0&&Ai(e)===n&&e.mounted),triggerProps:Te((e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Te((e,n)=>D3(e,n)?b1(e):void 0),popupProps:Te(e=>e.popupProps),popupElement:Te(e=>e.popupElement),positionerElement:Te(e=>e.positionerElement)};function qw(e){const{open:n=!1,onOpenChange:s,elements:r={}}=e,i=Ud(),c=Hd()!=null,d=fa(()=>new Vd({open:n,transitionStatus:void 0,onOpenChange:s,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Gd,floatingId:i,syncOnly:!1,nested:c})).current;return Ne(()=>{const f={open:n,floatingId:i};r.reference!==void 0&&(f.referenceElement=r.reference,f.domReferenceElement=lt(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 L3(e={}){const{nodeId:n,externalTree:s}=e,r=qw(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"),[h,x]=v.useState(null),[y,S]=v.useState(void 0),[w,_]=v.useState(void 0),j=v.useRef(null),E=fl(s),k=v.useMemo(()=>({reference:c,floating:d,domReference:f}),[c,d,f]),R=u3({...e,elements:{...k,...h&&{reference:h}}}),N=lt(y)?y:null,O=w===void 0?i.state.floatingElement:w;i.useSyncedValue("referenceElement",y??null),i.useSyncedValue("domReferenceElement",y===void 0?f:N),i.useSyncedValue("floatingElement",O);const A=v.useCallback(P=>{const H=lt(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;x(H),R.refs.setReference(H)},[R.refs]),M=v.useCallback(P=>{(lt(P)||P===null)&&(j.current=P,S(P)),(lt(R.refs.reference.current)||R.refs.reference.current===null||P!==null&&!lt(P))&&R.refs.setReference(P)},[R.refs,S]),B=v.useCallback(P=>{_(P),R.refs.setFloating(P)},[R.refs]),U=v.useMemo(()=>({...R.refs,setReference:M,setFloating:B,setPositionReference:A,domReference:j}),[R.refs,M,B,A]),I=v.useMemo(()=>({...R.elements,domReference:f}),[R.elements,f]),L=v.useMemo(()=>({...R,dataRef:i.context.dataRef,open:p,onOpenChange:i.setOpen,events:i.context.events,floatingId:m,refs:U,elements:I,nodeId:n,rootStore:i}),[R,U,I,n,i,p,m]);return Ne(()=>{f&&(j.current=f)},[f]),Ne(()=>{i.context.dataRef.current.floatingContext=L;const P=E?.nodesRef.current.find(H=>H.id===n);P&&(P.context=L)}),v.useMemo(()=>({...R,context:L,refs:U,elements:I,rootStore:i}),[R,U,I,L,i])}const Pp=lT&&Pj;function P3(e,n={}){const{enabled:s=!0,delay:r}=n,i="rootStore"in e?e.rootStore:e,{events:c,dataRef:d}=i.context,f=v.useRef(!1),p=v.useRef(null),m=v.useRef(!0),h=Zn();v.useEffect(()=>{const y=i.select("domReferenceElement");if(!s)return;const S=Ft(y);function w(){const E=i.select("domReferenceElement");!i.select("open")&&Ut(E)&&E===zn(xt(E))&&(f.current=!0)}function _(){m.current=!0}function j(){m.current=!1}return Xa(ct(S,"blur",w),Pp&&ct(S,"keydown",_,!0),Pp&&ct(S,"pointerdown",j,!0))},[i,s]),v.useEffect(()=>{if(!s)return;function y(S){if(S.reason===Vi||S.reason===Mh){const w=i.select("domReferenceElement");lt(w)&&(p.current=w,f.current=!0)}}return c.on("openchange",y),()=>{c.off("openchange",y)}},[c,s,i]);const x=v.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 _=En(S.nativeEvent);if(lt(_)){if(Pp&&!S.relatedTarget){if(!m.current&&!Ld(_))return}else if(!vT(_))return}const j=rd(S.relatedTarget,i.context.triggerElements),{nativeEvent:E,currentTarget:k}=S,R=typeof r=="function"?r():r;if(i.select("open")&&j||R===0||R===void 0){i.setOpen(!0,tt(Yu,E,k));return}h.start(R,()=>{f.current||i.setOpen(!0,tt(Yu,E,k))})},onBlur(S){y();const w=S.relatedTarget,_=S.nativeEvent,j=lt(w)&&w.hasAttribute(Yi("focus-guard"))&&w.getAttribute("data-type")==="outside";h.start(0,()=>{const E=i.select("domReferenceElement"),k=zn(xt(E));!w&&k===E||Ye(d.current.floatingContext?.refs.floating.current,k)||Ye(E,k)||j||rd(w??k,i.context.triggerElements)||i.setOpen(!1,tt(Yu,_))})}}},[d,r,i,h]);return v.useMemo(()=>s?{reference:x,trigger:x}:{},[s,x])}class Fh{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 Ia,this.restTimeout=new Ia,this.handleCloseOptions=void 0}static create(){return new Fh}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const gd=new WeakMap;function hd(e){if(!e.performedPointerEventsMutation)return;const n=e.pointerEventsScopeElement;n&&gd.get(n)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),gd.delete(n)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Vw(e,n){const{scopeElement:s,referenceElement:r,floatingElement:i}=n,c=gd.get(s);c&&c!==e&&hd(c),hd(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,gd.set(s,e),s.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function Xh(e){const n=e.context.dataRef.current,s=fa(()=>n.hoverInteractionState??Fh.create()).current;return n.hoverInteractionState||(n.hoverInteractionState=s),Ch(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function B3(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,h=fl(),x=Hd(),y=Xh(c),S=Zn(),w=Me(()=>qj(m.current.openEvent?.type,y.interactedInside)),_=Me(()=>_T(m.current.openEvent?.type)),j=Me(()=>{hd(y)});Ne(()=>{d||(y.pointerType=void 0,y.restTimeoutPending=!1,y.interactedInside=!1,j())},[d,y,j]),v.useEffect(()=>j,[j]),Ne(()=>{if(s&&d&&y.handleCloseOptions?.blockPointerEvents&&_()&<(p)&&f){const E=p,k=f,R=xt(f),N=h?.nodesRef.current.find(B=>B.id===x)?.context?.elements.floating;N&&(N.style.pointerEvents="");const O=y.pointerEventsScopeElement!==k?y.pointerEventsScopeElement:null,A=N!==k?N:null,M=y.handleCloseOptions?.getScope?.()??O??A??E.closest("[data-rootownerid]")??R.body;return Vw(y,{scopeElement:M,referenceElement:E,floatingElement:k}),()=>{j()}}},[s,d,p,f,y,_,h,x,j]),v.useEffect(()=>{if(!s)return;function E(){return!!(h&&x&&mr(h.nodesRef.current,x).length>0)}function k(B){const U=ld(r,"close",y.pointerType),I=()=>{c.setOpen(!1,tt(In,B)),h?.events.emit("floating.closed",B)};U?y.openChangeTimeout.start(U,I):(y.openChangeTimeout.clear(),I())}function R(B){const U=En(B);if(!bT(U)){y.interactedInside=!1;return}y.interactedInside=U?.closest("[aria-haspopup]")!=null}function N(){y.openChangeTimeout.clear(),S.clear(),h?.events.off("floating.closed",A),j()}function O(B){if(E()&&h){h.events.on("floating.closed",A);return}if(rd(B.relatedTarget,c.context.triggerElements))return;const U=m.current.floatingContext?.nodeId??i,I=B.relatedTarget;if(!(h&&U&<(I)&&mr(h.nodesRef.current,U,!1).some(P=>Ye(P.context?.elements.floating,I)))){if(y.handler){y.handler(B);return}j(),w()||k(B)}}function A(B){!h||!x||E()||S.start(0,()=>{h.events.off("floating.closed",A),c.setOpen(!1,tt(In,B)),h.events.emit("floating.closed",B)})}const M=f;return Xa(M&&ct(M,"mouseenter",N),M&&ct(M,"mouseleave",O),M&&ct(M,"pointerdown",R,!0),()=>{h?.events.off("floating.closed",A)})},[s,f,c,m,r,i,w,j,y,h,x,S])}const I3={current:null};function U3(e,n={}){const{enabled:s=!0,delay:r=0,handleClose:i=null,mouseOnly:c=!1,restMs:d=0,move:f=!0,triggerElementRef:p=I3,externalTree:m,isActiveTrigger:h=!0,getHandleCloseContext:x,isClosing:y,shouldOpen:S}=n,w="rootStore"in e?e.rootStore:e,{dataRef:_,events:j}=w.context,E=fl(m),k=Xh(w),R=v.useRef(!1),N=cn(i),O=cn(r),A=cn(d),M=cn(s),B=cn(S),U=cn(y),I=Me(()=>qj(_.current.openEvent?.type,k.interactedInside)),L=Me(()=>B.current?.()!==!1),P=Me((Q,q,X)=>{const Z=w.context.triggerElements;if(Z.hasElement(q))return!Q||!Ye(Q,q);if(!lt(X))return!1;const $=X;return Z.hasMatchingElement(K=>Ye(K,$))&&(!Q||!Ye(Q,$))}),H=Me(()=>{if(!k.handler)return;xt(w.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),Y=Me(()=>{hd(k)});return h&&(k.handleCloseOptions=N.current?.__options),v.useEffect(()=>H,[H]),v.useEffect(()=>{if(!s)return;function Q(q){q.open?R.current=!1:(R.current=q.reason===In,H(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return j.on("openchange",Q),()=>{j.off("openchange",Q)}},[s,j,k,H]),v.useEffect(()=>{if(!s)return;function Q($,K=!0){const D=ld(O.current,"close",k.pointerType);D?k.openChangeTimeout.start(D,()=>{w.setOpen(!1,tt(In,$)),E?.events.emit("floating.closed",$)}):K&&(k.openChangeTimeout.clear(),w.setOpen(!1,tt(In,$)),E?.events.emit("floating.closed",$))}const q=p.current??(h?w.select("domReferenceElement"):null);if(!lt(q))return;function X($){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,c&&!Fr(k.pointerType))return;const K=q0(A.current),D=ld(O.current,"open",k.pointerType),G=En($),V=$.currentTarget??null,W=w.select("domReferenceElement");let ce=V;if(lt(G)&&!w.context.triggerElements.hasElement(G)){for(const Ee of w.context.triggerElements.elements())if(Ye(Ee,G)){ce=Ee;break}}lt(V)&<(W)&&!w.context.triggerElements.hasElement(V)&&Ye(V,W)&&(ce=W);const oe=ce==null?!1:P(W,ce,G),se=w.select("open"),ue=U.current?.()??w.select("transitionStatus")==="ending",ee=!se&&ue&&R.current,Re=!oe&<(ce)&<(W)&&Ye(W,ce)&&ee,$e=K>0&&!D,be=oe&&(se||ee)||Re,Se=!se||oe;if(be){L()&&w.setOpen(!0,tt(In,$,ce));return}$e||(D?k.openChangeTimeout.start(D,()=>{Se&&L()&&w.setOpen(!0,tt(In,$,ce))}):Se&&L()&&w.setOpen(!0,tt(In,$,ce)))}function Z($){if(I()){Y();return}H();const K=w.select("domReferenceElement"),D=xt(K);k.restTimeout.clear(),k.restTimeoutPending=!1;const G=_.current.floatingContext??x?.();if(rd($.relatedTarget,w.context.triggerElements))return;if(N.current&&G){w.select("open")||k.openChangeTimeout.clear();const W=p.current;k.handler=N.current({...G,tree:E,x:$.clientX,y:$.clientY,onClose(){Y(),H(),M.current&&!I()&&W===w.select("domReferenceElement")&&Q($,!0)}}),D.addEventListener("mousemove",k.handler),k.handler($);return}(k.pointerType==="touch"?!Ye(w.select("floatingElement"),$.relatedTarget):!0)&&Q($)}return f?Xa(ct(q,"mousemove",X,{once:!0}),ct(q,"mouseenter",X),ct(q,"mouseleave",Z)):Xa(ct(q,"mouseenter",X),ct(q,"mouseleave",Z))},[H,Y,_,O,w,s,N,k,h,P,I,c,f,A,p,E,M,x,U,L]),v.useMemo(()=>{if(!s)return;function Q(q){k.pointerType=q.pointerType}return{onPointerDown:Q,onPointerEnter:Q,onMouseMove(q){const{nativeEvent:X}=q,Z=q.currentTarget,$=w.select("domReferenceElement"),K=w.select("open"),D=P($,Z,q.target);if(c&&!Fr(k.pointerType))return;if(K&&D&&k.handleCloseOptions?.blockPointerEvents){const W=w.select("floatingElement");if(W){const ce=k.handleCloseOptions?.getScope?.()??Z.ownerDocument.body;Vw(k,{scopeElement:ce,referenceElement:Z,floatingElement:W})}}const G=q0(A.current);if(K&&!D||G===0||!D&&k.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;k.restTimeout.clear();function V(){if(k.restTimeoutPending=!1,I())return;const W=w.select("open");!k.blockMouseMove&&(!W||D)&&L()&&w.setOpen(!0,tt(In,X,Z))}k.pointerType==="touch"?Zr.flushSync(()=>{V()}):D&&K?V():(k.restTimeoutPending=!0,k.restTimeout.start(G,V))}}},[s,k,I,P,c,w,A,L])}const H3="Escape";function Yd(e,n,s){switch(e){case"vertical":return n;case"horizontal":return s;default:return n||s}}function Eu(e,n){return Yd(n,e===Th||e===nc,e===ur||e===dr)}function Bp(e,n,s){return Yd(n,e===nc,s?e===ur:e===dr)||e==="Enter"||e===" "||e===""}function q3(e,n,s){return Yd(n,s?e===ur:e===dr,e===nc)}function V3(e,n,s,r){const i=s?e===dr:e===ur,c=e===Th;return n==="both"||n==="horizontal"&&r&&r>1?e===H3:Yd(n,i,c)}function $3(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:h=!1,virtual:x=!1,focusItemOnOpen:y="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:_=void 0,orientation:j="vertical",parentOrientation:E,cols:k=1,id:R,resetOnPointerLeave:N=!0,externalTree:O}=n,A="rootStore"in e?e.rootStore:e,M=A.useState("open"),B=A.useState("floatingElement"),U=A.useState("domReferenceElement"),I=A.context.dataRef,L=od(B),P=Pg(U),H=cn(L),Y=Hd(),Q=fl(O),q=v.useRef(y),X=v.useRef(d??-1),Z=v.useRef(null),$=v.useRef(!0),K=Me(ve=>{i(X.current===-1?null:X.current,ve)}),D=v.useRef(K),G=v.useRef(!!B),V=v.useRef(M),W=v.useRef(!1),ce=v.useRef(!1),oe=v.useRef(null),se=cn(_),ue=cn(M),ee=cn(d),Re=cn(N),$e=Qo(),be=Qo(),Se=Me(()=>{function ve(Be){x?Q?.events.emit("virtualfocus",Be):oe.current=Xu(Be,{sync:W.current,preventScroll:!0})}const le=s.current[X.current],ye=ce.current;le&&ve(le),(W.current?Be=>Be():Be=>$e.request(Be))(()=>{const Be=s.current[X.current]||le;if(!Be)return;le||ve(Be),_e&&(ye||!$.current)&&Be.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ne(()=>{I.current.orientation=j},[I,j]),Ne(()=>{c&&(M&&B?(X.current=d??-1,q.current&&d!=null&&(ce.current=!0,K())):G.current&&(X.current=-1,D.current()))},[c,M,B,d,K]),Ne(()=>{if(c){if(!M){W.current=!1;return}if(B)if(r==null){if(W.current=!1,ee.current!=null)return;if(G.current&&(X.current=-1,Se()),(!V.current||!G.current)&&q.current&&(Z.current!=null||q.current===!0&&Z.current==null)){let ve=0;const le=()=>{s.current[0]==null?(ve<2&&(ve?je=>be.request(je):queueMicrotask)(le),ve+=1):(X.current=Z.current==null||Bp(Z.current,j,h)||m?Fu(s):Ug(s),Z.current=null,K())};le()}}else Gi(s.current,r)||(X.current=r,Se(),ce.current=!1)}},[c,M,B,r,ee,m,s,j,h,K,Se,be]),Ne(()=>{if(!c||B||!Q||x||!G.current)return;const ve=Q.nodesRef.current,le=ve.find(Be=>Be.id===Y)?.context?.elements.floating,ye=zn(xt(B)),je=ve.some(Be=>Be.context&&Ye(Be.context.elements.floating,ye));le&&!je&&$.current&&le.focus({preventScroll:!0})},[c,B,Q,Y,x]),Ne(()=>{D.current=K,V.current=M,G.current=!!B}),Ne(()=>{M||(Z.current=null,q.current=y)},[M,y]);const Ee=r!=null,ze=Me(ve=>{if(!ue.current)return;const le=s.current.indexOf(ve.currentTarget);le!==-1&&(X.current!==le||r!==le)&&(X.current=le,K(ve))}),De=Me(()=>E??Q?.nodesRef.current.find(ve=>ve.id===Y)?.context?.dataRef?.current.orientation),xe=Me(()=>Fu(s,se.current)),ke=Me(ve=>{if($.current=!1,W.current=!0,ve.which===229||!ue.current&&ve.currentTarget===H.current)return;if(m&&V3(ve.key,j,h,k)){Eu(ve.key,De())||ua(ve),A.setOpen(!1,tt(V0,ve.nativeEvent)),Ut(U)&&(x?Q?.events.emit("virtualfocus",U):U.focus());return}const le=X.current,ye=Fu(s,_),je=Ug(s,_);if(P||(ve.key==="Home"&&(ua(ve),X.current=ye,K(ve)),ve.key==="End"&&(ua(ve),X.current=je,K(ve))),k>1){const Be=Array.from({length:s.current.length},()=>({width:1,height:1})),Ze=Jj(Be,k,!1),_t=Ze.findIndex(ut=>ut!=null&&!Es(s.current,ut,_)),Ht=Ze.reduce((ut,it,Et)=>it!=null&&!Es(s.current,it,_)?Et:ut,-1),vt=Ze[Zj(Ze.map(ut=>ut!=null?s.current[ut]:null),{event:ve,orientation:j,loopFocus:p,rtl:h,cols:k,disabledIndices:ew([...(typeof _!="function"?_:null)||s.current.map((ut,it)=>Es(s.current,it,_)?it:void 0),void 0],Ze),minIndex:_t,maxIndex:Ht,prevIndex:Wj(X.current>je?ye:X.current,Be,Ze,k,ve.key===nc?"bl":ve.key===(h?ur:dr)?"tr":"tl"),stopEvent:!0})];if(vt!=null&&(X.current=vt,K(ve)),j==="both")return}if(Eu(ve.key,j)){if(ua(ve),M&&!x&&zn(ve.currentTarget.ownerDocument)===ve.currentTarget){X.current=Bp(ve.key,j,h)?ye:je,K(ve);return}Bp(ve.key,j,h)?p?le>=je?f&&le!==s.current.length?X.current=-1:(W.current=!1,X.current=ye):X.current=On(s.current,{startingIndex:le,disabledIndices:_}):X.current=Math.min(je,On(s.current,{startingIndex:le,disabledIndices:_})):p?le<=ye?f&&le!==-1?X.current=s.current.length:(W.current=!1,X.current=je):X.current=On(s.current,{startingIndex:le,decrement:!0,disabledIndices:_}):X.current=Math.max(ye,On(s.current,{startingIndex:le,decrement:!0,disabledIndices:_})),Gi(s.current,X.current)&&(X.current=-1),K(ve)}}),_e=v.useMemo(()=>({onFocus(le){W.current=!0,ze(le)},onClick:({currentTarget:le})=>le.focus({preventScroll:!0}),onMouseMove(le){W.current=!0,ce.current=!1,S&&ze(le)},onPointerLeave(le){if(!ue.current||!$.current||le.pointerType==="touch")return;W.current=!0;const ye=le.relatedTarget;if(!(!S||s.current.includes(ye))&&Re.current&&(oe.current?.(),oe.current=null,X.current=-1,K(le),!x)){const je=H.current,Be=zn(xt(je));je&&Ye(je,Be)&&je.focus({preventScroll:!0})}}}),[ze,ue,H,S,s,K,Re,x]),Le=v.useMemo(()=>x&&M&&Ee&&{"aria-activedescendant":`${R}-${r}`},[x,M,Ee,R,r]),Ge=v.useMemo(()=>({"aria-orientation":j==="both"?void 0:j,...P?{}:Le,onKeyDown(ve){if(ve.key==="Tab"&&ve.shiftKey&&M&&!x){const le=En(ve.nativeEvent);if(le&&!Ye(H.current,le))return;ua(ve),A.setOpen(!1,tt(Pd,ve.nativeEvent)),Ut(U)&&U.focus();return}ke(ve)},onPointerMove(){$.current=!0}}),[Le,ke,H,j,P,A,M,x,U]),qe=v.useMemo(()=>{function ve(je){A.setOpen(!0,tt(V0,je.nativeEvent,je.currentTarget))}function le(je){y==="auto"&&kh(je.nativeEvent)&&(q.current=!x)}function ye(je){q.current=y,y==="auto"&&Ij(je.nativeEvent)&&(q.current=!0)}return{onKeyDown(je){const Be=A.select("open");$.current=!1;const Ze=je.key.startsWith("Arrow"),_t=q3(je.key,De(),h),Ht=Eu(je.key,j),vt=(m?_t:Ht)||je.key==="Enter"||je.key.trim()==="";if(x&&Be)return ke(je);if(!(!Be&&!w&&Ze)){if(vt){const ut=Eu(je.key,De());Z.current=m&&ut?null:je.key}if(m){_t&&(ua(je),Be?(X.current=xe(),K(je)):ve(je));return}Ht&&(ee.current!=null&&(X.current=ee.current),ua(je),!Be&&w?ve(je):ke(je),Be&&K(je))}},onFocus(je){A.select("open")&&!x&&(X.current=-1,K(je))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:le,onClick:le}},[ke,y,xe,m,K,A,w,j,De,h,ee,x]),Oe=v.useMemo(()=>({...Le,...qe}),[Le,qe]);return v.useMemo(()=>c?{reference:Oe,floating:Ge,item:_e,trigger:qe}:{},[c,Oe,Ge,qe,_e])}function G3(e,n){const{listRef:s,elementsRef:r,activeIndex:i,onMatch:c,onTyping:d,enabled:f=!0,resetMs:p=750,selectedIndex:m=null}=n,h="rootStore"in e?e.rootStore:e,x=h.useState("open"),y=Zn(),S=v.useRef(""),w=v.useRef(m??i??-1),_=v.useRef(null),j=Me(R=>{function N(P){const H=r?.current[P];return!H||Bd(H)}function O(P,H,Y=0){if(P.length===0)return-1;const Q=(Y%P.length+P.length)%P.length,q=H.toLocaleLowerCase();for(let X=0;X<P.length;X+=1){const Z=(Q+X)%P.length;if(!(!P[Z]?.toLocaleLowerCase().startsWith(q)||!N(Z)))return Z}return-1}const A=s.current;if(S.current.length>0&&R.key===" "&&(ua(R),d?.(!0)),S.current.length>0&&S.current[0]!==" "&&O(A,S.current)===-1&&R.key!==" "&&d?.(!1),A==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;x&&R.key!==" "&&(ua(R),d?.(!0));const M=S.current==="";M&&(w.current=m??i??-1),A.every(P=>P?P[0]?.toLocaleLowerCase()!==P[1]?.toLocaleLowerCase():!0)&&S.current===R.key&&(S.current="",w.current=_.current),S.current+=R.key,y.start(p,()=>{S.current="",w.current=_.current,d?.(!1)});const I=((M?m??i??-1:w.current)??0)+1,L=O(A,S.current,I);L!==-1?(c?.(L),_.current=L):R.key!==" "&&(S.current="",d?.(!1))}),E=Me(R=>{const N=R.relatedTarget,O=h.select("domReferenceElement"),A=h.select("floatingElement");Ye(O,N)||Ye(A,N)||(y.clear(),S.current="",w.current=_.current,d?.(!1))});Ne(()=>{!x&&m!==null||(y.clear(),_.current=null,S.current!==""&&(S.current=""))},[x,m,y]),Ne(()=>{x&&S.current===""&&(w.current=m??i??-1)},[x,m,i]);const k=v.useMemo(()=>({onKeyDown:j,onBlur:E}),[j,E]);return v.useMemo(()=>f?{reference:k,floating:k}:{},[f,k])}const v1=.1,Y3=v1*v1,Dt=.5;function ku(e,n,s,r,i,c){return r>=n!=c>=n&&e<=(i-s)*(n-r)/(c-r)+s}function Nu(e,n,s,r,i,c,d,f,p,m){let h=!1;return ku(e,n,s,r,i,c)&&(h=!h),ku(e,n,i,c,d,f)&&(h=!h),ku(e,n,d,f,p,m)&&(h=!h),ku(e,n,p,m,s,r)&&(h=!h),h}function F3(e,n,s){return e>=s.x&&e<=s.x+s.width&&n>=s.y&&n<=s.y+s.height}function Ru(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 X3(e={}){const{blockPointerEvents:n=!1}=e,s=new Ia,r=({x:i,y:c,placement:d,elements:f,onClose:p,nodeId:m,tree:h})=>{const x=d?.split("-")[0];let y=!1,S=null,w=null,_=typeof performance<"u"?performance.now():0;function j(k,R){const N=performance.now(),O=N-_;if(S===null||w===null||O===0)return S=k,w=R,_=N,!1;const A=k-S,M=R-w,B=A*A+M*M,U=O*O*Y3;return S=k,w=R,_=N,B<U}function E(){s.clear(),p()}return function(R){s.clear();const N=f.domReference,O=f.floating;if(!N||!O||x==null||i==null||c==null)return;const{clientX:A,clientY:M}=R,B=En(R),U=R.type==="mouseleave",I=Ye(O,B),L=Ye(N,B);if(I&&(y=!0,!U))return;if(L&&(y=!1,!U)){y=!0;return}if(U&<(R.relatedTarget)&&Ye(O,R.relatedTarget))return;function P(){return!!(h&&mr(h.nodesRef.current,m).length>0)}function H(){P()||E()}if(P())return;const Y=N.getBoundingClientRect(),Q=O.getBoundingClientRect(),q=i>Q.right-Q.width/2,X=c>Q.bottom-Q.height/2,Z=Q.width>Y.width,$=Q.height>Y.height,K=(Z?Y:Q).left,D=(Z?Y:Q).right,G=($?Y:Q).top,V=($?Y:Q).bottom;if(x==="top"&&c>=Y.bottom-1||x==="bottom"&&c<=Y.top+1||x==="left"&&i>=Y.right-1||x==="right"&&i<=Y.left+1){H();return}let W=!1;switch(x){case"top":W=Ru(A,M,K,Y.top+1,D,Q.bottom-1);break;case"bottom":W=Ru(A,M,K,Q.top+1,D,Y.bottom-1);break;case"left":W=Ru(A,M,Q.right-1,V,Y.left+1,G);break;case"right":W=Ru(A,M,Y.right-1,V,Q.left+1,G);break}if(W)return;if(y&&!F3(A,M,Y)){H();return}if(!U&&j(A,M)){H();return}let ce=!1;switch(x){case"top":{const oe=Z?Dt/2:Dt*4,se=Z||q?i+oe:i-oe,ue=Z?i-oe:q?i+oe:i-oe,ee=c+Dt+1,Re=q||Z?Q.bottom-Dt:Q.top,$e=q?Z?Q.bottom-Dt:Q.top:Q.bottom-Dt;ce=Nu(A,M,se,ee,ue,ee,Q.left,Re,Q.right,$e);break}case"bottom":{const oe=Z?Dt/2:Dt*4,se=Z||q?i+oe:i-oe,ue=Z?i-oe:q?i+oe:i-oe,ee=c-Dt,Re=q||Z?Q.top+Dt:Q.bottom,$e=q?Z?Q.top+Dt:Q.bottom:Q.top+Dt;ce=Nu(A,M,se,ee,ue,ee,Q.left,Re,Q.right,$e);break}case"left":{const oe=$?Dt/2:Dt*4,se=$||X?c+oe:c-oe,ue=$?c-oe:X?c+oe:c-oe,ee=i+Dt+1,Re=X||$?Q.right-Dt:Q.left,$e=X?$?Q.right-Dt:Q.left:Q.right-Dt;ce=Nu(A,M,Re,Q.top,$e,Q.bottom,ee,se,ee,ue);break}case"right":{const oe=$?Dt/2:Dt*4,se=$||X?c+oe:c-oe,ue=$?c-oe:X?c+oe:c-oe,ee=i-Dt,Re=X||$?Q.left+Dt:Q.right,$e=X?$?Q.left+Dt:Q.right:Q.left+Dt;ce=Nu(A,M,ee,se,ee,ue,Re,Q.top,$e,Q.bottom);break}}ce?y||s.start(40,H):H()}};return r.__options={...e,blockPointerEvents:n},r}const K3={...Hw,disabled:Te(e=>e.disabled),instantType:Te(e=>e.instantType),isInstantPhase:Te(e=>e.isInstantPhase),trackCursorAxis:Te(e=>e.trackCursorAxis),disableHoverablePopup:Te(e=>e.disableHoverablePopup),lastOpenChangeReason:Te(e=>e.openChangeReason),closeOnClick:Te(e=>e.closeOnClick),closeDelay:Te(e=>e.closeDelay),hasViewport:Te(e=>e.hasViewport)};class Kh extends Gh{constructor(n,s,r=!1){const i=new Gd,c={...Q3(),...n};c.floatingRootContext=Iw(i,s,r),super(c,{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},K3)}setOpen=(n,s)=>{const r=s.reason,i=r===In,c=n&&r===Yu,d=!n&&(r===Vi||r===Mh);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===In&&(p.instantType=void 0),zw(p,n,s.trigger),this.update(p)};i?Zr.flushSync(f):f()};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,tt(Vi,n))}static useStore(n,s){return Ow(n,(i,c)=>new Kh(s,i,c)).store}}function Q3(){return{...Bw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const Z3=Mj(function(n){const{disabled:s=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:c=!1,trackCursorAxis:d="none",actionsRef:f,onOpenChange:p,onOpenChangeComplete:m,handle:h,triggerId:x,defaultTriggerId:y=null,children:S}=n,w=Kh.useStore(h?.store,{open:r,openProp:i,activeTriggerId:y,triggerIdProp:x});Sh(()=>{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 _=w.useState("open"),j=!s&&_,E=w.useState("activeTriggerId"),k=w.useState("mounted"),R=w.useState("payload");w.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:c}),w.useSyncedValue("disabled",s),Dw(w);const{forceUnmount:N,transitionStatus:O}=Lw(j,w),A=w.useState("isInstantPhase"),M=w.useState("instantType"),B=w.useState("lastOpenChangeReason"),U=v.useRef(null);Ne(()=>{_&&s&&w.setOpen(!1,tt(Vj))},[_,s,w]),Ne(()=>{O==="ending"&&B===Ts||O!=="ending"&&A?(M!=="delay"&&(U.current=M),w.set("instantType","delay")):U.current!==null&&(w.set("instantType",U.current),U.current=null)},[O,A,B,M,w]),Ne(()=>{j&&E==null&&w.set("payload",void 0)},[w,E,j]);const I=v.useCallback(()=>{w.setOpen(!1,tt($j))},[w]);v.useImperativeHandle(f,()=>({unmount:N,close:I}),[N,I]);const L=j||k||!s&&d!=="none";return o.jsxs(Oj.Provider,{value:w,children:[L&&o.jsx(J3,{store:w,disabled:s,trackCursorAxis:d}),typeof S=="function"?S({payload:R}):S]})});function J3({store:e,disabled:n,trackCursorAxis:s}){const r=e.useState("floatingRootContext"),i=Vh(r,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),c=kA(r,{enabled:!n&&s!=="none",axis:s==="none"?void 0:s}),d=v.useMemo(()=>Ra(c.reference,i.reference),[c.reference,i.reference]),f=v.useMemo(()=>Ra(c.trigger,i.trigger),[c.trigger,i.trigger]),p=v.useMemo(()=>Ra($d,c.floating,i.floating),[c.floating,i.floating]);return Pw(e,{activeTriggerProps:d,inactiveTriggerProps:f,popupProps:p}),null}let Vr=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Kr.startingStyle]="startingStyle",e[e.endingStyle=Kr.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),xd=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const W3={[xd.popupOpen]:""},eM={[xd.popupOpen]:"",[xd.pressed]:""},tM={[Vr.open]:""},nM={[Vr.closed]:""},aM={[Vr.anchorHidden]:""},$w={open(e){return e?W3:null}},sM={open(e){return e?eM:null}},pl={open(e){return e?tM:nM},anchorHidden(e){return e?aM:null}};function vr(e){return Ud(e,"base-ui")}const Gw=v.createContext(void 0);function rM(){return v.useContext(Gw)}let oM=(function(e){return e[e.popupOpen=xd.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const lM=600,Yw="data-base-ui-tooltip-trigger";function y1(e){if("composedPath"in e){const s=e.composedPath();for(let r=0;r<s.length;r+=1){const i=s[r];if(lt(i))return i}}const n=e.target;return lt(n)?n:null}function iM(e){let n=e;for(;n;){if(n.hasAttribute(Yw))return n;const s=n.parentElement;if(s){n=s;continue}const r=n.getRootNode();n="host"in r&<(r.host)?r.host:null}return null}const cM=nT(function(n,s){const{render:r,className:i,style:c,handle:d,payload:f,disabled:p,delay:m,closeOnClick:h=!0,closeDelay:x,id:y,...S}=n,w=tc(!0),_=d?.store??w;if(!_)throw new Error(Rn(82));const j=vr(y),E=_.useState("isTriggerActive",j),k=_.useState("isOpenedByTrigger",j),R=_.useState("floatingRootContext"),N=v.useRef(null),O=m??lM,A=x??0,{registerTrigger:M,isMountedByThisTrigger:B}=M3(j,N,_,{payload:f,closeOnClick:h,closeDelay:A}),U=rM(),{delayRef:I,isInstantPhase:L,hasProvider:P}=ET(R,{open:k}),H=Xh(R);_.useSyncedValue("isInstantPhase",L);const Y=_.useState("disabled"),Q=p??Y,q=cn(Q),X=_.useState("trackCursorAxis"),Z=_.useState("disableHoverablePopup"),$=v.useRef(!1),K=Zn(),D=v.useRef(void 0);function G(){const be=U?.delay,Se=typeof I.current=="object"?I.current.open:void 0;let Ee=O;return P&&(Se!==0?Ee=m??be??O:Ee=0),Ee}function V(be){const Se=N.current;if(!Se||!be)return!1;const Ee=iM(be);return Ee!==null&&Ee!==Se&&Ye(Se,Ee)}function W(be){const Se=V(be);return $.current=Se,Se&&(H.openChangeTimeout.clear(),H.restTimeout.clear(),H.restTimeoutPending=!1,K.clear()),Se}const ce=U3(R,{enabled:!Q,mouseOnly:!0,move:!1,handleClose:!Z&&X!=="both"?X3():null,restMs:G,delay(){const be=typeof I.current=="object"?I.current.close:void 0;let Se=A;return x==null&&P&&(Se=be),{close:Se}},triggerElementRef:N,isActiveTrigger:E,isClosing:()=>_.select("transitionStatus")==="ending",shouldOpen(){return!$.current}}),oe=P3(R,{enabled:!Q}).reference,se=be=>{const Se=$.current,Ee=y1(be),ze=W(Ee),De=N.current,xe=De&&Ee&&Ye(De,Ee);if(ze&&_.select("open")&&_.select("lastOpenChangeReason")===In){_.setOpen(!1,tt(In,be));return}if(Se&&!ze&&xe&&!q.current&&!_.select("open")&&De&&Fr(D.current)){const ke=()=>{!$.current&&!q.current&&!_.select("open")&&_.setOpen(!0,tt(In,be,De))},_e=G();_e===0?(K.clear(),ke()):K.start(_e,ke)}},ue=_.useState("triggerProps",B);return Lt("button",n,{state:{open:k},ref:[s,M,N],props:[ce,oe,B||X!=="none"?ue:void 0,{onMouseOver(be){se(be.nativeEvent)},onFocus(be){V(y1(be.nativeEvent))&&be.preventBaseUIHandler()},onMouseLeave(){$.current=!1,K.clear(),D.current=void 0},onPointerEnter(be){D.current=be.pointerType},onPointerDown(be){D.current=be.pointerType,_.set("closeOnClick",h),h&&!_.select("open")&&_.cancelPendingOpen(be.nativeEvent)},onClick(be){h&&!_.select("open")&&_.cancelPendingOpen(be.nativeEvent)},id:j,[oM.triggerDisabled]:Q?"":void 0,[Yw]:Q?void 0:""},S],stateAttributesMapping:$w})}),Fw=v.createContext(void 0);function uM(){const e=v.useContext(Fw);if(e===void 0)throw new Error(Rn(70));return e}const dM=v.forwardRef(function(n,s){const{children:r,container:i,className:c,render:d,style:f,...p}=n,{portalNode:m,portalSubtree:h}=vw({container:i,ref:s,componentProps:n,elementProps:p});return!h&&!m?null:o.jsxs(v.Fragment,{children:[h,m&&Zr.createPortal(r,m)]})}),fM=v.forwardRef(function(n,s){const{keepMounted:r=!1,...i}=n;return tc().useState("mounted")||r?o.jsx(Fw.Provider,{value:r,children:o.jsx(dM,{ref:s,...i})}):null}),Xw=v.createContext(void 0);function Kw(){const e=v.useContext(Xw);if(e===void 0)throw new Error(Rn(71));return e}const mM=v.createContext(void 0);function Qh(){return v.useContext(mM)?.direction??"ltr"}const pM=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:h=0,offsetParent:x="real"}=Ms(e,n)||{};if(m==null)return{};const y=Qj(h),S={x:s,y:r},w=Ph(i),_=Lh(w),j=await d.getDimensions(m),E=w==="y",k=E?"top":"left",R=E?"bottom":"right",N=E?"clientHeight":"clientWidth",O=c.reference[_]+c.reference[w]-S[w]-c.floating[_],A=S[w]-c.reference[w],M=x==="real"?await d.getOffsetParent?.(m):f.floating;let B=f.floating[N]||c.floating[_];(!B||!await d.isElement?.(M))&&(B=f.floating[N]||c.floating[_]);const U=O/2-A/2,I=B/2-j[_]/2-1,L=Math.min(y[k],I),P=Math.min(y[R],I),H=L,Y=B-j[_]-P,Q=B/2-j[_]/2+U,q=Bg(H,Q,Y),X=!p.arrow&&xr(i)!=null&&Q!==q&&c.reference[_]/2-(Q<H?L:P)-j[_]/2<0,Z=X?Q<H?Q-H:Q-Y:0;return{[w]:S[w]+Z,data:{[w]:q,centerOffset:Q-q-Z,...X&&{alignmentOffset:Z}},reset:X}}}),gM=(e,n)=>({...pM(e),options:[e,n]}),hM={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 h3().fn(e)).data?.referenceHidden||c}}}},Qu={sideX:"left",sideY:"top"},xM={name:"adaptiveOrigin",async fn(e){const{x:n,y:s,rects:{floating:r},elements:{floating:i},platform:c,strategy:d,placement:f}=e,p=Ft(i),m=p.getComputedStyle(i);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:n,y:s,data:Qu};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=xt(i);y={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await c.isElement?.(x)&&(y=await c.getDimensions(x));const S=Jn(f);let w=n,_=s;S==="left"&&(w=y.width-(n+r.width)),S==="top"&&(_=y.height-(s+r.height));const j=S==="left"?"right":Qu.sideX,E=S==="top"?"bottom":Qu.sideY;return{x:w,y:_,data:{sideX:j,sideY:E}}}};function Qw(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 _1(e,n,s){const{rects:r,placement:i}=e;return{side:Qw(n,Jn(i),s),align:xr(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Zw(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:h=5,disableAnchorTracking:x=!1,inline:y,keepMounted:S=!1,floatingRootContext:w,mounted:_,collisionAvoidance:j,shiftCrossAxis:E=!1,nodeId:k,adaptiveOrigin:R,lazyFlip:N=!1,externalTree:O}=e,[A,M]=v.useState(null);!_&&A!==null&&M(null);const B=j.side||"flip",U=j.align||"flip",I=j.fallbackAxisSide||"end",L=typeof n=="function"?n:void 0,P=Me(L),H=L?P:n,Y=cn(n),Q=cn(_),X=Qh()==="rtl",Z=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":X?"left":"right","inline-start":X?"right":"left"}[r],$=c==="center"?Z:`${Z}-${c}`;let K=p;const D=1,G=r==="bottom"?D:0,V=r==="top"?D:0,W=r==="right"?D:0,ce=r==="left"?D:0;typeof K=="number"?K={top:K+G,right:K+ce,bottom:K+V,left:K+W}:K&&(K={top:(K.top||0)+G,right:(K.right||0)+ce,bottom:(K.bottom||0)+V,left:(K.left||0)+W});const oe={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:K},se=v.useRef(null),ue=cn(i),ee=cn(d),Re=typeof i!="function"?i:0,$e=typeof d!="function"?d:0,be=[];y&&be.push(y),be.push(d3(dt=>{const Tt=_1(dt,r,X),Xt=typeof ue.current=="function"?ue.current(Tt):ue.current,yt=typeof ee.current=="function"?ee.current(Tt):ee.current;return{mainAxis:Xt,crossAxis:yt,alignmentAxis:yt}},[Re,$e,X,r]));const Se=U==="none"&&B!=="shift",Ee=!Se&&(m||E||B==="shift"),ze=B==="none"?null:p3({...oe,padding:{top:K.top+D,right:K.right+D,bottom:K.bottom+D,left:K.left+D},mainAxis:!E&&B==="flip",crossAxis:U==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),De=Se?null:f3(dt=>{const Tt=xt(dt.elements.floating).documentElement;return{...oe,rootBoundary:E?{x:0,y:0,width:Tt.clientWidth,height:Tt.clientHeight}:void 0,mainAxis:U!=="none",crossAxis:Ee,limiter:m||E?void 0:m3(Xt=>{if(!se.current)return{};const{width:yt,height:Wt}=se.current.getBoundingClientRect(),Vt=Ea(Jn(Xt.placement)),rn=Vt==="y"?yt:Wt,Tn=Vt==="y"?K.left+K.right:K.top+K.bottom;return{offset:rn/2+Tn/2}})}},[oe,m,E,K,U]);B==="shift"||U==="shift"||c==="center"?be.push(De,ze):be.push(ze,De),be.push(g3({...oe,apply({elements:{floating:dt},availableWidth:Tt,availableHeight:Xt,rects:yt}){if(!Q.current)return;const Wt=dt.style;Wt.setProperty("--available-width",`${Tt}px`),Wt.setProperty("--available-height",`${Xt}px`);const Vt=Ft(dt).devicePixelRatio||1,{x:rn,y:Tn,width:qn,height:ta}=yt.reference,Vn=(Math.round((rn+qn)*Vt)-Math.round(rn*Vt))/Vt,ts=(Math.round((Tn+ta)*Vt)-Math.round(Tn*Vt))/Vt;Wt.setProperty("--anchor-width",`${Vn}px`),Wt.setProperty("--anchor-height",`${ts}px`)}}),gM(dt=>({element:se.current||xt(dt.elements.floating).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(dt){const{elements:Tt,middlewareData:Xt,placement:yt,rects:Wt,y:Vt}=dt,rn=Jn(yt),Tn=Ea(rn),qn=se.current,ta=Xt.arrow?.x||0,Vn=Xt.arrow?.y||0,ts=qn?.clientWidth||0,An=qn?.clientHeight||0,na=ta+ts/2,Aa=Vn+An/2,ns=Math.abs(Xt.shift?.y||0),at=Wt.reference.height/2,At=typeof i=="function"?i(_1(dt,r,X)):i,yn=ns>At,en={top:`${na}px calc(100% + ${At}px)`,bottom:`${na}px ${-At}px`,left:`calc(100% + ${At}px) ${Aa}px`,right:`${-At}px ${Aa}px`}[rn],kt=`${na}px ${Wt.reference.y+at-Vt}px`;return Tt.floating.style.setProperty("--transform-origin",Ee&&Tn==="y"&&yn?kt:en),{}}},hM,R),Ne(()=>{!_&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,w]);const xe=v.useMemo(()=>({elementResize:!x&&typeof ResizeObserver<"u",layoutShift:!x&&typeof IntersectionObserver<"u"}),[x]),{refs:ke,elements:_e,x:Le,y:Ge,middlewareData:qe,update:Oe,placement:ve,context:le,isPositioned:ye,floatingStyles:je}=L3({rootContext:w,open:S?_:void 0,placement:$,middleware:be,strategy:s,whileElementsMounted:S?void 0:(...dt)=>f1(...dt,xe),nodeId:k,externalTree:O}),{sideX:Be,sideY:Ze}=qe.adaptiveOrigin||Qu,_t=ye?s:"fixed",Ht=v.useMemo(()=>{const dt=R?{position:_t,[Be]:Le,[Ze]:Ge}:{position:_t,...je};return ye||(dt.opacity=0),dt},[R,_t,Be,Le,Ze,Ge,je,ye]),vt=v.useRef(null);Ne(()=>{if(!_)return;const dt=Y.current,Tt=typeof dt=="function"?dt():dt,yt=(j1(Tt)?Tt.current:Tt)||null||null;yt!==vt.current&&(ke.setPositionReference(yt),vt.current=yt)},[_,ke,H,Y]),v.useEffect(()=>{if(!_)return;const dt=Y.current;typeof dt!="function"&&j1(dt)&&dt.current!==vt.current&&(ke.setPositionReference(dt.current),vt.current=dt.current)},[_,ke,H,Y]),v.useEffect(()=>{if(S&&_&&_e.domReference&&_e.floating)return f1(_e.domReference,_e.floating,Oe,xe)},[S,_,_e,Oe,xe]);const ut=Jn(ve),it=Qw(r,ut,X),Et=xr(ve)||"center",Bt=!!qe.hide?.referenceHidden;Ne(()=>{N&&_&&ye&&M(ut)},[N,_,ye,ut]);const pa=v.useMemo(()=>({position:"absolute",top:qe.arrow?.y,left:qe.arrow?.x}),[qe.arrow]),gn=qe.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ht,arrowStyles:pa,arrowRef:se,arrowUncentered:gn,side:it,align:Et,physicalSide:ut,anchorHidden:Bt,refs:ke,context:le,isPositioned:ye,update:Oe}),[Ht,pa,se,gn,it,Et,ut,Bt,ke,le,ye,Oe])}function j1(e){return e!=null&&"current"in e}function Zh(e){return e==="starting"?mA:an}function Jw(e,n,{styles:s,transitionStatus:r,props:i,refs:c,hidden:d,inert:f=!1}){const p={...s};return f&&(p.pointerEvents="none"),Lt("div",e,{state:n,ref:c,props:[{role:"presentation",hidden:d,style:p},Zh(r),i],stateAttributesMapping:pl})}const bM=v.forwardRef(function(n,s){const{render:r,className:i,anchor:c,positionMethod:d="absolute",side:f="top",align:p="center",sideOffset:m=0,alignOffset:h=0,collisionBoundary:x="clipping-ancestors",collisionPadding:y=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:_=!1,collisionAvoidance:j=hA,style:E,...k}=n,R=tc(),N=uM(),O=R.useState("open"),A=R.useState("mounted"),M=R.useState("trackCursorAxis"),B=R.useState("disableHoverablePopup"),U=R.useState("floatingRootContext"),I=R.useState("instantType"),L=R.useState("transitionStatus"),P=R.useState("hasViewport"),H=Zw({anchor:c,positionMethod:d,floatingRootContext:U,mounted:A,side:f,sideOffset:m,align:p,alignOffset:h,collisionBoundary:x,collisionPadding:y,sticky:w,arrowPadding:S,disableAnchorTracking:_,keepMounted:N,collisionAvoidance:j,adaptiveOrigin:P?xM:void 0}),Y=v.useMemo(()=>({open:O,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:M!=="none"?"tracking-cursor":I}),[O,H.side,H.align,H.anchorHidden,M,I]),Q=Jw(n,Y,{styles:H.positionerStyles,transitionStatus:L,props:k,refs:[s,R.useStateSetter("positionerElement")],hidden:!A,inert:!O||M==="both"||B});return o.jsx(Xw.Provider,{value:H,children:Q})}),vM={...pl,...ml},yM=v.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=tc(),{side:p,align:m}=Kw(),h=f.useState("open"),x=f.useState("instantType"),y=f.useState("transitionStatus"),S=f.useState("popupProps"),w=f.useState("floatingRootContext"),_=f.useState("disabled"),j=f.useState("closeDelay");br({open:h,ref:f.context.popupRef,onComplete(){h&&f.context.onOpenChangeComplete?.(!0)}}),B3(w,{enabled:!_,closeDelay:j});const E=f.useStateSetter("popupElement");return Lt("div",n,{state:{open:h,side:p,align:m,instant:x,transitionStatus:y},ref:[s,f.context.popupRef,E],props:[S,Zh(y),d],stateAttributesMapping:vM})}),_M=v.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=tc(),{arrowRef:p,side:m,align:h,arrowUncentered:x,arrowStyles:y}=Kw(),S=f.useState("open"),w=f.useState("instantType");return Lt("div",n,{state:{open:S,side:m,align:h,uncentered:x,instant:w},ref:[s,p],props:[{style:y,"aria-hidden":!0},d],stateAttributesMapping:pl})}),jM=function(n){const{delay:s,closeDelay:r,timeout:i=400}=n,c=v.useMemo(()=>({delay:s,closeDelay:r}),[s,r]),d=v.useMemo(()=>({open:s,close:r}),[s,r]);return o.jsx(Gw.Provider,{value:c,children:o.jsx(CT,{delay:d,timeoutMs:i,children:n.children})})};function Jh(e){return Ih(19)?e:e?"true":void 0}function wM(e){const[n,s]=v.useState({current:e,previous:null});return e!==n.current&&s({current:e,previous:n.current}),n.previous}function Pt(...e){return Aj(jh(e))}function SM({delay:e=0,...n}){return o.jsx(jM,{"data-slot":"tooltip-provider",delay:e,...n})}function Wh({...e}){return o.jsx(Z3,{"data-slot":"tooltip",...e})}function ex({...e}){return o.jsx(cM,{"data-slot":"tooltip-trigger",...e})}function tx({className:e,side:n="top",sideOffset:s=4,align:r="center",alignOffset:i=0,children:c,...d}){return o.jsx(fM,{children:o.jsx(bM,{align:r,alignOffset:i,side:n,sideOffset:s,className:"isolate z-50",children:o.jsxs(yM,{"data-slot":"tooltip-content",className:Pt("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(_M,{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 fi({label:e,active:n,onClick:s,isAdd:r,isSettings:i,isDefault:c,icon:d,title:f,testId:p}){const m=e.trim()||"·",{initials:h,subLabel:x}=CM(m),y=r||i?"indigo":kM(m),S=x&&!r&&!i&&!c;return o.jsxs(Wh,{children:[o.jsx(ex,{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:Ae("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&&AM(y),!r&&!i&&!c&&!n&&TM(y)),children:d??h}),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(tx,{side:"right",children:f||e})]})}function CM(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:EM(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 EM(e){return e.length>6?e.slice(0,5)+"…":e}function kM(e){let n=0;for(let s=0;s<e.length;s++)n=n*31+e.charCodeAt(s)|0;return B0[Math.abs(n)%B0.length]}const NM={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"},RM={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 TM(e){return NM[e]}function AM(e){return RM[e]}function Jo({content:e,side:n="top",children:s}){return e?o.jsxs(Wh,{children:[o.jsx(ex,{render:s}),o.jsx(tx,{side:n,children:e})]}):s}const Ww=0,eS=1,tS=2,w1=3;var S1=Object.prototype.hasOwnProperty;function $g(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--&&$g(e[r],n[r]););return r===-1}if(!s||typeof e=="object"){r=0;for(s in e)if(S1.call(e,s)&&++r&&!S1.call(n,s)||!(s in n)||!$g(e[s],n[s]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const ws=new WeakMap,Ss=()=>{},Ln=Ss(),Gg=Object,ht=e=>e===Ln,Fa=e=>typeof e=="function",pr=(e,n)=>({...e,...n}),nS=e=>Fa(e.then),Ip={},Tu={},nx="undefined",sc=typeof window!=nx,Yg=typeof document!=nx,MM=sc&&"Deno"in window,OM=()=>sc&&typeof window.requestAnimationFrame!=nx,aS=(e,n)=>{const s=ws.get(e);return[()=>!ht(n)&&e.get(n)||Ip,r=>{if(!ht(n)){const i=e.get(n);n in Tu||(Tu[n]=i),s[5](n,pr(i,r),i||Ip)}},s[6],()=>!ht(n)&&n in Tu?Tu[n]:!ht(n)&&e.get(n)||Ip]};let Fg=!0;const zM=()=>Fg,[Xg,Kg]=sc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ss,Ss],DM=()=>{const e=Yg&&document.visibilityState;return ht(e)||e!=="hidden"},LM=e=>(Yg&&document.addEventListener("visibilitychange",e),Xg("focus",e),()=>{Yg&&document.removeEventListener("visibilitychange",e),Kg("focus",e)}),PM=e=>{const n=()=>{Fg=!0,e()},s=()=>{Fg=!1};return Xg("online",n),Xg("offline",s),()=>{Kg("online",n),Kg("offline",s)}},BM={isOnline:zM,isVisible:DM},IM={initFocus:LM,initReconnect:PM},C1=!Qi.useId,Fo=!sc||MM,UM=e=>OM()?window.requestAnimationFrame(e):setTimeout(e,1),Up=Fo?v.useEffect:v.useLayoutEffect,Hp=typeof navigator<"u"&&navigator.connection,E1=!Fo&&Hp&&(["slow-2g","2g"].includes(Hp.effectiveType)||Hp.saveData),Au=new WeakMap,HM=e=>Gg.prototype.toString.call(e),qp=(e,n)=>e===`[object ${n}]`;let qM=0;const Qg=e=>{const n=typeof e,s=HM(e),r=qp(s,"Date"),i=qp(s,"RegExp"),c=qp(s,"Object");let d,f;if(Gg(e)===e&&!r&&!i){if(d=Au.get(e),d)return d;if(d=++qM+"~",Au.set(e,d),Array.isArray(e)){for(d="@",f=0;f<e.length;f++)d+=Qg(e[f])+",";Au.set(e,d)}if(c){d="#";const p=Gg.keys(e).sort();for(;!ht(f=p.pop());)ht(e[f])||(d+=f+":"+Qg(e[f])+",");Au.set(e,d)}}else d=r?e.toJSON():n=="symbol"?e.toString():n=="string"?JSON.stringify(e):""+e;return d},ax=e=>{if(Fa(e))try{e=e()}catch{e=""}const n=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Qg(e):"",[e,n]};let VM=0;const Zg=()=>++VM;async function sS(...e){const[n,s,r,i]=e,c=pr({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,h=c.throwOnError;if(Fa(s)){const y=s,S=[],w=n.keys();for(const _ of w)!/^\$(inf|sub)\$/.test(_)&&y(n.get(_)._k)&&S.push(_);return Promise.all(S.map(x))}return x(s);async function x(y){const[S]=ax(y);if(!S)return;const[w,_]=aS(n,S),[j,E,k,R]=ws.get(n),N=()=>{const Y=j[S];return(Fa(c.revalidate)?c.revalidate(w().data,y):c.revalidate!==!1)&&(delete k[S],delete R[S],Y&&Y[0])?Y[0](tS).then(()=>w().data):w().data};if(e.length<3)return N();let O=r,A,M=!1;const B=Zg();E[S]=[B,0];const U=!ht(p),I=w(),L=I.data,P=I._c,H=ht(P)?L:P;if(U&&(p=Fa(p)?p(H,L):p,_({data:p,_c:H})),Fa(O))try{O=O(H)}catch(Y){A=Y,M=!0}if(O&&nS(O))if(O=await O.catch(Y=>{A=Y,M=!0}),B!==E[S][0]){if(M)throw A;return O}else M&&U&&m(A)&&(d=!0,_({data:H,_c:Ln}));if(d&&!M)if(Fa(d)){const Y=d(O,H);_({data:Y,error:Ln,_c:Ln})}else _({data:O,error:Ln,_c:Ln});if(E[S][1]=Zg(),Promise.resolve(N()).then(()=>{_({_c:Ln})}),M){if(h)throw A;return}return O}}const k1=(e,n)=>{for(const s in e)e[s][0]&&e[s][0](n)},$M=(e,n)=>{if(!ws.has(e)){const s=pr(IM,n),r=Object.create(null),i=sS.bind(Ln,e);let c=Ss;const d=Object.create(null),f=(h,x)=>{const y=d[h]||[];return d[h]=y,y.push(x),()=>y.splice(y.indexOf(x),1)},p=(h,x,y)=>{e.set(h,x);const S=d[h];if(S)for(const w of S)w(x,y)},m=()=>{if(!ws.has(e)&&(ws.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,p,f]),!Fo)){const h=s.initFocus(setTimeout.bind(Ln,k1.bind(Ln,r,Ww))),x=s.initReconnect(setTimeout.bind(Ln,k1.bind(Ln,r,eS)));c=()=>{h&&h(),x&&x(),ws.delete(e)}}};return m(),[e,i,m,c]}return[e,ws.get(e)[4]]},GM=(e,n,s,r,i)=>{const c=s.errorRetryCount,d=i.retryCount,f=~~((Math.random()+.5)*(1<<(d<8?d:8)))*s.errorRetryInterval;!ht(c)&&d>c||setTimeout(r,f,i)},YM=$g,[rS,FM]=$M(new Map),XM=pr({onLoadingSlow:Ss,onSuccess:Ss,onError:Ss,onErrorRetry:GM,onDiscarded:Ss,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:E1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:E1?5e3:3e3,compare:YM,isPaused:()=>!1,cache:rS,mutate:FM,fallback:{}},BM),KM=(e,n)=>{const s=pr(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=pr(i,d))}return s},QM=v.createContext({}),ZM="$inf$",oS=sc&&window.__SWR_DEVTOOLS_USE__,JM=oS?window.__SWR_DEVTOOLS_USE__:[],WM=()=>{oS&&(window.__SWR_DEVTOOLS_REACT__=Qi)},e5=e=>Fa(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],lS=()=>{const e=v.useContext(QM);return v.useMemo(()=>pr(XM,e),[e])},t5=e=>(n,s,r)=>e(n,s&&((...c)=>{const[d]=ax(n),[,,,f]=ws.get(rS);if(d.startsWith(ZM))return s(...c);const p=f[d];return ht(p)?s(...c):(delete f[d],p)}),r),n5=JM.concat(t5),a5=e=>function(...s){const r=lS(),[i,c,d]=e5(s),f=KM(r,d);let p=e;const{use:m}=f,h=(m||[]).concat(n5);for(let x=h.length;x--;)p=h[x](p);return p(i,c||f.fetcher||null,f)},s5=(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())}};WM();const Vp=Qi.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}}),$p={dedupe:!0},N1=Promise.resolve(Ln),r5=()=>Ss,o5=(e,n,s)=>{const{cache:r,compare:i,suspense:c,fallbackData:d,revalidateOnMount:f,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:h,refreshWhenOffline:x,keepPreviousData:y,strictServerPrefetchWarning:S}=s,[w,_,j,E]=ws.get(r),[k,R]=ax(e),N=v.useRef(!1),O=v.useRef(!1),A=v.useRef(k),M=v.useRef(n),B=v.useRef(s),U=()=>B.current,I=()=>U().isVisible()&&U().isOnline(),[L,P,H,Y]=aS(r,k),Q=v.useRef({}).current,q=ht(d)?ht(s.fallback)?Ln:s.fallback[k]:d,X=(xe,ke)=>{for(const _e in Q){const Le=_e;if(Le==="data"){if(!i(xe[Le],ke[Le])&&(!ht(xe[Le])||!i(oe,ke[Le])))return!1}else if(ke[Le]!==xe[Le])return!1}return!0},Z=!N.current,$=v.useMemo(()=>{const xe=L(),ke=Y(),_e=Oe=>{const ve=pr(Oe);return delete ve._k,(()=>{if(!k||!n||U().isPaused())return!1;if(Z&&!ht(f))return f;const ye=ht(q)?ve.data:q;return ht(ye)||p})()?{isValidating:!0,isLoading:!0,...ve}:ve},Le=_e(xe),Ge=xe===ke?Le:_e(ke);let qe=Le;return[()=>{const Oe=_e(L());return X(Oe,qe)?(qe.data=Oe.data,qe.isLoading=Oe.isLoading,qe.isValidating=Oe.isValidating,qe.error=Oe.error,qe):(qe=Oe,Oe)},()=>Ge]},[r,k]),K=pd.useSyncExternalStore(v.useCallback(xe=>H(k,(ke,_e)=>{X(_e,ke)||xe()}),[r,k]),$[0],$[1]),D=w[k]&&w[k].length>0,G=K.data,V=ht(G)?q&&nS(q)?Vp(q):q:G,W=K.error,ce=v.useRef(V),oe=y?ht(G)?ht(ce.current)?V:ce.current:G:V,se=k&&ht(V),ue=v.useRef(null);!Fo&&pd.useSyncExternalStore(r5,()=>(ue.current=!1,ue),()=>(ue.current=!0,ue));const ee=ue.current;S&&ee&&!c&&se&&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 Re=!k||!n||U().isPaused()||D&&!ht(W)?!1:Z&&!ht(f)?f:c?ht(V)?!1:p:ht(V)||p,$e=Z&&Re,be=ht(K.isValidating)?$e:K.isValidating,Se=ht(K.isLoading)?$e:K.isLoading,Ee=v.useCallback(async xe=>{const ke=M.current;if(!k||!ke||O.current||U().isPaused())return!1;let _e,Le,Ge=!0;const qe=xe||{},Oe=!j[k]||!qe.dedupe,ve=()=>C1?!O.current&&k===A.current&&N.current:k===A.current,le={isValidating:!1,isLoading:!1},ye=()=>{P(le)},je=()=>{const Ze=j[k];Ze&&Ze[1]===Le&&delete j[k]},Be={isValidating:!0};ht(L().data)&&(Be.isLoading=!0);try{if(Oe&&(P(Be),s.loadingTimeout&&ht(L().data)&&setTimeout(()=>{Ge&&ve()&&U().onLoadingSlow(k,s)},s.loadingTimeout),j[k]=[ke(R),Zg()]),[_e,Le]=j[k],_e=await _e,Oe&&setTimeout(je,s.dedupingInterval),!j[k]||j[k][1]!==Le)return Oe&&ve()&&U().onDiscarded(k),!1;le.error=Ln;const Ze=_[k];if(!ht(Ze)&&(Le<=Ze[0]||Le<=Ze[1]||Ze[1]===0))return ye(),Oe&&ve()&&U().onDiscarded(k),!1;const _t=L().data;le.data=i(_t,_e)?_t:_e,Oe&&ve()&&U().onSuccess(_e,k,s)}catch(Ze){je();const _t=U(),{shouldRetryOnError:Ht}=_t;_t.isPaused()||(le.error=Ze,Oe&&ve()&&(_t.onError(Ze,k,_t),(Ht===!0||Fa(Ht)&&Ht(Ze))&&(!U().revalidateOnFocus||!U().revalidateOnReconnect||I())&&_t.onErrorRetry(Ze,k,_t,vt=>{const ut=w[k];ut&&ut[0]&&ut[0](w1,vt)},{retryCount:(qe.retryCount||0)+1,dedupe:!0})))}return Ge=!1,ye(),!0},[k,r]),ze=v.useCallback((...xe)=>sS(r,A.current,...xe),[]);if(Up(()=>{M.current=n,B.current=s,ht(G)||(ce.current=G)}),Up(()=>{if(!k)return;const xe=Ee.bind(Ln,$p);let ke=0;U().revalidateOnFocus&&(ke=Date.now()+U().focusThrottleInterval);const Le=s5(k,w,(Ge,qe={})=>{if(Ge==Ww){const Oe=Date.now();U().revalidateOnFocus&&Oe>ke&&I()&&(ke=Oe+U().focusThrottleInterval,xe())}else if(Ge==eS)U().revalidateOnReconnect&&I()&&xe();else{if(Ge==tS)return Ee();if(Ge==w1)return Ee(qe)}});return O.current=!1,A.current=k,N.current=!0,P({_k:R}),Re&&(j[k]||(ht(V)||Fo?xe():UM(xe))),()=>{O.current=!0,Le()}},[k]),Up(()=>{let xe;function ke(){const Le=Fa(m)?m(L().data):m;Le&&xe!==-1&&(xe=setTimeout(_e,Le))}function _e(){!L().error&&(h||U().isVisible())&&(x||U().isOnline())?Ee($p).then(ke):ke()}return ke(),()=>{xe&&(clearTimeout(xe),xe=-1)}},[m,h,x,k]),v.useDebugValue(oe),c){if(!C1&&Fo&&se)throw new Error("Fallback data is required when using Suspense in SSR.");se&&(M.current=n,B.current=s,O.current=!1);const xe=E[k],ke=!ht(xe)&&se?ze(xe):N1;if(Vp(ke),!ht(W)&&se)throw W;const _e=se?Ee($p):N1;!ht(oe)&&se&&(_e.status="fulfilled",_e.value=!0),Vp(_e)}return{mutate:ze,get data(){return Q.data=!0,oe},get error(){return Q.error=!0,W},get isValidating(){return Q.isValidating=!0,be},get isLoading(){return Q.isLoading=!0,Se}}},Qe=a5(o5);let Wo=null;function Hr(e){Wo=e}function sx(){return Wo}class rc extends Error{status;body;constructor(n,s,r){super(s),this.status=n,this.body=r}}async function mi(e,n,s,r={}){const i={"content-type":"application/json",...Wo?{authorization:`Bearer ${Wo}`}:{},...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 rc(c.status,`${e} ${n} → ${c.status}: ${d}`,f)}if(c.status!==204)return await c.json()}const ge={get:e=>mi("GET",e),post:(e,n)=>mi("POST",e,n),put:(e,n)=>mi("PUT",e,n),patch:(e,n)=>mi("PATCH",e,n),del:e=>mi("DELETE",e)};async function iS(e,n,s,r){const i=await fetch(e,{method:"POST",signal:r,headers:{"content-type":"application/json",...Wo?{authorization:`Bearer ${Wo}`}:{}},body:JSON.stringify(n)});if(!i.ok||!i.body){const p=await i.text().catch(()=>"");throw new rc(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 h=f.indexOf(`
|
|
542
|
-
`);for(;h>=0;){const x=f.slice(0,h).trim();if(f=f.slice(h+1),x)try{s(JSON.parse(x))}catch{}h=f.indexOf(`
|
|
543
|
-
`)}}if(f.trim())try{s(JSON.parse(f.trim()))}catch{}}const l5={get:()=>ge.get("/health")},Qn={list:()=>ge.get("/projects"),register:e=>ge.post("/projects",{path:e}),remove:e=>ge.del(`/projects/${encodeURIComponent(e)}`),rebuild:e=>ge.post(`/projects/${encodeURIComponent(e)}/rebuild`),config:{show:e=>ge.get(`/projects/${e}/config`),set:(e,n)=>ge.patch(`/projects/${e}/config`,{set:n}),unset:(e,n)=>ge.patch(`/projects/${e}/config`,{unset:n}),put:(e,n)=>ge.put(`/projects/${e}/config`,n)},apcProject:{set:(e,n,s)=>ge.patch(`/projects/${e}/apc-project`,{set:n,unset:s}),put:(e,n)=>ge.put(`/projects/${e}/apc-project`,n)},memory:{get:e=>ge.get(`/projects/${e}/memory`),put:(e,n)=>ge.put(`/projects/${e}/memory`,{body:n})}},Jt={list:e=>ge.get(`/projects/${e}/agents`),get:(e,n)=>ge.get(`/projects/${e}/agents/${n}`),create:(e,n)=>ge.post(`/projects/${e}/agents`,n),update:(e,n,s)=>ge.patch(`/projects/${e}/agents/${encodeURIComponent(n)}`,s),remove:(e,n)=>ge.del(`/projects/${e}/agents/${encodeURIComponent(n)}`),chat:(e,n,s)=>ge.post(`/projects/${e}/agents/${encodeURIComponent(n)}/chat`,s),memory:{get:(e,n)=>ge.get(`/projects/${e}/agents/${n}/memory`),put:(e,n,s)=>ge.put(`/projects/${e}/agents/${n}/memory`,{body:s})},vault:e=>ge.get(e?.includeRemoved?"/agents/vault?include_removed=1":"/agents/vault"),vaultCreate:(e,n={},s="")=>ge.post("/agents/vault",{slug:e,fields:n,body:s}),vaultPatch:(e,n)=>ge.patch(`/agents/vault/${encodeURIComponent(e)}`,n),vaultRemove:e=>ge.del(`/agents/vault/${encodeURIComponent(e)}`),vaultRestore:e=>ge.post(`/agents/vault/${encodeURIComponent(e)}/restore`),import:(e,n)=>ge.post(`/projects/${e}/agents/import`,{slug:n})},rx={list:(e,n)=>ge.get(`/projects/${e}/agents/${n}/conversations`),get:(e,n,s)=>ge.get(`/projects/${e}/agents/${n}/conversations/${s}`),compact:(e,n,s)=>ge.post(s?`/projects/${e}/agents/${n}/conversations/${s}/compact`:`/projects/${e}/agents/${n}/compact`,{})},or={list:e=>ge.get(`/projects/${e}/routines`),get:(e,n)=>ge.get(`/projects/${e}/routines/${n}`),run:(e,n)=>ge.post(`/projects/${e}/routines/${n}/run`),enable:(e,n)=>ge.post(`/projects/${e}/routines/${n}/enable`),disable:(e,n)=>ge.post(`/projects/${e}/routines/${n}/disable`),upsert:(e,n)=>ge.post(`/projects/${e}/routines`,n),remove:(e,n)=>ge.del(`/projects/${e}/routines/${encodeURIComponent(n)}`)},lr={list:(e,n="open")=>ge.get(`/projects/${e}/tasks?state=${n}`),global:(e="open")=>ge.get(`/tasks?state=${e}`),add:(e,n)=>ge.post(`/projects/${e}/tasks`,n),done:(e,n)=>ge.post(`/projects/${e}/tasks/${n}/done`),drop:(e,n)=>ge.post(`/projects/${e}/tasks/${n}/drop`),reopen:(e,n)=>ge.post(`/projects/${e}/tasks/${n}/reopen`)},Mi={list:e=>ge.get(`/projects/${e}/mcps`),check:e=>ge.get(`/projects/${e}/mcps/check`),add:(e,n,s)=>ge.post(`/projects/${e}/mcps?scope=${n}`,s),remove:(e,n,s="shared")=>ge.del(`/projects/${e}/mcps/${encodeURIComponent(n)}?scope=${s}`)},Gp=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}`:""},Jg={global:(e={})=>ge.get(`/messages/global${Gp(e)}`),project:(e,n={})=>ge.get(`/projects/${e}/messages${Gp(n)}`),search:(e,n,s=50)=>ge.get(`/projects/${e}/messages/search${Gp({q:n,limit:s})}`)},i5={global:e=>ge.get(`/sessions${e?`?engine=${encodeURIComponent(e)}`:""}`)},c5={list:()=>ge.get("/tools")},kn={channels:{list:()=>ge.get("/telegram/channels"),upsert:e=>ge.post("/telegram/channels",e),patch:(e,n)=>ge.patch(`/telegram/channels/${e}`,n),remove:e=>ge.del(`/telegram/channels/${encodeURIComponent(e)}`)},contacts:{list:()=>ge.get("/telegram/contacts"),patch:(e,n)=>ge.patch(`/telegram/contacts/${encodeURIComponent(String(e))}`,n),remove:e=>ge.del(`/telegram/contacts/${encodeURIComponent(String(e))}`)},roles:{list:()=>ge.get("/telegram/roles"),set:(e,n)=>ge.put(`/telegram/roles/${encodeURIComponent(e)}`,{tools:n}),remove:e=>ge.del(`/telegram/roles/${encodeURIComponent(e)}`)},status:()=>ge.get("/telegram/status"),start:()=>ge.post("/telegram/start"),stop:()=>ge.post("/telegram/stop"),send:e=>ge.post("/telegram/send",e)},bd={list:()=>ge.get("/engines"),models:e=>ge.post("/engines/models",e)},el={reload:()=>ge.post("/admin/reload"),shutdown:()=>ge.post("/admin/shutdown"),config:{get:()=>ge.get("/admin/config"),patch:e=>ge.patch("/admin/config",e)},superAgent:()=>ge.get("/admin/super-agent"),logs:(e="errors",n=200)=>ge.get(`/admin/logs?file=${e}&limit=${n}`)},tl={list:()=>ge.get("/pair/list"),revoke:e=>ge.del(`/pair/revoke/${encodeURIComponent(e)}`),init:()=>ge.post("/pair/init",{}),status:e=>ge.get(`/pair/status/${encodeURIComponent(e)}`),confirm:e=>ge.post("/pair/confirm",e)},R1={get:()=>ge.get("/identity"),patch:e=>ge.patch("/identity",e)},cS={send:(e,n)=>ge.post(`/projects/${e}/super-agent/chat`,n),stream:(e,n,s,r)=>iS(`/projects/${e}/super-agent/chat/stream`,n,s,r),summarize:e=>ge.post("/super-agent/summarize",e)},u5={dirs:e=>ge.get(`/admin/fs/dirs?path=${encodeURIComponent(e)}`)},d5=["alloy","echo","fable","onyx","nova","shimmer"],f5=["Kore","Puck","Charon","Fenrir","Aoede"],m5=["eleven_multilingual_v2","eleven_turbo_v2_5","eleven_flash_v2_5"],p5=["tts-1","tts-1-hd"],g5=["tiny","base","small","medium","large-v2","large-v3"],vd={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 h5(e){const n=sx(),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 uS={providers:()=>ge.get("/tts/providers"),say:e=>ge.post("/tts/say",e),turn:e=>ge.post("/voice/turn",e)},T1={manifest:()=>ge.get("/deck/manifest"),setWidget:(e,n)=>ge.patch(`/deck/widgets/${encodeURIComponent(e)}`,n),exec:e=>ge.post("/deck/exec",e)},Ur=e=>`/projects/${e}/code/sessions`,sr={sessions:{list:e=>ge.get(Ur(e)).then(n=>n.sessions),get:(e,n)=>ge.get(`${Ur(e)}/${n}`),create:(e,n={})=>ge.post(Ur(e),n),update:(e,n,s)=>ge.patch(`${Ur(e)}/${n}`,s),remove:(e,n)=>ge.del(`${Ur(e)}/${n}`)},changes:(e,n)=>ge.get(`${Ur(e)}/${n}/changes`),stream:(e,n,s,r,i)=>iS(`${Ur(e)}/${n}/chat/stream`,s,r,i)},Zu={list:e=>ge.get(`/projects/${encodeURIComponent(e)}/artifacts`),read:(e,n)=>ge.get(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`),run:(e,n,s=[])=>ge.post(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}/run`,{args:s}),remove:(e,n)=>ge.del(`/projects/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(n)}`)};function oc(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/projects",()=>Qn.list(),{refreshInterval:Ad.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 dS(e){const{projects:n,isLoading:s,mutate:r}=oc();return{project:n.find(c=>String(c.id)===e)??null,isLoading:s,mutate:r}}const x5={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:"Conversaciones directas con agentes del proyecto. El super-agent no interviene.",roby_title:"Chat con Roby",roby_subtitle:"Chat con Roby — 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
|
|
544
|
-
|
|
545
|
-
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"},roby:{title:"Roby",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 Roby para arrancar.",thinking:"Roby está pensando…",talk:"Hablar con Roby",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]"}},b5={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.",roby_title:"Chat with Roby",roby_subtitle:"Chat with Roby — 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
|
|
546
|
-
|
|
547
|
-
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"},roby:{title:"Roby",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 Roby a message to get started.",thinking:"Roby is thinking…",talk:"Talk to Roby",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]"}},ox={es:x5,en:b5};function v5(){try{const e=localStorage.getItem(Cn.language);if(e&&e in ox)return e}catch{}return"es"}let Fd=v5();function y5(e){Fd=e;try{localStorage.setItem(Cn.language,e)}catch{}}const _5=[{value:"es",label:"Español"},{value:"en",label:"English"}];function j5(){return Fd}function w5(e){const n=ox[Fd],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 S5(e,n){return n?e.replace(/\{(\w+)\}/g,(s,r)=>r in n?String(n[r]):`{${r}}`):e}function C5(e){const n=w5(e);if(n!==void 0)return n;if(Fd!=="es"){const s=ox.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 C(e,n){const s=C5(e);return s===void 0?e:S5(s,n)}function E5(){return[{id:"voice",label:C("nav.modules.voice"),href:"/m/voice",icon:sR},{id:"desktop",label:C("nav.modules.desktop"),href:"/m/desktop",icon:rR},{id:"deck",label:C("nav.modules.deck"),href:"/m/deck",icon:WN},{id:"code",label:C("nav.modules.code"),href:"/m/code",icon:Ii}]}function k5({onSelect:e,onOpenRoby:n}){const{projects:s,isLoading:r}=oc(),i=ea(),c=E5(),d=m=>i.pathname===m||i.pathname.startsWith(`${m}/`),f=s.find(m=>String(m.id)==="0"),p=s.filter(m=>String(m.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(Jo,{content:C("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(jR,{size:36})})}),r&&o.jsx("div",{className:"size-10 animate-pulse rounded-xl bg-muted"}),f&&o.jsx(fi,{label:C("base.title"),testId:"project-avatar-0",title:C("base.subtitle"),active:d("/p/0"),isDefault:!0,icon:o.jsx("img",{src:"/modules/superagent.png",alt:C("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(m=>o.jsx(fi,{label:m.label,testId:`module-avatar-${m.id}`,title:m.label,active:d(m.href),icon:o.jsx(m.icon,{size:18}),onClick:()=>e(m.href)},m.id)),p.length>0&&o.jsx("div",{className:"my-0.5 h-px w-8 rounded-full bg-border"}),p.map(m=>{const h=m.name||m.path.split("/").pop()||String(m.id),x=`/p/${m.id}`;return o.jsx(fi,{label:h,testId:`project-avatar-${m.id}`,title:`${h} — ${m.path}`,active:d(x),onClick:()=>e(x)},m.id)}),o.jsx(fi,{label:"Add",isAdd:!0,testId:"nav-add-project",icon:o.jsx(Nn,{size:18}),active:!1,onClick:()=>e("/?action=add-project"),title:C("nav.add_project")}),o.jsx("div",{className:"flex-1"}),o.jsx(fi,{label:"Settings",isSettings:!0,testId:"nav-settings",icon:o.jsx(sd,{size:16}),active:i.pathname==="/settings"||i.pathname.startsWith("/settings/"),onClick:()=>e("/settings"),title:C("nav.settings")}),o.jsx(Jo,{content:C("roby.talk"),side:"right",children:o.jsx("button",{type:"button",onClick:n,"data-testid":"nav-roby","aria-label":C("roby.talk"),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 fS(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 C("nav.project")}}function He({title:e,description:n,action:s,className:r,children:i}){return o.jsxs("section",{className:Ae("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 A1({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 Xd({ok:e}){return o.jsx("span",{className:Ae("inline-block size-2 rounded-full",e===null?"bg-muted-fg":e?"bg-emerald-500":"bg-red-500")})}const mS=v.createContext(void 0);function pS(e=!1){const n=v.useContext(mS);if(n===void 0&&!e)throw new Error(Rn(16));return n}function N5(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:v.useMemo(()=>{const m={onKeyDown(h){s&&n&&h.key!=="Tab"&&h.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 gl(e={}){const{disabled:n=!1,focusableWhenDisabled:s,tabIndex:r=0,native:i=!0,composite:c}=e,d=v.useRef(null),f=pS(!0),p=c??f!==void 0,{props:m}=N5({focusableWhenDisabled:s,disabled:n,composite:p,tabIndex:r,isNativeButton:i}),h=v.useCallback(()=>{const S=d.current;Yp(S)&&p&&n&&m.disabled===void 0&&S.disabled&&(S.disabled=!1)},[n,m.disabled,p]);Ne(h,[h]);const x=v.useCallback((S={})=>{const{onClick:w,onMouseDown:_,onKeyUp:j,onKeyDown:E,onPointerDown:k,...R}=S;return Ra({onClick(N){if(n){N.preventDefault();return}w?.(N)},onMouseDown(N){n||_?.(N)},onKeyDown(N){if(n||(fd(N),E?.(N),N.baseUIHandlerPrevented))return;const O=N.target===N.currentTarget,A=N.currentTarget,M=Yp(A),B=!i&&R5(A),U=O&&(i?M:!B),I=N.key==="Enter",L=N.key===" ",P=A.getAttribute("role"),H=P?.startsWith("menuitem")||P==="option"||P==="gridcell";if(O&&p&&L){if(N.defaultPrevented&&H)return;N.preventDefault(),B||i&&M?(A.click(),N.preventBaseUIHandler()):U&&(w?.(N),N.preventBaseUIHandler());return}U&&(!i&&(L||I)&&N.preventDefault(),!i&&I&&w?.(N))},onKeyUp(N){if(!n){if(fd(N),j?.(N),N.target===N.currentTarget&&i&&p&&Yp(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=Me(S=>{d.current=S,h()});return{getButtonProps:x,buttonRef:y}}function Yp(e){return Ut(e)&&e.tagName==="BUTTON"}function R5(e){return!!(e?.tagName==="A"&&e?.href)}const T5=v.forwardRef(function(n,s){const{render:r,className:i,disabled:c=!1,focusableWhenDisabled:d=!1,nativeButton:f=!0,style:p,...m}=n,{getButtonProps:h,buttonRef:x}=gl({disabled:c,focusableWhenDisabled:d,native:f});return Lt("button",n,{state:{disabled:c},ref:[s,x],props:[m,h]})}),M1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,O1=jh,lx=(e,n)=>s=>{var r;if(n?.variants==null)return O1(e,s?.class,s?.className);const{variants:i,defaultVariants:c}=n,d=Object.keys(i).map(m=>{const h=s?.[m],x=c?.[m];if(h===null)return null;const y=M1(h)||M1(x);return i[m][y]}),f=s&&Object.entries(s).reduce((m,h)=>{let[x,y]=h;return y===void 0||(m[x]=y),m},{}),p=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((m,h)=>{let{class:x,className:y,...S}=h;return Object.entries(S).every(w=>{let[_,j]=w;return Array.isArray(j)?j.includes({...c,...f}[_]):{...c,...f}[_]===j})?[...m,x,y]:m},[]);return O1(e,d,p,s?.class,s?.className)},A5=lx("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 nl({className:e,variant:n="default",size:s="default",...r}){return o.jsx(T5,{"data-slot":"button",className:Pt(A5({variant:n,size:s,className:e})),...r})}let z1=(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 M5={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Si={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},O5={disabled:!1,...Si},ix={valid(e){return e===null?null:e?{[z1.valid]:""}:{[z1.invalid]:""}}},z5={invalid:void 0,name:void 0,validityData:{state:M5,errors:[],error:"",value:"",initialValue:null},setValidityData:Dn,disabled:void 0,touched:Si.touched,setTouched:Dn,dirty:Si.dirty,setDirty:Dn,filled:Si.filled,setFilled:Dn,focused:Si.focused,setFocused:Dn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:O5,markedDirtyRef:{current:!1},registerFieldControl:Dn,validation:{getValidationProps:(e=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}},D5=v.createContext(z5);function lc(e=!0){const n=v.useContext(D5);if(n.setValidityData===Dn&&!e)throw new Error(Rn(28));return n}const L5=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Dn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function gS(){return v.useContext(L5)}const P5=v.createContext({controlId:void 0,registerControlId:Dn,labelId:void 0,setLabelId:Dn,messageIds:[],setMessageIds:Dn,getDescriptionProps:e=>e});function Kd(){return v.useContext(P5)}function B5(e,n,s,r=!0,i){const[c,d]=v.useState(),f=vr(i?`${i}-label`:void 0),p=e??n??c;return Ne(()=>{const m=e||n||!r?void 0:I5(s.current,f);c!==m&&d(m)}),p}function I5(e,n){const s=U5(e);if(s)return!s.id&&n&&(s.id=n),s.id||void 0}function U5(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 Qd(e={}){const{id:n,implicit:s=!1,controlRef:r}=e,{controlId:i,registerControlId:c}=Kd(),d=vr(n),f=s?i:void 0,p=fa(()=>Symbol("labelable-control")),m=v.useRef(!1),h=v.useRef(n!=null),x=Me(()=>{!m.current||c===Dn||(m.current=!1,c(p.current,void 0))});return Ne(()=>{if(c===Dn)return;let y;if(s){const S=r?.current;lt(S)&&S.closest("label")!=null?y=n??null:y=f??d}else if(n!=null)h.current=!0,y=n;else if(h.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]),v.useEffect(()=>x,[x]),i??d}function Fi({controlled:e,default:n,name:s,state:r="value"}){const{current:i}=v.useRef(e!==void 0),[c,d]=v.useState(n),f=i?e:c,p=v.useCallback(m=>{i||d(m)},[]);return[f,p]}function cx(e,n,s,r,i=!0){const{registerFieldControl:c}=lc(),d=v.useRef(null);d.current||(d.current=Symbol()),Ne(()=>{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 H5=v.forwardRef(function(n,s){const{render:r,className:i,id:c,name:d,value:f,disabled:p=!1,onValueChange:m,defaultValue:h,autoFocus:x=!1,style:y,...S}=n,{state:w,name:_,disabled:j,setTouched:E,setDirty:k,validityData:R,setFocused:N,setFilled:O,validationMode:A,validation:M}=lc(),B=j||p,U=_??d,I={...w,disabled:B},{labelId:L}=Kd(),P=Qd({id:c});Ne(()=>{const $=f!=null;M.inputRef.current?.value||$&&f!==""?O(!0):$&&f===""&&O(!1)},[M.inputRef,O,f]);const H=v.useRef(null);Ne(()=>{x&&H.current===zn(xt(H.current))&&N(!0)},[x,N]);const[Y]=Fi({controlled:f,default:h,name:"FieldControl",state:"value"}),Q=f!==void 0,q=Q?Y:void 0,X=Me(()=>M.inputRef.current?.value);return cx(M.inputRef,P,q,X),Lt("input",n,{ref:[s,H],state:I,props:[{id:P,disabled:B,name:U,ref:M.inputRef,"aria-labelledby":L,autoFocus:x,...Q?{value:q}:{defaultValue:h},onChange($){const K=$.currentTarget.value;m?.(K,tt(Ts,$.nativeEvent)),k(K!==R.initialValue),O(K!=="")},onFocus(){N(!0)},onBlur($){E(!0),N(!1),A==="onBlur"&&M.commit($.currentTarget.value)},onKeyDown($){$.currentTarget.tagName==="INPUT"&&$.key==="Enter"&&(E(!0),M.commit($.currentTarget.value))}},M.getInputValidationProps(),S],stateAttributesMapping:ix})}),q5=v.forwardRef(function(n,s){return o.jsx(H5,{ref:s,...n})});function V5({className:e,type:n,...s}){return o.jsx(q5,{type:n,"data-slot":"input",className:Pt("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 $5({className:e,...n}){return o.jsx("textarea",{"data-slot":"textarea",className:Pt("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 G5(e){return Lt(e.defaultTagName??"div",e,e)}const Y5=lx("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 F5({className:e,variant:n="default",render:s,...r}){return G5({defaultTagName:"span",props:Ra({className:Pt(Y5({variant:n}),e)},r),render:s,state:{slot:"badge",variant:n}})}const hS=v.createContext(void 0);function X5(){const e=v.useContext(hS);if(e===void 0)throw new Error(Rn(63));return e}let D1=(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 xS={...ix,checked(e){return e?{[D1.checked]:""}:{[D1.unchecked]:""}}};function ux(e,n){const s=v.useRef(e),r=Me(n);Ne(()=>{s.current!==e&&r(s.current)},[e,r]),Ne(()=>{s.current=e},[e])}const K5=v.forwardRef(function(n,s){const{checked:r,className:i,defaultChecked:c,"aria-labelledby":d,form:f,id:p,inputRef:m,name:h,nativeButton:x=!1,onCheckedChange:y,readOnly:S=!1,required:w=!1,disabled:_=!1,render:j,uncheckedValue:E,value:k,style:R,...N}=n,{clearErrors:O}=gS(),{state:A,setTouched:M,setDirty:B,validityData:U,setFilled:I,setFocused:L,shouldValidateOnChange:P,validationMode:H,disabled:Y,name:Q,validation:q}=lc(),{labelId:X}=Kd(),Z=Y||_,$=Q??h,K=v.useRef(null),D=As(K,m,q.inputRef),G=v.useRef(null),V=vr(),W=Qd({id:p,implicit:!1,controlRef:G}),ce=x?void 0:W,[oe,se]=Fi({controlled:r,default:!!c,name:"Switch",state:"checked"});cx(G,V,oe),Ne(()=>{K.current&&I(K.current.checked)},[K,I]),ux(oe,()=>{O($),B(oe!==U.initialValue),I(oe),P()?q.commit(oe):q.commit(oe,!0)});const{getButtonProps:ue,buttonRef:ee}=gl({disabled:Z,native:x}),Re=B5(d,X,K,!x,ce),$e={id:x?W:V,role:"switch","aria-checked":oe,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":Re,onFocus(){Z||L(!0)},onBlur(){const ze=K.current;!ze||Z||(M(!0),L(!1),H==="onBlur"&&q.commit(ze.checked))},onClick(ze){if(S||Z)return;ze.preventDefault();const De=K.current;De&&De.dispatchEvent(new(Ft(De)).PointerEvent("click",{bubbles:!0,shiftKey:ze.shiftKey,ctrlKey:ze.ctrlKey,altKey:ze.altKey,metaKey:ze.metaKey}))}},be=Ra({checked:oe,disabled:Z,form:f,id:ce,name:$,required:w,style:$?Kj:zh,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:D,onChange(ze){if(ze.nativeEvent.defaultPrevented)return;if(S){ze.preventDefault();return}const De=ze.currentTarget.checked,xe=tt(Ts,ze.nativeEvent);y?.(De,xe),!xe.isCanceled&&se(De)},onFocus(){G.current?.focus()}},q.getInputValidationProps,k!==void 0?{value:k}:an),Se=v.useMemo(()=>({...A,checked:oe,disabled:Z,readOnly:S,required:w}),[A,oe,Z,S,w]),Ee=Lt("span",n,{state:Se,ref:[s,G,ee],props:[$e,q.getValidationProps,N,ue],stateAttributesMapping:xS});return o.jsxs(hS.Provider,{value:Se,children:[Ee,!oe&&$&&E!==void 0&&o.jsx("input",{type:"hidden",form:f,name:$,value:E}),o.jsx("input",{...be,suppressHydrationWarning:!0})]})}),Q5=v.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,f=X5();return Lt("span",n,{state:f,ref:s,stateAttributesMapping:xS,props:d})});function Z5({className:e,size:n="default",...s}){return o.jsx(K5,{"data-slot":"switch","data-size":n,className:Pt("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(Q5,{"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 J5({className:e,...n}){return o.jsx(Td,{role:"status","aria-label":"Loading",className:Pt("size-4 animate-spin",e),...n})}const bS=v.createContext(!1),vS=v.createContext(void 0);function eo(e){const n=v.useContext(vS);if(e===!1&&n===void 0)throw new Error(Rn(27));return n}const W5={...pl,...ml},yS=v.forwardRef(function(n,s){const{render:r,className:i,style:c,forceRender:d=!1,...f}=n,{store:p}=eo(),m=p.useState("open"),h=p.useState("nested"),x=p.useState("mounted"),y=p.useState("transitionStatus");return Lt("div",n,{state:{open:m,transitionStatus:y},ref:[p.context.backdropRef,s],stateAttributesMapping:W5,props:[{role:"presentation",hidden:!x,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:d||!h})}),_S=v.forwardRef(function(n,s){const{render:r,className:i,style:c,disabled:d=!1,nativeButton:f=!0,...p}=n,{store:m}=eo(),h=m.useState("open"),{getButtonProps:x,buttonRef:y}=gl({disabled:d,native:f}),S={disabled:d};function w(_){h&&m.setOpen(!1,tt(jT,_.nativeEvent))}return Lt("button",n,{state:S,ref:[s,y],props:[{onClick:w},p,x]})}),jS=v.forwardRef(function(n,s){const{render:r,className:i,style:c,id:d,...f}=n,{store:p}=eo(),m=vr(d);return p.useSyncedValueWithCleanup("descriptionElementId",m),Lt("p",n,{ref:s,props:[{id:m},f]})});let e4=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),t4=(function(e){return e[e.open=Vr.open]="open",e[e.closed=Vr.closed]="closed",e[e.startingStyle=Vr.startingStyle]="startingStyle",e[e.endingStyle=Vr.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const wS=v.createContext(void 0);function n4(){const e=v.useContext(wS);if(e===void 0)throw new Error(Rn(26));return e}const Oi="ArrowUp",$o="ArrowDown",yd="ArrowLeft",zi="ArrowRight",Zd="Home",Jd="End",SS=new Set([yd,zi]),a4=new Set([yd,zi,Zd,Jd]),CS=new Set([Oi,$o]),s4=new Set([Oi,$o,Zd,Jd]),ES=new Set([...SS,...CS]),dx=new Set([...ES,Zd,Jd]),r4="Shift",o4="Control",l4="Alt",i4="Meta",c4=new Set([r4,o4,l4,i4]);function u4(e){return Ut(e)&&e.tagName==="INPUT"}function L1(e){return!!(u4(e)&&e.selectionStart!=null||Ut(e)&&e.tagName==="TEXTAREA")}function P1(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=B1(e,n,"left"),m=Mu(e),h=Mu(n);s==="ltr"&&(p+n.offsetWidth+h.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight?i=p+n.offsetWidth+h.scrollMarginRight-e.clientWidth+m.scrollPaddingRight:p-h.scrollMarginLeft<e.scrollLeft+m.scrollPaddingLeft&&(i=p-h.scrollMarginLeft-m.scrollPaddingLeft)),s==="rtl"&&(p-h.scrollMarginRight<e.scrollLeft+m.scrollPaddingLeft?i=p-h.scrollMarginLeft-m.scrollPaddingLeft:p+n.offsetWidth+h.scrollMarginRight>e.scrollLeft+e.clientWidth-m.scrollPaddingRight&&(i=p+n.offsetWidth+h.scrollMarginRight-e.clientWidth+m.scrollPaddingRight))}if(f&&r!=="horizontal"){const p=B1(e,n,"top"),m=Mu(e),h=Mu(n);p-h.scrollMarginTop<e.scrollTop+m.scrollPaddingTop?c=p-h.scrollMarginTop-m.scrollPaddingTop:p+n.offsetHeight+h.scrollMarginBottom>e.scrollTop+e.clientHeight-m.scrollPaddingBottom&&(c=p+n.offsetHeight+h.scrollMarginBottom-e.clientHeight+m.scrollPaddingBottom)}e.scrollTo({left:i,top:c,behavior:"auto"})}function B1(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 Mu(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 d4={...pl,...ml,nestedDialogOpen(e){return e?{[t4.nestedDialogOpen]:""}:null}},kS=v.forwardRef(function(n,s){const{render:r,className:i,style:c,finalFocus:d,initialFocus:f,...p}=n,{store:m}=eo(),h=m.useState("descriptionElementId"),x=m.useState("disablePointerDismissal"),y=m.useState("floatingRootContext"),S=m.useState("popupProps"),w=m.useState("modal"),_=m.useState("mounted"),j=m.useState("nested"),E=m.useState("nestedOpenDialogCount"),k=m.useState("open"),R=m.useState("openMethod"),N=m.useState("titleElementId"),O=m.useState("transitionStatus"),A=m.useState("role"),M=y.useState("floatingId"),B=p.id??M;n4(),br({open:k,ref:m.context.popupRef,onComplete(){k&&m.context.onOpenChangeComplete?.(!0)}});function U(Q){return Q==="touch"?m.context.popupRef.current:!0}const I=f===void 0?U:f,L=E>0,P=m.useStateSetter("popupElement"),Y=Lt("div",n,{state:{open:k,nested:j,transitionStatus:O,nestedDialogOpen:L},props:[S,{id:B,"aria-labelledby":N??void 0,"aria-describedby":h??void 0,role:A,...$d,hidden:!_,onKeyDown(Q){dx.has(Q.key)&&Q.stopPropagation()},style:{[e4.nestedDialogs]:E}},p],ref:[s,m.context.popupRef,P],stateAttributesMapping:d4});return o.jsx(_w,{context:y,openInteractionType:R,disabled:!_,closeOnFocusOut:!x,initialFocus:I,returnFocus:d,modal:w!==!1,restoreFocus:"popup",children:Y})}),NS=v.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}})}),RS=v.forwardRef(function(n,s){const{keepMounted:r=!1,...i}=n,{store:c}=eo(),d=c.useState("mounted"),f=c.useState("modal"),p=c.useState("open");return d||r?o.jsx(wS.Provider,{value:r,children:o.jsxs(yw,{ref:s,...i,children:[d&&f===!0&&o.jsx(NS,{ref:c.context.internalBackdropRef,inert:Jh(!p)}),n.children]})}):null});let I1={},U1={},H1="";function f4(e){if(typeof document>"u")return!1;const n=xt(e);return Ft(n).innerWidth-n.documentElement.clientWidth>0}function m4(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=xt(e),r=s.documentElement,i=s.body,c=hr(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 p4(e){const n=xt(e),s=n.documentElement,r=n.body,i=hr(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 g4(e){const n=xt(e),s=n.documentElement,r=n.body,i=Ft(s);let c=0,d=0,f=!1;const p=Ya.create();if(Eh&&(i.visualViewport?.scale??1)!==1)return()=>{};function m(){const S=i.getComputedStyle(s),w=i.getComputedStyle(r),E=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=s.scrollTop,d=s.scrollLeft,I1={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},H1=s.style.scrollBehavior,U1={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",O=S.overflowX==="scroll"||w.overflowX==="scroll",A=Math.max(0,i.innerWidth-r.clientWidth),M=Math.max(0,i.innerHeight-r.clientHeight),B=parseFloat(w.marginTop)+parseFloat(w.marginBottom),U=parseFloat(w.marginLeft)+parseFloat(w.marginRight),I=hr(s)?s:r;if(f=m4(e),f){s.style.scrollbarGutter=E,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(k||N)&&(s.style.overflowY="scroll"),(R||O)&&(s.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:B||M?`calc(100dvh - ${B+M}px)`:"100dvh",width:U||A?`calc(100vw - ${U+A}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 h(){Object.assign(s.style,I1),Object.assign(r.style,U1),f||(s.scrollTop=c,s.scrollLeft=d,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=H1)}function x(){h(),p.request(m)}m();const y=ct(i,"resize",x);return()=>{p.cancel(),h(),typeof i.removeEventListener=="function"&&y()}}class h4{lockCount=0;restore=null;timeoutLock=Ia.create();timeoutUnlock=Ia.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=xt(n).documentElement,i=Ft(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Dn;return}const c=Lj||!f4(n);this.restore=c?p4(n):g4(n)}}const x4=new h4;function TS(e=!0,n=null){Ne(()=>{if(e)return x4.acquire(n)},[e,n])}function b4(e){const{store:n,parentContext:s,actionsRef:r,isDrawer:i}=e,c=n.useState("open");O3(n,c),Dw(n);const{forceUnmount:d}=Lw(c,n),f=v.useCallback(()=>{n.setOpen(!1,tt($j))},[n]);return v.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]),{parentContext:s,isDrawer:i}}function v4({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,h]=v.useState(0),[x,y]=v.useState(0),S=m===0,w=Vh(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=En(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||Ye(N,f)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:S});TS(i&&d===!0,f),e.useContextCallback("onNestedDialogOpen",(k,R)=>{h(k),y(R)}),e.useContextCallback("onNestedDialogClose",()=>{h(0),y(0)}),v.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 _=w.reference??an,j=w.trigger??an,E=v.useMemo(()=>Ra($d,w.floating),[w.floating]);return Pw(e,{activeTriggerProps:_,inactiveTriggerProps:j,popupProps:E,nestedOpenDialogCount:m,nestedOpenDrawerCount:x}),null}const y4={...Hw,modal:Te(e=>e.modal),nested:Te(e=>e.nested),nestedOpenDialogCount:Te(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Te(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Te(e=>e.disablePointerDismissal),openMethod:Te(e=>e.openMethod),descriptionElementId:Te(e=>e.descriptionElementId),titleElementId:Te(e=>e.titleElementId),viewportElement:Te(e=>e.viewportElement),role:Te(e=>e.role)};class fx extends Gh{constructor(n,s,r=!1){const i=new Gd,c=_4(n);c.floatingRootContext=Iw(i,s,r),super(c,{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:i,onOpenChange:void 0,onOpenChangeComplete:void 0},y4)}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};zw(r,n,s.trigger),this.update(r)};static useStore(n,s){return Ow(n,(i,c)=>new fx(s,i,c),!0).store}}function _4(e={}){return{...Bw(),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 j4(e,n="dialog"){const{children:s,open:r,defaultOpen:i=!1,onOpenChange:c,onOpenChangeComplete:d,disablePointerDismissal:f=!1,modal:p=!0,actionsRef:m,handle:h,triggerId:x,defaultTriggerId:y=null}=e,S=n==="drawer",w=n==="alert-dialog",_=w?!0:p,j=w||f,E=w?"alertdialog":"dialog",k=eo(!0),N={modal:_,disablePointerDismissal:j,nested:!!k,role:E},O=fx.useStore(h?.store,{open:i,openProp:r,activeTriggerId:y,triggerIdProp:x,...N});Sh(()=>{const P=r===void 0&&O.state.open===!1&&i===!0?{open:!0,activeTriggerId:y}:null;w?O.update(P?{...N,...P}:N):P&&O.update(P)}),O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",x),O.useSyncedValues(N),O.useContextCallback("onOpenChange",c),O.useContextCallback("onOpenChangeComplete",d);const A=O.useState("open"),M=O.useState("mounted"),B=O.useState("payload"),U=b4({store:O,actionsRef:m,parentContext:k?.store.context,isDrawer:S}),I=A||M,L=v.useMemo(()=>({store:O}),[O]);return o.jsx(bS.Provider,{value:!1,children:o.jsxs(vS.Provider,{value:L,children:[I&&o.jsx(v4,{store:O,dialogRoot:U}),typeof s=="function"?s({payload:B}):s]})})}function AS(e){const n=v.useContext(bS)?"drawer":"dialog";return j4(e,n)}const MS=v.forwardRef(function(n,s){const{render:r,className:i,style:c,id:d,...f}=n,{store:p}=eo(),m=vr(d);return p.useSyncedValueWithCleanup("titleElementId",m),Lt("h2",n,{ref:s,props:[{id:m},f]})});function w4(e){const n=v.useRef(""),s=v.useCallback(i=>{i.defaultPrevented||(n.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:v.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 S4(e,n){const s=Me((c,d)=>{(typeof e=="function"?e():e)||n(d||(Lj?"touch":""))}),{onClick:r,onPointerDown:i}=w4(s);return v.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function C4(e){const[n,s]=v.useState(null),r=S4(e,s);return ux(e,i=>{i&&!e&&s(null)}),v.useMemo(()=>({openMethod:n,triggerProps:r}),[n,r])}function E4({...e}){return o.jsx(AS,{"data-slot":"dialog",...e})}function k4({...e}){return o.jsx(RS,{"data-slot":"dialog-portal",...e})}function N4({className:e,...n}){return o.jsx(yS,{"data-slot":"dialog-overlay",className:Pt("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 R4({className:e,children:n,showCloseButton:s=!0,...r}){return o.jsxs(k4,{children:[o.jsx(N4,{}),o.jsxs(kS,{"data-slot":"dialog-content",className:Pt("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(_S,{"data-slot":"dialog-close",render:o.jsx(nl,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[o.jsx(ec,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function T4({className:e,...n}){return o.jsx("div",{"data-slot":"dialog-header",className:Pt("flex flex-col gap-2",e),...n})}function A4({className:e,...n}){return o.jsx(MS,{"data-slot":"dialog-title",className:Pt("font-heading text-base leading-none font-medium",e),...n})}function M4({className:e,...n}){return o.jsx(jS,{"data-slot":"dialog-description",className:Pt("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}const O4={primary:"default",secondary:"outline",ghost:"ghost",destructive:"destructive"},z4={sm:"sm",md:"default"};function he({variant:e="secondary",size:n="md",loading:s,className:r,children:i,disabled:c,type:d="button",...f}){return o.jsxs(nl,{type:d,variant:O4[e],size:z4[n],disabled:c||s,className:r,...f,children:[s?o.jsx(gr,{size:14}):null,i]})}function Ce(e){return o.jsx(V5,{...e})}function Qt(e){return o.jsx($5,{...e})}function D4(e){return o.jsx("select",{...e,className:Ae("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 sn({checked:e,onChange:n,label:s,disabled:r}){return o.jsxs("label",{className:Ae("inline-flex items-center gap-2",r&&"opacity-50"),children:[o.jsx(Z5,{checked:e,onCheckedChange:n,disabled:r}),s&&o.jsx("span",{className:"text-sm",children:s})]})}function Ue({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(F5,{variant:r,className:Ae("rounded-md",i[n],s),children:e})}function ma({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(E4,{open:e,onOpenChange:p=>{p||n()},children:o.jsxs(R4,{className:Ae("flex max-h-[88vh] w-full flex-col gap-0 p-0",f[d]),children:[(s||r)&&o.jsxs(T4,{className:"shrink-0 border-b border-border px-5 py-4 pr-12",children:[s&&o.jsx(A4,{children:s}),r&&o.jsx(M4,{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 gr({size:e=14}){return o.jsx(J5,{style:{width:e,height:e}})}function ot({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 Je({label:e="Cargando…"}){return o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(gr,{})," ",e]})}const OS=v.createContext(null);let L4=1;function P4({children:e}){const[n,s]=v.useState([]),r=v.useCallback((c,d)=>{const f=L4++;s(p=>[...p,{id:f,kind:c,message:d}]),setTimeout(()=>{s(p=>p.filter(m=>m.id!==f))},4500)},[]),i=v.useMemo(()=>({show:r,success:c=>r("success",c),error:c=>r("error",c),info:c=>r("info",c)}),[r]);return v.useEffect(()=>(window.__apxToast=i,()=>{delete window.__apxToast}),[i]),o.jsxs(OS.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:Ae("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:Ae("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 nt(){const e=v.useContext(OS);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function zS(){const{data:e,error:n,isLoading:s}=Qe("/health",()=>l5.get(),{refreshInterval:Ad.health});return{health:e,error:n,isLoading:s,isUp:!n&&!!e}}function B4(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/engines",()=>bd.list());return{engines:e?.engines||[],error:n,isLoading:s,mutate:r}}function I4(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/telegram/status",()=>kn.status(),{refreshInterval:Ad.telegramStatus});return{status:e,error:n,isLoading:s,mutate:r}}function mx(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/telegram/channels",()=>kn.channels.list());return{channels:e?.channels||[],error:n,isLoading:s,mutate:r}}function px(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/telegram/contacts",()=>kn.contacts.list());return{contacts:e?.contacts||[],roles:e?.roles||{},channelOwners:e?.channel_owners||[],error:n,isLoading:s,mutate:r}}function La(e){return typeof e=="string"&&e.startsWith("*** set ***")}function fr(e,n="(no seteada)"){return La(e)?e:n}function al(e){if(typeof e!="string")return null;const n=e.match(/\(\.\.\.([^)]+)\)/);return n?n[1]:null}function DS({channel:e,onClose:n,onSaved:s}){const r=nt(),[i,c]=v.useState(!1),[d,f]=v.useState({name:""});v.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 kn.channels.patch(e.name,d):await kn.channels.upsert(d),r.success("Canal guardado."),s()}catch(m){r.error(m.message)}finally{c(!1)}};return o.jsx(ma,{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(he,{variant:"ghost",onClick:n,disabled:i,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:p,loading:i,children:C("common.save")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"name (slug interno)",children:o.jsx(Ce,{value:d.name,onChange:m=>f({...d,name:m.target.value}),disabled:!!e?.name})}),o.jsx(fe,{label:"bot_token",hint:e?.bot_token?fr(e.bot_token):"Token del BotFather. Se guarda en ~/.apx/config.json.",children:o.jsx(Ce,{type:"password",value:d.bot_token||"",onChange:m=>f({...d,bot_token:m.target.value}),placeholder:e?.bot_token?fr(e.bot_token):""})}),o.jsx(fe,{label:"chat_id",children:o.jsx(Ce,{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(Ce,{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(Ce,{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(Ce,{value:d.owner_user_id!=null?String(d.owner_user_id):"",onChange:m=>{const h=m.target.value.trim();f({...d,owner_user_id:h===""?void 0:/^\d+$/.test(h)?Number(h):h})},placeholder:"889721252"})}),o.jsx(sn,{checked:!!d.respond_with_engine,onChange:m=>f({...d,respond_with_engine:m}),label:"Responder con engine (no echo)"})]})})}function LS({channel:e,onClose:n}){const s=nt(),[r,i]=v.useState(C("admin.telegram_default_message")),[c,d]=v.useState(!1),f=async()=>{if(!(!r.trim()||!e)){d(!0);try{await kn.send({text:r,channel:e.name}),s.success("Mensaje enviado."),n()}catch(p){s.error(p.message)}finally{d(!1)}}};return o.jsx(ma,{open:!!e,onClose:n,title:e?`${C("admin.telegram_send_test_title")} ${e.name}`:"",description:e?`chat_id: ${e.chat_id||"—"}`:"",footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:c,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:f,loading:c,children:"Enviar"})]}),children:o.jsx(fe,{label:"Texto",children:o.jsx(Qt,{rows:4,value:r,onChange:p=>i(p.target.value)})})})}function PS({bare:e=!1}){const n=nt(),{contacts:s,roles:r,channelOwners:i,isLoading:c,mutate:d}=px(),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 kn.contacts.patch(y.user_id,{role:S}),n.success(`${y.name||y.user_id} → ${S}`),d()}catch(w){n.error(w.message)}},h=async y=>{if(confirm(C("telegram_contacts.delete_confirm",{name:y.name||String(y.user_id)})))try{await kn.contacts.remove(y.user_id),n.success(C("telegram_contacts.removed")),d()}catch(S){n.error(S.message)}},x=o.jsxs(o.Fragment,{children:[c&&o.jsx(Je,{}),!c&&s.length===0&&o.jsx(ot,{children:C("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(Ue,{tone:"success",children:C("telegram_contacts.owner_badge")})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(D4,{value:w,disabled:S,onChange:_=>m(y,_.target.value),title:C(S?"telegram_contacts.owner_hint":"telegram_contacts.assign_role"),children:p.map(_=>o.jsx("option",{value:_,children:_},_))}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>h(y),children:C("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:[C("telegram_contacts.last_seen")," ",y.last_seen?y.last_seen.slice(0,10):"—"]}),o.jsx("span",{children:U4(r[w])})]})]},String(y.user_id))})})]});return e?x:o.jsx(He,{title:C("telegram_contacts.title"),description:C("telegram_contacts.desc"),children:x})}function U4(e){return!e||e.tools===void 0?"":e.tools==="*"?C("telegram_contacts.tools_all"):Array.isArray(e.tools)?e.tools.length?`${C("telegram_contacts.tools_label")} ${e.tools.join(", ")}`:C("telegram_contacts.tools_none"):""}function H4(){const e=Ua(),n=nt(),{health:s,isUp:r}=zS(),{projects:i,isLoading:c,mutate:d}=oc(),{engines:f,isLoading:p}=B4(),{status:m,mutate:h}=I4(),{channels:x,isLoading:y,mutate:S}=mx(),[w,_]=v.useState(null),[j,E]=v.useState(null),k=async()=>{try{await el.reload(),n.success(C("admin.reload_success"))}catch(A){n.error(A.message)}},R=async()=>{try{m?.enabled?(await kn.stop(),n.info(C("admin.telegram_polling_stopped"))):(await kn.start(),n.success(C("admin.telegram_polling_started"))),h()}catch(A){n.error(A.message)}},N=async A=>{if(confirm(C("telegram_channels.delete_confirm",{name:A})))try{await kn.channels.remove(A),n.success(C("admin.telegram_channel_removed")),S()}catch(M){n.error(M.message)}},O=async(A,M)=>{if(confirm(C("admin.unregister_confirm",{label:M})))try{await Qn.remove(A),n.success(C("project.unregistered")),d()}catch(B){n.error(B.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:C("admin.title")}),o.jsx("p",{className:"text-sm text-muted-fg",children:C("admin.subtitle")})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(he,{size:"sm",onClick:k,title:C("daemon.reload_hint"),children:[C("common.reload")," config"]}),o.jsxs(he,{size:"sm",variant:"primary",onClick:()=>e("/?action=add-project"),children:[o.jsx(Nn,{size:14})," ",C("nav.project")]})]})]}),o.jsx(He,{title:C("daemon.version"),children:o.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[o.jsx(Fp,{label:C("daemon.version"),value:s?.version||"—"}),o.jsx(Fp,{label:C("daemon.uptime"),value:s?`${s.uptime_s}s`:"—"}),o.jsx(Fp,{label:C("daemon.status"),value:C(r?"daemon.running":"daemon.down"),ok:r})]})}),o.jsxs(He,{title:C("admin.engines_title"),description:C("admin.engines_subtitle"),children:[p&&o.jsx(Je,{}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(A=>o.jsx(Ue,{tone:"info",children:A},A))})]}),o.jsxs(He,{title:C("admin.telegram_title"),description:C("admin.telegram_subtitle"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(sn,{checked:!!m?.enabled,onChange:R,label:m?.enabled?C("admin.telegram_polling_on"):C("admin.telegram_polling_off")}),o.jsxs(he,{size:"sm",onClick:()=>_({name:""}),children:[o.jsx(Nn,{size:14})," ",C("admin.telegram_add_channel")]})]}),children:[y&&o.jsx(Je,{}),x.length===0&&o.jsx(ot,{children:C("common.none_yet")}),o.jsx("ul",{className:"space-y-2 text-sm",children:x.map(A=>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:A.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[A.project&&o.jsxs(Ue,{tone:"success",children:["project = ",A.project]}),o.jsxs(he,{size:"sm",variant:"ghost",onClick:()=>E(A),children:[o.jsx(Za,{size:13})," ",C("admin.telegram_send_test")]}),o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>_(A),children:C("common.edit")}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>N(A.name),children:C("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: ",A.chat_id||"—"]}),o.jsxs("span",{children:["route_to_agent: ",A.route_to_agent||"default APX"]}),o.jsxs("span",{children:["engine: ",A.respond_with_engine?C("admin.engine_badge"):C("admin.engine_badge_no")]})]})]},A.name))})]}),o.jsx(PS,{}),o.jsxs(He,{title:C("admin.projects_title"),description:C("admin.projects_subtitle"),children:[c&&o.jsx(Je,{}),o.jsx("ul",{className:"divide-y divide-border",children:i.map(A=>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:["#",A.id]}),o.jsxs("button",{type:"button",className:"flex-1 text-left hover:underline",onClick:()=>e(`/p/${A.id}`),children:[o.jsx("span",{className:"font-medium",children:A.name||A.path.split("/").pop()}),o.jsx("span",{className:"ml-2 text-xs text-muted-fg",children:A.path})]}),o.jsxs(Ue,{children:[A.agents??0," ",C("admin.agents_badge")]}),Number(A.id)!==0&&o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>O(String(A.id),A.name||A.path),children:C("admin.unregister")})]},A.id))})]}),o.jsx(DS,{channel:w,onClose:()=>_(null),onSaved:()=>{_(null),S()}}),o.jsx(LS,{channel:j,onClose:()=>E(null)})]})}function Fp({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(Xd,{ok:s}),o.jsx("span",{children:n})]})]})}function BS(e){const[n,s]=v.useState(!1);return v.useEffect(()=>{try{s(localStorage.getItem(e)==="true")}catch{}},[e]),{collapsed:n,toggle:()=>s(i=>{const c=!i;try{localStorage.setItem(e,String(c))}catch{}return c})}}function q4({collapsed:e,onToggle:n}){return o.jsx(Jo,{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(cR,{className:Ae("size-4 transition-transform",e&&"rotate-180")})})})}function V4({sections:e,active:n,onChange:s,collapsed:r=!1}){return o.jsx("nav",{className:Ae("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:Ae("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 h=n===d,x=o.jsxs("button",{type:"button",onClick:()=>s(d),"data-testid":`tabnav-${d||"index"}`,className:Ae("flex cursor-pointer items-center rounded-lg transition-colors",r?"size-9 justify-center":"w-full gap-2 px-2.5 py-1.5",h?"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(Jo,{content:f,side:"right",children:x},d):o.jsx(v.Fragment,{children:x},d)})})]},c))})}function IS({sections:e,active:n,onChange:s,collapsed:r,onToggleCollapse:i,actions:c,contentClassName:d,testId:f,children:p}){return o.jsxs("div",{className:"flex h-full",children:[o.jsx(V4,{sections:e,active:n,onChange:s,collapsed:r}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-y-auto",children:[o.jsxs("div",{className:"flex items-center justify-between px-6 pt-3",children:[o.jsx(q4,{collapsed:r,onToggle:i}),c?o.jsx("div",{className:"flex gap-2",children:c}):null]}),o.jsx("div",{className:Ae(d),"data-testid":f,children:p})]})]})}function q1({pid:e}){const n=Qe(`/projects/${e}/tasks?state=open`,()=>lr.list(e)),s=Qe(`/projects/${e}/routines`,()=>or.list(e)),r=Qe(`/projects/${e}/agents`,()=>Jt.list(e)),i=Qe(`/projects/${e}/mcps`,()=>Mi.list(e));return o.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:[o.jsx(pi,{title:C("project.overview.tasks_open"),value:n.data?.length??"…",href:`/p/${e}/tasks`,icon:Ui}),o.jsx(pi,{title:C("project.overview.routines"),value:s.data?.length??"…",href:`/p/${e}/routines`,icon:Xo}),o.jsx(pi,{title:C("project.overview.agents"),value:r.data?.length??"…",href:`/p/${e}/agents`,icon:vn}),o.jsx(pi,{title:C("project.overview.mcps"),value:i.data?.length??"…",href:`/p/${e}/mcps`,icon:Rg}),o.jsx(pi,{title:C("project.overview.chat"),value:C("project.overview.chat_value"),href:`/p/${e}/chat`,icon:Ri})]})}function pi({title:e,value:n,href:s,icon:r}){return o.jsxs(oj,{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 $4(){const e=Ua(),{projects:n,isLoading:s}=oc();return o.jsxs(He,{title:C("base.workspaces_title"),description:C("base.workspaces_desc"),action:o.jsxs(he,{size:"sm",variant:"primary",onClick:()=>e("/p/0/workspaces?action=add-project"),children:[o.jsx(Nn,{size:14})," ",C("base.workspaces_new")]}),children:[s&&o.jsx(Je,{}),!s&&n.length===0&&o.jsx(ot,{children:C("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?C("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(bj,{className:"size-4 text-muted-fg"}),o.jsx("span",{className:"truncate text-sm font-semibold",children:c}),o.jsx(Ue,{tone:i?"success":"info",children:i?C("base.title"):fS(r.kind)})]}),o.jsx("p",{className:"truncate font-mono text-[10px] text-muted-fg",children:r.path})]},r.id)})})]})}const US=v.createContext(null),HS=v.createContext(null);function es(){const e=v.useContext(US);if(e===null)throw new Error(Rn(60));return e}function qS(){const e=v.useContext(HS);if(e===null)throw new Error(Rn(61));return e}const G4=(e,n)=>Object.is(e,n);function sl(e,n,s){return e==null||n==null?Object.is(e,n):s(e,n)}function Y4(e,n,s){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:sl(n,r,s))}function Di(e,n,s){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:sl(r,n,s))}function F4(e,n,s){return e.filter(r=>!sl(n,r,s))}function Wg(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function VS(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function X4(e){if(!Array.isArray(e))return e!=null&&"null"in e;const n=e;if(VS(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 $S(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 Wg(e)}function qo(e,n){return n&&e!=null?n(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Wg(e.value):Wg(e)}function GS(e,n,s){function r(){return $S(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=VS(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 K4(e,n,s){return e.reduce((r,i,c)=>(c>0&&r.push(", "),r.push(o.jsx(v.Fragment,{children:GS(i,n,s)},c)),r),[])}const Fe={id:Te(e=>e.id),labelId:Te(e=>e.labelId),modal:Te(e=>e.modal),multiple:Te(e=>e.multiple),items:Te(e=>e.items),itemToStringLabel:Te(e=>e.itemToStringLabel),itemToStringValue:Te(e=>e.itemToStringValue),isItemEqualToValue:Te(e=>e.isItemEqualToValue),value:Te(e=>e.value),hasSelectedValue:Te(e=>{const{value:n,multiple:s,itemToStringValue:r}=e;return n==null?!1:s&&Array.isArray(n)?n.length>0:qo(n,r)!==""}),hasNullItemLabel:Te((e,n)=>n?X4(e.items):!1),open:Te(e=>e.open),mounted:Te(e=>e.mounted),forceMount:Te(e=>e.forceMount),transitionStatus:Te(e=>e.transitionStatus),openMethod:Te(e=>e.openMethod),activeIndex:Te(e=>e.activeIndex),selectedIndex:Te(e=>e.selectedIndex),isActive:Te((e,n)=>e.activeIndex===n),isSelected:Te((e,n,s)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(c=>sl(s,c,r)):e.selectedIndex===n&&e.selectedIndex!==null?!0:sl(s,i,r)}),isSelectedByFocus:Te((e,n)=>e.selectedIndex===n),popupProps:Te(e=>e.popupProps),triggerProps:Te(e=>e.triggerProps),triggerElement:Te(e=>e.triggerElement),positionerElement:Te(e=>e.positionerElement),listElement:Te(e=>e.listElement),popupSide:Te(e=>e.popupSide),scrollUpArrowVisible:Te(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Te(e=>e.scrollDownArrowVisible),hasScrollArrows:Te(e=>e.hasScrollArrows)};function Ci(e,n=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,s))}const Da=1;function gx(e,n){return Math.max(0,e-n)}function _d(e,n){if(n<=0)return 0;const s=Ci(e,0,n),r=s,i=n-s,c=r<=Da,d=i<=Da;return c&&d?r<=i?0:n:c?0:d?n:s}function Q4(e){const{id:n,value:s,defaultValue:r=null,onValueChange:i,open:c,defaultOpen:d=!1,onOpenChange:f,name:p,form:m,autoComplete:h,disabled:x=!1,readOnly:y=!1,required:S=!1,modal:w=!0,actionsRef:_,inputRef:j,onOpenChangeComplete:E,items:k,multiple:R=!1,itemToStringLabel:N,itemToStringValue:O,isItemEqualToValue:A=G4,highlightItemOnHover:M=!0,children:B}=e,{clearErrors:U}=gS(),{setDirty:I,setTouched:L,setFocused:P,shouldValidateOnChange:H,validityData:Y,setFilled:Q,name:q,disabled:X,validation:Z,validationMode:$}=lc(),K=Qd({id:n}),D=X||x,G=q??p,[V,W]=Fi({controlled:s,default:R?r??qi:r,name:"Select",state:"value"}),[ce,oe]=Fi({controlled:c,default:d,name:"Select",state:"open"}),se=v.useRef([]),ue=v.useRef([]),ee=v.useRef(null),Re=v.useRef(null),$e=v.useRef(0),be=v.useRef(null),Se=v.useRef([]),Ee=v.useRef(!1),ze=v.useRef(!1),De=v.useRef(null),xe=v.useRef(null),ke=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),_e=v.useRef(!1),{mounted:Le,setMounted:Ge,transitionStatus:qe}=ac(ce),{openMethod:Oe,triggerProps:ve}=C4(ce),le=fa(()=>new Mw({id:K,labelId:void 0,modal:w,multiple:R,itemToStringLabel:N,itemToStringValue:O,isItemEqualToValue:A,value:V,open:ce,mounted:Le,transitionStatus:qe,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,ye=Ke(le,Fe.activeIndex),je=Ke(le,Fe.selectedIndex),Be=Ke(le,Fe.triggerElement),Ze=Ke(le,Fe.positionerElement),_t=wM(Oe),Ht=Oe??_t,vt=v.useMemo(()=>R&&Array.isArray(V)&&V.length===0?"":qo(V,O),[R,V,O]),ut=v.useMemo(()=>R&&Array.isArray(V)?V.map(at=>qo(at,O)):qo(V,O),[R,V,O]),it=cn(le.state.triggerElement),Et=Me(()=>ut);cx(it,K,V,Et);const Bt=v.useRef(V),pa=R?Array.isArray(V)&&V.length>0:V!=null;Ne(()=>{V!==Bt.current&&le.set("forceMount",!0)},[le,V]),Ne(()=>{Q(pa)},[pa,Q]),Ne(function(){const At=Se.current;let yn;if(R){const en=Array.isArray(V)?V:[];if(en.length===0)yn=null;else{const kt=en[en.length-1],un=Di(At,kt,A);yn=un===-1?null:un}}else{const en=Di(At,V,A);yn=en===-1?null:en}yn===null&&(xe.current=null),!ce&&le.set("selectedIndex",yn)},[pa,R,ce,V,Se,A,le,xe]),ux(V,()=>{U(G),I(V!==Y.initialValue),H()?Z.commit(V):Z.commit(V,!0)});const gn=Me((at,At)=>{if(f?.(at,At),!At.isCanceled&&(oe(at),!at&&(At.reason===Pd||At.reason===Ah)&&(L(!0),P(!1),$==="onBlur"&&Z.commit(V)),!at&&le.state.activeIndex!==null)){const yn=se.current[le.state.activeIndex];queueMicrotask(()=>{yn?.setAttribute("tabindex","-1")})}}),dt=Me(()=>{Ge(!1),le.update({activeIndex:null,openMethod:null}),E?.(!1)});br({enabled:!_,open:ce,ref:ee,onComplete(){ce||dt()}}),v.useImperativeHandle(_,()=>({unmount:dt}),[dt]);const Tt=Me((at,At)=>{i?.(at,At),!At.isCanceled&&W(at)}),Xt=Me(()=>{const at=le.state.listElement||ee.current;if(!at)return;const At=gx(at.scrollHeight,at.clientHeight),yn=_d(at.scrollTop,At),en=yn>0,kt=yn<At;le.state.scrollUpArrowVisible!==en&&le.set("scrollUpArrowVisible",en),le.state.scrollDownArrowVisible!==kt&&le.set("scrollDownArrowVisible",kt)}),yt=qw({open:ce,onOpenChange:gn,elements:{reference:Be,floating:Ze}}),Wt=CA(yt,{enabled:!y&&!D,event:"mousedown"}),Vt=Vh(yt),rn=$3(yt,{enabled:!y&&!D,listRef:se,activeIndex:ye,selectedIndex:je,disabledIndices:qi,onNavigate(at){at===null&&!ce||le.set("activeIndex",at)},focusItemOnHover:M}),Tn=G3(yt,{enabled:!y&&!D&&(ce||!R),listRef:ue,activeIndex:ye,selectedIndex:je,onMatch(at){ce?le.set("activeIndex",at):Tt(Se.current[at],tt("none"))},onTyping(at){Ee.current=at}}),qn=v.useMemo(()=>{const at=Ra(Tn.reference,rn.reference,Vt.reference,Wt.reference,ve);return K&&(at.id=K),at},[Wt.reference,Tn.reference,rn.reference,Vt.reference,ve,K]),ta=v.useMemo(()=>Ra($d,Tn.floating,rn.floating,Vt.floating),[Tn.floating,rn.floating,Vt.floating]),Vn=rn.item??an;Sh(()=>{le.update({popupProps:ta,triggerProps:qn})}),Ne(()=>{le.update({id:K,modal:w,multiple:R,value:V,open:ce,mounted:Le,transitionStatus:qe,popupProps:ta,triggerProps:qn,items:k,itemToStringLabel:N,itemToStringValue:O,isItemEqualToValue:A,openMethod:Ht})},[le,K,w,R,V,ce,Le,qe,ta,qn,k,N,O,A,Ht]);const ts=v.useMemo(()=>({store:le,name:G,required:S,disabled:D,readOnly:y,multiple:R,highlightItemOnHover:M,setValue:Tt,setOpen:gn,listRef:se,popupRef:ee,scrollHandlerRef:Re,handleScrollArrowVisibility:Xt,scrollArrowsMountedCountRef:$e,itemProps:Vn,events:yt.context.events,valueRef:be,valuesRef:Se,labelsRef:ue,typingRef:Ee,selectionRef:ke,firstItemTextRef:De,selectedItemTextRef:xe,validation:Z,onOpenChangeComplete:E,keyboardActiveRef:ze,alignItemWithTriggerActiveRef:_e,initialValueRef:Bt}),[le,G,S,D,y,R,M,Tt,gn,Vn,yt.context.events,Z,E,Xt]),An=As(j,Z.inputRef),na=R&&Array.isArray(V)&&V.length>0,Aa=R?void 0:G,ns=v.useMemo(()=>!R||!Array.isArray(V)||!G?null:V.map(at=>{const At=qo(at,O);return o.jsx("input",{type:"hidden",form:m,name:G,value:At},At)}),[R,V,m,G,O]);return o.jsx(US.Provider,{value:ts,children:o.jsxs(HS.Provider,{value:yt,children:[B,o.jsx("input",{...Z.getInputValidationProps({onFocus(){le.state.triggerElement?.focus({focusVisible:!0})},onChange(at){if(at.nativeEvent.defaultPrevented||D||y){at.preventBaseUIHandler?.();return}const At=at.currentTarget.value,yn=tt(Ts,at.nativeEvent);function en(){if(R)return;const kt=Se.current.find(un=>qo(un,O).toLowerCase()===At.toLowerCase()||$S(un,N).toLowerCase()===At.toLowerCase());kt!=null&&(I(kt!==Y.initialValue),Tt(kt,yn),H()&&Z.commit(kt))}le.set("forceMount",!0),queueMicrotask(en)}}),id:K&&Aa==null?`${K}-hidden-input`:void 0,form:m,name:Aa,autoComplete:h,value:vt,disabled:D,required:S&&!na,readOnly:y,ref:An,style:G?Kj:zh,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ns]})})}function Z4(e,n){return e??n}function J4(e){const n=e.getBoundingClientRect(),s=Ft(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,h=Math.max(n.width,d,p),x=Math.max(n.height,f,m),y=h-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 Ou=2,W4=400,eO={...sM,...ix,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},tO=v.forwardRef(function(n,s){const{render:r,className:i,id:c,disabled:d=!1,nativeButton:f=!0,style:p,...m}=n,{setTouched:h,setFocused:x,validationMode:y,state:S,disabled:w}=lc(),{labelId:_}=Kd(),{store:j,setOpen:E,selectionRef:k,validation:R,readOnly:N,required:O,alignItemWithTriggerActiveRef:A,disabled:M,keyboardActiveRef:B}=es(),U=w||M||d,I=Ke(j,Fe.open),L=Ke(j,Fe.mounted),P=Ke(j,Fe.value),H=Ke(j,Fe.triggerProps),Y=Ke(j,Fe.positionerElement),Q=Ke(j,Fe.listElement),q=Ke(j,Fe.popupSide),X=Ke(j,Fe.id),Z=Ke(j,Fe.labelId),$=Ke(j,Fe.hasSelectedValue),K=L&&Y?q:null,D=c??X,G=Z4(_,Z);Qd({id:D});const V=cn(Y),W=v.useRef(null),{getButtonProps:ce,buttonRef:oe}=gl({disabled:U,native:f}),se=Me(Ee=>{j.set("triggerElement",Ee)}),ue=As(s,W,oe,se),ee=Zn(),Re=Zn(),$e=Zn();v.useEffect(()=>{if(I)return $e.start(W4,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}),()=>{$e.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Re.clear()},[I,k,Re,$e]);const be=Ra(H,{id:D,role:"combobox","aria-expanded":I?"true":"false","aria-haspopup":"listbox","aria-controls":I?Q?.id??od(Y)?.id:void 0,"aria-labelledby":G,"aria-readonly":N||void 0,"aria-required":O||void 0,tabIndex:U?-1:0,ref:ue,onFocus(Ee){x(!0),I&&A.current&&E(!1,tt(Ts,Ee.nativeEvent)),ee.start(0,()=>{j.set("forceMount",!0)})},onBlur(Ee){Ye(Y,Ee.relatedTarget)||(h(!0),x(!1),y==="onBlur"&&R.commit(P))},onPointerMove(){B.current=!1},onKeyDown(){B.current=!0},onMouseDown(Ee){if(I)return;const ze=xt(Ee.currentTarget);function De(xe){if(!W.current)return;const ke=xe.target;if(Ye(W.current,ke)||Ye(V.current,ke)||ke===W.current)return;const _e=J4(W.current);xe.clientX>=_e.left-Ou&&xe.clientX<=_e.right+Ou&&xe.clientY>=_e.top-Ou&&xe.clientY<=_e.bottom+Ou||E(!1,tt(wT,xe))}Re.start(0,()=>{ze.addEventListener("mouseup",De,{once:!0})})}},R.getValidationProps,m,ce);be.role="combobox";const Se={...S,open:I,disabled:U,value:P,readOnly:N,popupSide:K,placeholder:!$};return Lt("button",n,{ref:[s,W],state:Se,stateAttributesMapping:eO,props:be})}),nO={value:()=>null},aO=v.forwardRef(function(n,s){const{className:r,render:i,children:c,placeholder:d,style:f,...p}=n,{store:m,valueRef:h}=es(),x=Ke(m,Fe.value),y=Ke(m,Fe.items),S=Ke(m,Fe.itemToStringLabel),w=Ke(m,Fe.hasSelectedValue),_=!w&&d!=null&&c==null,j=Ke(m,Fe.hasNullItemLabel,_),E={value:x,placeholder:!w};let k=null;return typeof c=="function"?k=c(x):c!=null?k=c:!w&&d!=null&&!j?k=d:Array.isArray(x)?k=K4(x,y,S):k=GS(x,y,S),Lt("span",n,{state:E,ref:[s,h],props:[{children:k},p],stateAttributesMapping:nO})}),sO=v.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,{store:f}=es(),m={open:Ke(f,Fe.open)};return Lt("span",n,{state:m,ref:s,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:$w})}),rO=v.createContext(void 0),oO=v.forwardRef(function(n,s){const{store:r}=es(),i=Ke(r,Fe.mounted),c=Ke(r,Fe.forceMount);return i||c?o.jsx(rO.Provider,{value:!0,children:o.jsx(yw,{ref:s,...n})}):null}),YS=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function lO(){return v.useContext(YS)}function hx(e){const{children:n,elementsRef:s,labelsRef:r,onMapChange:i}=e,c=Me(i),d=v.useRef(0),f=fa(cO).current,p=fa(iO).current,[m,h]=v.useState(0),x=v.useRef(m),y=Me((E,k)=>{p.set(E,k??null),x.current+=1,h(x.current)}),S=Me(E=>{p.delete(E),x.current+=1,h(x.current)}),w=v.useMemo(()=>{const E=new Map;return Array.from(p.keys()).filter(R=>R.isConnected).sort(uO).forEach((R,N)=>{const O=p.get(R)??{};E.set(R,{...O,index:N})}),E},[p,m]);Ne(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const E=new MutationObserver(k=>{const R=new Set,N=O=>R.has(O)?R.delete(O):R.add(O);k.forEach(O=>{O.removedNodes.forEach(N),O.addedNodes.forEach(N)}),R.size===0&&(x.current+=1,h(x.current))});return w.forEach((k,R)=>{R.parentElement&&E.observe(R.parentElement,{childList:!0})}),()=>{E.disconnect()}},[w]),Ne(()=>{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]),Ne(()=>()=>{s.current=[]},[s]),Ne(()=>()=>{r&&(r.current=[])},[r]);const _=Me(E=>(f.add(E),()=>{f.delete(E)}));Ne(()=>{f.forEach(E=>E(w))},[f,w]);const j=v.useMemo(()=>({register:y,unregister:S,subscribeMapChange:_,elementsRef:s,labelsRef:r,nextIndexRef:d}),[y,S,_,s,r,d]);return o.jsx(YS.Provider,{value:j,children:n})}function iO(){return new Map}function cO(){return new Set}function uO(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 FS=v.createContext(void 0);function xx(){const e=v.useContext(FS);if(!e)throw new Error(Rn(59));return e}function jd(e,n){e&&Object.assign(e.style,n)}const XS={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},dO=20;function fO(e,n,s,r){const[i,c]=v.useState(!1);Ne(()=>{if(!e||!n||s==null){c(!1);return}const d=xt(s).documentElement.clientWidth,f=s.offsetWidth;c(d>0&&f>0&&f>=d-dO)},[e,n,s]),TS(e&&(!n||i),r)}const mO={position:"fixed"},pO=v.forwardRef(function(n,s){const{anchor:r,positionMethod:i="absolute",className:c,render:d,side:f="bottom",align:p="center",sideOffset:m=0,alignOffset:h=0,collisionBoundary:x="clipping-ancestors",collisionPadding:y,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:_,alignItemWithTrigger:j=!0,collisionAvoidance:E=gA,style:k,...R}=n,{store:N,listRef:O,labelsRef:A,alignItemWithTriggerActiveRef:M,selectedItemTextRef:B,valuesRef:U,initialValueRef:I,popupRef:L,setValue:P}=es(),H=qS(),Y=Ke(N,Fe.open),Q=Ke(N,Fe.mounted),q=Ke(N,Fe.modal),X=Ke(N,Fe.value),Z=Ke(N,Fe.openMethod),$=Ke(N,Fe.positionerElement),K=Ke(N,Fe.triggerElement),D=Ke(N,Fe.isItemEqualToValue),G=Ke(N,Fe.transitionStatus),V=v.useRef(null),W=v.useRef(null),[ce,oe]=v.useState(j),se=Q&&ce&&Z!=="touch";!Q&&ce!==j&&oe(j),Ne(()=>{Q||(Fe.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),Fe.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Q]),v.useImperativeHandle(M,()=>se),fO((se||q)&&Y,Z==="touch",$,K);const ue=Zw({anchor:r,floatingRootContext:H,positionMethod:i,mounted:Q,side:f,sideOffset:m,align:p,alignOffset:h,arrowPadding:S,collisionBoundary:x,collisionPadding:y,sticky:w,disableAnchorTracking:_??se,collisionAvoidance:E,keepMounted:!0}),ee=se?"none":ue.side,Re=se?mO:ue.positionerStyles,$e={open:Y,side:ee,align:ue.align,anchorHidden:ue.anchorHidden};Ne(()=>{N.set("popupSide",ue.side)},[N,ue.side]);const be=Me(xe=>{N.set("positionerElement",xe)}),Se=Jw(n,$e,{styles:Re,transitionStatus:G,props:R,refs:[s,be],hidden:!Q,inert:!Y}),Ee=v.useRef(0),ze=Me(xe=>{if(xe.size===0&&Ee.current===0||U.current.length===0)return;const ke=Ee.current;if(Ee.current=xe.size,xe.size===ke)return;const _e=tt(Ts);if(ke!==0&&!N.state.multiple&&X!==null&&Di(U.current,X,D)===-1){const Ge=I.current,Oe=Ge!=null&&Di(U.current,Ge,D)!==-1?Ge:null;P(Oe,_e),Oe===null&&(N.set("selectedIndex",null),B.current=null)}if(ke!==0&&N.state.multiple&&Array.isArray(X)){const Le=qe=>Di(U.current,qe,D)!==-1,Ge=X.filter(qe=>Le(qe));(Ge.length!==X.length||Ge.some(qe=>!Y4(X,qe,D)))&&(P(Ge,_e),Ge.length===0&&(N.set("selectedIndex",null),B.current=null))}if(Y&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Le={height:""};jd($,Le),jd(L.current,Le)}}),De=v.useMemo(()=>({...ue,side:ee,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:V,scrollDownArrowRef:W}),[ue,ee,se,oe]);return o.jsx(hx,{elementsRef:O,labelsRef:A,onMapChange:ze,children:o.jsxs(FS.Provider,{value:De,children:[Q&&q&&o.jsx(NS,{inert:Jh(!Y),cutout:K}),Se]})})}),zu="base-ui-disable-scrollbar",eh={className:zu,getElement(e){return o.jsx("style",{nonce:e,href:zu,precedence:"base-ui:low",children:`.${zu}{scrollbar-width:none}.${zu}::-webkit-scrollbar{display:none}`})}},gO=v.createContext(void 0);function hO(e){return v.useContext(gO)}const xO=v.createContext(void 0),bO={disableStyleElements:!1};function vO(){return v.useContext(xO)??bO}const yO={...pl,...ml},_O=v.forwardRef(function(n,s){const{render:r,className:i,style:c,finalFocus:d,...f}=n,{store:p,popupRef:m,onOpenChangeComplete:h,setOpen:x,valueRef:y,firstItemTextRef:S,selectedItemTextRef:w,keyboardActiveRef:_,multiple:j,handleScrollArrowVisibility:E,scrollHandlerRef:k,listRef:R,highlightItemOnHover:N}=es(),{side:O,align:A,alignItemWithTriggerActive:M,isPositioned:B,setControlledAlignItemWithTrigger:U,scrollDownArrowRef:I,scrollUpArrowRef:L}=xx(),P=hO()!=null,H=qS(),Y=Qh(),{nonce:Q,disableStyleElements:q}=vO(),X=Ke(p,Fe.id),Z=Ke(p,Fe.open),$=Ke(p,Fe.mounted),K=Ke(p,Fe.popupProps),D=Ke(p,Fe.transitionStatus),G=Ke(p,Fe.triggerElement),V=Ke(p,Fe.positionerElement),W=Ke(p,Fe.listElement),ce=v.useRef(!1),oe=v.useRef(!1),se=v.useRef({}),ue=Qo(),ee=Me(Se=>{if(!V||!m.current||!oe.current)return;if(ce.current||!M){E();return}const Ee=V.style.top==="0px",ze=V.style.bottom==="0px";if(!Ee&&!ze){E();return}const De=$1(V),xe=Ei(V.getBoundingClientRect().height,"y",De),ke=xt(V),_e=getComputedStyle(V),Le=parseFloat(_e.marginTop),Ge=parseFloat(_e.marginBottom),qe=V1(getComputedStyle(m.current)),Oe=Math.min(ke.documentElement.clientHeight-Le-Ge,qe),ve=Se.scrollTop,le=Du(Se);let ye=0,je=null,Be=!1,Ze=!1;const _t=it=>{V.style.height=`${it}px`},Ht=(it,Et)=>{const Bt=Ci(it,0,Oe-xe);Bt>0&&_t(xe+Bt),Se.scrollTop=Et,Oe-(xe+Bt)<=Da&&(ce.current=!0),E()},vt=Ee?le-ve:ve,ut=Math.min(xe+vt,Oe);if(ye=ut,vt<=Da){Ht(vt,Ee?le:0);return}if(Oe-ut>Da)Ee?Ze=!0:je=0;else if(Be=!0,ze&&ve<le){const it=xe+vt-Oe;je=ve-(vt-it)}if(ye=Math.ceil(ye),ye!==0&&_t(ye),Ze||je!=null){const it=Du(Se),Et=Ze?it:Ci(je,0,it);Math.abs(Se.scrollTop-Et)>Da&&(Se.scrollTop=Et)}(Be||ye>=Oe-Da)&&(ce.current=!0),E()});v.useImperativeHandle(k,()=>ee,[ee]),br({open:Z,ref:m,onComplete(){Z&&h?.(!0)}});const Re={open:Z,transitionStatus:D,side:O,align:A};Ne(()=>{!V||!m.current||Object.keys(se.current).length||(se.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[m,V]),Ne(()=>{Z||M||(oe.current=!1,ce.current=!1,jd(V,se.current))},[Z,M,V,m]),Ne(()=>{const Se=m.current;if(!Z||!G||!V||!Se||M&&!B||p.state.transitionStatus==="ending")return;if(!M){oe.current=!0,ue.request(E),Se.style.removeProperty("--transform-origin");return}const Ee=jO(Se);Se.style.removeProperty("--transform-origin");try{let ze=w.current;ze?.isConnected||(ze=!Fe.hasSelectedValue(p.state)&&S.current?.isConnected?S.current:null);const De=y.current,xe=getComputedStyle(V),ke=getComputedStyle(Se),_e=xt(G),Le=Ft(V),Ge=$1(G),qe=Lu(G.getBoundingClientRect(),Ge),Oe=Lu(V.getBoundingClientRect(),Ge),ve=qe.height,le=W||Se,ye=le.scrollHeight,je=parseFloat(ke.borderBottomWidth),Be=parseFloat(xe.marginTop)||10,Ze=parseFloat(xe.marginBottom)||10,_t=parseFloat(xe.minHeight)||100,Ht=V1(ke),vt=5,ut=5,it=20,Et=_e.documentElement.clientHeight-Be-Ze,Bt=_e.documentElement.clientWidth,pa=Et-qe.bottom+ve;let gn,dt=Y==="rtl"?qe.right-Oe.width:qe.left,Tt=0;if(ze&&De){const An=Lu(De.getBoundingClientRect(),Ge);gn=Lu(ze.getBoundingClientRect(),Ge),dt=Oe.left+(Y==="rtl"?An.right-gn.right:An.left-gn.left);const na=An.top-qe.top+An.height/2;Tt=gn.top-Oe.top+gn.height/2-na}const Xt=pa+Tt+Ze+je;let yt=Math.min(Et,Xt);const Wt=Et-Be-Ze,Vt=Xt-yt,rn=Bt-ut;V.style.left=`${Ci(dt,vt,rn-Oe.width)}px`,V.style.height=`${yt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Be}px`,V.style.marginBottom=`${Ze}px`,Se.style.height="100%";const Tn=Du(le),qn=Vt>=Tn-Da;qn&&(yt=Math.min(Et,Oe.height)-(Vt-Tn));const ta=qe.top<it||qe.bottom>Et-it||Math.ceil(yt)+Da<Math.min(ye,_t),Vn=(Le.visualViewport?.scale??1)!==1&&Eh;if(ta||Vn){oe.current=!0,jd(V,se.current),U(!1);return}const ts=Math.max(_t,yt);if(qn){const An=Math.max(0,Et-Xt);V.style.top=Oe.height>=Wt?"0":`${An}px`,V.style.height=`${yt}px`,le.scrollTop=Du(le)}else V.style.bottom="0",le.scrollTop=Vt;if(gn){const An=Oe.top,na=Oe.height,Aa=gn.top+gn.height/2,ns=na>0?(Aa-An)/na*100:50,at=Ci(ns,0,100);Se.style.setProperty("--transform-origin",`50% ${at}%`)}(ts===Et||yt>=Ht)&&(ce.current=!0),E(),N&&p.state.selectedIndex===null&&p.state.activeIndex===null&&R.current[0]!=null&&p.set("activeIndex",0),oe.current=!0}finally{Ee()}},[p,Z,V,G,y,S,w,m,E,M,U,ue,I,L,W,R,N,Y,B]),v.useEffect(()=>{if(!M||!V||!Z)return;const Se=Ft(V);function Ee(ze){x(!1,tt(ST,ze))}return ct(Se,"resize",Ee)},[x,M,V,Z]);const $e={...W?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":j||void 0,id:`${X}-list`},onKeyDown(Se){_.current=!0,P&&dx.has(Se.key)&&Se.stopPropagation()},onMouseMove(){_.current=!1},onScroll(Se){W||ee(Se.currentTarget)},...M&&{style:W?{height:"100%"}:XS}},be=Lt("div",n,{ref:[s,m],state:Re,stateAttributesMapping:yO,props:[K,$e,Zh(D),{className:!W&&M?eh.className:void 0},f]});return o.jsxs(v.Fragment,{children:[!q&&eh.getElement(Q),o.jsx(_w,{context:H,modal:!1,disabled:!$,returnFocus:d,restoreFocus:!0,children:be})]})});function V1(e){const n=e.maxHeight||"";return n.endsWith("px")&&parseFloat(n)||1/0}function Du(e){return gx(e.scrollHeight,e.clientHeight)}function $1(e){return Nw.getScale(e)}function Ei(e,n,s){return e/s[n]}function Lu(e,n){return $i({x:Ei(e.x,"x",n),y:Ei(e.y,"y",n),width:Ei(e.width,"x",n),height:Ei(e.height,"y",n)})}const G1=[["transform","none"],["scale","1"],["translate","0 0"]];function jO(e){const{style:n}=e,s={};for(const[r,i]of G1)s[r]=n.getPropertyValue(r),n.setProperty(r,i,"important");return()=>{for(const[r]of G1){const i=s[r];i?n.setProperty(r,i):n.removeProperty(r)}}}const wO=v.forwardRef(function(n,s){const{render:r,className:i,style:c,...d}=n,{store:f,scrollHandlerRef:p}=es(),{alignItemWithTriggerActive:m}=xx(),h=Ke(f,Fe.hasScrollArrows),x=Ke(f,Fe.openMethod),y=Ke(f,Fe.multiple),w={id:`${Ke(f,Fe.id)}-list`,role:"listbox","aria-multiselectable":y||void 0,onScroll(j){p.current?.(j.currentTarget)},...m&&{style:XS},className:h&&x!=="touch"?eh.className:void 0},_=Me(j=>{f.set("listElement",j)});return Lt("div",n,{ref:[s,_],props:[w,d]})});let KS=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function bx(e={}){const{label:n,metadata:s,textRef:r,indexGuessBehavior:i,index:c}=e,{register:d,unregister:f,subscribeMapChange:p,elementsRef:m,labelsRef:h,nextIndexRef:x}=lO(),y=v.useRef(-1),[S,w]=v.useState(c??(i===KS.GuessFromOrder?()=>{if(y.current===-1){const E=x.current;x.current+=1,y.current=E}return y.current}:-1)),_=v.useRef(null),j=v.useCallback(E=>{if(_.current=E,S!==-1&&E!==null&&(m.current[S]=E,h)){const k=n!==void 0;h.current[S]=k?n:r?.current?.textContent??E.textContent}},[S,m,h,n,r]);return Ne(()=>{if(c!=null)return;const E=_.current;if(E)return d(E,s),()=>{f(E)}},[c,d,f,s]),Ne(()=>{if(c==null)return p(E=>{const k=_.current?E.get(_.current)?.index:null;k!=null&&w(k)})},[c,p,w]),v.useMemo(()=>({ref:j,index:S}),[S,j])}const QS=v.createContext(void 0);function vx(){const e=v.useContext(QS);if(!e)throw new Error(Rn(57));return e}const SO=v.memo(v.forwardRef(function(n,s){const{render:r,className:i,style:c,value:d=null,label:f,disabled:p=!1,nativeButton:m=!1,...h}=n,x=v.useRef(null),y=bx({label:f,textRef:x,indexGuessBehavior:KS.GuessFromOrder}),{store:S,itemProps:w,setOpen:_,setValue:j,selectionRef:E,typingRef:k,valuesRef:R,multiple:N,selectedItemTextRef:O}=es(),A=Ke(S,Fe.isActive,y.index),M=Ke(S,Fe.isSelected,y.index,d),B=Ke(S,Fe.isSelectedByFocus,y.index),U=Ke(S,Fe.isItemEqualToValue),I=y.index,L=I!==-1,P=v.useRef(null);Ne(()=>{if(!L)return;const W=R.current;return W[I]=d,()=>{delete W[I]}},[L,I,d,R]),Ne(()=>{if(!L)return;const W=S.state.value;let ce=W;N&&Array.isArray(W)&&W.length>0&&(ce=W[W.length-1]),ce!==void 0&&sl(d,ce,U)&&(S.set("selectedIndex",I),x.current&&(O.current=x.current))},[L,I,N,U,S,d,O]);const H=v.useRef(null),Y=v.useRef("mouse"),Q=v.useRef(!1),{getButtonProps:q,buttonRef:X}=gl({disabled:p,focusableWhenDisabled:!0,native:m,composite:!0}),Z={disabled:p,selected:M,highlighted:A};function $(W){const ce=S.state.value;if(N){const oe=Array.isArray(ce)?ce:[],se=M?F4(oe,d,U):[...oe,d];j(se,tt(Sp,W))}else j(d,tt(Sp,W)),_(!1,tt(Sp,W))}function K(){E.current.dragY=0}const D={role:"option","aria-selected":M,tabIndex:A?0:-1,onKeyDown(W){H.current=W.key,S.set("activeIndex",I),W.key===" "&&k.current&&W.preventDefault()},onClick(W){const ce=W.type==="click"&&Y.current!=="touch",oe=W.nativeEvent.pointerType,se=ce&&kh(W.nativeEvent)&&(oe!==void 0||A),ue=ce&&!se&&!Q.current;Q.current=!1,!(W.type==="keydown"&&H.current===null)&&(p||W.type==="keydown"&&H.current===" "&&k.current||ue||(H.current=null,$(W.nativeEvent)))},onPointerEnter(W){Y.current=W.pointerType},onPointerMove(W){if(W.pointerType==="mouse"&&W.buttons===1){const ce=E.current;ce.dragY+=W.movementY,ce.dragY**2>=64&&(ce.allowUnselectedMouseUp=!0)}},onPointerDown(W){Y.current=W.pointerType,Q.current=!0,K()},onMouseUp(){if(K(),p||Y.current==="touch"||Q.current)return;const W=!E.current.allowSelectedMouseUp&&M,ce=!E.current.allowUnselectedMouseUp&&!M;W||ce||(Q.current=!0,P.current?.click(),Q.current=!1)}},G=Lt("div",n,{ref:[X,s,y.ref,P],state:Z,props:[w,D,h,q]}),V=v.useMemo(()=>({selected:M,index:I,textRef:x,selectedByFocus:B,hasRegistered:L}),[M,I,x,B,L]);return o.jsx(QS.Provider,{value:V,children:G})})),CO=v.forwardRef(function(n,s){const r=n.keepMounted??!1,{selected:i}=vx();return r||i?o.jsx(EO,{...n,ref:s}):null}),EO=v.memo(v.forwardRef((e,n)=>{const{render:s,className:r,style:i,keepMounted:c,...d}=e,{selected:f}=vx(),p=v.useRef(null),{transitionStatus:m,setMounted:h}=ac(f),y=Lt("span",e,{ref:[n,p],state:{selected:f,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},d],stateAttributesMapping:ml});return br({open:f,ref:p,onComplete(){f||h(!1)}}),y})),kO=v.memo(v.forwardRef(function(n,s){const{index:r,textRef:i,selectedByFocus:c,hasRegistered:d}=vx(),{firstItemTextRef:f,selectedItemTextRef:p}=es(),{render:m,className:h,style:x,...y}=n,S=v.useCallback(_=>{_&&(d&&r===0&&(f.current=_),d&&c&&(p.current=_))},[f,p,r,c,d]);return Lt("div",n,{ref:[S,s,i],props:y})})),ZS=v.forwardRef(function(n,s){const{render:r,className:i,style:c,direction:d,keepMounted:f=!1,...p}=n,m=d==="up",{store:h,popupRef:x,listRef:y,handleScrollArrowVisibility:S,scrollArrowsMountedCountRef:w}=es(),{side:_,scrollDownArrowRef:j,scrollUpArrowRef:E}=xx(),k=m?Fe.scrollUpArrowVisible:Fe.scrollDownArrowVisible,R=Ke(h,k),N=Ke(h,Fe.openMethod),O=R&&N!=="touch",A=Zn(),M=m?E:j,{transitionStatus:B,setMounted:U}=ac(O);Ne(()=>(w.current+=1,h.state.hasScrollArrows||h.set("hasScrollArrows",!0),()=>{w.current=Math.max(0,w.current-1),w.current===0&&h.state.hasScrollArrows&&h.set("hasScrollArrows",!1)}),[h,w]),br({open:O,ref:M,onComplete(){O||U(!1)}});const P=Lt("div",n,{ref:[s,M],state:{direction:d,visible:O,side:_,transitionStatus:B},props:[{"aria-hidden":!0,children:m?"▲":"▼",style:{position:"absolute"},onMouseMove(Y){if(Y.movementX===0&&Y.movementY===0||A.isStarted())return;h.set("activeIndex",null);function Q(){const q=h.state.listElement??x.current;if(!q)return;h.set("activeIndex",null),S();const X=gx(q.scrollHeight,q.clientHeight),Z=_d(q.scrollTop,X),$=Z===(m?0:X),K=y.current;if(Z!==q.scrollTop&&(q.scrollTop=Z),K.length===0&&h.set(m?"scrollUpArrowVisible":"scrollDownArrowVisible",!$),$){A.clear();return}if(K.length>0){const D=M.current?.offsetHeight||0;q.scrollTop=NO(K,m,Z,q.clientHeight,D,X)}A.start(40,Q)}A.start(40,Q)},onMouseLeave(){A.clear()}},p]});return O||f?P:null});function NO(e,n,s,r,i,c){if(n){let h=0;const x=s+i-Da;for(let w=0;w<e.length;w+=1){const _=e[w];if(_&&_.offsetTop>=x){h=w;break}}const y=Math.max(0,h-1),S=e[y];return y<h&&S?_d(S.offsetTop-i,c):0}let d=e.length-1;const f=s+r-i+Da;for(let h=0;h<e.length;h+=1){const x=e[h];if(x&&x.offsetTop+x.offsetHeight>f){d=Math.max(0,h-1);break}}const p=Math.min(e.length-1,d+1),m=e[p];return p>d&&m?_d(m.offsetTop+m.offsetHeight-r+i,c):c}const RO=v.forwardRef(function(n,s){return o.jsx(ZS,{...n,ref:s,direction:"down"})}),TO=v.forwardRef(function(n,s){return o.jsx(ZS,{...n,ref:s,direction:"up"})}),AO=Q4;function MO({className:e,...n}){return o.jsx(aO,{"data-slot":"select-value",className:Pt("flex flex-1 text-left",e),...n})}function OO({className:e,size:n="default",children:s,...r}){return o.jsxs(tO,{"data-slot":"select-trigger","data-size":n,className:Pt("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(sO,{render:o.jsx(Jr,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function zO({className:e,children:n,side:s="bottom",sideOffset:r=4,align:i="center",alignOffset:c=0,alignItemWithTrigger:d=!0,...f}){return o.jsx(oO,{children:o.jsx(pO,{side:s,sideOffset:r,align:i,alignOffset:c,alignItemWithTrigger:d,className:"isolate z-50",children:o.jsxs(_O,{"data-slot":"select-content","data-align-trigger":d,className:Pt("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(LO,{}),o.jsx(wO,{children:n}),o.jsx(PO,{})]})})})}function DO({className:e,children:n,...s}){return o.jsxs(SO,{"data-slot":"select-item",className:Pt("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(kO,{className:"flex min-w-0 flex-1 gap-2 overflow-hidden whitespace-nowrap",children:n}),o.jsx(CO,{render:o.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:o.jsx(Bi,{className:"pointer-events-none"})})]})}function LO({className:e,...n}){return o.jsx(TO,{"data-slot":"select-scroll-up-button",className:Pt("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(pj,{})})}function PO({className:e,...n}){return o.jsx(RO,{"data-slot":"select-scroll-down-button",className:Pt("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(Jr,{})})}function Ct({value:e,onChange:n,options:s,placeholder:r="— elegir —",disabled:i,className:c}){return o.jsxs(AO,{value:e,onValueChange:d=>n(d??""),disabled:i,children:[o.jsx(OO,{className:Ae("h-9 w-full",c),children:o.jsx(MO,{placeholder:r,children:d=>s.find(f=>f.value===d)?.label??d})}),o.jsx(zO,{side:"bottom",sideOffset:6,align:"start",alignItemWithTrigger:!1,className:"max-w-[min(20rem,var(--available-width))] p-1.5",children:s.map(d=>{const f=d.icon;return o.jsx(DO,{value:d.value,children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[f?o.jsx(f,{className:"size-4 shrink-0 text-muted-fg"}):null,d.description?o.jsxs("span",{className:"flex min-w-0 flex-col leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:d.label}),o.jsx("span",{className:"truncate text-[11px] text-muted-fg",children:d.description})]}):o.jsx("span",{className:"truncate",children:d.label})]})},d.value)})})]})}const Y1=320;function BO(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 IO(e){return e.agent_slug||e.actor_id||e.author||e.actor_kind||"—"}function UO({m:e}){const[n,s]=v.useState(!1),r=(e.body?.length||0)>Y1,i=!r||n?e.body:`${e.body.slice(0,Y1)}…`;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(dj,{size:14,className:"text-blue-400"}):o.jsx(mj,{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:BO(e.ts)}),o.jsx(Ue,{tone:"info",children:e.channel}),e.type&&o.jsx(Ue,{children:e.type}),o.jsx("span",{className:"font-medium text-foreground",children:IO(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:C(n?"logs.show_less":"logs.show_more")})]})]})}function HO(){const[e,n]=v.useState(!1),s=Qe(e?"/admin/logs?errors":null,()=>el.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:[C("logs.daemon_errors"),r.length?` · ${r.length}`:""]}),o.jsxs("div",{className:"border-t border-border p-3",children:[s.isLoading&&o.jsx(Je,{}),e&&!s.isLoading&&r.length===0&&o.jsx("p",{className:"text-xs text-muted-fg",children:C("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 qO({pid:e}){const n=!e||String(e)==="0",[s,r]=v.useState(""),[i,c]=v.useState(""),[d,f]=v.useState(""),[p,m]=v.useState(""),h=s.trim()||void 0,x=n?`/messages/global?channel=${h??""}`:`/projects/${e}/messages?channel=${h??""}`,y=Qe(x,()=>n?Jg.global({channel:h,limit:300}):Jg.project(e,{channel:h,limit:300})),S=v.useMemo(()=>[...y.data||[]].sort((j,E)=>(E.ts||"").localeCompare(j.ts||"")),[y.data]),w=v.useMemo(()=>Array.from(new Set(S.map(j=>j.type).filter(Boolean))),[S]),_=v.useMemo(()=>S.filter(j=>!(i&&j.direction!==i||d&&j.type!==d||p&&!(j.body||"").toLowerCase().includes(p.toLowerCase()))),[S,i,d,p]);return o.jsxs(He,{title:C("logs.title"),description:C(n?"logs.desc_global":"logs.desc_project"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ce,{placeholder:C("logs.filter_channel"),value:s,onChange:j=>r(j.target.value),className:"w-44"}),o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>y.mutate(),children:o.jsx(Wr,{size:13})})]}),children:[n&&o.jsx(HO,{}),o.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[o.jsx("div",{className:"w-36",children:o.jsx(Ct,{value:i,onChange:c,placeholder:C("logs.filter_dir"),options:[{value:"",label:C("logs.all_directions")},{value:"in",label:C("logs.in")},{value:"out",label:C("logs.out")}]})}),o.jsx("div",{className:"w-40",children:o.jsx(Ct,{value:d,onChange:f,placeholder:C("logs.filter_type"),options:[{value:"",label:C("logs.all_types")},...w.map(j=>({value:j,label:j}))]})}),o.jsx(Ce,{placeholder:C("logs.search_text"),value:p,onChange:j=>m(j.target.value),className:"w-56"}),o.jsxs("span",{className:"text-[11px] text-muted-fg",children:[_.length," ",C("logs.count_of")," ",S.length]})]}),y.isLoading&&o.jsx(Je,{}),y.error&&o.jsx(ot,{children:C("logs.error",{msg:y.error.message})}),!y.isLoading&&!y.error&&_.length===0&&o.jsx(ot,{children:h?C("logs.no_activity_ch",{ch:h}):C("logs.no_activity")}),o.jsx("ul",{className:"space-y-1 text-sm",children:_.map((j,E)=>o.jsx(UO,{m:j},`${j.ts}-${E}`))})]})}function JS({value:e,onChange:n,options:s,placeholder:r="elegí o escribí un modelo…",invalid:i,invalidHint:c,className:d}){const[f,p]=v.useState(!1),[m,h]=v.useState(e),x=v.useRef(null);v.useEffect(()=>{h(e)},[e]),v.useEffect(()=>{if(!f)return;const _=j=>{x.current&&!x.current.contains(j.target)&&p(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[f]);const y=m.trim().toLowerCase(),S=y?s.filter(_=>_.toLowerCase().includes(y)):s,w=_=>{n(_),h(_),p(!1)};return o.jsxs("div",{ref:x,className:Ae("relative",d),children:[o.jsxs("div",{className:Ae("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(jj,{className:"size-3.5 shrink-0 text-amber-400"})}),o.jsx("input",{value:m,placeholder:r,onChange:_=>{h(_.target.value),n(_.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(_=>!_),className:"shrink-0 text-muted-fg hover:text-foreground",children:o.jsx(Jr,{className:"size-4"})})]}),f&&S.length>0&&o.jsx("ul",{className:"absolute z-50 mt-1 max-h-56 w-full overflow-y-auto rounded-lg border border-border bg-popover p-1 shadow-md ring-1 ring-foreground/10",children:S.map(_=>o.jsx("li",{children:o.jsx("button",{type:"button",onMouseDown:j=>{j.preventDefault(),w(_)},className:Ae("flex w-full items-center rounded-md px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-fg",_===e&&"bg-accent/50"),children:o.jsx("span",{className:"truncate font-mono text-xs",children:_})})},_))})]})}function yr(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/admin/config",()=>el.config.get()),i=async(c,d)=>{const f=await el.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 WS(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/admin/super-agent",()=>el.superAgent());return{superAgent:e,error:n,isLoading:s,mutate:r}}const VO={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"},$O={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"},Li=[{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 Xp(e,n){return n&&n in e?e[n]:e.custom}const wd={anthropic:il,openai:vn,gemini:GN,groq:Ui,openrouter:hh,ollama:yj,azure:MN,mock:HN,custom:cl},$r={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 e2(e){const n=e.indexOf(":");return n<0?{provider:e,model:""}:{provider:e.slice(0,n),model:e.slice(n+1)}}function Kp({value:e,onChange:n,providers:s}){const{provider:r,model:i}=e2(e),c=s.find(h=>h.slug===r),d=!!r&&!c,f=v.useMemo(()=>{const h=c?$r[c.engine]?.known_models||[]:[];return Array.from(new Set([...c?.default_model?[c.default_model]:[],...h]))},[c]),p=h=>{const x=s.find(S=>S.slug===h),y=x?.default_model||$r[x?.engine]?.default_model||"";n(y?`${h}:${y}`:`${h}:`)},m=h=>n(`${r}:${h}`);return o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(Ct,{value:r,onChange:p,placeholder:d?`⚠ ${r} (no existe)`:"— proveedor —",options:s.map(h=>({value:h.slug,label:h.slug,icon:wd[h.engine]}))}),o.jsx(JS,{value:i,onChange:m,options:f,invalid:d,invalidHint:`El proveedor "${r}" no está configurado.`})]})}function GO(){const e=nt(),{superAgent:n,isLoading:s,mutate:r}=WS(),{config:i,patch:c}=yr(),[d,f]=v.useState(""),[p,m]=v.useState([]),[h,x]=v.useState(""),[y,S]=v.useState(null),[w,_]=v.useState(!1),[j,E]=v.useState({model:"",fallback:[]});v.useEffect(()=>{if(!n)return;const I=n.model_fallback?.models||[],L=Array.isArray(I)?I:[];f(n.model||""),m(L),E({model:n.model||"",fallback:L})},[n]);const k=v.useMemo(()=>{const I=i.engines||{};return Object.entries(I).map(([L,P])=>({slug:L,engine:P?.engine||L,default_model:P?.default_model||$r[P?.engine||L]?.default_model}))},[i.engines]),R=I=>{const{provider:L}=e2(I);return k.some(P=>P.slug===L)};if(s||!n)return o.jsx(Je,{});const N=d!==j.model||JSON.stringify(p)!==JSON.stringify(j.fallback),O=async()=>{_(!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."),E({model:d,fallback:p}),r()}catch(I){e.error(I.message)}finally{_(!1)}},A=()=>{const I=h.trim().replace(/:$/,"");!I||!I.includes(":")||p.includes(I)||(m([...p,I]),x(""))},M=(I,L)=>{const P=[...p];P[I]=L,m(P)},B=I=>{m(p.filter((L,P)=>P!==I)),y===I&&S(null)},U=(I,L)=>{const P=I+L;if(P<0||P>=p.length)return;const H=[...p];[H[I],H[P]]=[H[P],H[I]],m(H)};return o.jsx(He,{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(Ue,{tone:"success",children:[o.jsx(hh,{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(fj,{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(Kp,{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,L)=>{const P=!R(I),H=y===L;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:["#",L+1]}),H?o.jsx("div",{className:"flex-1",children:o.jsx(Kp,{value:I,onChange:Y=>M(L,Y),providers:k})}):o.jsxs("button",{type:"button",onClick:()=>S(L),className:"flex flex-1 items-center gap-1.5 text-left",children:[P&&o.jsx(jj,{size:12,className:"text-amber-400"}),o.jsx("span",{className:`font-mono ${P?"text-amber-400":""}`,children:I})]}),H?o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>S(null),children:"listo"}):o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>S(L),children:o.jsx(xh,{size:12})}),o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>U(L,-1),disabled:L===0,children:"↑"}),o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>U(L,1),disabled:L===p.length-1,children:"↓"}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>B(L),children:o.jsx(Ja,{size:12})})]})},`${L}-${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(Kp,{value:h,onChange:x,providers:k}),o.jsxs(he,{size:"sm",variant:"secondary",onClick:A,disabled:!h.includes(":")||h.endsWith(":"),children:[o.jsx(Nn,{size:13})," Agregar a la cadena"]})]})]}),o.jsx(he,{variant:"primary",loading:w,disabled:!N,onClick:O,children:N?"Guardar router":"Guardado"})]})})}function YO({provider:e,onEdit:n,onDelete:s,onToggle:r}){const i=Xp(VO,e.engine),c=Xp($O,e.engine),d=Xp(wd,e.engine),f=Li.find(x=>x.value===e.engine)?.label||e.engine,p=typeof e.api_key=="string"&&e.api_key.length>0,m=al(e.api_key),h=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:Ae("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:Ae("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(Jo,{content:h?"Activo · click para desactivar":"Inactivo · click para activar",children:o.jsxs("button",{type:"button",onClick:x=>{x.stopPropagation(),r()},className:Ae("flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-medium transition-colors",h?"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:Ae("size-1.5 rounded-full",h?"bg-emerald-400":"bg-muted-fg/40")}),h?"Active":"Off"]})}),o.jsx(Jo,{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(Ja,{className:"size-3.5"})})})]})]}),o.jsxs("div",{className:"mt-auto space-y-1 text-xs",children:[o.jsx(gi,{label:"Modelo",value:e.default_model||"—",mono:!0}),e.base_url&&o.jsx(gi,{label:"Base URL",value:e.base_url,mono:!0,truncate:!0}),o.jsx(gi,{label:"API key",value:p?m?`…${m}`:"✓ seteada":"—",mono:!!m}),e.default_temperature!==void 0&&o.jsx(gi,{label:"Temp",value:e.default_temperature.toFixed(1)}),e.pricing?.input_per_million!==void 0&&o.jsx(gi,{label:"$ in/out (1M)",value:`${e.pricing.input_per_million??0} / ${e.pricing.output_per_million??0}`})]})]})}function gi({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:Ae("text-foreground",s&&"font-mono",r&&"max-w-[180px] truncate"),children:n})]})}const F1={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:""},FO=["anthropic","openai","gemini","groq","openrouter","ollama","custom"];function hi(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Pu(e){if(e==null)return"";const n=Number(e);return Number.isFinite(n)?String(n):""}function XO(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:Pu(e.pricing?.input_per_million),p_output:Pu(e.pricing?.output_per_million),p_cache_read:Pu(e.pricing?.cache_read_per_million),p_cache_write:Pu(e.pricing?.cache_write_per_million)}}function KO({open:e,initial:n,existingSlugs:s,onClose:r,onSave:i}){const c=!!n,[d,f]=v.useState(F1),[p,m]=v.useState(!1),[h,x]=v.useState(null),[y,S]=v.useState([]),[w,_]=v.useState(!1),[j,E]=v.useState(null),[k,R]=v.useState(!1),[N,O]=v.useState("");v.useEffect(()=>{if(!e)return;const $=n?XO(n):F1;f($),x(null),E(null),R(!1);const K=$r[$.engine];S(K?.known_models||[])},[e,n]);const A=$=>f(K=>({...K,...$})),M=$=>{const K=$r[$];A({engine:$,name:$==="custom"?d.name:Li.find(D=>D.value===$)?.label||$,slug:$==="custom"?d.slug:$,base_url:K.base_url,default_model:K.default_model}),S(K.known_models),E(null)},B=$=>{const K=$r[$];A({engine:$,base_url:d.base_url||K.base_url,default_model:d.default_model||K.default_model}),S(K.known_models)},U=async()=>{_(!0),E(null);try{const $=await bd.models({engine:d.engine,slug:d.slug||hi(d.name),base_url:d.base_url||void 0,api_key:d.api_key_value||void 0});if($.error){E($.error);return}S($.models),$.models.length===0&&E("Sin modelos. ¿Key/URL correctas?")}catch($){E($.message||"No se pudo listar modelos.")}finally{_(!1)}},I=v.useMemo(()=>d.default_model&&!y.includes(d.default_model)?[d.default_model,...y]:y,[y,d.default_model]),L=()=>{const $=(d.slug||hi(d.name)).trim();if(!$)return x("Slug requerido."),null;if(!c&&s.includes($))return x(`Ya existe un provider "${$}".`),null;let K;if(d.model_context_limits_json.trim())try{const V=JSON.parse(d.model_context_limits_json);if(!V||typeof V!="object"||Array.isArray(V))throw new Error;K=V}catch{return x("Límites de contexto por modelo: JSON inválido."),null}const G=[d.p_input,d.p_output,d.p_cache_read,d.p_cache_write].map(V=>V.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:K,pricing:G},modelLimits:K}},P=()=>{const $=L();if(!$)return;const{provider:K}=$,D={name:K.name,engine:K.engine,is_active:K.is_active!==!1,default_temperature:K.default_temperature,default_max_tokens:K.default_max_tokens};K.base_url&&(D.base_url=K.base_url),K.default_model&&(D.default_model=K.default_model),K.context_limit_tokens&&(D.context_limit_tokens=K.context_limit_tokens),K.model_context_limits&&(D.model_context_limits=K.model_context_limits),K.pricing&&(D.pricing=K.pricing),d.api_key_value.trim()&&(D.api_key=d.api_key_value.trim()),O(JSON.stringify(D,null,2)),x(null),R(!0)},H=async()=>{m(!0),x(null);try{if(k){const K=(d.slug||hi(d.name)).trim();if(!K){x("Slug requerido (en el formulario).");return}let D;try{D=JSON.parse(N)}catch{x("JSON inválido: revisá la sintaxis.");return}if(!D||typeof D!="object"||Array.isArray(D)){x("El JSON debe ser un objeto con la config del provider.");return}const G=D;if(!G.engine||typeof G.engine!="string"){x('Falta "engine" (ej. "anthropic", "ollama").');return}const V={slug:K,name:typeof G.name=="string"?G.name:K,engine:String(G.engine),base_url:typeof G.base_url=="string"?G.base_url:void 0,default_model:typeof G.default_model=="string"?G.default_model:void 0,is_active:G.is_active!==!1};await i({provider:V,raw:G,originalSlug:n?.slug}),r();return}const $=L();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)}},Y=c&&La(n?.api_key),Q=al(n?.api_key),q=Y?`…${Q??""} (ya seteada)`:"sk-…",X=d.engine==="ollama",Z=$r[d.engine]?.api_key_env;return o.jsx(ma,{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(he,{variant:"ghost",onClick:r,disabled:p,children:"Cancelar"}),o.jsx(he,{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:FO.map($=>{const K=wd[$],D=$==="custom"?"Custom":Li.find(V=>V.value===$)?.label||$,G=d.engine===$;return o.jsxs("button",{type:"button",onClick:()=>M($),className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs transition-colors ${G?"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(K,{className:"size-3.5"})," ",D]},$)})}),o.jsxs("button",{type:"button",onClick:()=>k?R(!1):P(),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(RN,{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||hi(d.name)||"<slug>"} en config.json`,children:o.jsx(Qt,{rows:14,className:"font-mono text-xs",value:N,onChange:$=>O($.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(Ce,{value:d.name,onChange:$=>A({name:$.target.value,slug:c?d.slug:hi($.target.value)}),placeholder:"Mi provider"})}),o.jsx(fe,{label:"Motor (engine)",children:o.jsx(Ct,{value:d.engine,onChange:$=>B($),options:Li.map($=>({value:$.value,label:$.label,icon:wd[$.value]}))})})]}),o.jsx(fe,{label:"URL base (base_url)",hint:"Se completa sola al elegir un proveedor.",children:o.jsx(Ce,{value:d.base_url,onChange:$=>A({base_url:$.target.value}),placeholder:"https://api.openai.com/v1"})}),!X&&o.jsx(fe,{label:"API key",hint:Y?"Dejá en blanco para mantener la actual.":Z?`Se guarda como secreto. Env sugerida: ${Z}`:"Se guarda como secreto.",children:o.jsx(Ce,{type:"password",autoComplete:"new-password",value:d.api_key_value,onChange:$=>A({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(JS,{value:d.default_model,onChange:$=>A({default_model:$}),options:I,className:"flex-1"}),o.jsxs(he,{size:"sm",variant:"secondary",onClick:U,disabled:w,title:"Lista los modelos reales del proveedor",children:[w?o.jsx(Td,{className:"size-3.5 animate-spin"}):o.jsx(Wr,{className:"size-3.5"}),"Cargar modelos"]})]}),j&&o.jsx("p",{className:"text-[11px] text-amber-400",children:j})]})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:"Máx. tokens (max_tokens)",children:o.jsx(Ce,{type:"number",min:256,step:256,value:d.default_max_tokens,onChange:$=>A({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:$=>A({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(Ce,{type:"number",min:0,step:1024,value:d.context_limit_tokens,onChange:$=>A({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(Ce,{type:"number",min:0,step:1e-4,value:d.p_input,onChange:$=>A({p_input:$.target.value}),placeholder:"0.15"})}),o.jsx(fe,{label:"$ salida / 1M",children:o.jsx(Ce,{type:"number",min:0,step:1e-4,value:d.p_output,onChange:$=>A({p_output:$.target.value}),placeholder:"0.60"})}),o.jsx(fe,{label:"$ cache read / 1M",children:o.jsx(Ce,{type:"number",min:0,step:1e-4,value:d.p_cache_read,onChange:$=>A({p_cache_read:$.target.value}),placeholder:"0.03"})}),o.jsx(fe,{label:"$ cache write / 1M",children:o.jsx(Ce,{type:"number",min:0,step:1e-4,value:d.p_cache_write,onChange:$=>A({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(Qt,{rows:3,className:"font-mono text-xs",value:d.model_context_limits_json,onChange:$=>A({model_context_limits_json:$.target.value})})})]})]}),o.jsx(sn,{checked:d.is_active,onChange:$=>A({is_active:$}),label:"Activo (los agentes pueden usarlo)"})]}),h&&o.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:h})]})})}const QO=new Set(Li.map(e=>e.value));function ZO(e,n){const s=typeof n.engine=="string"&&n.engine||(QO.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 JO(){const e=nt(),{config:n,isLoading:s,patch:r,mutate:i}=yr(),[c,d]=v.useState(!1),[f,p]=v.useState(null);if(s)return o.jsx(Je,{});const m=n.engines||{},h=Object.entries(m).map(([E,k])=>ZO(E,k||{})),x=h.map(E=>E.slug),y=()=>{p(null),d(!0)},S=E=>{p(E),d(!0)},w=async({provider:E,apiKeyValue:k,raw:R})=>{if(R){await r({[`engines.${E.slug}`]:R}),e.success("Provider guardado (JSON)."),i();return}const N=`engines.${E.slug}`,O={[`${N}.name`]:E.name,[`${N}.engine`]:E.engine,[`${N}.is_active`]:E.is_active!==!1,[`${N}.default_temperature`]:E.default_temperature,[`${N}.default_max_tokens`]:E.default_max_tokens},A=[],M=(B,U)=>{U===void 0||U===""?A.push(`${N}.${B}`):O[`${N}.${B}`]=U};M("base_url",E.base_url),M("default_model",E.default_model),M("context_limit_tokens",E.context_limit_tokens),M("pricing",E.pricing),M("model_context_limits",E.model_context_limits),k&&(O[`${N}.api_key`]=k),await r(O,A),e.success("Provider guardado."),i()},_=async E=>{try{await r({[`engines.${E.slug}.is_active`]:E.is_active===!1}),i()}catch(k){e.error(k.message)}},j=async E=>{if(confirm(`Borrar provider ${E.name||E.slug}?`))try{await r(void 0,[`engines.${E.slug}`]),e.success("Provider borrado."),i()}catch(k){e.error(k.message)}};return o.jsxs(He,{title:"Proveedores",description:"Proveedores LLM (API). Cada provider usa un engine/adapter (openai, ollama, …) con su key y URL.",action:o.jsxs(he,{size:"sm",variant:"primary",onClick:y,children:[o.jsx(Nn,{size:14})," Nuevo provider"]}),children:[h.length===0?o.jsx(ot,{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:[h.map(E=>o.jsx(YO,{provider:E,onEdit:()=>S(E),onDelete:()=>j(E),onToggle:()=>_(E)},E.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(Nn,{size:20}),o.jsx("span",{className:"text-sm font-medium",children:"Agregar provider"})]})]}),o.jsx(KO,{open:c,initial:f,existingSlugs:x,onClose:()=>{d(!1),p(null)},onSave:w})]})}function t2(){return o.jsxs("div",{className:"space-y-6",children:[o.jsx(GO,{}),o.jsx(JO,{})]})}function WO(){const e=nt(),[n,s]=v.useState(!1),i=Qe(n?"/agents/vault?include_removed=1":"/agents/vault",()=>Jt.vault({includeRemoved:n})),c=i.data||[],[d,f]=v.useState(null),p=async h=>{const x=h.source!=="user",y=x?C("base.defaults_tombstone_msg",{slug:h.slug}):C("base.defaults_delete_msg",{slug:h.slug});if(confirm(y))try{await Jt.vaultRemove(h.slug),e.success(C(x?"base.defaults_hidden":"base.defaults_deleted")),i.mutate()}catch(S){e.error(S.message)}},m=async h=>{try{await Jt.vaultRestore(h),e.success(C("base.defaults_restored")),i.mutate()}catch(x){e.error(x.message)}};return o.jsxs(He,{title:C("base.defaults_title"),description:C("base.defaults_desc"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(sn,{checked:n,onChange:s,label:C("base.defaults_show_removed")}),o.jsxs(he,{size:"sm",onClick:()=>f("new"),children:[o.jsx(Nn,{size:14})," ",C("base.defaults_new")]})]}),children:[i.isLoading&&o.jsx(Je,{}),!i.isLoading&&c.length===0&&o.jsx(ot,{children:C("base.defaults_empty")}),o.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:c.map(h=>{const x=n&&h.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:h.is_master?o.jsx(Ns,{className:"size-4 text-white"}):o.jsx(vn,{className:"size-4 text-white"})}),o.jsx("span",{className:"truncate text-sm font-semibold",children:h.slug}),o.jsx(ez,{source:h.source})]}),o.jsx("div",{className:"flex shrink-0 items-center gap-0.5",children:x?o.jsx(Qp,{label:C("base.defaults_restore"),onClick:()=>m(h.slug),variant:"secondary",children:o.jsx(vj,{size:13})}):o.jsxs(o.Fragment,{children:[o.jsx(Qp,{label:C("base.defaults_edit"),onClick:()=>f(h),variant:"ghost",children:o.jsx(xh,{size:13})}),o.jsx(Qp,{label:h.source==="user"?C("base.defaults_delete"):C("base.defaults_hide"),onClick:()=>p(h),variant:"ghost-destructive",children:o.jsx(Ja,{size:13})})]})})]}),h.model?o.jsx(Ue,{tone:"info",children:h.model}):o.jsx("span",{className:"text-[10px] text-muted-fg",children:"modelo: default del router"}),h.description&&o.jsx("p",{className:"line-clamp-3 text-xs text-muted-fg",children:h.description}),o.jsxs("div",{className:"flex flex-wrap gap-1",children:[h.role&&o.jsx(Ue,{children:h.role}),h.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(il,{size:9})," ",y]},y)),h.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(cl,{size:9})," ",y]},y))]})]},h.slug)})}),d!==null&&o.jsx(tz,{agent:d==="new"?null:d,onClose:()=>f(null),onSaved:()=>{f(null),i.mutate()}})]})}function ez({source:e}){return e==="user"?o.jsx(Ue,{tone:"success",children:"user"}):e==="user-override"?o.jsx(Ue,{tone:"warning",children:"override"}):o.jsx(Ue,{tone:"muted",children:"bundled"})}function Qp({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(Wh,{children:[o.jsx(ex,{render:o.jsx("button",{type:"button",onClick:n,"aria-label":e,className:`${i} ${c[s]}`,children:r})}),o.jsx(tx,{children:e})]})}function tz({agent:e,onClose:n,onSaved:s}){const r=nt(),[i,c]=v.useState(!1),d=!e,[f,p]=v.useState(e?.slug??""),[m,h]=v.useState(e?.role??""),[x,y]=v.useState(e?.model??""),[S,w]=v.useState(e?.description??""),[_,j]=v.useState(e?.language??"es"),[E,k]=v.useState((e?.skills??[]).join(", ")),[R,N]=v.useState((e?.tools??[]).join(", ")),[O,A]=v.useState(!!e?.is_master),[M,B]=v.useState(e?.body??""),U=async()=>{const I={role:m||void 0,model:x||void 0,description:S||void 0,language:_||void 0,skills:E,tools:R,is_master:O};c(!0);try{if(d){if(!/^[a-z][a-z0-9_-]*$/.test(f))throw new Error(C("base.defaults_slug_invalid"));await Jt.vaultCreate(f,I,M),r.success(C("base.defaults_created",{slug:f}))}else await Jt.vaultPatch(e.slug,{fields:I,body:M}),r.success(C("base.defaults_saved",{slug:e.slug}));s()}catch(L){r.error(L.message)}finally{c(!1)}};return o.jsx(ma,{open:!0,onClose:n,title:d?C("base.defaults_new_title"):C("base.defaults_edit_title",{slug:e.slug}),description:d?C("base.defaults_new_desc"):e.source==="bundled"?C("base.defaults_bundled_desc"):C("base.defaults_user_desc"),size:"lg",footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:i,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:U,loading:i,children:C("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(Ce,{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(Ce,{value:m,onChange:I=>h(I.target.value),placeholder:"Code reviewer"})}),o.jsx(fe,{label:"model",children:o.jsx(Ce,{value:x,onChange:I=>y(I.target.value),placeholder:"openrouter:..."})}),o.jsx(fe,{label:"language",children:o.jsx(Ce,{value:_,onChange:I=>j(I.target.value),placeholder:"es"})}),o.jsx(fe,{label:"is_master",children:o.jsx("div",{className:"flex h-9 items-center",children:o.jsx(sn,{checked:O,onChange:A,label:C("base.defaults_master_label")})})})]}),o.jsx(fe,{label:"description",children:o.jsx(Ce,{value:S,onChange:I=>w(I.target.value)})}),o.jsx(fe,{label:"skills",hint:"separadas por coma",children:o.jsx(Ce,{value:E,onChange:I=>k(I.target.value),placeholder:"code-review, git"})}),o.jsx(fe,{label:"tools",hint:"separadas por coma",children:o.jsx(Ce,{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(Qt,{value:M,onChange:I=>B(I.target.value),rows:10,placeholder:"# Mission\\n..."})})]})})}const nz={apx:"success",claude:"info",codex:"warning"};function az(){const[e,n]=v.useState(""),s=Qe(`/sessions?engine=${e}`,()=>i5.global(e||void 0)),r=s.data?.sessions||[];return o.jsxs(He,{title:C("base.sessions_title"),description:C("base.sessions_desc"),action:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-40",children:o.jsx(Ct,{value:e,onChange:n,options:[{value:"",label:C("base.sessions_all")},{value:"apx",label:"apx"},{value:"claude",label:"claude"},{value:"codex",label:"codex"}]})}),o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>s.mutate(),children:o.jsx(Wr,{size:13})})]}),children:[s.isLoading&&o.jsx(Je,{}),s.error&&o.jsx(ot,{children:C("base.sessions_error",{msg:s.error.message})}),!s.isLoading&&!s.error&&r.length===0&&o.jsx(ot,{children:C("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(Ue,{tone:nz[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 sz(){const e=Ua(),[n,s]=v.useState("open"),r=Qe(`/tasks?state=${n}`,()=>lr.global(n));return o.jsxs(He,{title:C("project.global_tasks.title"),description:C("project.global_tasks.subtitle"),action:o.jsx("div",{className:"flex gap-1",children:["open","done","dropped","all"].map(i=>o.jsx(he,{size:"sm",variant:n===i?"primary":"ghost",onClick:()=>s(i),children:i},i))}),children:[r.isLoading&&o.jsx(Je,{}),!r.isLoading&&(r.data?.length??0)===0&&o.jsx(ot,{children:C("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:C("project.global_tasks.go_project"),children:o.jsx(Ue,{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(Ue,{tone:"muted",children:["@",i.agent]}),i.tags?.map(c=>o.jsxs("span",{children:["#",c]},c)),i.due&&o.jsxs("span",{children:[C("project.global_tasks.due")," ",i.due]})]})]})]},`${i.project_id}-${i.id}`))})]})}const n2=v.createContext(void 0);function yx(){const e=v.useContext(n2);if(e===void 0)throw new Error(Rn(64));return e}let rz=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const _x={tabActivationDirection:e=>({[rz.activationDirection]:e})},oz=v.forwardRef(function(n,s){const{className:r,defaultValue:i=0,onValueChange:c,orientation:d="horizontal",render:f,value:p,style:m,...h}=n,x=n.defaultValue!==void 0,y=v.useRef([]),[S,w]=v.useState(()=>new Map),[_,j]=Fi({controlled:p,default:i,name:"Tabs",state:"value"}),E=p!==void 0,[k,R]=v.useState(()=>new Map),N=v.useCallback(se=>{if(se===void 0)return null;for(const[ue,ee]of k.entries())if(ee!=null&&se===(ee.value??ee.index))return ue;return null},[k]),[O,A]=v.useState(()=>({previousValue:_,tabActivationDirection:"none"})),{previousValue:M,tabActivationDirection:B}=O;let U=B,I=!1;M!==_&&(U=X1(M,_,d,k),I=M!=null&&_!=null&&N(_)==null);const L=I?M:_,P=M!==L||B!==U;Ne(()=>{P&&A({previousValue:L,tabActivationDirection:U})},[L,P,U]);const H=Me((se,ue)=>{const ee=X1(_,se,d,k);ue.activationDirection=ee,c?.(se,ue),!ue.isCanceled&&j(se)}),Y=Me((se,ue)=>{c?.(se,tt(ue,void 0,void 0,{activationDirection:"none"}))}),Q=Me((se,ue)=>{w(ee=>{if(ee.get(se)===ue)return ee;const Re=new Map(ee);return Re.set(se,ue),Re})}),q=Me((se,ue)=>{w(ee=>{if(!ee.has(se)||ee.get(se)!==ue)return ee;const Re=new Map(ee);return Re.delete(se),Re})}),X=v.useCallback(se=>S.get(se),[S]),Z=v.useCallback(se=>{for(const ue of k.values())if(se===ue?.value)return ue?.id},[k]),$=v.useMemo(()=>({getTabElementBySelectedValue:N,getTabIdByPanelValue:Z,getTabPanelIdByValue:X,onValueChange:H,orientation:d,registerMountedTabPanel:Q,setTabMap:R,unregisterMountedTabPanel:q,tabActivationDirection:U,value:_}),[N,Z,X,H,d,Q,R,q,U,_]),K=v.useMemo(()=>{for(const se of k.values())if(se!=null&&se.value===_)return se},[k,_]),D=v.useMemo(()=>{for(const se of k.values())if(se!=null&&!se.disabled)return se.value},[k]),G=v.useRef(!x),V=v.useRef(x),W=v.useRef(!1);Ne(()=>{if(E)return;function se($e,be){j($e),A(Se=>Se.previousValue===$e&&Se.tabActivationDirection==="none"?Se:{previousValue:$e,tabActivationDirection:"none"}),Y($e,be),G.current=!1}if(k.size===0){if(!W.current||_===null)return;se(null,$0);return}W.current=!0;const ue=K?.disabled,ee=K==null&&_!==null;if(!ue&&_===i&&(V.current=!1),V.current&&ue&&_===i)return;const Re=G.current;if(ue||ee){const $e=D??null;if(_===$e){G.current=!1;return}let be=$0;Re?be=G0:ue&&(be=Vj),se($e,be);return}Re&&K!=null&&(Y(_,G0),G.current=!1)},[i,D,E,Y,K,j,k,_]);const oe=Lt("div",n,{state:{orientation:d,tabActivationDirection:U},ref:s,props:h,stateAttributesMapping:_x});return o.jsx(n2.Provider,{value:$,children:o.jsx(hx,{elementsRef:y,children:oe})})});function X1(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 h=m.value??m.index;if(e===h&&(i=p),n===h&&(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 a2="data-composite-item-active";function lz(e={}){const{highlightItemOnHover:n,highlightedIndex:s,onHighlightedIndexChange:r}=pS(),{ref:i,index:c}=bx(e),d=s===c,f=v.useRef(null),p=As(i,f);return{compositeProps:v.useMemo(()=>({tabIndex:d?0:-1,onFocus(){r(c)},onMouseMove(){const h=f.current;if(!n||!h)return;const x=h.hasAttribute("disabled")||h.ariaDisabled==="true";!d&&!x&&h.focus()}}),[d,r,c,n]),compositeRef:p,index:c}}const s2=v.createContext(void 0);function iz(){const e=v.useContext(s2);if(e===void 0)throw new Error(Rn(65));return e}const cz=v.forwardRef(function(n,s){const{className:r,disabled:i=!1,render:c,value:d,id:f,nativeButton:p=!0,style:m,...h}=n,{value:x,getTabPanelIdByValue:y,orientation:S}=yx(),{activateOnFocus:w,highlightedTabIndex:_,onTabActivation:j,registerTabResizeObserverElement:E,setHighlightedTabIndex:k,tabsListElement:R}=iz(),N=vr(f),O=v.useMemo(()=>({disabled:i,id:N,value:d}),[i,N,d]),{compositeProps:A,compositeRef:M,index:B}=lz({metadata:O}),U=d===x,I=v.useRef(!1),L=v.useRef(null);v.useEffect(()=>{const G=L.current;if(G)return E(G)},[E]),Ne(()=>{if(I.current){I.current=!1;return}if(!(U&&B>-1&&_!==B))return;const G=R;if(G!=null){const V=zn(xt(G));if(V&&Ye(G,V))return}i||k(B)},[U,B,_,k,i,R]);const{getButtonProps:P,buttonRef:H}=gl({disabled:i,native:p,focusableWhenDisabled:!0}),Y=y(d),Q=v.useRef(!1),q=v.useRef(!1);function X(G){U||i||j(d,tt(Ts,G.nativeEvent,void 0,{activationDirection:"none"}))}function Z(G){U||(B>-1&&!i&&k(B),!i&&w&&(!Q.current||Q.current&&q.current)&&j(d,tt(Ts,G.nativeEvent,void 0,{activationDirection:"none"})))}function $(G){if(U||i)return;Q.current=!0;function V(){Q.current=!1,q.current=!1}(!G.button||G.button===0)&&(q.current=!0,xt(G.currentTarget).addEventListener("pointerup",V,{once:!0}))}return Lt("button",n,{state:{disabled:i,active:U,orientation:S},ref:[s,H,M,L],props:[A,{role:"tab","aria-controls":Y,"aria-selected":U,id:N,onClick:X,onFocus:Z,onPointerDown:$,[a2]:U?"":void 0,onKeyDownCapture(){I.current=!0}},h,P]})});let uz=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e[e.startingStyle=Kr.startingStyle]="startingStyle",e[e.endingStyle=Kr.endingStyle]="endingStyle",e})({});const dz={..._x,...ml},fz=v.forwardRef(function(n,s){const{className:r,value:i,render:c,keepMounted:d=!1,style:f,...p}=n,{value:m,getTabIdByPanelValue:h,orientation:x,tabActivationDirection:y,registerMountedTabPanel:S,unregisterMountedTabPanel:w}=yx(),_=vr(),j=v.useMemo(()=>({id:_,value:i}),[_,i]),{ref:E,index:k}=bx({metadata:j}),R=i===m,{mounted:N,transitionStatus:O,setMounted:A}=ac(R),M=!N,B=h(i),U={hidden:M,orientation:x,tabActivationDirection:y,transitionStatus:O},I=v.useRef(null),L=Lt("div",n,{state:U,ref:[s,E,I],props:[{"aria-labelledby":B,hidden:M,id:_,role:"tabpanel",tabIndex:R?0:-1,inert:Jh(!R),[uz.index]:k},p],stateAttributesMapping:dz});return br({open:R,ref:I,onComplete(){R||A(!1)}}),Ne(()=>{if(!(M&&!d)&&_!=null)return S(i,_),()=>{w(i,_)}},[M,d,i,_,S,w]),d||N?L:null});function mz(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const pz=[];function gz(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:h,enableHomeAndEndKeys:x=!1,stopEventPropagation:y=!1,disabledIndices:S,modifierKeys:w=pz}=e,[_,j]=v.useState(0),E=s>1,k=v.useRef(null),R=As(k,h),N=v.useRef([]),O=v.useRef(!1),A=p??_,M=Me((L,P=!1)=>{if((m??j)(L),P){const H=N.current[L];P1(k.current,H,f,d)}}),B=Me(L=>{if(L.size===0||O.current)return;O.current=!0;const P=Array.from(L.keys()),H=P.find(Q=>Q?.hasAttribute(a2))??null,Y=H?P.indexOf(H):-1;Y!==-1&&M(Y),P1(k.current,H,f,d)}),U=Me((L,P,H)=>i?i?.(L,P,H,N):H),I=v.useMemo(()=>({"aria-orientation":d==="both"?void 0:d,ref:R,onFocus(L){const P=k.current,H=En(L.nativeEvent);!P||H==null||!L1(H)||H.setSelectionRange(0,H.value.length??0)},onKeyDown(L){const P=x?dx:ES;if(!P.has(L.key)||hz(L,w)||!k.current)return;const Y=f==="rtl",Q=Y?yd:zi,q={horizontal:Q,vertical:$o,both:Q}[d],X=Y?zi:yd,Z={horizontal:X,vertical:Oi,both:X}[d],$=En(L.nativeEvent);if($!=null&&L1($)&&!mz($)){const oe=$.selectionStart,se=$.selectionEnd,ue=$.value??"";if(oe==null||L.shiftKey||oe!==se||L.key!==Z&&oe<ue.length||L.key!==q&&oe>0)return}let K=A;const D=Fu(N,S),G=Ug(N,S);if(E){const oe=n||Array.from({length:N.current.length},()=>({width:1,height:1})),se=Jj(oe,s,c),ue=se.findIndex(Re=>Re!=null&&!Es(N.current,Re,S)),ee=se.reduce((Re,$e,be)=>$e!=null&&!Es(N.current,$e,S)?be:Re,-1);K=se[Zj(se.map(Re=>Re!=null?N.current[Re]:null),{event:L,orientation:d,loopFocus:r,onLoop:U,cols:s,disabledIndices:ew([...S||N.current.map((Re,$e)=>Es(N.current,$e)?$e:void 0),void 0],se),minIndex:ue,maxIndex:ee,prevIndex:Wj(A>G?D:A,oe,se,s,L.key===$o?"bl":L.key===zi?"tr":"tl"),rtl:Y})]}const V={horizontal:[Q],vertical:[$o],both:[Q,$o]}[d],W={horizontal:[X],vertical:[Oi],both:[X,Oi]}[d],ce=E?P:{horizontal:x?a4:SS,vertical:x?s4:CS,both:P}[d];x&&(L.key===Zd?K=D:L.key===Jd&&(K=G)),K===A&&(V.includes(L.key)||W.includes(L.key))&&(r&&K===G&&V.includes(L.key)?(K=D,i&&(K=i(L,A,K,N))):r&&K===D&&W.includes(L.key)?(K=G,i&&(K=i(L,A,K,N))):K=On(N.current,{startingIndex:K,decrement:W.includes(L.key),disabledIndices:S})),K!==A&&!Gi(N.current,K)&&(y&&L.stopPropagation(),ce.has(L.key)&&L.preventDefault(),M(K,!0),queueMicrotask(()=>{N.current[K]?.focus()}))}}),[s,c,f,S,N,x,A,E,n,r,i,U,R,w,M,d,y]);return v.useMemo(()=>({props:I,highlightedIndex:A,onHighlightedIndexChange:M,elementsRef:N,disabledIndices:S,onMapChange:B,relayKeyboardEvent:I.onKeyDown}),[I,A,M,N,S,B])}function hz(e,n){for(const s of c4.values())if(!n.includes(s)&&e.getModifierState(s))return!0;return!1}function xz(e){const{render:n,className:s,style:r,refs:i=qi,props:c=qi,state:d=an,stateAttributesMapping:f,highlightedIndex:p,onHighlightedIndexChange:m,orientation:h,dense:x,itemSizes:y,loopFocus:S,onLoop:w,cols:_,enableHomeAndEndKeys:j,onMapChange:E,stopEventPropagation:k=!0,rootRef:R,disabledIndices:N,modifierKeys:O,highlightItemOnHover:A=!1,tag:M="div",...B}=e,U=Qh(),{props:I,highlightedIndex:L,onHighlightedIndexChange:P,elementsRef:H,onMapChange:Y,relayKeyboardEvent:Q}=gz({itemSizes:y,cols:_,loopFocus:S,onLoop:w,dense:x,orientation:h,highlightedIndex:p,onHighlightedIndexChange:m,rootRef:R,stopEventPropagation:k,enableHomeAndEndKeys:j,direction:U,disabledIndices:N,modifierKeys:O}),q=Lt(M,e,{state:d,ref:i,props:[I,...c,B],stateAttributesMapping:f}),X=v.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:P,highlightItemOnHover:A,relayKeyboardEvent:Q}),[L,P,A,Q]);return o.jsx(mS.Provider,{value:X,children:o.jsx(hx,{elementsRef:H,onMapChange:Z=>{E?.(Z),Y(Z)},children:q})})}const bz=v.forwardRef(function(n,s){const{activateOnFocus:r=!1,className:i,loopFocus:c=!0,render:d,style:f,...p}=n,{onValueChange:m,orientation:h,value:x,setTabMap:y,tabActivationDirection:S}=yx(),[w,_]=v.useState(0),[j,E]=v.useState(null),k=v.useRef(new Set),R=v.useRef(new Set),N=v.useRef(null);v.useEffect(()=>{if(typeof ResizeObserver>"u")return;const L=new ResizeObserver(()=>{k.current.forEach(P=>{P()})});return N.current=L,j&&L.observe(j),R.current.forEach(P=>{L.observe(P)}),()=>{L.disconnect(),N.current=null}},[j]);const O=Me(L=>(k.current.add(L),()=>{k.current.delete(L)})),A=Me(L=>(R.current.add(L),N.current?.observe(L),()=>{R.current.delete(L),N.current?.unobserve(L)})),M=Me((L,P)=>{L!==x&&m(L,P)}),B={orientation:h,tabActivationDirection:S},U={"aria-orientation":h==="vertical"?"vertical":void 0,role:"tablist"},I=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,registerIndicatorUpdateListener:O,registerTabResizeObserverElement:A,onTabActivation:M,setHighlightedTabIndex:_,tabsListElement:j}),[r,w,O,A,M,_,j]);return o.jsx(s2.Provider,{value:I,children:o.jsx(xz,{render:d,className:i,style:f,state:B,refs:[s,E],props:[U,p],stateAttributesMapping:_x,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:c,orientation:h,onHighlightedIndexChange:_,onMapChange:y,disabledIndices:qi})})});function Wd({className:e,...n}){return o.jsx(oz,{"data-slot":"tabs",className:Pt("flex flex-col gap-4",e),...n})}const vz=lx("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 ef({className:e,variant:n="default",...s}){return o.jsx(bz,{"data-slot":"tabs-list","data-variant":n,className:Pt(vz({variant:n}),e),...s})}function ka({className:e,...n}){return o.jsx(cz,{"data-slot":"tabs-trigger",className:Pt("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 Na({className:e,...n}){return o.jsx(fz,{"data-slot":"tabs-content",className:Pt("text-sm outline-none",e),...n})}function K1(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 jx(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,jx(i,c)):s[c]=i}return s}function yz(e){const n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("JSON debe ser objeto.");return n}function th({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",[h,x]=v.useState({}),[y,S]=v.useState(""),[w,_]=v.useState("");v.useEffect(()=>{const R={};for(const N of e.flatMap(O=>O.fields))R[N.path]=K1(n,N.path)??"";x(R),S(JSON.stringify(n||{},null,2)),_("")},[n,e]);const j=v.useMemo(()=>new Set(e.flatMap(R=>R.fields.map(N=>N.path))),[e]),E=async()=>{const R={},N=[];for(const O of e.flatMap(A=>A.fields)){const A=h[O.path];if(!La(A)){if(A===""||A===void 0||A===null){N.push(O.path);continue}if(O.kind==="number"){const M=Number(A);Number.isFinite(M)&&(R[O.path]=M)}else R[O.path]=A}}await d(R,N.filter(O=>j.has(O)))},k=async()=>{_("");try{await f(yz(y))}catch(R){_(R.message)}};return o.jsxs(Wd,{defaultValue:m,className:"space-y-4",children:[o.jsxs(ef,{className:"flex flex-wrap",children:[e.map(R=>o.jsx(ka,{value:R.key,children:R.label},R.key)),o.jsx(ka,{value:"json",children:"JSON"})]}),e.map(R=>o.jsx(Na,{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(_z,{field:N,value:h[N.path],inherited:K1(s,N.path),onChange:O=>x(A=>({...A,[N.path]:O}))},N.path))}),o.jsx(he,{variant:"primary",loading:p,onClick:E,children:c})]})},R.key)),o.jsx(Na,{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(Qt,{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(he,{variant:"primary",loading:p,onClick:k,children:"Guardar JSON"})]})})]})}function _z({field:e,value:n,inherited:s,onChange:r}){const i=e.placeholder||Q1(s)||(La(n)?fr(n):""),c=e.hint||(s!==void 0?`Heredado: ${Q1(s)}`:void 0);return e.kind==="boolean"?o.jsx("div",{className:"flex items-end pb-1",children:o.jsx(sn,{checked:n===!0,onChange:r,label:e.label})}):o.jsx(fe,{label:e.label,hint:c,children:e.kind==="select"?o.jsx(Ct,{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(Qt,{rows:4,value:String(n||""),placeholder:i,onChange:d=>r(d.target.value)}):o.jsx(Ce,{type:e.kind==="password"?"password":e.kind==="number"?"number":"text",value:String(La(n)?"":n||""),placeholder:e.kind==="password"&&La(n)?fr(n):e.kind==="password"&&La(s)?fr(s):i,onChange:d=>r(d.target.value)})})}function Q1(e){return e==null||e===""?"":La(e)?fr(e):Array.isArray(e)?e.join(", "):typeof e=="object"?JSON.stringify(e):String(e)}const jz=[{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:yh.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"}]}],wz=[{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 Sz({pid:e}){const n=nt(),s=Qe(`/projects/${e}/config`,()=>Qn.config.show(e));if(s.isLoading)return o.jsx(Je,{});if(!s.data)return o.jsx(ot,{children:C("project.config.no_data")});const r=async c=>{await Qn.apcProject.put(e,c),n.success(C("project.config.save_project")),s.mutate()},i=async c=>{await Qn.config.put(e,c),n.success(C("project.config.save_override")),s.mutate()};return o.jsx("div",{className:"space-y-6",children:o.jsx(He,{title:C("project.config.section_title"),description:C("project.config.section_desc"),children:o.jsxs(Wd,{defaultValue:"override",className:"space-y-4",children:[o.jsxs(ef,{children:[o.jsx(ka,{value:"override",children:"Override"}),o.jsx(ka,{value:"project",children:"APC project"}),o.jsx(ka,{value:"effective",children:"Effective"})]}),o.jsx(Na,{value:"override",children:o.jsx(th,{sections:jz,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 Qn.config.set(e,c),d.length&&await Qn.config.unset(e,d),n.success(C("project.config.save_fields_success")),s.mutate()},onSaveJson:i})}),o.jsx(Na,{value:"project",children:o.jsx(th,{sections:wz,source:s.data.apc_project||{},jsonTitle:s.data.project_json_path,jsonDescription:".apc/project.json. Metadata APC portable.",onSaveFields:async(c,d)=>{await Qn.apcProject.set(e,Cz(c),d),n.success(C("project.config.save_meta_success")),s.mutate()},onSaveJson:r})}),o.jsx(Na,{value:"effective",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-xs text-muted-fg",children:C("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 Cz(e){const n={};for(const[s,r]of Object.entries(jx(e)))La(r)||(n[s]=r);return n}const Ez=["","es","en","pt","fr","it","de"],Z1=e=>e.split(",").map(n=>n.trim()).filter(Boolean);function r2(e){return e.is_master?{gradient:"from-violet-600 to-indigo-600",Icon:Ns}:{gradient:"from-slate-600 to-gray-600",Icon:vn}}function kz(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 Nz({pid:e}){const n=Ua();nt();const s=Qe(`/projects/${e}/agents`,()=>Jt.list(e)),[r,i]=v.useState("hierarchy"),[c,d]=v.useState(!1),[f,p]=v.useState(!1),m=s.data||[],h=w=>n(`/p/${e}/agents/${w}`),x=w=>n(w?`/p/${e}/chat?agent=${w}`:`/p/${e}/chat`),{roots:y,childrenByParent:S}=v.useMemo(()=>kz(m),[m]);return o.jsxs(He,{title:C("project.agents.title"),description:C("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:Ae("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(hh,{size:13})," ",C("project.agents.hierarchy")]}),o.jsxs("button",{onClick:()=>i("list"),className:Ae("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(tR,{size:13})," ",C("project.agents.list_view")]})]}),o.jsxs(he,{size:"sm",variant:"ghost",onClick:()=>p(!0),children:[o.jsx(gR,{size:13})," ",C("project.agents.import")]}),o.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>x(),children:[o.jsx(Za,{size:13})," ",C("project.agents.chat")]}),o.jsxs(he,{size:"sm",variant:"primary","data-testid":"agent-new",onClick:()=>d(!0),children:[o.jsx(Nn,{size:14})," ",C("project.agents.new")]})]}),children:[s.isLoading&&o.jsx(Je,{}),!s.isLoading&&m.length===0&&o.jsx(ot,{children:C("project.agents.empty_text")}),!s.isLoading&&m.length>0&&(r==="hierarchy"?o.jsx(Tz,{roots:y,childrenByParent:S,onOpen:h,onChat:x}):o.jsx(Az,{agents:m,onOpen:h,onChat:x})),o.jsx(Mz,{open:c,pid:e,agents:m,onClose:()=>d(!1),onCreated:()=>{d(!1),s.mutate()}}),o.jsx(Rz,{open:f,pid:e,existing:m.map(w=>w.slug),onClose:()=>p(!1),onImported:()=>s.mutate()})]})}function Rz({open:e,onClose:n,onImported:s,pid:r,existing:i}){const c=nt(),d=Qe(e?"/agents/vault":null,()=>Jt.vault()),[f,p]=v.useState(""),m=d.data||[],h=async x=>{p(x);try{await Jt.import(r,x),c.success(C("project.agents.import_success",{slug:x})),s()}catch(y){c.error(y.message)}finally{p("")}};return o.jsxs(ma,{open:e,onClose:n,title:C("project.agents.import_title"),description:C("project.agents.import_desc"),size:"lg",footer:o.jsx(he,{variant:"ghost",onClick:n,children:C("common.close")}),children:[d.isLoading&&o.jsx(Je,{}),!d.isLoading&&m.length===0&&o.jsx(ot,{children:C("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(Ue,{tone:"success",children:[o.jsx(Ns,{size:9})," ",C("project.agents.orchestrator")]}),x.model&&o.jsx(Ue,{tone:"info",children:x.model})]}),x.description&&o.jsx("p",{className:"truncate text-xs text-muted-fg",children:x.description})]}),o.jsx(he,{size:"sm",variant:"primary",disabled:y||f===x.slug,loading:f===x.slug,onClick:()=>h(x.slug),children:C(y?"project.agents.import_already":"project.agents.import_btn")})]},x.slug)})})]})}function Tz({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(Zp,{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(Zp,{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(Zp,{agent:f,onOpen:s,onChat:r,compact:!0},f.slug))})]})]},d.slug))})]})]},i.slug)})})}function Zp({agent:e,onOpen:n,onChat:s,wide:r,compact:i}){const{gradient:c,Icon:d}=r2(e);return o.jsxs("div",{"data-testid":`agent-card-${e.slug}`,className:Ae("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:Ae("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(Ue,{tone:"success",children:[o.jsx(Ns,{size:9})," ",C("project.agents.orchestrator")]}),e.role&&o.jsx(Ue,{children:e.role}),e.model&&!i&&o.jsx(Ue,{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(xj,{size:12})," ",C("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(Za,{size:12})," ",C("project.agents.chat")]})]})]})}function Az({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}=r2(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:Ae("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(Ue,{tone:"success",children:[o.jsx(Ns,{size:10})," ",C("project.agents.orchestrator")]}),i.role&&o.jsx(Ue,{children:i.role}),i.model&&o.jsx(Ue,{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(il,{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(cl,{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(xj,{size:12})," ",C("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(Za,{size:12})," ",C("project.agents.chat")]})]})]},i.slug)})})}function Mz({open:e,onClose:n,onCreated:s,pid:r,agents:i}){const c=nt(),[d,f]=v.useState(""),[p,m]=v.useState(""),[h,x]=v.useState(""),[y,S]=v.useState(""),[w,_]=v.useState(""),[j,E]=v.useState(""),[k,R]=v.useState(""),[N,O]=v.useState(!1),[A,M]=v.useState(""),[B,U]=v.useState(!1),I=()=>{f(""),m(""),x(""),S(""),_(""),E(""),R(""),O(!1),M("")},L=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(d)){c.error(C("project.agents.slug_invalid"));return}U(!0);try{await Jt.create(r,{slug:d,role:p||void 0,model:h||void 0,language:y||void 0,description:w||void 0,skills:Z1(j),tools:Z1(k),is_master:N,parent:A||void 0}),c.success(C("project.agents.create_success",{slug:d})),s(),I()}catch(P){c.error(P?.message||C("project.agents.create_error"))}finally{U(!1)}};return o.jsx(ma,{open:e,onClose:n,title:C("project.agents.new_title"),description:C("project.agents.new_desc"),size:"lg",footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:B,children:C("common.cancel")}),o.jsx(he,{variant:"primary","data-testid":"agent-create-submit",onClick:L,loading:B,children:C("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:C("project.agents.slug_label"),children:o.jsx(Ce,{autoFocus:!0,"data-testid":"agent-slug",value:d,onChange:P=>f(P.target.value),placeholder:C("project.agents.slug_ph")})}),o.jsx(fe,{label:C("project.agents.role_label"),children:o.jsx(Ce,{value:p,onChange:P=>m(P.target.value),placeholder:C("project.agents.role_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.agents.model_label"),hint:C("project.agents.model_hint"),children:o.jsx(Ce,{value:h,onChange:P=>x(P.target.value)})}),o.jsx(fe,{label:C("project.agents.lang_label"),children:o.jsx(Ct,{value:y,onChange:S,options:Ez.map(P=>({value:P,label:P||"—"}))})})]}),o.jsx(fe,{label:C("project.agents.desc_label"),children:o.jsx(Qt,{rows:2,value:w,onChange:P=>_(P.target.value),placeholder:C("project.agents.desc_ph")})}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.agents.skills_label"),children:o.jsx(Ce,{value:j,onChange:P=>E(P.target.value),placeholder:C("project.agents.skills_ph")})}),o.jsx(fe,{label:C("project.agents.tools_label"),children:o.jsx(Ce,{value:k,onChange:P=>R(P.target.value),placeholder:C("project.agents.tools_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 items-end gap-3",children:[o.jsx(fe,{label:C("project.agents.parent_label"),hint:C("project.agents.parent_hint"),children:o.jsx(Ct,{value:A,onChange:M,placeholder:C("project.agents.none_parent"),options:[{value:"",label:C("project.agents.none_parent")},...i.filter(P=>P.slug!==d).map(P=>({value:P.slug,label:P.slug}))]})}),o.jsx(sn,{checked:N,onChange:O,label:C("project.agents.master_label")})]})]})})}function Bu(e){return e.split(`
|
|
548
|
-
`).map(n=>n.trim()).filter(Boolean)}const Gr={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:Ns},telegram:{label:"Telegram",desc:"Manda un mensaje fijo a un canal de Telegram. No usa modelo ni agente.",icon:Za},shell:{label:"Shell",desc:"Corre un comando de shell. Sin prompt ni pre/post — el comando es la acción.",icon:Ii},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:Xo}},Oz=Object.keys(Gr).map(e=>({value:e,label:Gr[e].label,description:Gr[e].desc,icon:Gr[e].icon}));function o2(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 zz=[{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"}],Dz=[{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 Lz(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 Pz({pid:e}){const n=nt(),s=Qe(`/projects/${e}/routines`,()=>or.list(e)),[r,i]=v.useState(null),c=async p=>{try{await(p.enabled?or.disable:or.enable)(e,p.name),s.mutate()}catch(m){n.error(m?.message||C("project.routines.toggle_error"))}},d=async p=>{try{await or.run(e,p.name),n.success(C("project.routines.run_success",{name:p.name}))}catch(m){n.error(m?.message||C("project.routines.run_error"))}},f=async p=>{if(confirm(C("project.routines.delete_confirm",{name:p.name})))try{await or.remove(e,p.name),n.success(C("project.routines.delete_success")),s.mutate()}catch(m){n.error(m?.message||C("project.routines.delete_error"))}};return o.jsxs(He,{title:C("project.routines.title"),description:C("project.routines.subtitle"),action:o.jsxs(he,{size:"sm",variant:"primary",onClick:()=>i({kind:"super_agent",schedule:"every:10m",enabled:!0}),children:[o.jsx(Nn,{size:14})," ",C("project.routines.new_btn")]}),children:[s.isLoading&&o.jsx(Je,{}),!s.isLoading&&(s.data?.length??0)===0&&o.jsx(ot,{children:C("project.routines.empty")}),o.jsx("ul",{className:"space-y-2 text-sm",children:(s.data||[]).map(p=>{const m=Gr[p.kind],h=m?.icon||Ui,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:Ae("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(h,{size:14})}),o.jsx("span",{className:"font-medium",children:p.name}),o.jsx(Ue,{tone:p.kind==="shell"?"warning":"info",children:m?.label||p.kind}),!p.enabled&&o.jsx(Ue,{tone:"muted",children:C("project.routines.paused")})]}),o.jsxs("div",{className:"flex items-center gap-2",onClick:y=>y.stopPropagation(),children:[o.jsx(sn,{checked:p.enabled,onChange:()=>c(p)}),o.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>d(p),children:[o.jsx(bh,{size:13})," Run"]}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>f(p),children:o.jsx(Ja,{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:["⏱ ",o2(p.schedule)]}),o.jsx("span",{children:Lz(p.kind,p.spec||{})}),p.next_run_at&&o.jsxs("span",{children:[C("project.routines.next_run")," ",new Date(p.next_run_at).toLocaleString()]}),o.jsxs("span",{className:Ae(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(Bz,{draft:r,onClose:()=>i(null),onSaved:()=>{i(null),s.mutate()},pid:e})]})}function Bz({draft:e,onClose:n,onSaved:s,pid:r}){const i=nt(),c=Qe(e?`/projects/${r}/agents`:null,()=>Jt.list(r)),[d,f]=v.useState(!1),[p,m]=v.useState(""),[h,x]=v.useState("super_agent"),[y,S]=v.useState("every:10m"),[w,_]=v.useState(!0),[j,E]=v.useState(""),[k,R]=v.useState(""),[N,O]=v.useState("default"),[A,M]=v.useState(""),[B,U]=v.useState(""),[I,L]=v.useState(""),[P,H]=v.useState("heartbeat"),[Y,Q]=v.useState(""),[q,X]=v.useState(""),[Z,$]=v.useState("");v.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"),_(e.enabled??!0),E(ee.agent||""),R(ee.prompt||""),O(ee.channel||"default"),M(ee.chat_id?String(ee.chat_id):""),U(ee.text||""),L(ee.command||""),H(ee.channel||"heartbeat"),Q(ee.message||""),X((e.pre_commands||[]).join(`
|
|
549
|
-
`)),$((e.post_commands||[]).join(`
|
|
550
|
-
`))},[e]);const K=()=>{switch(h){case"exec_agent":return{agent:j,prompt:k};case"super_agent":return{prompt:k};case"telegram":return{channel:N,...A?{chat_id:A}:{},text:B};case"shell":return{command:I};case"heartbeat":return{channel:P,message:Y}}},D=async()=>{if(!p){i.error(C("project.routines.name_required"));return}f(!0);try{const ee=h==="exec_agent"||h==="super_agent";await or.upsert(r,{name:p,kind:h,schedule:y,enabled:w,spec:K(),pre_commands:ee?Bu(q):[],post_commands:ee?Bu(Z):[]}),i.success(C("project.routines.saved")),s()}catch(ee){i.error(ee?.message||C("project.routines.save_error"))}finally{f(!1)}},G=h==="exec_agent"||h==="super_agent",V=G?Bu(q):[],W=G?Bu(Z):[],ce=(()=>{switch(h){case"exec_agent":return j?`Agente "${j}" 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"}})(),oe=G,se=Gr[h].icon,ue=[...V.map((ee,Re)=>({id:`pre-${Re}`,icon:Ii,label:"Pre",detail:ee,action:!1})),{id:"action",icon:se,label:ce,detail:oe&&k?k.slice(0,90):void 0,action:!0},...W.map((ee,Re)=>({id:`post-${Re}`,icon:Ii,label:"Post",detail:ee,action:!1}))];return o.jsx(ma,{open:!!e,onClose:n,title:e?.name?C("project.routines.edit_title",{name:e.name}):C("project.routines.new_title"),description:C("project.routines.dialog_desc"),size:"xl",footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:d,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:D,loading:d,children:C("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(sn,{checked:w,onChange:_,label:C("project.routines.enabled_label")}),o.jsx("span",{className:"text-[11px] text-muted-fg",children:C(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:C("project.routines.name_field"),hint:e?.name?C("project.routines.name_no_edit"):void 0,children:o.jsx(Ce,{value:p,disabled:!!e?.name,onChange:ee=>m(ee.target.value),placeholder:"resumen-diario"})}),o.jsx(fe,{label:C("project.routines.kind_field"),children:o.jsx(Ct,{value:h,onChange:ee=>x(ee),options:Oz})}),o.jsx("p",{className:"-mt-1 text-[11px] text-muted-fg",children:Gr[h].desc}),h==="exec_agent"&&o.jsx(fe,{label:C("project.routines.agent_field"),hint:C("project.routines.agent_hint"),children:o.jsx(Ct,{value:j,onChange:E,placeholder:c.isLoading?C("project.routines.agent_loading"):C("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:C("project.routines.schedule_field"),hint:C("project.routines.schedule_hint"),children:o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-wrap gap-1",children:[zz.map(ee=>o.jsx("button",{type:"button",onClick:()=>S(ee.value),className:Ae("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:Ae("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(Ce,{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:[G&&o.jsx(fe,{label:C("project.routines.pre_field"),hint:C("project.routines.pre_hint"),children:o.jsx(Qt,{rows:2,className:"font-mono text-xs",value:q,onChange:ee=>X(ee.target.value),placeholder:"curl -s https://wttr.in/Bariloche"})}),h==="exec_agent"&&o.jsx(fe,{label:C("project.routines.prompt_exec"),children:o.jsx(Qt,{rows:4,value:k,onChange:ee=>R(ee.target.value),placeholder:C("project.routines.prompt_exec_ph")})}),h==="super_agent"&&o.jsx(fe,{label:C("project.routines.prompt_super"),children:o.jsx(Qt,{rows:4,value:k,onChange:ee=>R(ee.target.value),placeholder:C("project.routines.prompt_super_ph")})}),h==="telegram"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.routines.tg_channel"),children:o.jsx(Ce,{value:N,onChange:ee=>O(ee.target.value),placeholder:"default"})}),o.jsx(fe,{label:C("project.routines.tg_chat_id"),children:o.jsx(Ce,{value:A,onChange:ee=>M(ee.target.value),placeholder:"(usa el del canal)"})})]}),o.jsx(fe,{label:C("project.routines.tg_text"),hint:C("project.routines.tg_text_hint"),children:o.jsx(Qt,{rows:8,value:B,onChange:ee=>U(ee.target.value),placeholder:"mensaje a enviar"})})]}),h==="shell"&&o.jsx(fe,{label:C("project.routines.shell_field"),hint:C("project.routines.shell_hint"),children:o.jsx(Qt,{rows:11,className:"font-mono text-xs",value:I,onChange:ee=>L(ee.target.value),placeholder:"cd /repo && git pull && npm test"})}),h==="heartbeat"&&o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.routines.hb_channel"),children:o.jsx(Ce,{value:P,onChange:ee=>H(ee.target.value),placeholder:"heartbeat"})}),o.jsx(fe,{label:C("project.routines.hb_message"),children:o.jsx(Ce,{value:Y,onChange:ee=>Q(ee.target.value),placeholder:"sigo vivo"})})]}),G&&o.jsx(fe,{label:C("project.routines.post_field"),hint:C("project.routines.post_hint"),children:o.jsx(Qt,{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:C("project.routines.vars_title")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Dz.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:[C("project.routines.what_happens")," ",o.jsxs("span",{className:"font-normal text-muted-fg",children:["· ⏱ ",o2(y)]})]}),o.jsx("div",{className:"flex flex-wrap items-stretch gap-2",children:ue.map((ee,Re)=>o.jsxs("div",{className:"flex items-stretch gap-2",children:[o.jsxs("div",{className:Ae("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:Ae("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})]}),Re<ue.length-1&&o.jsx(fj,{size:14,className:"shrink-0 self-center text-muted-fg"})]},ee.id))})]})]})})}function Iz({pid:e}){const[n,s]=v.useState("open"),r=nt(),i=Qe(`/projects/${e}/tasks?state=${n}`,()=>lr.list(e,n),{dedupingInterval:0,revalidateOnFocus:!0}),[c,d]=v.useState(""),[f,p]=v.useState(!1),m=async()=>{if(c.trim()){p(!0);try{await lr.add(e,{title:c.trim()}),d(""),r.success(C("project.tasks.created")),i.mutate()}catch(x){r.error(x?.message||C("project.tasks.create_error"))}finally{p(!1)}}},h=async(x,y)=>{try{await x(),r.success(y),i.mutate()}catch(S){r.error(S?.message||C("common.error_generic"))}};return o.jsxs(He,{title:C("project.tasks.title"),description:C("project.tasks.subtitle"),action:o.jsx("div",{className:"flex gap-1",children:["open","done","dropped"].map(x=>o.jsx(he,{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:C("project.tasks.add_label"),children:o.jsx(Ce,{"data-testid":"task-input",placeholder:C("project.tasks.add_placeholder"),value:c,onChange:x=>d(x.target.value),onKeyDown:x=>{x.key==="Enter"&&m()}})}),o.jsxs(he,{variant:"primary","data-testid":"task-add",onClick:m,loading:f,children:[o.jsx(Nn,{size:14})," ",C("project.tasks.add")]})]}),i.isLoading&&o.jsx(Je,{}),!i.isLoading&&(i.data?.length??0)===0&&o.jsxs(ot,{children:[n==="open"?C("project.tasks.empty_open"):C("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(Ue,{children:["#",y]},y)),x.agent&&o.jsxs(Ue,{tone:"info",children:["@",x.agent]}),x.source&&o.jsxs("span",{children:[C("project.tasks.via")," ",x.source]}),x.due&&o.jsxs("span",{children:[C("project.tasks.due")," ",x.due]})]})]}),o.jsxs("div",{className:"flex gap-1",children:[n==="open"&&o.jsxs(o.Fragment,{children:[o.jsx(he,{size:"sm",variant:"secondary","aria-label":C("project.tasks.aria_done"),"data-testid":`task-done-${x.id}`,onClick:()=>h(()=>lr.done(e,x.id),C("project.tasks.done")),children:o.jsx(Bi,{size:13})}),o.jsx(he,{size:"sm",variant:"destructive","aria-label":C("project.tasks.aria_drop"),"data-testid":`task-drop-${x.id}`,onClick:()=>h(()=>lr.drop(e,x.id),C("project.tasks.drop")),children:o.jsx(Ja,{size:13})})]}),n!=="open"&&o.jsx(he,{size:"sm",variant:"ghost","aria-label":C("project.tasks.aria_reopen"),"data-testid":`task-reopen-${x.id}`,onClick:()=>h(()=>lr.reopen(e,x.id),C("project.tasks.reopen")),children:o.jsx(vj,{size:13})})]})]},x.id))})]})}function Uz({pid:e}){const n=nt(),s=Qe(`/projects/${e}/mcps`,()=>Mi.list(e)),r=Qe(`/projects/${e}/mcps/check`,()=>Mi.check(e)),[i,c]=v.useState(!1),d=async(f,p)=>{if(confirm(C("project.mcps.delete_confirm",{name:f,scope:p})))try{await Mi.remove(e,f,p),n.success(C("project.mcps.removed")),s.mutate()}catch(m){n.error(m?.message||C("common.error_generic"))}};return o.jsxs(He,{title:C("project.mcps.title"),description:C("project.mcps.subtitle"),action:o.jsxs(he,{size:"sm",variant:"primary",onClick:()=>c(!0),children:[o.jsx(Nn,{size:14})," ",C("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:C("project.mcps.conflicts",{names:r.data.conflicts.map(f=>f.name).join(", ")})}):null,s.isLoading&&o.jsx(Je,{}),!s.isLoading&&(s.data?.length??0)===0&&o.jsx(ot,{children:C("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(Ue,{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(he,{size:"sm",variant:"destructive",onClick:()=>d(f.name,f.source),children:o.jsx(Ja,{size:13})})]},`${f.source}-${f.name}`))}),o.jsx(Hz,{open:i,onClose:()=>c(!1),pid:e,onCreated:()=>{c(!1),s.mutate()}})]})}function Hz({open:e,onClose:n,pid:s,onCreated:r}){const i=nt(),[c,d]=v.useState(!1),[f,p]=v.useState("shared"),[m,h]=v.useState(""),[x,y]=v.useState("stdio"),[S,w]=v.useState(""),[_,j]=v.useState(""),[E,k]=v.useState(""),[R,N]=v.useState(""),[O,A]=v.useState(!0),M=async()=>{if(!m){i.error(C("project.mcps.name_required"));return}d(!0);try{let B;if(R.trim())try{B=JSON.parse(R)}catch{i.error(C("project.mcps.env_invalid")),d(!1);return}const U=x==="stdio"?{name:m,command:S,args:_?_.split(/\s+/):void 0,env:B,enabled:O}:{name:m,url:E,enabled:O};await Mi.add(s,f,U),i.success(C("project.mcps.added")),h(""),w(""),j(""),k(""),N(""),r()}catch(B){i.error(B?.message||C("common.error_generic"))}finally{d(!1)}};return o.jsx(ma,{open:e,onClose:n,title:C("project.mcps.new_title"),description:C("project.mcps.new_desc"),footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:c,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:M,loading:c,children:C("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:C("project.mcps.scope_label"),children:o.jsx(Ct,{value:f,onChange:B=>p(B),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:C("project.mcps.transport_label"),children:o.jsx(Ct,{value:x,onChange:B=>y(B),options:[{value:"stdio",label:"stdio",description:"command"},{value:"http",label:"http",description:"url"}]})})]}),o.jsx(fe,{label:C("project.mcps.name_label"),children:o.jsx(Ce,{value:m,onChange:B=>h(B.target.value),placeholder:C("project.mcps.name_ph")})}),x==="stdio"?o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:C("project.mcps.cmd_label"),children:o.jsx(Ce,{value:S,onChange:B=>w(B.target.value),placeholder:C("project.mcps.cmd_ph")})}),o.jsx(fe,{label:C("project.mcps.args_label"),hint:C("project.mcps.args_hint"),children:o.jsx(Ce,{value:_,onChange:B=>j(B.target.value),placeholder:C("project.mcps.args_ph")})}),o.jsx(fe,{label:C("project.mcps.env_label"),hint:'{"FOO":"bar"}',children:o.jsx(Qt,{rows:3,className:"font-mono text-xs",value:R,onChange:B=>N(B.target.value)})})]}):o.jsx(fe,{label:C("project.mcps.url_label"),children:o.jsx(Ce,{value:E,onChange:B=>k(B.target.value),placeholder:C("project.mcps.url_ph")})}),o.jsx(sn,{checked:O,onChange:A,label:C("project.mcps.enabled_label")})]})})}function qz({pid:e}){const n=Qe(`/projects/${e}/agents`,()=>Jt.list(e)),[s,r]=v.useState(null),[i,c]=v.useState(null);return o.jsxs(He,{title:C("project.threads.title"),description:C("project.threads.subtitle"),children:[n.isLoading&&o.jsx(Je,{}),!n.isLoading&&(n.data?.length??0)===0&&o.jsx(ot,{children:C("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:Ae("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(Ue,{tone:"info",children:d.model})]})},d.slug))}),o.jsx("div",{className:"md:col-span-2",children:s?o.jsx(Vz,{pid:e,slug:s,onOpen:c}):o.jsx(ot,{children:C("project.threads.pick")})})]}),s&&i&&o.jsx($z,{pid:e,slug:s,id:i,onClose:()=>c(null)})]})}function Vz({pid:e,slug:n,onOpen:s}){const r=Qe(`/projects/${e}/agents/${n}/conversations`,()=>rx.list(e,n));return r.isLoading?o.jsx(Je,{}):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:[C("project.threads.via")," ",i.channel," · "]}),i.messages??0," ",C("project.threads.messages")]})]},i.id))}):o.jsx(ot,{children:C("project.threads.empty",{slug:n})})}function $z({pid:e,slug:n,id:s,onClose:r}){const i=Qe(`/projects/${e}/agents/${n}/conversations/${s}`,()=>rx.get(e,n,s));return o.jsxs(ma,{open:!0,onClose:r,title:C("project.threads.conversation_title",{id:s}),size:"lg",children:[i.isLoading&&o.jsx(Je,{}),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 wx({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:h,className:x}){const y=v.useRef(null);v.useLayoutEffect(()=>{const w=y.current;if(!w)return;w.style.height="auto";const _=parseFloat(getComputedStyle(w).lineHeight)||20,j=_*p,E=_*m;w.style.height=`${Math.min(Math.max(w.scrollHeight,j),E)}px`,w.style.overflowY=w.scrollHeight>E?"auto":"hidden"},[e,p,m]);const S=e.trim().length>0&&!c;return o.jsxs("div",{className:Pt("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:h}),i&&r?o.jsx(nl,{type:"button",size:"icon-sm",variant:"destructive",onClick:r,"aria-label":"Detener",title:"Detener",children:o.jsx(_j,{className:"size-3.5",fill:"currentColor"})}):o.jsx(nl,{type:"button",size:"icon-sm",variant:"default",onClick:s,disabled:!S,"aria-label":"Enviar",title:"Enviar",children:o.jsx(kN,{className:"size-4"})})]})]})}function Sx({value:e,onChange:n,disabled:s}){const[r,i]=v.useState(!1),[c,d]=v.useState(""),[f,p]=v.useState([]),[m,h]=v.useState(!1),x=v.useRef(null);v.useEffect(()=>{if(!r)return;const j=E=>{x.current&&!x.current.contains(E.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[r]),v.useEffect(()=>{if(!r||m)return;let j=!1;return(async()=>{try{const{engines:E}=await bd.list(),k=await Promise.all(E.map(R=>bd.models({engine:R}).then(N=>(N.models||[]).map(O=>O.includes(":")?O:`${R}:${O}`)).catch(()=>[])));if(!j){const R=Array.from(new Set(k.flat())).sort();p(R),h(!0)}}catch{j||h(!0)}})(),()=>{j=!0}},[r,m]);const y=c.trim().toLowerCase(),S=y?f.filter(j=>j.toLowerCase().includes(y)):f,w=e||"Auto",_=j=>{n(j),i(!1),d("")};return o.jsxs("div",{ref:x,className:"relative",children:[o.jsxs("button",{type:"button",disabled:s,onClick:()=>i(j=>!j),"data-testid":"chat-model-picker",className:Ae("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(yj,{className:"size-3 shrink-0"}),o.jsx("span",{className:"truncate font-mono",children:w}),o.jsx(Jr,{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:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&c.trim()&&_(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:j=>{j.preventDefault(),_("")},className:Ae("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(ec,{className:"size-3"})," Auto (router decide)"]}),!e&&o.jsx(Bi,{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:j=>{j.preventDefault(),_(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(j=>o.jsx("li",{children:o.jsxs("button",{type:"button",onMouseDown:E=>{E.preventDefault(),_(j)},className:Ae("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",j===e&&"bg-accent/50"),children:[o.jsx("span",{className:"truncate",children:j}),j===e&&o.jsx(Bi,{className:"size-3 shrink-0"})]})},j))]})]})]})}function Gz({onSend:e,onStop:n,streaming:s,model:r,onModelChange:i}){const[c,d]=v.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(wx,{value:c,onValueChange:d,onSubmit:f,onStop:n,busy:s,placeholder:C("project.chat.placeholder"),maxRows:12,footer:i?o.jsx(Sx,{value:r||"",onChange:i,disabled:s}):void 0})})}const Yz={read_file:{icon:IN,label:"Leer archivo"},write_file:{icon:BN,label:"Escribir archivo"},edit_file:{icon:ad,label:"Editar archivo"},list_files:{icon:$N,label:"Listar archivos"},search_files:{icon:Gu,label:"Buscar en archivos"},search_messages:{icon:Gu,label:"Buscar mensajes"},tail_messages:{icon:Gu,label:"Últimos mensajes"},run_shell:{icon:Ii,label:"Ejecutar shell"},send_telegram:{icon:Za,label:"Enviar Telegram"},call_agent:{icon:vn,label:"Llamar agente"},call_mcp:{icon:uR,label:"Llamar MCP"},call_runtime:{icon:vn,label:"Llamar runtime"},create_task:{icon:eR,label:"Crear tarea"}},l2=new Set(["write_file","edit_file"]);function Fz(e){return Yz[e]||{icon:cl,label:e}}function Xz(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 J1(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kz({status:e}){return e==="running"?o.jsx(Td,{className:"size-3 shrink-0 animate-spin text-sky-400"}):e==="error"?o.jsx(ec,{className:"size-3 shrink-0 text-rose-400"}):e==="deduped"?o.jsx(DN,{className:"size-3 shrink-0 text-amber-400"}):o.jsx(Bi,{className:"size-3 shrink-0 text-emerald-400"})}function Qz({part:e}){const[n,s]=v.useState(!1),{icon:r,label:i}=Fz(e.tool),c=Xz(e.tool,e.args),d=l2.has(e.tool),f=!!e.args||e.result!==void 0;return o.jsxs("div",{className:Ae("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(Nd,{className:Ae("size-3 shrink-0 text-muted-foreground transition-transform",n&&"rotate-90")}):o.jsx("span",{className:"size-3 shrink-0"}),o.jsx(r,{className:Ae("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(Kz,{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:J1(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:Ae("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:J1(e.result)})]})]})]})}function Zz(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 Jz({part:e,pending:n}){const s=Zz(e),r=C(n?"ask_panel.status_waiting":"ask_panel.status_received");return o.jsxs("div",{className:Ae("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(Td,{className:"size-3.5 shrink-0 animate-spin text-amber-600 dark:text-amber-400"}):o.jsx(gj,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),o.jsx(nR,{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 Cx(e){return e.parts.filter(n=>n.kind==="text").map(n=>n.text).join(`
|
|
551
|
-
|
|
552
|
-
`).trim()}const Wz=e=>[{kind:"text",text:e}];function eD(e){if(!e||typeof e!="object")return!1;const n=e;return"error"in n&&!!n.error}function Ex(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=eD(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 tD(e,n){const[s,r]=v.useState([]),[i,c]=v.useState(!1),d=v.useRef(null),f=v.useRef(void 0),p=v.useCallback(S=>{r(w=>{const _=[...w],j=_[_.length-1];return j&&j.role==="assistant"&&(_[_.length-1]=S(j)),_})},[]),m=v.useCallback(S=>{if(S.type==="error"){n?.(S.error||"stream error");return}p(w=>Ex(w,S))},[p,n]),h=v.useCallback(async(S,w={})=>{const _=S.trim();if(!_||i)return;const j=()=>new Date().toISOString(),E=s.map(R=>({role:R.role,content:Cx(R)}));if(r(R=>[...R,{role:"user",parts:Wz(_),ts:j()},{role:"assistant",parts:[],ts:j(),pending:!0}]),c(!0),w.agentSlug){try{const R=await Jt.chat(e,w.agentSlug,{prompt:_,conversation_id:f.current});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((O,A)=>A!==N.length-1))}finally{c(!1)}return}const k=new AbortController;d.current=k;try{await cS.stream(e,{prompt:_,previousMessages:E,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((O,A)=>A!==N.length-1)))}finally{c(!1),d.current=null}},[e,s,i,m,p,n]),x=v.useCallback(()=>d.current?.abort(),[]),y=v.useCallback(()=>{i||(f.current=void 0,r([]))},[i]);return{msgs:s,send:h,stop:x,clear:y,streaming:i}}function nD({msg:e,isLast:n,onCopy:s}){const r=e.role==="user",i=Cx(e),c=e.parts.some(d=>d.kind==="tool");return o.jsxs("div",{className:Ae("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:Ae("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(QN,{size:10})," ",d]},f))}),e.parts.map((d,f)=>d.kind==="tool"?d.tool==="ask_questions"&&!r?o.jsx(Jz,{part:d,pending:!!n},`${d.id}-${f}`):o.jsx(Qz,{part:d},`${d.id}-${f}`):d.text?o.jsx("div",{className:Ae("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:aD(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(wj,{size:14})})]})}function aD(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function kx({msgs:e,onCopy:n}){const s=v.useRef(null);if(v.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(ot,{children:C("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(nD,{msg:i,isLast:c===r,onCopy:n},c)),o.jsx("div",{ref:s})]})}function sD(e){if(!e)return;const n=e.path??e.file??e.filename;return typeof n=="string"?n:void 0}function i2({msgs:e}){const[n,s]=v.useState(!1),{inTok:r,outTok:i,toolCount:c,changed:d,model:f}=v.useMemo(()=>{let m=0,h=0,x=0,y;const S=new Set,w=[];for(const _ of e)if(_.role==="assistant"){_.usage&&(m+=_.usage.input_tokens||0,h+=_.usage.output_tokens||0),_.model&&(y=_.model);for(const j of _.parts)if(j.kind==="tool"&&(x+=1,l2.has(j.tool)&&j.status!=="error")){const E=sD(j.args);E&&!S.has(E)&&(S.add(E),w.push({path:E,tool:j.tool}))}}return{inTok:m,outTok:h,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:Ae("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(Rd,{size:12})," ",Jp(p)," tok",o.jsxs("span",{className:"text-muted-foreground/60",children:["(",Jp(r),"↑ / ",Jp(i),"↓)"]})]}),c>0&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(cl,{size:12})," ",c," tools"]}),d.length>0&&o.jsxs("span",{className:"flex items-center gap-1 text-violet-400",children:[o.jsx(ad,{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(Jr,{className:Ae("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(ad,{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 Jp(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Vo(){return{picked:new Set,text:"",skipped:!1}}function W1(e,n){const s=[];return e.forEach((r,i)=>{const c=n[i]||Vo();if(c.skipped){s.push(`- ${r.question}
|
|
553
|
-
→ (omitido)`);return}const d=[];if(r.options&&r.options.length>0){const m=[...c.picked].sort((h,x)=>h-x).map(h=>r.options[h]?.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}
|
|
554
|
-
→ ${p}`)}),s.join(`
|
|
555
|
-
`)}function c2({turnKey:e,questions:n,onSubmit:s,onDismiss:r,disabled:i}){const c=n.length,[d,f]=v.useState(0),[p,m]=v.useState(()=>n.map(()=>Vo()));v.useEffect(()=>{f(0),m(n.map(()=>Vo()))},[e,n]);const h=n[d],x=p[d]||Vo(),y=!!h?.options&&h.options.length>0,S=!!h?.multiSelect,w=h?.allowText!==!1,_=A=>{m(M=>{const B=[...M],U=B[d]||Vo();return B[d]={...U,...A,skipped:!1},B})},j=A=>{m(M=>{const B=[...M],U=B[d]||Vo(),I=new Set(U.picked);return S?I.has(A)?I.delete(A):I.add(A):(I.clear(),I.add(A)),B[d]={...U,picked:I,skipped:!1},B})},E=v.useMemo(()=>!0,[]),k=d===c-1,R=()=>f(A=>Math.max(0,A-1)),N=()=>{if(k){s(W1(n,p));return}f(A=>Math.min(c-1,A+1))},O=()=>{if(m(A=>{const M=[...A];return M[d]={picked:new Set,text:"",skipped:!0},M}),k){const A=p.map((M,B)=>B===d?{picked:new Set,text:"",skipped:!0}:M);s(W1(n,A))}else f(A=>Math.min(c-1,A+1))};return v.useEffect(()=>{const A=M=>{if(i)return;const B=M.target?.tagName?.toLowerCase(),U=B==="input"||B==="textarea";if(M.key==="Enter"&&(M.metaKey||M.ctrlKey)){M.preventDefault(),N();return}if(!U&&y&&/^[1-9]$/.test(M.key)){const I=parseInt(M.key,10)-1;I<(h?.options?.length||0)&&(M.preventDefault(),j(I))}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)}),!h||c===0?null:o.jsxs("div",{className:Ae("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]}),h.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:h.header}),o.jsx("p",{className:"min-w-0 flex-1 text-sm font-semibold leading-snug",children:h.question}),r&&o.jsx("button",{type:"button",onClick:r,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":C("common.close"),children:o.jsx(ec,{className:"size-3.5"})})]}),o.jsxs("div",{className:"space-y-1 px-2 py-2",children:[y&&h.options.map((A,M)=>{const B=x.picked.has(M);return o.jsxs("button",{type:"button",onClick:()=>j(M),className:Ae("flex w-full items-start gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition",B?"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:A.label}),A.description&&o.jsx("div",{className:"text-[11px] text-muted-foreground",children:A.description})]}),S?o.jsx("span",{className:Ae("mt-0.5 grid size-4 shrink-0 place-items-center rounded border",B?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-background"),children:B&&o.jsx("span",{className:"text-[10px] leading-none",children:"✓"})}):o.jsx("span",{className:Ae("mt-0.5 grid size-4 shrink-0 place-items-center rounded border font-mono text-[10px]",B?"border-emerald-500 bg-emerald-500 text-white":"border-border bg-muted text-muted-foreground"),children:M+1})]},`${M}:${A.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:C("ask_panel.other")}),o.jsx("input",{type:"text",value:x.text,onChange:A=>_({text:A.target.value}),placeholder:C(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:C("ask_panel.back")}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{type:"button",onClick:O,className:"rounded px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",children:C("ask_panel.skip")}),o.jsxs("button",{type:"button",onClick:N,disabled:!E,className:"inline-flex items-center gap-1 rounded bg-emerald-500/15 px-2 py-1 text-[11px] font-medium text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-300",children:[C(k?"ask_panel.submit":"ask_panel.next"),o.jsx(zN,{className:"size-3 opacity-60"})]})]})]})]})}function rD(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 u2(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 h=n.parts[m];if(h.kind==="tool"&&h.tool==="ask_questions"){s=h,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(rD).filter(h=>!!h),d.length>0)break;return d.length?{turnKey:`${n.ts||""}#${r}`,questions:d}:null}const xi="__super_agent__";function oD({pid:e}){const n=nt(),[s]=ij(),r=Qe(`/projects/${e}/agents`,()=>Jt.list(e)),[i,c]=v.useState(s.get("agent")||""),[d,f]=v.useState(!1),[p,m]=v.useState(""),[h,x]=v.useState(null),{msgs:y,send:S,stop:w,clear:_,streaming:j}=tD(e,L=>n.error(L)),E=r.data||[],k=L=>L===xi,R=v.useMemo(()=>[{value:xi,label:"Roby (super-agent)"},...E.map(L=>({value:L.slug,label:L.slug}))],[E]),N=v.useMemo(()=>E.find(L=>L.slug===i)||E[0],[E,i]),O=k(i)?xi:N?.slug||xi,A=O===xi;v.useEffect(()=>{!i&&N?.slug&&c(N.slug)},[N?.slug,i]);const M=()=>_(),B=async L=>{!A&&!N||await S(L,{model:A?p:void 0,agentSlug:A?void 0:N.slug})},U=async L=>{try{await navigator.clipboard.writeText(L),n.info(C("project.chat.copied"))}catch{}};if(r.isLoading)return o.jsx(Je,{});const I=C(A?"project.chat.roby_subtitle":"project.chat.subtitle");return o.jsxs("div",{className:"flex h-[calc(100vh-11rem)] 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:C(A?"project.chat.roby_title":"project.chat.title")}),o.jsx("p",{className:"truncate text-[11px] text-muted-fg",children:I})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-52",children:o.jsx(Ct,{value:O,onChange:L=>{c(L),M()},options:R})}),A?o.jsx(Ue,{tone:"success",children:"super-agent"}):N?.model&&o.jsx(Ue,{tone:"info",children:N.model}),!E.length&&!A&&o.jsxs(he,{variant:"primary",size:"sm",onClick:()=>f(!0),children:[o.jsx(Nn,{size:14})," ",C("project.chat.create_agent")]}),o.jsxs(he,{variant:"ghost",size:"sm",disabled:j||y.length===0,onClick:M,children:[o.jsx(Ja,{size:13})," ",C("project.chat.clear")]})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length?o.jsx(kx,{msgs:y,onCopy:U}):o.jsx(ot,{children:C("project.chat.empty")})}),o.jsx(i2,{msgs:y}),(()=>{const L=j?null:u2(y);return!L||L.turnKey===h?null:o.jsx(c2,{turnKey:L.turnKey,questions:L.questions,onSubmit:P=>void B(P),onDismiss:()=>x(L.turnKey),disabled:j})})(),o.jsx(Gz,{onSend:B,onStop:w,streaming:j,model:A?p:void 0,onModelChange:A?m:void 0}),o.jsx(lD,{open:d,pid:e,onClose:()=>f(!1),onCreated:()=>{f(!1),r.mutate()}})]})}function lD({open:e,onClose:n,onCreated:s,pid:r}){const i=nt(),[c,d]=v.useState(""),[f,p]=v.useState("master"),[m,h]=v.useState(""),[x,y]=v.useState(!0),[S,w]=v.useState(!1),_=async()=>{if(!/^[a-z][a-z0-9_-]*$/.test(c)){i.error(C("project.agents.slug_invalid"));return}w(!0);try{await Jt.create(r,{slug:c,role:f,model:m||void 0,is_master:x}),i.success(C("project.agents.created",{slug:c})),d(""),p("master"),h(""),y(!0),s()}catch(j){i.error(j.message)}finally{w(!1)}};return o.jsx(ma,{open:e,onClose:n,title:C("project.chat.create_agent_title"),description:C("project.chat.create_agent_desc"),footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:S,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:_,loading:S,children:C("common.create")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:"slug",children:o.jsx(Ce,{autoFocus:!0,value:c,onChange:j=>d(j.target.value),placeholder:"master"})}),o.jsx(fe,{label:C("project.chat.role_label"),children:o.jsx(Ce,{value:f,onChange:j=>p(j.target.value),placeholder:"master"})}),o.jsx(fe,{label:C("project.chat.model_label"),hint:C("project.chat.model_hint"),children:o.jsx(Ce,{value:m,onChange:j=>h(j.target.value)})}),o.jsx(sn,{checked:x,onChange:y,label:C("project.chat.master_label")})]})})}function iD({pid:e}){const n=nt(),{project:s}=dS(e),{channels:r,isLoading:i,mutate:c}=mx(),d=String(e),f=s?.name||s?.path?.split("/").pop()||d,p=`proj-${d}`,m=r.find(M=>M.project===d||M.project===f||M.name===p),[h,x]=v.useState(!!m),[y,S]=v.useState(""),[w,_]=v.useState(""),[j,E]=v.useState(""),[k,R]=v.useState(!0),[N,O]=v.useState(!1);if(v.useEffect(()=>{m?(x(!0),S(""),_(m.chat_id||""),E(m.route_to_agent||""),R(m.respond_with_engine??!0)):(x(!1),S(""),_(""),E(""),R(!0))},[m?.name,m?.chat_id,m?.route_to_agent]),i)return o.jsx(Je,{});const A=async()=>{O(!0);try{if(!h){m&&(await kn.channels.remove(m.name),n.success(C("project.telegram.cleared"))),await c();return}const M={name:m?.name||p,project:d,chat_id:w,route_to_agent:j,respond_with_engine:k,...y?{bot_token:y}:{}};m?await kn.channels.patch(m.name,M):await kn.channels.upsert(M),n.success(C("project.telegram.saved")),await c(),S("")}catch(M){n.error(M.message)}finally{O(!1)}};return o.jsx(He,{title:C("project.telegram.title"),description:C("project.telegram.subtitle"),children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(sn,{checked:h,onChange:x,label:C(h?"project.telegram.override_active":"project.telegram.use_default")}),m&&o.jsx(Ue,{tone:"success",children:C("project.telegram.channel_badge",{name:m.name})})]}),h&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.telegram.bot_token"),hint:m?.bot_token?`${fr(m.bot_token)} — vacío = mantener`:C("project.telegram.bot_hint_none"),children:o.jsx(Ce,{type:"password",value:y,onChange:M=>S(M.target.value),placeholder:m?.bot_token?fr(m.bot_token):""})}),o.jsx(fe,{label:C("project.telegram.chat_id"),children:o.jsx(Ce,{value:w,onChange:M=>_(M.target.value)})}),o.jsx(fe,{label:C("project.telegram.route_agent"),hint:C("project.telegram.route_hint"),children:o.jsx(Ce,{value:j,onChange:M=>E(M.target.value)})})]}),o.jsx(sn,{checked:k,onChange:R,label:C("project.telegram.respond_engine")})]}),o.jsx("div",{className:"pt-2",children:o.jsx(he,{variant:"primary",loading:N,onClick:A,children:C("common.save")})}),!h&&!m&&o.jsx(ot,{children:C("project.telegram.no_override")})]})})}function d2({load:e,save:n,rows:s=10,placeholder:r}){const i=nt(),[c,d]=v.useState(null),[f,p]=v.useState(""),[m,h]=v.useState(!1);if(v.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(Je,{});const x=f!==c,y=async()=>{h(!0);try{await n(f),d(f),i.success(C("project.memories.saved"))}catch(S){i.error(S.message)}finally{h(!1)}};return o.jsxs("div",{className:"space-y-2",children:[o.jsx(Qt,{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," ",C("project.memories.chars")]}),o.jsxs(he,{size:"sm",variant:"primary",loading:m,disabled:!x,onClick:y,children:[o.jsx(vh,{size:12})," ",C("project.memories.save_btn")]})]})]})}function cD({pid:e,agent:n}){const[s,r]=v.useState(!1),i=n.is_master?Ns: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(Jr,{size:14,className:"text-muted-fg"}):o.jsx(Nd,{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(d2,{rows:8,load:()=>Jt.memory.get(e,n.slug).then(c=>c.body),save:c=>Jt.memory.put(e,n.slug,c).then(()=>{})})})]})}function uD({pid:e}){const n=Qe(`/projects/${e}/agents`,()=>Jt.list(e));return o.jsxs("div",{className:"space-y-6",children:[o.jsx(He,{title:C("project.memories.project_title"),description:C("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(td,{className:"size-4 text-white"})}),o.jsx("div",{className:"min-w-0 flex-1",children:o.jsx(d2,{rows:12,load:()=>Qn.memory.get(e).then(s=>s.body),save:s=>Qn.memory.put(e,s).then(()=>{}),placeholder:C("project.memories.project_ph")})})]})}),o.jsxs(He,{title:C("project.memories.agents_title"),description:C("project.memories.agents_desc"),children:[n.isLoading&&o.jsx(Je,{}),!n.isLoading&&(n.data?.length??0)===0&&o.jsx(ot,{children:C("project.memories.no_agents")}),o.jsx("ul",{className:"space-y-2",children:(n.data||[]).map(s=>o.jsx(cD,{pid:e,agent:s},s.slug))})]})]})}function dD(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 fD(e){const n=+this._x.call(null,e),s=+this._y.call(null,e);return f2(this.cover(n,s),n,s,e)}function f2(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,h=e._y1,x,y,S,w,_,j,E,k;if(!c)return e._root=d,e;for(;c.length;)if((_=n>=(x=(f+m)/2))?f=x:m=x,(j=s>=(y=(p+h)/2))?p=y:h=y,i=c,!(c=c[E=j<<1|_]))return i[E]=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[E]=d:e._root=d,e;do i=i?i[E]=new Array(4):e._root=new Array(4),(_=n>=(x=(f+m)/2))?f=x:m=x,(j=s>=(y=(p+h)/2))?p=y:h=y;while((E=j<<1|_)===(k=(w>=y)<<1|S>=x));return i[k]=c,i[E]=d,e}function mD(e){var n,s,r=e.length,i,c,d=new Array(r),f=new Array(r),p=1/0,m=1/0,h=-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>h&&(h=i),c<m&&(m=c),c>x&&(x=c));if(p>h||m>x)return this;for(this.cover(p,m).cover(h,x),s=0;s<r;++s)f2(this,d[s],f[s],e[s]);return this}function pD(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 gD(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function hD(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 Un(e,n,s,r,i){this.node=e,this.x0=n,this.y0=s,this.x1=r,this.y1=i}function xD(e,n,s){var r,i=this._x0,c=this._y0,d,f,p,m,h=this._x1,x=this._y1,y=[],S=this._root,w,_;for(S&&y.push(new Un(S,i,c,h,x)),s==null?s=1/0:(i=e-s,c=n-s,h=e+s,x=n+s,s*=s);w=y.pop();)if(!(!(S=w.node)||(d=w.x0)>h||(f=w.y0)>x||(p=w.x1)<i||(m=w.y1)<c))if(S.length){var j=(d+p)/2,E=(f+m)/2;y.push(new Un(S[3],j,E,p,m),new Un(S[2],d,E,j,m),new Un(S[1],j,f,p,E),new Un(S[0],d,f,j,E)),(_=(n>=E)<<1|e>=j)&&(w=y[y.length-1],y[y.length-1]=y[y.length-1-_],y[y.length-1-_]=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 O=Math.sqrt(s=N);i=e-O,c=n-O,h=e+O,x=n+O,r=S.data}}return r}function bD(e){if(isNaN(h=+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,h,x,y,S,w,_,j,E;if(!s)return this;if(s.length)for(;;){if((w=h>=(y=(d+p)/2))?d=y:p=y,(_=x>=(S=(f+m)/2))?f=S:m=S,n=s,!(s=s[j=_<<1|w]))return this;if(!s.length)break;(n[j+1&3]||n[j+2&3]||n[j+3&3])&&(r=n,E=j)}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[j]=c:delete n[j],(s=n[0]||n[1]||n[2]||n[3])&&s===(n[3]||n[2]||n[1]||n[0])&&!s.length&&(r?r[E]=s:this._root=s),this):(this._root=c,this)}function vD(e){for(var n=0,s=e.length;n<s;++n)this.remove(e[n]);return this}function yD(){return this._root}function _D(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function jD(e){var n=[],s,r=this._root,i,c,d,f,p;for(r&&n.push(new Un(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,h=(d+p)/2;(i=r[3])&&n.push(new Un(i,m,h,f,p)),(i=r[2])&&n.push(new Un(i,c,h,m,p)),(i=r[1])&&n.push(new Un(i,m,d,f,h)),(i=r[0])&&n.push(new Un(i,c,d,m,h))}return this}function wD(e){var n=[],s=[],r;for(this._root&&n.push(new Un(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,h=(d+p)/2,x=(f+m)/2;(c=i[0])&&n.push(new Un(c,d,f,h,x)),(c=i[1])&&n.push(new Un(c,h,f,p,x)),(c=i[2])&&n.push(new Un(c,d,x,h,m)),(c=i[3])&&n.push(new Un(c,h,x,p,m))}s.push(r)}for(;r=s.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function SD(e){return e[0]}function CD(e){return arguments.length?(this._x=e,this):this._x}function ED(e){return e[1]}function kD(e){return arguments.length?(this._y=e,this):this._y}function Nx(e,n,s){var r=new Rx(n??SD,s??ED,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Rx(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 e_(e){for(var n={data:e.data},s=n;e=e.next;)s=s.next={data:e.data};return n}var Hn=Nx.prototype=Rx.prototype;Hn.copy=function(){var e=new Rx(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=e_(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]=e_(r));return e};Hn.add=fD;Hn.addAll=mD;Hn.cover=pD;Hn.data=gD;Hn.extent=hD;Hn.find=xD;Hn.remove=bD;Hn.removeAll=vD;Hn.root=yD;Hn.size=_D;Hn.visit=jD;Hn.visitAfter=wD;Hn.x=CD;Hn.y=kD;function Yr(e){return function(){return e}}function cr(e){return(e()-.5)*1e-6}function ND(e){return e.x+e.vx}function RD(e){return e.y+e.vy}function TD(e){var n,s,r,i=1,c=1;typeof e!="function"&&(e=Yr(e==null?1:+e));function d(){for(var m,h=n.length,x,y,S,w,_,j,E=0;E<c;++E)for(x=Nx(n,ND,RD).visitAfter(f),m=0;m<h;++m)y=n[m],_=s[y.index],j=_*_,S=y.x+y.vx,w=y.y+y.vy,x.visit(k);function k(R,N,O,A,M){var B=R.data,U=R.r,I=_+U;if(B){if(B.index>y.index){var L=S-B.x-B.vx,P=w-B.y-B.vy,H=L*L+P*P;H<I*I&&(L===0&&(L=cr(r),H+=L*L),P===0&&(P=cr(r),H+=P*P),H=(I-(H=Math.sqrt(H)))/H*i,y.vx+=(L*=H)*(I=(U*=U)/(j+U)),y.vy+=(P*=H)*I,B.vx-=L*(I=1-I),B.vy-=P*I)}return}return N>S+I||A<S-I||O>w+I||M<w-I}}function f(m){if(m.data)return m.r=s[m.data.index];for(var h=m.r=0;h<4;++h)m[h]&&m[h].r>m.r&&(m.r=m[h].r)}function p(){if(n){var m,h=n.length,x;for(s=new Array(h),m=0;m<h;++m)x=n[m],s[x.index]=+e(x,m,n)}}return d.initialize=function(m,h){n=m,r=h,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:Yr(+m),p(),d):e},d}function AD(e){return e.index}function t_(e,n){var s=e.get(n);if(!s)throw new Error("node not found: "+n);return s}function MD(e){var n=AD,s=x,r,i=Yr(30),c,d,f,p,m,h=1;e==null&&(e=[]);function x(j){return 1/Math.min(f[j.source.index],f[j.target.index])}function y(j){for(var E=0,k=e.length;E<h;++E)for(var R=0,N,O,A,M,B,U,I;R<k;++R)N=e[R],O=N.source,A=N.target,M=A.x+A.vx-O.x-O.vx||cr(m),B=A.y+A.vy-O.y-O.vy||cr(m),U=Math.sqrt(M*M+B*B),U=(U-c[R])/U*j*r[R],M*=U,B*=U,A.vx-=M*(I=p[R]),A.vy-=B*I,O.vx+=M*(I=1-I),O.vy+=B*I}function S(){if(d){var j,E=d.length,k=e.length,R=new Map(d.map((O,A)=>[n(O,A,d),O])),N;for(j=0,f=new Array(E);j<k;++j)N=e[j],N.index=j,typeof N.source!="object"&&(N.source=t_(R,N.source)),typeof N.target!="object"&&(N.target=t_(R,N.target)),f[N.source.index]=(f[N.source.index]||0)+1,f[N.target.index]=(f[N.target.index]||0)+1;for(j=0,p=new Array(k);j<k;++j)N=e[j],p[j]=f[N.source.index]/(f[N.source.index]+f[N.target.index]);r=new Array(k),w(),c=new Array(k),_()}}function w(){if(d)for(var j=0,E=e.length;j<E;++j)r[j]=+s(e[j],j,e)}function _(){if(d)for(var j=0,E=e.length;j<E;++j)c[j]=+i(e[j],j,e)}return y.initialize=function(j,E){d=j,m=E,S()},y.links=function(j){return arguments.length?(e=j,S(),y):e},y.id=function(j){return arguments.length?(n=j,y):n},y.iterations=function(j){return arguments.length?(h=+j,y):h},y.strength=function(j){return arguments.length?(s=typeof j=="function"?j:Yr(+j),w(),y):s},y.distance=function(j){return arguments.length?(i=typeof j=="function"?j:Yr(+j),_(),y):i},y}var OD={value:()=>{}};function m2(){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 Ju(s)}function Ju(e){this._=e}function zD(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}})}Ju.prototype=m2.prototype={constructor:Ju,on:function(e,n){var s=this._,r=zD(e+"",s),i,c=-1,d=r.length;if(arguments.length<2){for(;++c<d;)if((i=(e=r[c]).type)&&(i=DD(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]=n_(s[i],e.name,n);else if(n==null)for(i in s)s[i]=n_(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 Ju(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 DD(e,n){for(var s=0,r=e.length,i;s<r;++s)if((i=e[s]).name===n)return i.value}function n_(e,n,s){for(var r=0,i=e.length;r<i;++r)if(e[r].name===n){e[r]=OD,e=e.slice(0,r).concat(e.slice(r+1));break}return s!=null&&e.push({name:n,value:s}),e}var rl=0,ki=0,bi=0,p2=1e3,Sd,Ni,Cd=0,Qr=0,tf=0,Xi=typeof performance=="object"&&performance.now?performance:Date,g2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function h2(){return Qr||(g2(LD),Qr=Xi.now()+tf)}function LD(){Qr=0}function nh(){this._call=this._time=this._next=null}nh.prototype=x2.prototype={constructor:nh,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?h2():+s)+(n==null?0:+n),!this._next&&Ni!==this&&(Ni?Ni._next=this:Sd=this,Ni=this),this._call=e,this._time=s,ah()},stop:function(){this._call&&(this._call=null,this._time=1/0,ah())}};function x2(e,n,s){var r=new nh;return r.restart(e,n,s),r}function PD(){h2(),++rl;for(var e=Sd,n;e;)(n=Qr-e._time)>=0&&e._call.call(void 0,n),e=e._next;--rl}function a_(){Qr=(Cd=Xi.now())+tf,rl=ki=0;try{PD()}finally{rl=0,ID(),Qr=0}}function BD(){var e=Xi.now(),n=e-Cd;n>p2&&(tf-=n,Cd=e)}function ID(){for(var e,n=Sd,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:Sd=s);Ni=e,ah(r)}function ah(e){if(!rl){ki&&(ki=clearTimeout(ki));var n=e-Qr;n>24?(e<1/0&&(ki=setTimeout(a_,e-Xi.now()-tf)),bi&&(bi=clearInterval(bi))):(bi||(Cd=Xi.now(),bi=setInterval(BD,p2)),rl=1,g2(a_))}}const UD=1664525,HD=1013904223,s_=4294967296;function qD(){let e=1;return()=>(e=(UD*e+HD)%s_)/s_}function VD(e){return e.x}function $D(e){return e.y}var GD=10,YD=Math.PI*(3-Math.sqrt(5));function FD(e){var n,s=1,r=.001,i=1-Math.pow(r,1/300),c=0,d=.6,f=new Map,p=x2(x),m=m2("tick","end"),h=qD();e==null&&(e=[]);function x(){y(),m.call("tick",n),s<r&&(p.stop(),m.call("end",n))}function y(_){var j,E=e.length,k;_===void 0&&(_=1);for(var R=0;R<_;++R)for(s+=(c-s)*i,f.forEach(function(N){N(s)}),j=0;j<E;++j)k=e[j],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 _=0,j=e.length,E;_<j;++_){if(E=e[_],E.index=_,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var k=GD*Math.sqrt(.5+_),R=_*YD;E.x=k*Math.cos(R),E.y=k*Math.sin(R)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function w(_){return _.initialize&&_.initialize(e,h),_}return S(),n={tick:y,restart:function(){return p.restart(x),n},stop:function(){return p.stop(),n},nodes:function(_){return arguments.length?(e=_,S(),f.forEach(w),n):e},alpha:function(_){return arguments.length?(s=+_,n):s},alphaMin:function(_){return arguments.length?(r=+_,n):r},alphaDecay:function(_){return arguments.length?(i=+_,n):+i},alphaTarget:function(_){return arguments.length?(c=+_,n):c},velocityDecay:function(_){return arguments.length?(d=1-_,n):1-d},randomSource:function(_){return arguments.length?(h=_,f.forEach(w),n):h},force:function(_,j){return arguments.length>1?(j==null?f.delete(_):f.set(_,w(j)),n):f.get(_)},find:function(_,j,E){var k=0,R=e.length,N,O,A,M,B;for(E==null?E=1/0:E*=E,k=0;k<R;++k)M=e[k],N=_-M.x,O=j-M.y,A=N*N+O*O,A<E&&(B=M,E=A);return B},on:function(_,j){return arguments.length>1?(m.on(_,j),n):m.on(_)}}}function XD(){var e,n,s,r,i=Yr(-30),c,d=1,f=1/0,p=.81;function m(S){var w,_=e.length,j=Nx(e,VD,$D).visitAfter(x);for(r=S,w=0;w<_;++w)n=e[w],j.visit(y)}function h(){if(e){var S,w=e.length,_;for(c=new Array(w),S=0;S<w;++S)_=e[S],c[_.index]=+i(_,S,e)}}function x(S){var w=0,_,j,E=0,k,R,N;if(S.length){for(k=R=N=0;N<4;++N)(_=S[N])&&(j=Math.abs(_.value))&&(w+=_.value,E+=j,k+=j*_.x,R+=j*_.y);S.x=k/E,S.y=R/E}else{_=S,_.x=_.data.x,_.y=_.data.y;do w+=c[_.data.index];while(_=_.next)}S.value=w}function y(S,w,_,j){if(!S.value)return!0;var E=S.x-n.x,k=S.y-n.y,R=j-w,N=E*E+k*k;if(R*R/p<N)return N<f&&(E===0&&(E=cr(s),N+=E*E),k===0&&(k=cr(s),N+=k*k),N<d&&(N=Math.sqrt(d*N)),n.vx+=E*S.value*r/N,n.vy+=k*S.value*r/N),!0;if(S.length||N>=f)return;(S.data!==n||S.next)&&(E===0&&(E=cr(s),N+=E*E),k===0&&(k=cr(s),N+=k*k),N<d&&(N=Math.sqrt(d*N)));do S.data!==n&&(R=c[S.data.index]*r/N,n.vx+=E*R,n.vy+=k*R);while(S=S.next)}return m.initialize=function(S,w){e=S,s=w,h()},m.strength=function(S){return arguments.length?(i=typeof S=="function"?S:Yr(+S),h(),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 vi={agent:"#a78bfa",memory:"#38bdf8",thread:"#34d399",task:"#fbbf24",routine:"#f472b6",agentlink:"#c084fc"},r_={agent:"agente",memory:"memoria",thread:"thread",task:"task",routine:"rutina",agentlink:"jerarquía"},yi=760,_i=460;function KD({center:e,nodes:n}){const s=v.useRef(null),r=v.useRef(null),i=v.useRef([]),c=v.useRef([]),d=v.useRef(null),[,f]=v.useState(0),[p,m]=v.useState(null);v.useEffect(()=>{const j={id:"__center",label:e,kind:"agent",relation:"self",x:yi/2,y:_i/2,fx:yi/2,fy:_i/2},E=[j,...n.map(N=>({...N}))],k=E.slice(1).map(N=>({source:j,target:N}));i.current=E,c.current=k;const R=FD(E).force("link",MD(k).distance(120).strength(.5)).force("charge",XD().strength(-220)).force("center",dD(yi/2,_i/2).strength(.05)).force("collide",TD(26)).on("tick",()=>f(N=>N+1));return r.current=R,()=>{R.stop()}},[e,n]);const h=j=>{const E=s.current.getBoundingClientRect();return{x:(j.clientX-E.left)/E.width*yi,y:(j.clientY-E.top)/E.height*_i}},x=j=>E=>{j.id!=="__center"&&(d.current=j,E.target.setPointerCapture?.(E.pointerId),r.current?.alphaTarget(.3).restart())},y=j=>{const E=d.current;if(!E)return;const{x:k,y:R}=h(j);E.fx=k,E.fy=R},S=()=>{const j=d.current;j&&(j.fx=null,j.fy=null),d.current=null,r.current?.alphaTarget(0)},w=i.current,_=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 ${yi} ${_i}`,className:"h-[460px] w-full touch-none select-none",onPointerMove:y,onPointerUp:S,onPointerLeave:S,children:[_.map((j,E)=>o.jsx("line",{x1:j.source.x,y1:j.source.y,x2:j.target.x,y2:j.target.y,stroke:vi[j.target.kind],strokeOpacity:.22,strokeWidth:1.5},E)),w.map(j=>{if(j.id==="__center")return o.jsxs("g",{transform:`translate(${j.x},${j.y})`,children:[o.jsx("circle",{r:22,fill:vi.agent}),o.jsx("text",{textAnchor:"middle",y:4,fontSize:11,fontWeight:700,fill:"#1a1a1a",children:e.length>8?e.slice(0,8):e})]},j.id);const E=p?.id===j.id;return o.jsxs("g",{transform:`translate(${j.x},${j.y})`,className:"cursor-grab active:cursor-grabbing",onPointerDown:x(j),onClick:()=>m(j),children:[o.jsx("circle",{r:E?9:6,fill:vi[j.kind],fillOpacity:E?1:.9,stroke:E?"#fff":"none",strokeWidth:E?2:0}),o.jsx("text",{x:10,y:4,fontSize:10,className:"fill-foreground/80",children:j.label.length>22?`${j.label.slice(0,22)}…`:j.label})]},j.id)})]})}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-[11px] text-muted-fg",children:[Object.keys(r_).filter(j=>j!=="agent").map(j=>o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx("span",{className:"size-2 rounded-full",style:{background:vi[j]}})," ",r_[j]]},j)),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:vi[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 QD(){return[{key:"overview",label:"Explorer",icon:Rd},{key:"memories",label:C("project.nav.memories"),icon:td},{key:"records",label:C("project.agent_detail.records_title"),icon:uj},{key:"sleep",label:C("project.agent_detail.sleep_title"),icon:Xo},{key:"brain",label:C("project.agent_detail.brain_title"),icon:il},{key:"config",label:C("settings.tabs.advanced"),icon:sd}]}const ZD=[{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."}],sh=e=>e.split(",").map(n=>n.trim()).filter(Boolean),JD=(e,n)=>e.filter(s=>s.spec?.agent===n||n==="super-agent"&&s.kind==="super_agent");function WD(e){return e.split(`
|
|
556
|
-
`).map(n=>n.replace(/^[-*#>\s]+/,"").trim()).filter(n=>n.length>2&&!n.startsWith("```")).slice(0,12)}function e6({pid:e}){const{slug:n=""}=W_(),s=Ua(),[r,i]=v.useState("overview"),c=QD(),d=Qe(`/projects/${e}/agents/${n}`,()=>Jt.get(e,n)),f=Qe(`/projects/${e}/agents`,()=>Jt.list(e)),p=Qe(`/projects/${e}/routines`,()=>or.list(e)),m=Qe(`/projects/${e}/messages?agent=${n}`,()=>Jg.project(e,{agent:n,limit:200})),h=Qe(`/projects/${e}/agents/${n}/conversations`,()=>rx.list(e,n)),x=Qe(`/projects/${e}/tasks?all`,()=>lr.list(e,"all")),y=d.data,S=JD(p.data||[],n),w=(x.data||[]).filter(E=>E.agent===n),_=(f.data||[]).filter(E=>E.parent===n);if(d.isLoading)return o.jsx(Je,{});if(!y)return o.jsx("div",{className:"text-sm text-muted-fg",children:C("project.agent_detail.not_found")});const j=y.is_master?Ns: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(EN,{size:16})}),o.jsx("div",{className:Ae("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(j,{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(Ue,{tone:"success",children:[o.jsx(Ns,{size:10})," ",C("project.agents.orchestrator")]}),y.role&&o.jsx(Ue,{children:y.role}),y.model&&o.jsx(Ue,{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:[C("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(he,{size:"sm",variant:"primary",onClick:()=>s(`/p/${e}/chat?agent=${n}`),children:[o.jsx(Za,{size:13})," ",C("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:E,label:k,icon:R})=>o.jsxs("button",{onClick:()=>i(E),className:Ae("flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm transition-colors -mb-px",r===E?"border-foreground text-foreground":"border-transparent text-muted-fg hover:text-foreground"),children:[o.jsx(R,{size:14})," ",k]},E))}),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(Iu,{label:"Threads",value:h.data?.length??0,icon:Ri}),o.jsx(Iu,{label:"Records",value:m.data?.length??0,icon:uj}),o.jsx(Iu,{label:"Tasks",value:w.length,icon:Rd}),o.jsx(Iu,{label:"Heartbeats",value:S.length,icon:Xo})]}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsx(He,{title:"Skills & tools",description:"",children:o.jsxs("div",{className:"flex flex-wrap gap-1",children:[y.skills?.map(E=>o.jsxs(Ue,{tone:"info",children:[o.jsx(il,{size:10})," ",E]},E)),y.tools?.map(E=>o.jsxs(Ue,{children:[o.jsx(cl,{size:10})," ",E]},E)),!y.skills?.length&&!y.tools?.length&&o.jsx("span",{className:"text-xs text-muted-fg",children:"—"})]})}),o.jsx(He,{title:C("project.agent_detail.threads_recent"),description:"",children:o.jsxs("ul",{className:"space-y-1 text-xs",children:[(h.data||[]).slice(0,6).map(E=>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:E.title||E.filename}),o.jsxs("span",{className:"shrink-0 text-muted-fg",children:[E.messages??0," ",C("project.agent_detail.msgs_count")]})]},E.id)),!h.data?.length&&o.jsx("li",{className:"text-muted-fg",children:C("project.agent_detail.no_threads")})]})})]}),_.length>0&&o.jsx(He,{title:C("project.agent_detail.subagents"),description:C("project.agent_detail.subagents_desc"),children:o.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(E=>o.jsxs("button",{onClick:()=>s(`/p/${e}/agents/${E.slug}`),className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm hover:border-muted-fg/50",children:[o.jsx(vn,{size:14,className:"text-muted-fg"})," ",E.slug]},E.slug))})})]}),r==="memories"&&o.jsx(n6,{pid:e,slug:n,initial:y.memory||"",onSaved:()=>d.mutate()}),r==="records"&&o.jsx(a6,{records:m.data||[],loading:m.isLoading}),r==="sleep"&&o.jsx(s6,{routines:S}),r==="brain"&&o.jsx(o6,{slug:n,memory:y.memory||"",threads:(h.data||[]).map(E=>({id:E.id,label:E.title||E.filename})),tasks:w.map(E=>({id:E.id,label:E.title,detail:E.body||void 0})),routines:S,parent:y.parent||null,children:_.map(E=>E.slug)}),r==="config"&&o.jsx(t6,{pid:e,agent:y,agents:f.data||[],onSaved:()=>{d.mutate(),f.mutate()},onDeleted:()=>{f.mutate(),s(`/p/${e}/agents`)}})]})}function t6({pid:e,agent:n,agents:s,onSaved:r,onDeleted:i}){const c=nt(),[d,f]=v.useState(n.type||""),[p,m]=v.useState(n.area||""),[h,x]=v.useState(n.role||""),[y,S]=v.useState(n.model||""),[w,_]=v.useState(n.parent||""),[j,E]=v.useState(!!n.is_master),[k,R]=v.useState((n.skills||[]).join(", ")),[N,O]=v.useState((n.tools||[]).join(", ")),[A,M]=v.useState(n.description||""),[B,U]=v.useState(n.system||""),[I,L]=v.useState(!1),P=async()=>{L(!0);try{await Jt.update(e,n.slug,{type:d||null,area:p||null,role:h||null,model:y||null,parent:w||null,is_master:j||d==="orchestrator",skills:sh(k),tools:sh(N),description:A||null,system:B}),c.success(C("project.agent_detail.update_success")),r()}catch(Y){c.error(Y.message)}finally{L(!1)}},H=async()=>{if(confirm(C("project.agent_detail.delete_confirm",{slug:n.slug})))try{await Jt.remove(e,n.slug),c.success(C("project.agent_detail.delete_success")),i()}catch(Y){c.error(Y.message)}};return o.jsx(He,{title:C("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:C("project.agent_detail.type_label"),children:o.jsx(Ct,{value:d,onChange:f,options:ZD})}),o.jsx(fe,{label:C("project.agent_detail.area_label"),hint:C("project.agent_detail.area_hint"),children:o.jsx(Ce,{value:p,onChange:Y=>m(Y.target.value),placeholder:C("project.agent_detail.area_ph")})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("project.agent_detail.role_label"),children:o.jsx(Ce,{value:h,onChange:Y=>x(Y.target.value),placeholder:"Operations Lead"})}),o.jsx(fe,{label:C("project.agent_detail.parent_label"),children:o.jsx(Ct,{value:w,onChange:_,placeholder:C("project.agent_detail.none_parent"),options:[{value:"",label:C("project.agent_detail.none_parent")},...s.filter(Y=>Y.slug!==n.slug).map(Y=>({value:Y.slug,label:Y.slug}))]})})]}),o.jsx(fe,{label:C("project.agent_detail.model_label"),hint:C("project.agent_detail.model_hint"),children:o.jsx(Ce,{value:y,onChange:Y=>S(Y.target.value),placeholder:C("project.agent_detail.model_ph")})}),o.jsx(fe,{label:C("project.agent_detail.skills_label"),children:o.jsx(Ce,{value:k,onChange:Y=>R(Y.target.value),placeholder:"skill-a, skill-b"})}),o.jsx(r6,{value:N,onChange:O}),o.jsx(fe,{label:C("project.agent_detail.bio_label"),children:o.jsx(Qt,{rows:2,value:A,onChange:Y=>M(Y.target.value)})}),o.jsx(fe,{label:C("project.agent_detail.system_label"),hint:C("project.agent_detail.system_hint"),children:o.jsx(Qt,{rows:10,className:"font-mono text-xs",value:B,onChange:Y=>U(Y.target.value),placeholder:"You are…"})}),o.jsx(sn,{checked:j,onChange:E,label:C("project.agent_detail.master_label")}),o.jsxs("div",{className:"flex items-center justify-between border-t border-border pt-3",children:[o.jsxs(he,{variant:"destructive",onClick:H,children:[o.jsx(Ja,{size:13})," ",C("project.agent_detail.delete_btn")]}),o.jsxs(he,{variant:"primary",loading:I,onClick:P,children:[o.jsx(vh,{size:13})," ",C("project.agent_detail.save_btn")]})]})]})})}function Iu({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 n6({pid:e,slug:n,initial:s,onSaved:r}){const i=nt(),[c,d]=v.useState(s),[f,p]=v.useState(!1);v.useEffect(()=>{d(s)},[s]);const m=c!==s,h=async()=>{p(!0);try{await Jt.memory.put(e,n,c),i.success(C("project.agent_detail.memory_saved")),r()}catch(x){i.error(x.message)}finally{p(!1)}};return o.jsxs(He,{title:C("project.agent_detail.memory_title"),description:`~/.apx/projects/<id>/agents/${n}/memory.md — hechos durables que el agente recuerda.`,children:[o.jsx(Qt,{rows:16,className:"font-mono text-xs",value:c,onChange:x=>d(x.target.value),placeholder:C("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," ",C("project.memories.chars")]}),o.jsxs(he,{size:"sm",variant:"primary",loading:f,disabled:!m,onClick:h,children:[o.jsx(vh,{size:12})," ",C("project.memories.save_btn")]})]})]})}function a6({records:e,loading:n}){const s=v.useMemo(()=>[...e].sort((r,i)=>(i.ts||"").localeCompare(r.ts||"")),[e]);return o.jsxs(He,{title:C("project.agent_detail.records_title"),description:C("project.agent_detail.records_desc"),children:[n&&o.jsx(Je,{}),!n&&s.length===0&&o.jsx("p",{className:"text-xs text-muted-fg",children:C("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(dj,{size:13,className:"text-blue-400"}):o.jsx(mj,{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(Ue,{tone:"info",children:r.channel}),r.type&&o.jsx(Ue,{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 s6({routines:e}){return e.length===0?o.jsx(He,{title:C("project.agent_detail.sleep_title"),description:C("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:C("project.agent_detail.sleep_deep")}),o.jsx("p",{className:"mt-1 text-xs text-muted-fg",children:C("project.agent_detail.sleep_deep_desc")})]})}):o.jsx(He,{title:C("project.agent_detail.sleep_title"),description:C("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:Ae("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(Ue,{tone:s?"success":"muted",children:s?"running":"paused"}),r&&o.jsx(Ue,{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(Uu,{label:"Tick",value:n.schedule}),o.jsx(Uu,{label:"Next tick",value:n.next_run_at?new Date(n.next_run_at).toLocaleString():"—"}),o.jsx(Uu,{label:"Last tick",value:n.last_run_at?new Date(n.last_run_at).toLocaleString():"—"}),o.jsx(Uu,{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 Uu({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 r6({value:e,onChange:n}){const s=Qe("/tools",()=>c5.list()),r=sh(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:C("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:Ae("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(Ce,{className:"mt-2",value:e,onChange:f=>n(f.target.value),placeholder:C("project.agent_detail.tools_custom_ph")})]})}function o6({slug:e,memory:n,threads:s,tasks:r,routines:i,parent:c,children:d}){const f=v.useMemo(()=>{const p=[];return WD(n).forEach((m,h)=>p.push({id:`m${h}`,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(He,{title:C("project.agent_detail.brain_title"),description:C("project.agent_detail.brain_desc"),children:f.length===0?o.jsx("p",{className:"text-xs text-muted-fg",children:C("project.agent_detail.brain_empty")}):o.jsx(KD,{center:e,nodes:f})})}function l6(){const e=Ua(),n=ea(),s=nt(),{pid:r=""}=W_(),{project:i,mutate:c}=dS(r),{collapsed:d,toggle:f}=BS(Cn.sidebarCollapsed+".project"),p=String(r)==="0",m=v.useMemo(()=>p?[{title:C("base.nav_general"),items:[{key:"",label:"Dashboard",icon:JN},{key:"workspaces",label:C("base.workspaces_title"),icon:NN},{key:"models",label:C("settings.tabs.engines"),icon:gh},{key:"agent-defaults",label:C("base.defaults_title"),icon:vn}]},{title:C("base.nav_activity"),items:[{key:"chat",label:C("project.nav.chat"),icon:Ri},{key:"sessions",label:C("base.sessions_title"),icon:XN},{key:"tasks",label:C("project.nav.tasks"),icon:Ui},{key:"logs",label:C("project.nav.logs"),icon:Tg}]},{title:C("base.nav_system"),items:[{key:"agents",label:C("project.nav.agents"),icon:vn},{key:"memories",label:C("project.nav.memories"),icon:td},{key:"routines",label:C("project.nav.routines"),icon:Xo},{key:"mcps",label:C("project.nav.mcps"),icon:Rg},{key:"config",label:C("project.nav.config"),icon:sd}]}]:[{title:C("project.sections.workspace"),items:[{key:"",label:C("project.nav.overview"),icon:bj},{key:"telegram",label:C("project.nav.telegram"),icon:Za},{key:"chat",label:C("project.nav.chat"),icon:Ri},{key:"threads",label:C("project.nav.threads"),icon:Ri},{key:"agents",label:C("project.nav.agents"),icon:vn},{key:"memories",label:C("project.nav.memories"),icon:td}]},{title:C("project.sections.automation"),items:[{key:"routines",label:C("project.nav.routines"),icon:Xo},{key:"tasks",label:C("project.nav.tasks"),icon:Ui},{key:"mcps",label:C("project.nav.mcps"),icon:Rg},{key:"logs",label:C("project.nav.logs"),icon:Tg}]},{title:C("project.sections.config"),items:[{key:"config",label:C("project.nav.config"),icon:sd}]}],[p]),h=n.pathname.replace(`/p/${r}`,"").replace(/^\//,"").split("/")[0];if(!i)return o.jsx("div",{className:"p-8 text-muted-fg",children:C("project.not_found",{pid:r})});const x=async()=>{try{await Qn.rebuild(r),s.success(C("project.rebuild_done"))}catch(_){s.error(_.message)}},y=async()=>{const _=i.name||i.path;if(confirm(C("project.unregister_confirm",{label:_})))try{await Qn.remove(r),s.success(C("project.unregistered")),c(),e("/")}catch(j){s.error(j.message)}},S=_=>{const j=_?`/p/${r}/${_}`:`/p/${r}`;e(j)},w=Number(r)!==0?o.jsxs(o.Fragment,{children:[o.jsxs(he,{size:"sm",variant:"secondary",onClick:x,children:[o.jsx(Wr,{size:13})," ",C("project.rebuild")]}),o.jsx(he,{size:"sm",variant:"destructive",onClick:y,children:C("admin.unregister")})]}):void 0;return o.jsx(IS,{sections:m,active:h,onChange:S,collapsed:d,onToggleCollapse:f,actions:w,contentClassName:"w-full space-y-6 p-6 pt-3",testId:`project-tab-${h||"overview"}`,children:o.jsxs(aj,{children:[o.jsx(qt,{index:!0,element:o.jsx(q1,{pid:r})}),o.jsx(qt,{path:"workspaces",element:o.jsx($4,{})}),o.jsx(qt,{path:"models",element:o.jsx(t2,{})}),o.jsx(qt,{path:"agent-defaults",element:o.jsx(WO,{})}),o.jsx(qt,{path:"sessions",element:o.jsx(az,{})}),o.jsx(qt,{path:"logs",element:o.jsx(qO,{pid:r})}),o.jsx(qt,{path:"config",element:o.jsx(Sz,{pid:r})}),o.jsx(qt,{path:"telegram",element:o.jsx(iD,{pid:r})}),o.jsx(qt,{path:"agents",element:o.jsx(Nz,{pid:r})}),o.jsx(qt,{path:"agents/:slug",element:o.jsx(e6,{pid:r})}),o.jsx(qt,{path:"memories",element:o.jsx(uD,{pid:r})}),o.jsx(qt,{path:"routines",element:o.jsx(Pz,{pid:r})}),o.jsx(qt,{path:"tasks",element:p?o.jsx(sz,{}):o.jsx(Iz,{pid:r})}),o.jsx(qt,{path:"mcps",element:o.jsx(Uz,{pid:r})}),o.jsx(qt,{path:"threads",element:o.jsx(qz,{pid:r})}),o.jsx(qt,{path:"chat",element:o.jsx(oD,{pid:r})}),o.jsx(qt,{path:"*",element:o.jsx(q1,{pid:r})})]})})}function b2(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/identity",()=>R1.get());return{identity:e||{},error:n,isLoading:s,mutate:r,save:async c=>{const d=await R1.patch(c);return await r(d,{revalidate:!1}),d}}}const i6=["es","en","pt","fr","it","de"];function c6(){const e=nt(),{identity:n,isLoading:s,save:r}=b2(),[i,c]=v.useState({}),[d,f]=v.useState(!1);if(v.useEffect(()=>{c(n)},[n]),s)return o.jsx(Je,{});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(C("settings.identity.saved"))}catch(m){e.error(m.message)}finally{f(!1)}};return o.jsxs(He,{title:C("settings.identity.title"),description:C("settings.identity.subtitle"),children:[n?null:o.jsx(ot,{children:C("common.none_yet")}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("settings.identity.owner_name"),children:o.jsx(Ce,{value:i.owner_name||"",onChange:m=>c({...i,owner_name:m.target.value})})}),o.jsx(fe,{label:C("settings.identity.language"),children:o.jsx(Ct,{value:i.language||"es",onChange:m=>c({...i,language:m}),options:i6.map(m=>({value:m,label:m}))})}),o.jsx(fe,{label:C("settings.identity.timezone"),hint:"ej. America/Argentina/Buenos_Aires",children:o.jsx(Ce,{value:i.timezone||"",onChange:m=>c({...i,timezone:m.target.value})})})]}),o.jsx("div",{className:"mt-3",children:o.jsx(fe,{label:C("settings.identity.owner_context"),hint:"Quién sos, en qué trabajás, qué le interesa al agente saber de vos.",children:o.jsx(Qt,{rows:3,value:i.owner_context||"",onChange:m=>c({...i,owner_context:m.target.value})})})}),o.jsx("div",{className:"mt-4",children:o.jsx(he,{variant:"primary",loading:d,onClick:p,children:C("common.save")})})]})}function u6(){const e=nt(),n=Ua(),{superAgent:s,isLoading:r,mutate:i}=WS(),{patch:c}=yr(),{identity:d,save:f}=b2(),[p,m]=v.useState(!0),[h,x]=v.useState(""),[y,S]=v.useState(""),[w,_]=v.useState("permiso"),[j,E]=v.useState(!1);if(v.useEffect(()=>{s&&(m(!!s.enabled),x(s.system||""),_(s.permission_mode||"permiso"))},[s]),v.useEffect(()=>{S(d.personality||"")},[d.personality]),r||!s)return o.jsx(Je,{});const k=async()=>{E(!0);try{await c({"super_agent.enabled":p,"super_agent.system":h,"super_agent.permission_mode":w},["super_agent.name"]),await f({personality:y}),e.success(C("settings.super_agent.saved")),i()}catch(R){e.error(R.message)}finally{E(!1)}};return o.jsx(He,{title:C("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(sn,{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(he,{size:"sm",variant:"secondary",onClick:()=>n("/p/0/models"),children:[o.jsx(gh,{size:13})," Configurar en Modelos"]})]}),o.jsx(fe,{label:C("settings.super_agent.permission_mode"),children:o.jsx(Ct,{value:w,onChange:_,options:yh.map(R=>({value:R,label:R}))})}),o.jsx(fe,{label:C("settings.super_agent.personality"),children:o.jsx(Qt,{rows:2,value:y,onChange:R=>S(R.target.value)})}),o.jsx(fe,{label:C("settings.super_agent.system"),hint:C("settings.super_agent.system_hint"),children:o.jsx(Qt,{rows:6,className:"font-mono text-xs",value:h,onChange:R=>x(R.target.value),placeholder:"(Vacío = se usa el prompt base de core/agent/prompts/super-agent-base.md)"})}),o.jsx(he,{variant:"primary",loading:j,onClick:k,children:C("common.save")})]})})}const Wp={providers:()=>ge.get("/embeddings/providers"),test:(e={})=>ge.post("/embeddings/test",e),reindex:()=>ge.post("/embeddings/reindex",{})},d6=[{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)"}],f6=[{value:"chain",label:"Cadena (fallback automático)"},{value:"single",label:"Único (usa solo el elegido)"}],o_=e=>e.startsWith("***");function m6(){const e=nt(),{config:n,isLoading:s,patch:r}=yr(),{data:i,mutate:c}=Qe("/embeddings/providers",()=>Wp.providers()),[d,f]=v.useState(!1),[p,m]=v.useState(null);if(s)return o.jsx(Je,{});const x=(n.memory||{}).embeddings||{},y=i?.configured_provider||x.provider||"auto",S=i?.mode||x.mode||"chain",w=i?.engines||[],_=async k=>{f(!0);try{await r(k),await c()}catch(R){e.error(`No se pudo guardar: ${R.message}`)}finally{f(!1)}},j=async()=>{f(!0),m(null);try{const k=await Wp.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)}},E=async()=>{f(!0);try{const k=await Wp.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(He,{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(Ct,{value:y,onChange:k=>_({"memory.embeddings.provider":k}),options:d6,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(Ct,{value:S,onChange:k=>_({"memory.embeddings.mode":k}),options:f6,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(Ue,{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(he,{variant:"secondary",onClick:j,loading:d,children:[o.jsx(il,{size:14})," Probar embedding"]}),o.jsxs(he,{variant:"secondary",onClick:E,loading:d,children:[o.jsx(hj,{size:14})," Reindexar memoria"]}),p&&o.jsx("span",{className:"text-sm text-muted-foreground",children:p})]})]})}),o.jsxs(He,{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(Ce,{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&&_({"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(Ce,{defaultValue:x.ollama?.base_url||"",placeholder:"http://localhost:11434",disabled:d,onBlur:k=>_({"memory.embeddings.ollama.base_url":k.target.value.trim()}),className:"max-w-md"})})]}),o.jsxs(He,{title:"OpenAI",description:"text-embedding-3-small (1536 dims) u otro modelo compatible.",children:[o.jsx(fe,{label:"Modelo",children:o.jsx(Ce,{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&&_({"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(Ce,{type:"password",defaultValue:x.openai?.api_key||"",placeholder:"sk-…",disabled:d,onBlur:k=>{const R=k.target.value;R&&!o_(R)&&_({"memory.embeddings.openai.api_key":R})},className:"max-w-md"})})]}),o.jsxs(He,{title:"Gemini",description:"text-embedding-004 (768 dims). Free tier con API key de Google.",children:[o.jsx(fe,{label:"Modelo",children:o.jsx(Ce,{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&&_({"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(Ce,{type:"password",defaultValue:x.gemini?.api_key||"",placeholder:"AIza…",disabled:d,onBlur:k=>{const R=k.target.value;R&&!o_(R)&&_({"memory.embeddings.gemini.api_key":R})},className:"max-w-md"})})]})]})}function p6(){const e=nt(),{config:n,isLoading:s,patch:r,mutate:i}=yr(),c=n.telegram?.channels||[],d=Math.max(0,c.findIndex(O=>O.name==="default")),f=c[d],[p,m]=v.useState(!0),[h,x]=v.useState(1500),[y,S]=v.useState(!0),[w,_]=v.useState(""),[j,E]=v.useState(""),[k,R]=v.useState(!1);if(v.useEffect(()=>{m(!!n.telegram?.enabled),x(Number(n.telegram?.poll_interval_ms||1500)),S(!!n.telegram?.respond_with_engine),_(""),E(f?.chat_id||"")},[n,f?.chat_id]),s)return o.jsx(Je,{});const N=async()=>{R(!0);try{const O=c.slice(),A={name:"default",chat_id:j,respond_with_engine:y,...w?{bot_token:w}:{}};c.length===0?O.push(A):O[d]={...f,...A},await r({"telegram.enabled":p,"telegram.poll_interval_ms":h,"telegram.respond_with_engine":y,"telegram.channels":O}),e.success(C("settings.telegram_global.saved")),i(),_("")}catch(O){e.error(O.message)}finally{R(!1)}};return o.jsx(He,{title:C("settings.telegram_global.title"),description:C("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(sn,{checked:p,onChange:m,label:C("settings.telegram_global.enabled")}),o.jsx(sn,{checked:y,onChange:S,label:C("settings.telegram_global.respond_with_engine")})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("settings.telegram_global.bot_token"),hint:f?.bot_token?`…${al(f.bot_token)??""} (seteado — escribí para reemplazar)`:"Token del BotFather.",children:o.jsx(Ce,{type:"password",value:w,onChange:O=>_(O.target.value),placeholder:f?.bot_token?`…${al(f.bot_token)??""} (ya seteado)`:""})}),o.jsx(fe,{label:C("settings.telegram_global.chat_id"),children:o.jsx(Ce,{value:j,onChange:O=>E(O.target.value),placeholder:"889721252"})}),o.jsx(fe,{label:C("settings.telegram_global.poll_interval"),children:o.jsx(Ce,{type:"number",value:String(h),onChange:O=>x(Number(O.target.value)||1500)})})]}),o.jsx(he,{variant:"primary",loading:k,onClick:N,children:C("common.save")})]})})}function g6(){const e=nt(),{channels:n,isLoading:s,mutate:r}=mx(),{contacts:i}=px(),[c,d]=v.useState(null),[f,p]=v.useState(null),m=new Map;for(const x of i)m.set(String(x.user_id),x.name||`@${x.username||x.user_id}`);const h=async x=>{if(confirm(C("telegram_channels.delete_confirm",{name:x})))try{await kn.channels.remove(x),e.success(C("telegram_channels.removed")),r()}catch(y){e.error(y.message)}};return o.jsxs(He,{title:C("telegram_channels.title"),description:C("telegram_channels.desc"),action:o.jsxs(he,{size:"sm",onClick:()=>d({name:""}),children:[o.jsx(Nn,{size:14})," ",C("telegram_channels.new_btn")]}),children:[s&&o.jsx(Je,{}),!s&&n.length===0&&o.jsx(ot,{children:C("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}`:C("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(Ue,{tone:"success",children:["project = ",x.project]}),o.jsxs(he,{size:"sm",variant:"ghost",onClick:()=>p(x),children:[o.jsx(Za,{size:13})," ",C("admin.telegram_send_test")]}),o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>d(x),children:C("common.edit")}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>h(x.name),children:C("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?`…${al(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:[C("telegram_channels.owner_label")," ",y]})]})]},x.name)})}),o.jsx(DS,{channel:c,onClose:()=>d(null),onSaved:()=>{d(null),r()}}),o.jsx(LS,{channel:f,onClose:()=>p(null)})]})}const l_=new Set(["owner","guest"]);function h6(){const e=nt(),{roles:n,mutate:s,isLoading:r}=px(),[i,c]=v.useState(""),[d,f]=v.useState(""),[p,m]=v.useState(!1),[h,x]=v.useState(!1),y=async()=>{const _=i.trim();if(!_){e.error(C("telegram_roles.name_required"));return}if(l_.has(_)){e.error(C("telegram_roles.builtin_error",{name:_}));return}x(!0);try{const j=p?"*":d.split(",").map(E=>E.trim()).filter(Boolean);await kn.roles.set(_,j),e.success(C("telegram_roles.saved",{name:_})),c(""),f(""),m(!1),s()}catch(j){e.error(j.message)}finally{x(!1)}},S=async _=>{if(confirm(C("telegram_roles.delete_confirm",{name:_})))try{await kn.roles.remove(_),e.success(C("telegram_roles.removed")),s()}catch(j){e.error(j.message)}},w=Object.entries(n);return o.jsxs(He,{title:C("telegram_roles.title"),description:C("telegram_roles.desc"),children:[r&&o.jsx(Je,{}),w.length===0&&!r&&o.jsx(ot,{children:C("telegram_roles.empty")}),w.length>0&&o.jsx("ul",{className:"space-y-2 text-sm",children:w.map(([_,j])=>{const E=l_.has(_),k=j?.tools==="*"?C("telegram_roles.tools_all"):Array.isArray(j?.tools)&&j.tools.length>0?j.tools.join(", "):C("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:_}),E&&o.jsx(Ue,{tone:"info",children:C("telegram_roles.builtin")})]}),!E&&o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>S(_),children:C("telegram_roles.delete_btn")})]}),o.jsxs("div",{className:"mt-1 text-xs text-muted-fg",children:["tools: ",k]})]},_)})}),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(Nn,{size:14})," ",C("telegram_roles.new_title")]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(fe,{label:C("telegram_roles.name_label"),children:o.jsx(Ce,{value:i,onChange:_=>c(_.target.value),placeholder:C("telegram_roles.name_ph")})}),o.jsx(fe,{label:C("telegram_roles.tools_label"),hint:C("telegram_roles.tools_hint"),children:o.jsx(Ce,{value:d,onChange:_=>f(_.target.value),disabled:p,placeholder:C("telegram_roles.tools_ph")})})]}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(sn,{checked:p,onChange:m,label:C("telegram_roles.full_access")}),o.jsx(he,{variant:"primary",loading:h,onClick:y,children:C("telegram_roles.save_btn")})]})]})]})}const v2="apx.settings.telegramTab";function x6(){if(typeof window>"u")return"default";const e=window.localStorage.getItem(v2);return e==="channels"||e==="contacts"||e==="roles"||e==="default"?e:"default"}function b6(){const[e,n]=v.useState("default");v.useEffect(()=>{n(x6())},[]);const s=r=>{const i=r==="channels"||r==="contacts"||r==="roles"||r==="default"?r:"default";n(i);try{window.localStorage.setItem(v2,i)}catch{}};return o.jsxs(Wd,{value:e,onValueChange:s,className:"w-full",children:[o.jsxs(ef,{children:[o.jsx(ka,{value:"default",children:C("settings.telegram_global.title")}),o.jsx(ka,{value:"channels",children:C("telegram_channels.title")}),o.jsx(ka,{value:"contacts",children:C("telegram_contacts.title")}),o.jsx(ka,{value:"roles",children:C("telegram_roles.title")})]}),o.jsx(Na,{value:"default",className:"mt-4",children:o.jsx(p6,{})}),o.jsx(Na,{value:"channels",className:"mt-4",children:o.jsx(g6,{})}),o.jsx(Na,{value:"contacts",className:"mt-4",children:o.jsx(PS,{})}),o.jsx(Na,{value:"roles",className:"mt-4",children:o.jsx(h6,{})})]})}function v6(){const{data:e,error:n,isLoading:s,mutate:r}=Qe("/pair/list",()=>tl.list(),{refreshInterval:Ad.pairList});return{clients:e?.clients||[],error:n,isLoading:s,mutate:r}}var Ho={},eg,i_;function y6(){return i_||(i_=1,eg=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),eg}var tg={},rr={},c_;function to(){if(c_)return rr;c_=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 rr.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},rr.getSymbolTotalCodewords=function(r){return n[r]},rr.getBCHDigit=function(s){let r=0;for(;s!==0;)r++,s>>>=1;return r},rr.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},rr.isKanjiModeEnabled=function(){return typeof e<"u"},rr.toSJIS=function(r){return e(r)},rr}var ng={},u_;function Tx(){return u_||(u_=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}}})(ng)),ng}var ag,d_;function _6(){if(d_)return ag;d_=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++}},ag=e,ag}var sg,f_;function j6(){if(f_)return sg;f_=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]},sg=e,sg}var rg={},m_;function w6(){return m_||(m_=1,(function(e){const n=to().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}})(rg)),rg}var og={},p_;function S6(){if(p_)return og;p_=1;const e=to().getSymbolSize,n=7;return og.getPositions=function(r){const i=e(r);return[[0,0],[i-n,0],[0,i-n]]},og}var lg={},g_;function C6(){return g_||(g_=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,h=null;for(let x=0;x<c;x++){f=p=0,m=h=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===h?p++:(p>=5&&(d+=n.N1+(p-5)),h=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 h=0;h<c;h++)f=f<<1&2047|i.get(m,h),h>=10&&(f===1488||f===93)&&d++,p=p<<1&2047|i.get(h,m),h>=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 h=e.getPenaltyN1(i)+e.getPenaltyN2(i)+e.getPenaltyN3(i)+e.getPenaltyN4(i);e.applyMask(m,i),h<p&&(p=h,f=m)}return f}})(lg)),lg}var Hu={},h_;function y2(){if(h_)return Hu;h_=1;const e=Tx(),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 Hu.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}},Hu.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}},Hu}var ig={},ji={},x_;function E6(){if(x_)return ji;x_=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]})(),ji.log=function(r){if(r<1)throw new Error("log("+r+")");return n[r]},ji.exp=function(r){return e[r]},ji.mul=function(r,i){return r===0||i===0?0:e[n[r]+n[i]]},ji}var b_;function k6(){return b_||(b_=1,(function(e){const n=E6();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}})(ig)),ig}var cg,v_;function N6(){if(v_)return cg;v_=1;const e=k6();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},cg=n,cg}var ug={},dg={},fg={},y_;function _2(){return y_||(y_=1,fg.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}),fg}var Ga={},__;function j2(){if(__)return Ga;__=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
|
|
557
|
-
]))+`;Ga.KANJI=new RegExp(s,"g"),Ga.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ga.BYTE=new RegExp(r,"g"),Ga.NUMERIC=new RegExp(e,"g"),Ga.ALPHANUMERIC=new RegExp(n,"g");const i=new RegExp("^"+s+"$"),c=new RegExp("^"+e+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ga.testKanji=function(p){return i.test(p)},Ga.testNumeric=function(p){return c.test(p)},Ga.testAlphanumeric=function(p){return d.test(p)},Ga}var j_;function no(){return j_||(j_=1,(function(e){const n=_2(),s=j2();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}}})(dg)),dg}var w_;function R6(){return w_||(w_=1,(function(e){const n=to(),s=y2(),r=Tx(),i=no(),c=_2(),d=7973,f=n.getBCHDigit(d);function p(y,S,w){for(let _=1;_<=40;_++)if(S<=e.getCapacity(_,w,y))return _}function m(y,S){return i.getCharCountIndicator(y,S)+4}function h(y,S){let w=0;return y.forEach(function(_){const j=m(_.mode,S);w+=j+_.getBitsLength()}),w}function x(y,S){for(let w=1;w<=40;w++)if(h(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,_){if(!c.isValid(S))throw new Error("Invalid QR Code version");typeof _>"u"&&(_=i.BYTE);const j=n.getSymbolTotalCodewords(S),E=s.getTotalCodewordsCount(S,w),k=(j-E)*8;if(_===i.MIXED)return k;const R=k-m(_,S);switch(_){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 _;const j=r.from(w,r.M);if(Array.isArray(S)){if(S.length>1)return x(S,j);if(S.length===0)return 1;_=S[0]}else _=S;return p(_.mode,_.getLength(),j)},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}})(ug)),ug}var mg={},S_;function T6(){if(S_)return mg;S_=1;const e=to(),n=1335,s=21522,r=e.getBCHDigit(n);return mg.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},mg}var pg={},gg,C_;function A6(){if(C_)return gg;C_=1;const e=no();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))},gg=n,gg}var hg,E_;function M6(){if(E_)return hg;E_=1;const e=no(),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)},hg=s,hg}var xg,k_;function O6(){if(k_)return xg;k_=1;const e=no();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)},xg=n,xg}var bg,N_;function z6(){if(N_)return bg;N_=1;const e=no(),n=to();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]+`
|
|
558
|
-
Make sure your charset is UTF-8`);c=(c>>>8&255)*192+(c&255),r.put(c,13)}},bg=s,bg}var vg={exports:{}},R_;function D6(){return R_||(R_=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,h,x,y,S,w,_,j;!f.empty();){p=f.pop(),m=p.value,x=p.cost,y=s[m]||{};for(h in y)y.hasOwnProperty(h)&&(S=y[h],w=x+S,_=d[h],j=typeof d[h]>"u",(j||_>w)&&(d[h]=w,f.push(h,w),c[h]=m))}if(typeof i<"u"&&typeof d[i]>"u"){var E=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(E)}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})(vg)),vg.exports}var T_;function L6(){return T_||(T_=1,(function(e){const n=no(),s=A6(),r=M6(),i=O6(),c=z6(),d=j2(),f=to(),p=D6();function m(E){return unescape(encodeURIComponent(E)).length}function h(E,k,R){const N=[];let O;for(;(O=E.exec(R))!==null;)N.push({data:O[0],index:O.index,mode:k,length:O[0].length});return N}function x(E){const k=h(d.NUMERIC,n.NUMERIC,E),R=h(d.ALPHANUMERIC,n.ALPHANUMERIC,E);let N,O;return f.isKanjiModeEnabled()?(N=h(d.BYTE,n.BYTE,E),O=h(d.KANJI,n.KANJI,E)):(N=h(d.BYTE_KANJI,n.BYTE,E),O=[]),k.concat(R,N,O).sort(function(M,B){return M.index-B.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function y(E,k){switch(k){case n.NUMERIC:return s.getBitsLength(E);case n.ALPHANUMERIC:return r.getBitsLength(E);case n.KANJI:return c.getBitsLength(E);case n.BYTE:return i.getBitsLength(E)}}function S(E){return E.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(E){const k=[];for(let R=0;R<E.length;R++){const N=E[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 _(E,k){const R={},N={start:{}};let O=["start"];for(let A=0;A<E.length;A++){const M=E[A],B=[];for(let U=0;U<M.length;U++){const I=M[U],L=""+A+U;B.push(L),R[L]={node:I,lastCount:0},N[L]={};for(let P=0;P<O.length;P++){const H=O[P];R[H]&&R[H].node.mode===I.mode?(N[H][L]=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][L]=y(I.length,I.mode)+4+n.getCharCountIndicator(I.mode,k))}}O=B}for(let A=0;A<O.length;A++)N[O[A]].end=0;return{map:N,table:R}}function j(E,k){let R;const N=n.getBestModeForData(E);if(R=n.from(k,N),R!==n.BYTE&&R.bit<N.bit)throw new Error('"'+E+'" cannot be encoded with mode '+n.toString(R)+`.
|
|
559
|
-
Suggested mode is: `+n.toString(N));switch(R===n.KANJI&&!f.isKanjiModeEnabled()&&(R=n.BYTE),R){case n.NUMERIC:return new s(E);case n.ALPHANUMERIC:return new r(E);case n.KANJI:return new c(E);case n.BYTE:return new i(E)}}e.fromArray=function(k){return k.reduce(function(R,N){return typeof N=="string"?R.push(j(N,null)):N.data&&R.push(j(N.data,N.mode)),R},[])},e.fromString=function(k,R){const N=x(k,f.isKanjiModeEnabled()),O=w(N),A=_(O,R),M=p.find_path(A.map,"start","end"),B=[];for(let U=1;U<M.length-1;U++)B.push(A.table[M[U]].node);return e.fromArray(S(B))},e.rawSplit=function(k){return e.fromArray(x(k,f.isKanjiModeEnabled()))}})(pg)),pg}var A_;function P6(){if(A_)return tg;A_=1;const e=to(),n=Tx(),s=_6(),r=j6(),i=w6(),c=S6(),d=C6(),f=y2(),p=N6(),m=R6(),h=T6(),x=no(),y=L6();function S(A,M){const B=A.size,U=c.getPositions(M);for(let I=0;I<U.length;I++){const L=U[I][0],P=U[I][1];for(let H=-1;H<=7;H++)if(!(L+H<=-1||B<=L+H))for(let Y=-1;Y<=7;Y++)P+Y<=-1||B<=P+Y||(H>=0&&H<=6&&(Y===0||Y===6)||Y>=0&&Y<=6&&(H===0||H===6)||H>=2&&H<=4&&Y>=2&&Y<=4?A.set(L+H,P+Y,!0,!0):A.set(L+H,P+Y,!1,!0))}}function w(A){const M=A.size;for(let B=8;B<M-8;B++){const U=B%2===0;A.set(B,6,U,!0),A.set(6,B,U,!0)}}function _(A,M){const B=i.getPositions(M);for(let U=0;U<B.length;U++){const I=B[U][0],L=B[U][1];for(let P=-2;P<=2;P++)for(let H=-2;H<=2;H++)P===-2||P===2||H===-2||H===2||P===0&&H===0?A.set(I+P,L+H,!0,!0):A.set(I+P,L+H,!1,!0)}}function j(A,M){const B=A.size,U=m.getEncodedBits(M);let I,L,P;for(let H=0;H<18;H++)I=Math.floor(H/3),L=H%3+B-8-3,P=(U>>H&1)===1,A.set(I,L,P,!0),A.set(L,I,P,!0)}function E(A,M,B){const U=A.size,I=h.getEncodedBits(M,B);let L,P;for(L=0;L<15;L++)P=(I>>L&1)===1,L<6?A.set(L,8,P,!0):L<8?A.set(L+1,8,P,!0):A.set(U-15+L,8,P,!0),L<8?A.set(8,U-L-1,P,!0):L<9?A.set(8,15-L-1+1,P,!0):A.set(8,15-L-1,P,!0);A.set(U-8,8,1,!0)}function k(A,M){const B=A.size;let U=-1,I=B-1,L=7,P=0;for(let H=B-1;H>0;H-=2)for(H===6&&H--;;){for(let Y=0;Y<2;Y++)if(!A.isReserved(I,H-Y)){let Q=!1;P<M.length&&(Q=(M[P]>>>L&1)===1),A.set(I,H-Y,Q),L--,L===-1&&(P++,L=7)}if(I+=U,I<0||B<=I){I-=U,U=-U;break}}}function R(A,M,B){const U=new s;B.forEach(function(Y){U.put(Y.mode.bit,4),U.put(Y.getLength(),x.getCharCountIndicator(Y.mode,A)),Y.write(U)});const I=e.getSymbolTotalCodewords(A),L=f.getTotalCodewordsCount(A,M),P=(I-L)*8;for(U.getLengthInBits()+4<=P&&U.put(0,4);U.getLengthInBits()%8!==0;)U.putBit(0);const H=(P-U.getLengthInBits())/8;for(let Y=0;Y<H;Y++)U.put(Y%2?17:236,8);return N(U,A,M)}function N(A,M,B){const U=e.getSymbolTotalCodewords(M),I=f.getTotalCodewordsCount(M,B),L=U-I,P=f.getBlocksCount(M,B),H=U%P,Y=P-H,Q=Math.floor(U/P),q=Math.floor(L/P),X=q+1,Z=Q-q,$=new p(Z);let K=0;const D=new Array(P),G=new Array(P);let V=0;const W=new Uint8Array(A.buffer);for(let ee=0;ee<P;ee++){const Re=ee<Y?q:X;D[ee]=W.slice(K,K+Re),G[ee]=$.encode(D[ee]),K+=Re,V=Math.max(V,Re)}const ce=new Uint8Array(U);let oe=0,se,ue;for(se=0;se<V;se++)for(ue=0;ue<P;ue++)se<D[ue].length&&(ce[oe++]=D[ue][se]);for(se=0;se<Z;se++)for(ue=0;ue<P;ue++)ce[oe++]=G[ue][se];return ce}function O(A,M,B,U){let I;if(Array.isArray(A))I=y.fromArray(A);else if(typeof A=="string"){let Q=M;if(!Q){const q=y.rawSplit(A);Q=m.getBestVersionForData(q,B)}I=y.fromString(A,Q||40)}else throw new Error("Invalid data");const L=m.getBestVersionForData(I,B);if(!L)throw new Error("The amount of data is too big to be stored in a QR Code");if(!M)M=L;else if(M<L)throw new Error(`
|
|
560
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
561
|
-
Minimum version required to store current data is: `+L+`.
|
|
562
|
-
`);const P=R(M,B,I),H=e.getSymbolSize(M),Y=new r(H);return S(Y,M),w(Y),_(Y,M),E(Y,B,0),M>=7&&j(Y,M),k(Y,P),isNaN(U)&&(U=d.getBestMask(Y,E.bind(null,Y,B))),d.applyMask(U,Y),E(Y,B,U),{modules:Y,version:M,errorCorrectionLevel:B,maskPattern:U,segments:I}}return tg.create=function(M,B){if(typeof M>"u"||M==="")throw new Error("No input text");let U=n.M,I,L;return typeof B<"u"&&(U=n.from(B.errorCorrectionLevel,n.M),I=m.from(B.version),L=d.from(B.maskPattern),B.toSJISFunc&&e.setToSJISFunction(B.toSJISFunc)),O(M,I,U,L)},tg}var yg={},_g={},M_;function w2(){return M_||(M_=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),h=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,_=c.color.light;if(y>=h&&S>=h&&y<m-h&&S<m-h){const j=Math.floor((y-h)/p),E=Math.floor((S-h)/p);_=x[f[j*d+E]?1:0]}r[w++]=_.r,r[w++]=_.g,r[w++]=_.b,r[w]=_.a}}})(_g)),_g}var O_;function B6(){return O_||(O_=1,(function(e){const n=w2();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 h=n.getImageWidth(c.modules.size,p),x=m.getContext("2d"),y=x.createImageData(h,h);return n.qrToImageData(y.data,c,p),s(x,m,h),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),h=p.type||"image/png",x=p.rendererOpts||{};return m.toDataURL(h,x.quality)}})(yg)),yg}var jg={},z_;function I6(){if(z_)return jg;z_=1;const e=w2();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,h=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]?(h++,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",h),h=0)):p++}return f}return jg.render=function(c,d,f){const p=e.getOptions(d),m=c.modules.size,h=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(h,m,p.margin)+'"/>',w='viewBox="0 0 '+x+" "+x+'"',j='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+w+' shape-rendering="crispEdges">'+y+S+`</svg>
|
|
563
|
-
`;return typeof f=="function"&&f(null,j),j},jg}var D_;function U6(){if(D_)return Ho;D_=1;const e=y6(),n=P6(),s=B6(),r=I6();function i(c,d,f,p,m){const h=[].slice.call(arguments,1),x=h.length,y=typeof h[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 _=n.create(f,p);S(c(_,d,p))}catch(_){w(_)}})}try{const S=n.create(f,p);m(null,c(S,d,p))}catch(S){m(S)}}return Ho.create=n.create,Ho.toCanvas=i.bind(null,s.render),Ho.toDataURL=i.bind(null,s.renderToDataURL),Ho.toString=i.bind(null,function(c,d,f){return r.render(c,f)}),Ho}var H6=U6();const q6=rh(H6);function V6({value:e,size:n=200}){const[s,r]=v.useState(null);return v.useEffect(()=>{let i=!0;return q6.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 $6(e){return e.find(n=>!n.includes("127.0.0.1")&&!n.includes("localhost"))||e[0]||window.location.origin}function G6({open:e,onClose:n,onPaired:s}){const r=nt(),[i,c]=v.useState(null),[d,f]=v.useState(null),[p,m]=v.useState(0),[h,x]=v.useState(!1),y=v.useRef(null),S=v.useCallback(async()=>{c(null),f(null),x(!1);try{const k=await tl.init();c(k),m(Math.round((k.ttl_ms||9e4)/1e3))}catch(k){k instanceof rc&&k.status===403?f(C("settings.devices_pair_localhost_only")):f(k.message)}},[]);v.useEffect(()=>{e?S():(c(null),f(null),x(!1))},[e,S]),v.useEffect(()=>{if(!i||h||p<=0)return;const k=window.setTimeout(()=>m(R=>R-1),1e3);return()=>window.clearTimeout(k)},[i,p,h]),v.useEffect(()=>{if(!e||!i||h)return;let k=!0;const R=async()=>{try{const N=await tl.status(i.pairing_id);if(!k)return;if(N.status==="confirmed"){x(!0),r.success(C("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,h,n,s,r]);const w=!!i&&!h&&p<=0,_=i?$6(i.lan_urls):"",j=i?`${_}/#pair=${i.pairing_id}`:"",E=async(k,R)=>{try{await navigator.clipboard.writeText(k),r.success(R)}catch{r.error(k)}};return o.jsxs(ma,{open:e,onClose:n,title:C("settings.devices_pair_title"),description:C("settings.devices_pair_desc"),footer:o.jsx(he,{variant:"secondary",onClick:n,children:C("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(gr,{})," ",C("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(V6,{value:j,size:196})}),h?o.jsx("p",{className:"text-sm font-medium text-emerald-500",children:C("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:C("settings.devices_pair_expired")}),o.jsx(he,{variant:"primary",onClick:()=>void S(),children:C("settings.devices_pair_regen")})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-center text-xs text-muted-fg",children:C("settings.devices_pair_scan")}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-fg",children:[o.jsx(gr,{size:12}),o.jsx("span",{children:C("settings.devices_pair_waiting")}),o.jsxs("span",{className:"tabular-nums",children:["· ",C("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:C("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:j}),o.jsx(he,{size:"sm",variant:"secondary",onClick:()=>E(j,C("settings.devices_pair_copied")),title:C("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:C("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(he,{size:"sm",variant:"secondary",onClick:()=>E(i.pairing_id,C("settings.devices_pair_copied_code")),title:C("settings.devices_pair_copy"),children:o.jsx(nd,{size:14})})]})]})]})]})]})]})}function Y6(){const e=nt(),{clients:n,isLoading:s,mutate:r}=v6(),[i,c]=v.useState(!1),d=async f=>{if(confirm(C("settings.devices_revoke_confirm",{id:f})))try{await tl.revoke(f),e.success("Cliente revocado."),r()}catch(p){e.error(p.message)}};return o.jsxs(He,{title:C("settings.devices"),description:C("settings.devices_sub"),action:o.jsxs(he,{size:"sm",variant:"primary",onClick:()=>c(!0),children:[o.jsx(dR,{size:14})," ",C("settings.devices_pair_btn")]}),children:[s&&o.jsx(Je,{}),!s&&n.length===0&&o.jsx(ot,{children:C("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(Ue,{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(he,{size:"sm",variant:"destructive",onClick:()=>d(f.id),children:"Revocar"})]},f.id))}),o.jsx(G6,{open:i,onClose:()=>c(!1),onPaired:()=>r()})]})}const F6=[{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:yh.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 X6(){const{config:e,isLoading:n,patch:s,mutate:r}=yr();if(n)return o.jsx(Je,{});const i=async c=>{const d={};for(const[f,p]of Object.entries(jx(c)))La(p)||(d[f]=p);await s(d),r()};return o.jsx(He,{title:"Config APX",description:"Config general en ~/.apx/config.json. Editable por tabs; JSON queda separado.",children:o.jsx(th,{sections:F6,source:e,jsonTitle:"~/.apx/config.json",jsonDescription:"Secretos redacted no se sobrescriben.",onSaveFields:async(c,d)=>{await s(c,d),r()},onSaveJson:i})})}function K6(){const e=nt(),{health:n,isUp:s}=zS(),r=async()=>{try{await el.reload(),e.success("Config recargada.")}catch(i){e.error(i.message)}};return o.jsxs("div",{className:"space-y-6",children:[o.jsx(He,{title:C("daemon.version"),action:o.jsx(he,{size:"sm",onClick:r,children:C("common.reload")}),children:o.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[o.jsx(wg,{label:C("daemon.version"),value:n?.version||"—"}),o.jsx(wg,{label:C("daemon.uptime"),value:n?`${n.uptime_s}s`:"—"}),o.jsx(wg,{label:C("daemon.status"),value:C(s?"daemon.running":"daemon.down"),ok:s})]})}),o.jsx(X6,{})]})}function wg({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(Xd,{ok:s}),o.jsx("span",{children:n})]})]})}function Q6(){const e=nt(),{theme:n,set:s}=_h(),[r,i]=v.useState(""),[c,d]=v.useState(j5()),f=()=>{const m=r.trim();if(m){Hr(m);try{localStorage.setItem(Cn.token,m)}catch{}i(""),e.success(C("settings.token_saved"))}},p=m=>{y5(m),d(m),window.location.reload()};return o.jsxs("div",{className:"space-y-6",children:[o.jsx(He,{title:C("settings.appearance"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:n==="light"?"primary":"secondary",onClick:()=>s("light"),children:C("settings.light_mode")}),o.jsx(he,{variant:n==="dark"?"primary":"secondary",onClick:()=>s("dark"),children:C("settings.dark_mode")})]})}),o.jsx(He,{title:C("settings.language"),children:o.jsx("div",{className:"flex items-center gap-2",children:_5.map(m=>o.jsx(he,{variant:c===m.value?"primary":"secondary",onClick:()=>p(m.value),children:m.label},m.value))})}),o.jsxs(He,{title:C("settings.token"),description:C("settings.token_sub"),children:[o.jsx(fe,{label:"Bearer",children:o.jsx(Ce,{type:"password",placeholder:sx()?C("settings.token_active"):C("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(he,{variant:"primary",onClick:f,children:C("common.save")})})]})]})}const Z6=[{title:C("settings.account_section"),items:[{key:"identity",label:C("settings.tabs.identity"),icon:wj},{key:"appearance",label:C("settings.appearance"),icon:iR}]},{title:C("settings.agents_section"),items:[{key:"super_agent",label:C("settings.tabs.super_agent"),icon:vn},{key:"engines",label:C("settings.tabs.engines"),icon:gh},{key:"memory",label:"Memoria (RAG)",icon:hj}]},{title:C("settings.channels_section"),items:[{key:"telegram",label:C("settings.tabs.telegram"),icon:Za},{key:"devices",label:C("settings.tabs.devices"),icon:mR}]},{title:C("settings.advanced_section"),items:[{key:"advanced",label:C("settings.tabs.advanced"),icon:Tg}]}],J6=new Set(["engines","telegram"]),W6={identity:()=>o.jsx(c6,{}),super_agent:()=>o.jsx(u6,{}),engines:()=>o.jsx(t2,{}),memory:()=>o.jsx(m6,{}),telegram:()=>o.jsx(b6,{}),devices:()=>o.jsx(Y6,{}),appearance:()=>o.jsx(Q6,{}),advanced:()=>o.jsx(K6,{})};function eL(){const e=Ua(),n=ea(),s=tL(n.pathname),r=W6[s],{collapsed:i,toggle:c}=BS(Cn.sidebarCollapsed+".settings");return o.jsx(IS,{sections:Z6,active:s,onChange:d=>e(d==="identity"?"/settings":`/settings/${nL(d)}`),collapsed:i,onToggleCollapse:c,contentClassName:`mx-auto w-full ${J6.has(s)?"max-w-6xl":"max-w-3xl"} space-y-6 p-6 pt-3`,testId:`settings-tab-${s}`,children:o.jsx(r,{})})}function tL(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 nL(e){return e==="super_agent"?"super-agent":e==="advanced"?"config":e}function aL({engines:e,order:n,mode:s,configuredProvider:r,onSetMode:i,onSetDefault:c,onToggleEnabled:d,onReorder:f,onConfigure:p,busy:m}){const h=new Map(e.map(w=>[w.id,w])),x=[...n.filter(w=>h.has(w)),...e.map(w=>w.id).filter(w=>!n.includes(w))],y=s==="chain",S=(w,_)=>{const j=x.indexOf(w),E=j+_;if(j<0||E<0||E>=x.length)return;const k=[...x];[k[j],k[E]]=[k[E],k[j]],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:Ae("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:Ae("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,_)=>{const j=h.get(w),E=vd[w]||{name:w,note:""},k=!y&&r===w,R=w==="mock";return o.jsxs("div",{"data-testid":`voice-provider-${w}`,className:Ae("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&&!j.enabled&&"opacity-60"),children:[y&&o.jsxs("div",{className:"flex flex-col",children:[o.jsx("button",{type:"button",onClick:()=>S(w,-1),disabled:m||_===0,"aria-label":"Subir","data-testid":`voice-provider-${w}-up`,className:"text-muted-fg hover:text-fg disabled:opacity-30",children:o.jsx(pj,{className:"size-3.5"})}),o.jsx("button",{type:"button",onClick:()=>S(w,1),disabled:m||_===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(Jr,{className:"size-3.5"})})]}),o.jsx(Xd,{ok:j.available?!0:j.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:E.name}),E.local&&o.jsx(Ue,{tone:"info",children:"local"}),j.available?o.jsx(Ue,{tone:"success",children:"disponible"}):j.configured?o.jsx(Ue,{tone:"warning",children:"configurado, no disponible"}):o.jsx(Ue,{tone:"muted",children:"sin configurar"}),k&&o.jsx(Ue,{tone:"success",children:"por defecto"})]}),o.jsx("div",{className:"truncate text-xs text-muted-fg",children:E.note})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[y?o.jsx(sn,{checked:R?!0:j.enabled,onChange:N=>d(w,N),disabled:m||R}):!k&&o.jsxs(he,{size:"sm",variant:"ghost",onClick:()=>c(w),disabled:m,"data-testid":`voice-provider-${w}-default`,children:[o.jsx(TN,{className:"size-3.5"})," Usar por defecto"]}),k&&o.jsx(gj,{className:"size-4 text-emerald-400"}),o.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>p(w),"data-testid":`voice-provider-${w}-config`,children:[o.jsx(fR,{className:"size-3.5"})," Configurar"]})]})]},w)})})]})}function Ca(e){return typeof e=="string"?e:e==null?"":String(e)}function sL({open:e,providerId:n,config:s,onClose:r,onSave:i}){const[c,d]=v.useState(!1),[f,p]=v.useState(null),[m,h]=v.useState(""),[x,y]=v.useState({});if(v.useEffect(()=>{if(!e||!n)return;p(null),h("");const N=s||{};if(n==="piper"){const O=N;y({bin:Ca(O.bin),model:Ca(O.model),speaker:Ca(O.speaker)})}else if(n==="elevenlabs"){const O=N;y({model:Ca(O.model),voice_id:Ca(O.voice_id),output_format:Ca(O.output_format)})}else if(n==="openai"){const O=N;y({model:Ca(O.model)||"tts-1",voice:Ca(O.voice)||"alloy",format:Ca(O.format)||"mp3"})}else if(n==="gemini"){const O=N;y({model:Ca(O.model),voice:Ca(O.voice)||"Kore",style:Ca(O.style)})}else y({})},[e,n,s]),!n)return null;const S=vd[n],w=`voice.tts.${n}`,_=N=>y(O=>({...O,...N})),j=n!=="piper"&&n!=="mock",E=j&&La(s?.api_key),k=E?`…${al(s?.api_key)??""} (ya seteada)`:"API key",R=async()=>{d(!0),p(null);try{const N={},O=[],A=(M,B)=>{B.trim()?N[`${w}.${M}`]=B.trim():O.push(`${w}.${M}`)};n==="piper"?(A("bin",x.bin),A("model",x.model),x.speaker.trim()?N[`${w}.speaker`]=x.speaker.trim():O.push(`${w}.speaker`)):n==="elevenlabs"?(A("model",x.model),A("voice_id",x.voice_id),A("output_format",x.output_format)):n==="openai"?(A("model",x.model),A("voice",x.voice),A("format",x.format)):n==="gemini"&&(A("model",x.model),A("voice",x.voice),A("style",x.style)),j&&m.trim()&&(N[`${w}.api_key`]=m.trim()),await i({set:N,unset:O}),r()}catch(N){p(N.message||"Error al guardar.")}finally{d(!1)}};return o.jsx(ma,{open:e,onClose:r,title:`Configurar ${S?.name||n}`,description:S?.note,size:"md",footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:r,disabled:c,children:"Cancelar"}),o.jsx(he,{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(Ce,{value:x.bin,onChange:N=>_({bin:N.target.value}),placeholder:"piper"})}),o.jsx(fe,{label:"Modelo (.onnx)",hint:"Ruta absoluta al modelo de voz piper.",children:o.jsx(Ce,{value:x.model,onChange:N=>_({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(Ce,{value:x.speaker,onChange:N=>_({speaker:N.target.value}),placeholder:"0"})})]}),n==="elevenlabs"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"API key",hint:E?"Dejá en blanco para mantener la actual.":"Se guarda como secreto. Env: ELEVENLABS_API_KEY",children:o.jsx(Ce,{type:"password",autoComplete:"new-password",value:m,onChange:N=>h(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",children:o.jsx(Ct,{value:x.model||"",onChange:N=>_({model:N}),options:m5.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(Ce,{value:x.voice_id,onChange:N=>_({voice_id:N.target.value}),placeholder:"EXAVITQu4vr4xnSDxMaL"})}),o.jsx(fe,{label:"Formato de salida",children:o.jsx(Ce,{value:x.output_format,onChange:N=>_({output_format:N.target.value}),placeholder:"mp3_44100_128"})})]}),n==="openai"&&o.jsxs(o.Fragment,{children:[o.jsx(fe,{label:"API key",hint:E?"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(Ce,{type:"password",autoComplete:"new-password",value:m,onChange:N=>h(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",children:o.jsx(Ct,{value:x.model||"tts-1",onChange:N=>_({model:N}),options:p5.map(N=>({value:N,label:N}))})}),o.jsx(fe,{label:"Voz",children:o.jsx(Ct,{value:x.voice||"alloy",onChange:N=>_({voice:N}),options:d5.map(N=>({value:N,label:N}))})}),o.jsx(fe,{label:"Formato",children:o.jsx(Ct,{value:x.format||"mp3",onChange:N=>_({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:E?"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(Ce,{type:"password",autoComplete:"new-password",value:m,onChange:N=>h(N.target.value),placeholder:k})}),o.jsx(fe,{label:"Modelo",hint:"TTS de Gemini sigue en preview.",children:o.jsx(Ce,{value:x.model,onChange:N=>_({model:N.target.value}),placeholder:"gemini-2.5-flash-preview-tts"})}),o.jsx(fe,{label:"Voz",children:o.jsx(Ct,{value:x.voice||"Kore",onChange:N=>_({voice:N}),options:f5.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(Qt,{rows:2,value:x.style||"",onChange:N=>_({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 rL(){const e=v.useRef(null),n=v.useRef(null),[s,r]=v.useState(!1),[i,c]=v.useState(!1),d=v.useCallback(()=>{n.current&&(URL.revokeObjectURL(n.current),n.current=null)},[]);v.useEffect(()=>()=>{e.current&&(e.current.pause(),e.current=null),d()},[d]);const f=v.useCallback(async m=>{c(!0);try{d();const h=await h5(m);n.current=h,e.current||(e.current=new Audio);const x=e.current;x.src=h,x.onended=()=>r(!1),x.onerror=()=>r(!1),await x.play(),r(!0)}finally{c(!1)}},[d]),p=v.useCallback(()=>{e.current&&(e.current.pause(),e.current.currentTime=0),r(!1)},[]);return{play:f,stop:p,playing:s,loading:i}}function oL({engines:e,defaultProvider:n,mode:s}){const r=nt(),{play:i,stop:c,playing:d,loading:f}=rL(),[p,m]=v.useState("Hola, soy APX. Esto es una prueba de voz."),[h,x]=v.useState(""),[y,S]=v.useState(""),[w,_]=v.useState(!1),[j,E]=v.useState(null),R=[{value:"",label:s==="single"&&n&&n!=="auto"?`Por defecto (${vd[n]?.name||n})`:"Por defecto (cadena)"},...e.map(O=>({value:O.id,label:`${vd[O.id]?.name||O.id}${O.available?"":" · no disponible"}`}))],N=async()=>{const O=p.trim();if(!O){r.error("Escribí algo para decir.");return}_(!0);try{const A=await uS.say({text:O,provider:h||void 0,style:y.trim()||void 0});E(A),await i(A.audio_path)}catch(A){r.error(A.message||"No se pudo sintetizar.")}finally{_(!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(Ct,{value:h,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(Ce,{value:y,onChange:O=>S(O.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(Qt,{rows:2,value:p,onChange:O=>m(O.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(he,{variant:"primary",onClick:N,loading:w,disabled:f,"data-testid":"voice-test-say",children:[o.jsx(hR,{className:"size-4"})," Decir esto"]}),d?o.jsxs(he,{variant:"secondary",onClick:c,"data-testid":"voice-test-stop",children:[o.jsx(_j,{className:"size-4"})," Parar"]}):j?o.jsxs(he,{variant:"secondary",onClick:()=>i(j.audio_path),loading:f,"data-testid":"voice-test-replay",children:[o.jsx(bh,{className:"size-4"})," Repetir"]}):null,j&&o.jsxs("span",{className:"text-xs text-muted-fg",children:["Motor: ",o.jsx("strong",{children:j.provider}),j.duration_s?` · ${j.duration_s.toFixed(1)}s`:""]})]})]})}const lL=[{value:"auto",label:"Automático (local, luego OpenAI)"},{value:"local",label:"Local — faster-whisper (offline)"},{value:"openai",label:"OpenAI — Whisper-1 (cloud)"}],iL=[{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 cL({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(Ct,{value:r,onChange:p=>n({"transcription.provider":p}),options:lL,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(Ct,{value:c,onChange:p=>n({"transcription.local.model":p}),options:g5.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(Ct,{value:d,onChange:p=>n({"transcription.local.language":p}),options:iL,disabled:s})})]})]})}function uL(){const e=nt(),{config:n,isLoading:s,patch:r,mutate:i}=yr(),{data:c,isLoading:d,error:f,mutate:p}=Qe("/tts/providers",()=>uS.providers()),[m,h]=v.useState(null),[x,y]=v.useState(!1),S=n,w=S.voice?.tts||{},_=S.transcription||{},j=c?.configured_provider||w.provider||"auto",E=c?.mode||w.mode||"chain",k=c?.engines||[],R=c?.order||[],N=v.useMemo(()=>m?w[m]||{}:{},[m,w]),O=async L=>{y(!0);try{await r({"voice.tts.provider":L,"voice.tts.mode":"single"}),await p(),e.success(`Motor por defecto: ${L}.`)}catch(P){e.error(P.message)}finally{y(!1)}},A=async L=>{y(!0);try{const P={"voice.tts.mode":L};if(L==="single"&&(j==="auto"||!j)){const H=k.find(Y=>Y.available)?.id||R[0]||"mock";P["voice.tts.provider"]=H}await r(P),await p(),e.success(L==="chain"?"Modo: cadena con fallback.":"Modo: solo el motor por defecto.")}catch(P){e.error(P.message)}finally{y(!1)}},M=async(L,P)=>{y(!0);try{await r({[`voice.tts.${L}.enabled`]:P}),await p()}catch(H){e.error(H.message)}finally{y(!1)}},B=async L=>{y(!0);try{await r({"voice.tts.order":L}),await p()}catch(P){e.error(P.message)}finally{y(!1)}},U=async({set:L,unset:P})=>{await r(L,P.length?P:void 0),await p(),await i(),e.success("Configuración de voz guardada.")},I=async(L,P)=>{try{await r(L,P),e.success("Transcripción actualizada.")}catch(H){e.error(H.message)}};return o.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6","data-testid":"screen-voice",children:[o.jsxs("header",{children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Voces"}),o.jsx("p",{className:"text-sm text-muted-fg",children:"Configurá el texto a voz (TTS) y la transcripción (STT), elegí el motor por defecto y probá la voz."})]}),o.jsx(He,{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(Je,{}):f?o.jsxs(ot,{children:["No se pudieron cargar los proveedores: ",f.message]}):o.jsx(aL,{engines:k,order:R,mode:E,configuredProvider:j,onSetMode:A,onSetDefault:O,onToggleEnabled:M,onReorder:B,onConfigure:L=>h(L),busy:x})}),o.jsx(He,{title:"Probar voz",description:"Elegí con qué motor sintetizar y, si aplica, cómo querés que hable.",children:o.jsx(oL,{engines:k,defaultProvider:j,mode:E})}),o.jsx(He,{title:"Transcripción (STT)",description:"Motor de voz a texto que usan el deck, Telegram y la CLI al escuchar.",children:s?o.jsx(Je,{}):o.jsx(cL,{config:_,onPatch:I})}),o.jsx(sL,{open:!!m,providerId:m,config:N,onClose:()=>h(null),onSave:U})]})}const Sg={status:()=>ge.get("/desktop/status"),autostartGet:()=>ge.get("/desktop/autostart"),autostartSet:e=>ge.post("/desktop/autostart",{enable:e})};function dL(e=30){return ge.get(`/messages/global?channel=desktop&limit=${e}`)}const L_="CommandOrControl+G",fL=[{value:"left",label:"Izquierda"},{value:"center",label:"Centro"},{value:"right",label:"Derecha"}],mL=[{value:"light",label:"Claro"},{value:"dark",label:"Oscuro"}];function pL(){const e=nt(),{config:n,isLoading:s,patch:r}=yr(),i=n,c=i.desktop?.shortcut||i.overlay?.shortcut||L_,d=i.desktop?.enabled!==!1,f=i.desktop?.theme||"light",p=i.desktop?.position||"right",{data:m,isLoading:h,mutate:x}=Qe("/desktop/status",()=>Sg.status(),{refreshInterval:5e3}),y=!!m?.running,{data:S,mutate:w}=Qe("/desktop/autostart",()=>Sg.autostartGet()),{data:_,isLoading:j,mutate:E}=Qe("/messages/global?channel=desktop",()=>dL(40),{refreshInterval:8e3}),[k,R]=v.useState(c),[N,O]=v.useState(!1),[A,M]=v.useState(!1);v.useEffect(()=>R(c),[c]);const B=async()=>{const L=k.trim();if(!(!L||L===c)){O(!0);try{await r({"desktop.shortcut":L}),e.success("Atajo guardado. Reiniciá la ventana (apx desktop stop && start) para aplicarlo.")}catch(P){e.error(P.message)}finally{O(!1)}}},U=async(L,P,H)=>{O(!0);try{await r({[L]:P}),e.success(H)}catch(Y){e.error(Y.message)}finally{O(!1)}},I=async L=>{M(!0);try{await Sg.autostartSet(L),await w(),e.success(L?"Autostart activado para el próximo login.":"Autostart desactivado.")}catch(P){e.error(P.message)}finally{M(!1)}};return o.jsxs("div",{className:"mx-auto max-w-6xl space-y-6 p-6","data-testid":"screen-desktop",children:[o.jsxs("header",{children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Escritorio"}),o.jsx("p",{className:"text-sm text-muted-fg",children:"Ventana flotante de voz (Electron): atajo global, escucha por micrófono y muestra el chat."})]}),o.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_1fr]",children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs(He,{title:"Estado",description:"La ventana se lanza desde la terminal o por autostart.",children:[h?o.jsx(Je,{}):o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx(Xd,{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(A1,{children:"apx desktop start"})," · ",o.jsx(A1,{children:"apx desktop --debug"})]})]}),o.jsx(He,{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(sn,{checked:S.enabled,onChange:I,disabled:A,label:S.enabled?"Activado":"Desactivado"}),o.jsxs("span",{className:"text-xs text-muted-fg",children:["platform: ",S.platform]})]}):o.jsx(Je,{})}),o.jsx(He,{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(Je,{}):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(Ce,{value:k,onChange:L=>R(L.target.value),onKeyDown:L=>{L.key==="Enter"&&B()},placeholder:L_,className:"max-w-md font-mono",disabled:N})})}),o.jsx(he,{variant:"primary",onClick:B,loading:N,disabled:!k.trim()||k.trim()===c,children:"Guardar"})]})}),o.jsx(He,{title:"Apariencia",description:"Tema y posición de la ventana en la pantalla.",children:s?o.jsx(Je,{}):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(Ct,{value:f,onChange:L=>U("desktop.theme",L,`Tema: ${L}.`),options:mL,disabled:N})}),o.jsx(fe,{label:"Posición",hint:'"izquierda" / "centro" / "derecha" del borde superior.',children:o.jsx(Ct,{value:p,onChange:L=>U("desktop.position",L,`Posición: ${L}.`),options:fL,disabled:N})})]})}),o.jsx(He,{title:"Activación + transcripción",description:"El plugin del daemon procesa los mensajes. STT se configura en Voces.",children:s?o.jsx(Je,{}):o.jsxs("div",{className:"space-y-3",children:[o.jsx(sn,{checked:d,onChange:L=>U("desktop.enabled",L,L?"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(ph,{to:"/m/voice",className:"font-medium text-fg underline underline-offset-2",children:"Voces"})," ","(whisper local, idioma, modelo)."]})]})})]}),o.jsx("div",{children:o.jsx(He,{title:"Última conversación",description:"Lo último charlado con el agente desde la ventana flotante.",action:o.jsx("button",{type:"button",onClick:()=>E(),className:"text-xs text-muted-fg underline-offset-2 hover:underline",children:"refrescar"}),children:o.jsx(gL,{messages:_||[],loading:j})})})]})]})}function gL({messages:e,loading:n}){const s=v.useMemo(()=>xL(e),[e]);return n?o.jsx(Je,{}):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(hL,{m:c},d))},i))}):o.jsx(ot,{children:"Sin mensajes todavía. Mandale algo a la ventana de escritorio para que aparezca aquí."})}function hL({m:e}){const n=e.direction==="in",s=bL(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 xL(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 bL(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 vL(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 yL({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 · ",vL(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(Ue,{tone:"success",children:"sin shell directo"}),s.arbitrary_commands===!1&&o.jsx(Ue,{tone:"success",children:"comandos arbitrarios bloqueados"}),s.dangerous_actions_require_confirmation&&o.jsx(Ue,{tone:"info",children:"acciones peligrosas requieren confirmación"})]})]})}function _L(e){return e==="available"?"success":e==="configured"?"info":"muted"}function jL(e){return e==="available"?"activo":e==="configured"?"configurado":e==="disabled"?"deshabilitado":"sin configurar"}function wL(e){return e==="voice"?"warning":e==="plugin"?"info":"muted"}function SL({widget:e,onToggle:n}){const s=e.source==="external",[r,i]=v.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:Ae("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:Ae("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(Ue,{tone:wL(e.kind),children:e.kind}),o.jsx(Ue,{tone:_L(e.status),children:jL(e.status)}),s?o.jsx("span",{"data-testid":`deck-widget-toggle-${e.id}`,children:o.jsx(sn,{checked:c,onChange:d,disabled:r||!n})}):o.jsx("span",{className:"w-9 shrink-0","aria-hidden":!0})]})}function CL({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(SL,{widget:r,onToggle:r.source==="external"?i=>s(r.id,i):void 0},r.id))})]})}function EL(){const e=nt(),{data:n,error:s,isLoading:r,mutate:i}=Qe("/deck/manifest",()=>T1.manifest(),{refreshInterval:3e4}),c=async(x,y)=>{try{await T1.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)})),h=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:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Deck"}),o.jsx("p",{className:"text-sm text-muted-fg",children:"App companion · widgets y escritorios."})]}),o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>i(),disabled:r,title:"Recargar manifest",children:o.jsx(Wr,{size:14,className:r?"animate-spin":""})})]}),n&&o.jsx(yL,{manifest:n}),o.jsxs(He,{title:"Widgets",description:r?"Cargando manifest…":s?"Error al cargar el manifest.":`${f.length} widgets · ${h} externos habilitados`,children:[r&&o.jsx(Je,{label:"Cargando manifest del Deck…"}),!r&&s&&o.jsxs(ot,{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(ot,{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(CL,{desktop:x.desktop,widgets:x.widgets,onToggle:c},x.desktop.id))})]}),n?.apx&&o.jsx(He,{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 kL({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:qN,description:c.path}});return o.jsx("div",{className:"w-60","data-testid":"code-project-select",children:o.jsx(Ct,{value:n,onChange:s,options:i,placeholder:"Elegí un proyecto…",disabled:r})})}function NL({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:C("code_module.sessions")}),o.jsxs("button",{type:"button",onClick:i,disabled:s,title:C("code_module.new_session"),"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(Nn,{className:"size-3"})," ",C("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(ot,{children:C("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:Ae("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(aR,{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("button",{type:"button",onClick:()=>c(f.id,f.title),title:C("code_module.rename"),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-foreground",children:o.jsx(xh,{className:"size-3"})}),o.jsx("button",{type:"button",onClick:()=>d(f.id),title:C("code_module.delete"),className:"rounded p-1 text-muted-foreground hover:bg-background hover:text-rose-500",children:o.jsx(Ja,{className:"size-3"})})]})]},f.id))})})]})}function RL({mode:e,onChange:n,disabled:s}){const r=(i,c,d,f)=>o.jsxs("button",{type:"button",disabled:s,title:d,"data-testid":`code-mode-${i}`,"aria-pressed":e===i,onClick:()=>n(i),className:Ae("flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] 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"})," ",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",C("code_module.mode_build"),C("code_module.mode_build_hint"),FN),r("plan",C("code_module.mode_plan"),C("code_module.mode_plan_hint"),AN)]})}function TL({value:e,onValueChange:n,onSubmit:s,onStop:r,busy:i,disabled:c,mode:d,onModeChange:f,model:p,onModelChange:m}){return o.jsx(wx,{value:e,onValueChange:n,onSubmit:s,onStop:r,busy:i,disabled:c,placeholder:C("code_module.placeholder"),maxRows:12,footer:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(RL,{mode:d,onChange:f,disabled:i}),o.jsx(Sx,{value:p,onChange:m,disabled:i})]})})}function Cg(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 AL(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 ML(e){let n=0,s=0,r=0;for(const d of e)d.role==="user"?n+=Cg(d,{text:!0}):s+=Cg(d,{text:!0}),r+=Cg(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 P_={user:"bg-emerald-500",assistant:"bg-sky-500",tool:"bg-amber-500"};function qu({label:e,value:n}){return o.jsxs("div",{className:"rounded-md border border-border bg-background/50 px-2.5 py-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),o.jsx("div",{className:"mt-0.5 truncate font-mono text-sm",children:n})]})}function OL({turns:e}){const n=v.useMemo(()=>AL(e),[e]),s=v.useMemo(()=>ML(e),[e]);return e.length===0?o.jsx("div",{className:"p-3",children:o.jsx(ot,{children:C("code_module.ctx_none")})}):o.jsxs("div",{className:"space-y-3 p-3","data-testid":"code-context-tab",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(qu,{label:C("code_module.ctx_model"),value:n.model||"auto"}),o.jsx(qu,{label:C("code_module.ctx_messages"),value:`${n.userMsgs}/${n.assistantMsgs}`}),o.jsx(qu,{label:C("code_module.ctx_input"),value:n.input.toLocaleString()}),o.jsx(qu,{label:C("code_module.ctx_output"),value:n.output.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold text-muted-foreground",children:C("code_module.ctx_breakdown")}),s.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-muted",children:s.map(r=>o.jsx("div",{className:P_[r.key],style:{width:`${r.percent}%`},title:`${r.key}: ${r.tokens} (${r.percent}%)`},r.key))}),o.jsx("ul",{className:"mt-2 space-y-1",children:s.map(r=>o.jsxs("li",{className:"flex items-center gap-2 text-[11px]",children:[o.jsx("span",{className:`size-2 rounded-full ${P_[r.key]}`}),o.jsx("span",{className:"flex-1 text-foreground/80",children:C(`code_module.seg_${r.key}`)}),o.jsxs("span",{className:"font-mono text-muted-foreground",children:[r.tokens," · ",r.percent,"%"]})]},r.key))})]}):o.jsx("p",{className:"text-[11px] text-muted-foreground",children:C("code_module.ctx_none")})]})]})}function zL(e){const n=[];for(const s of(e||"").split(`
|
|
564
|
-
`))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 DL({patch:e}){const n=v.useMemo(()=>zL(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:Ae("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 LL={added:PN,modified:ad,deleted:UN},PL={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 BL({file:e}){const[n,s]=v.useState(!1),r=LL[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(Nd,{className:Ae("size-3 shrink-0 transition-transform",n&&"rotate-90")}),o.jsx(r,{className:Ae("size-3.5 shrink-0",PL[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(DL,{patch:e.patch})})]})}function IL({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?C("code_module.changes_files",{n:r.length}):""}),o.jsx("button",{type:"button",onClick:s,title:"↻",className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:n?o.jsx(gr,{size:12}):o.jsx(Wr,{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(ot,{children:C("code_module.changes_no_git")}):r.length===0?o.jsx(ot,{children:C("code_module.changes_none")}):o.jsx("ul",{className:"space-y-1.5",children:r.map(i=>o.jsx(BL,{file:i},i.path))})})]})}function UL({pid:e,entry:n,onDeleted:s}){const[r,i]=v.useState(!1),[c,d]=v.useState(!1),[f,p]=v.useState(null),m=nt(),h=Qe(r?["artifact",e,n.name]:null,()=>Zu.read(e,n.name)),x=!h.data?.content||h.data.content.startsWith("#!"),y=async _=>{try{await navigator.clipboard.writeText(_),m.info("Copiado.")}catch{}},S=async()=>{d(!0),p(null);try{const _=await Zu.run(e,n.name);p(_),_.ok?m.info(`exit 0 — ${_.durationMs}ms`):m.error(`exit ${_.exitCode??_.signal??"?"}${_.timedOut?" (timeout)":""}`)}catch(_){m.error(_.message)}finally{d(!1)}},w=async()=>{if(window.confirm(C("code_module.artifacts_delete_confirm")))try{await Zu.remove(e,n.name),s()}catch(_){m.error(_.message)}};return o.jsxs("li",{className:"rounded-md border border-border",children:[o.jsxs("button",{type:"button",onClick:()=>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(Nd,{className:Ae("size-3 shrink-0 transition-transform",r&&"rotate-90")}),o.jsx(LN,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"}),o.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:n.name}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:[n.size,"b"]})]}),r&&o.jsxs("div",{className:"space-y-2 border-t border-border p-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:n.path}),x&&o.jsxs("button",{type:"button",onClick:()=>void S(),disabled:c,title:C("code_module.artifacts_run"),className:Ae("inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] font-medium",c?"bg-muted text-muted-foreground":"bg-emerald-500/15 text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-300"),children:[c?o.jsx(gr,{size:10}):o.jsx(bh,{className:"size-3"}),C("code_module.artifacts_run")]}),o.jsx("button",{type:"button",onClick:()=>void y(n.path),title:C("code_module.artifacts_copy_path"),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:o.jsx(nd,{className:"size-3"})}),o.jsx("button",{type:"button",onClick:()=>void w(),title:C("code_module.artifacts_delete"),className:"rounded p-1 text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950",children:o.jsx(Ja,{className:"size-3"})})]}),o.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[C("code_module.artifacts_run_hint")," ",o.jsxs("code",{className:"rounded bg-muted px-1 font-mono",children:["apx artifact run ",n.name]})]}),f&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[o.jsxs("span",{className:Ae("rounded px-1.5 py-0.5 font-mono",f.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 ",f.exitCode??f.signal??"?"]}),f.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"}),f.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:[f.durationMs,"ms"]})]}),f.stdout&&o.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-background/60 p-2 text-[10px] leading-tight",children:f.stdout}),f.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:f.stderr})]}),h.isLoading?o.jsx("div",{className:"flex justify-center py-2",children:o.jsx(gr,{size:12})}):h.data?.content?o.jsx("pre",{className:"max-h-64 overflow-auto rounded bg-muted/50 p-2 text-[10px] leading-tight",children:h.data.content}):null]})]})}function HL({pid:e}){const n=Qe(e?["artifacts",e]:null,()=>Zu.list(e)),s=n.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:s.length>0?C("code_module.artifacts_count",{n:s.length}):""}),o.jsx("button",{type:"button",onClick:()=>void n.mutate(),title:"↻",className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:n.isLoading?o.jsx(gr,{size:12}):o.jsx(Wr,{className:"size-3"})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3",children:s.length===0?o.jsx(ot,{children:C("code_module.artifacts_none")}):o.jsx("ul",{className:"space-y-1.5",children:s.map(r=>o.jsx(UL,{pid:e,entry:r,onDeleted:()=>void n.mutate()},r.name))})})]})}function qL({pid:e,turns:n,changes:s,changesLoading:r,onRefreshChanges:i}){const c=s?.files.length||0;return o.jsxs(Wd,{defaultValue:"context",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-3 py-2",children:o.jsxs(ef,{variant:"line",className:"w-full",children:[o.jsxs(ka,{value:"context",className:"flex-1",children:[o.jsx(Rd,{className:"size-3.5"})," ",C("code_module.tab_context")]}),o.jsxs(ka,{value:"changes",className:"flex-1",children:[o.jsx(YN,{className:"size-3.5"})," ",C("code_module.tab_changes"),c>0&&o.jsx("span",{className:"ml-1 rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground",children:c})]}),o.jsxs(ka,{value:"artifacts",className:"flex-1",children:[o.jsx(lR,{className:"size-3.5"})," ",C("code_module.tab_artifacts")]})]})}),o.jsx(Na,{value:"context",className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(OL,{turns:n})}),o.jsx(Na,{value:"changes",className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(IL,{changes:s,loading:r,onRefresh:i})}),o.jsx(Na,{value:"artifacts",className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(HL,{pid:e})})]})}function VL(){const e=nt(),n=Qe("/projects",()=>Qn.list()),s=v.useMemo(()=>n.data||[],[n.data]),[r,i]=v.useState(""),[c,d]=v.useState(null),[f,p]=v.useState([]),[m,h]=v.useState(""),[x,y]=v.useState(!1),S=v.useRef(null);v.useEffect(()=>{!r&&s.length&&i(String(s[0].id))},[r,s]);const w=Qe(r?["code-sessions",r]:null,()=>sr.sessions.list(r)),_=Qe(r&&c?["code-session",r,c]:null,()=>sr.sessions.get(r,c)),j=Qe(r&&c?["code-changes",r,c]:null,()=>sr.changes(r,c));v.useEffect(()=>{const D=w.data||[];!c&&D.length&&d(D[0].id),c&&D.length&&!D.some(G=>G.id===c)&&d(D[0]?.id??null)},[w.data,c]),v.useEffect(()=>{x||(_.data?p(_.data.messages||[]):c||p([]))},[_.data,c,x]),v.useEffect(()=>()=>S.current?.abort(),[]);const E=_.data,k=E?.mode==="plan"?"plan":"build",R=E?.model||"",N=D=>{D===r||x||(i(D),d(null),p([]))},O=D=>{x||D===c||(d(D),p([]))},A=async()=>{if(!(!r||x))try{const D=await sr.sessions.create(r,{title:C("code_module.untitled")});await w.mutate(),d(D.id),p([])}catch(D){e.error(D.message)}},M=async(D,G)=>{const V=window.prompt(C("code_module.rename"),G);if(!(!V||V===G))try{await sr.sessions.update(r,D,{title:V}),await w.mutate(),D===c&&await _.mutate()}catch(W){e.error(W.message)}},B=async D=>{if(!x&&window.confirm(C("code_module.delete_confirm")))try{await sr.sessions.remove(r,D),D===c&&(d(null),p([])),await w.mutate()}catch(G){e.error(G.message)}},U=v.useCallback(async D=>{if(c)try{await sr.sessions.update(r,c,D),await Promise.all([_.mutate(),w.mutate()])}catch(G){e.error(G.message)}},[r,c,_,w,e]),I=()=>{S.current?.abort(),y(!1)},L=D=>p(G=>{const V=[...G],W=V[V.length-1];return W&&W.role==="assistant"&&(V[V.length-1]=D(W)),V}),P=async D=>{const G=(D??m).trim();if(!G||x||!r||!c)return;const V=new Date().toISOString();p(oe=>[...oe,{role:"user",parts:[{kind:"text",text:G}],ts:V},{role:"assistant",parts:[],ts:V,pending:!0}]),h(""),y(!0);const W=new AbortController;S.current=W;const ce=oe=>{if(oe.type==="error"){e.error(oe.error||"error");return}L(se=>Ex(se,oe))};try{await sr.stream(r,c,{prompt:G},ce,W.signal),L(oe=>({...oe,pending:!1}))}catch(oe){W.signal.aborted?L(se=>({...se,pending:!1,parts:[...se.parts,{kind:"text",text:C("code_module.stopped")}]})):(e.error(oe.message),p(se=>se.filter((ue,ee)=>ee!==se.length-1)))}finally{S.current===W&&(S.current=null),y(!1),_.mutate(),w.mutate(),j.mutate()}},H=async D=>{try{await navigator.clipboard.writeText(D),e.info("Copiado.")}catch{}},Y=!n.isLoading&&s.length>0,Q=v.useMemo(()=>f,[f]),[q,X]=v.useState(null),Z=x?null:u2(f),$=Z&&Z.turnKey!==q,K=D=>{P(D)};return o.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden p-4","data-testid":"screen-code",children:[o.jsxs("header",{className:"mb-3 flex items-center justify-between gap-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[o.jsx(ON,{size:22})," ",C("code_module.title")]}),o.jsx("p",{className:"text-sm text-muted-fg",children:C("code_module.desc")})]}),o.jsx(Ue,{tone:"success",children:C("code_module.badge")})]}),n.isLoading?o.jsx(Je,{}):Y?o.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-border bg-card/40",children:[o.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r border-border",children:[o.jsx("div",{className:"shrink-0 border-b border-border p-2",children:o.jsx(kL,{projects:s,value:r,onChange:N,disabled:x})}),o.jsx(NL,{sessions:w.data||[],activeId:c,busy:x,onSelect:O,onCreate:A,onRename:M,onDelete:B})]}),o.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"code-transcript",children:c?f.length?o.jsx(kx,{msgs:f,onCopy:H}):o.jsx("div",{className:"grid h-full place-items-center p-6",children:o.jsx(ot,{children:C("code_module.empty_chat")})}):o.jsx("div",{className:"grid h-full place-items-center p-6",children:o.jsx(ot,{children:C("code_module.pick_project")})})}),$&&Z&&o.jsx(c2,{turnKey:Z.turnKey,questions:Z.questions,onSubmit:K,onDismiss:()=>X(Z.turnKey),disabled:x}),o.jsx("div",{className:"border-t border-border bg-card/60 p-3","data-testid":"code-input",children:o.jsx(TL,{value:m,onValueChange:h,onSubmit:()=>void P(),onStop:I,busy:x,disabled:!c,mode:k,onModeChange:D=>void U({mode:D}),model:R,onModelChange:D=>void U({model:D||null})})})]}),o.jsx("aside",{className:"hidden w-80 shrink-0 flex-col border-l border-border lg:flex",children:o.jsx(qL,{pid:r,turns:Q,changes:j.data,changesLoading:j.isLoading,onRefreshChanges:()=>void j.mutate()})})]}):o.jsx(ot,{children:C("code_module.no_projects")})]})}function $L({open:e,onClose:n}){const{mutate:s}=lS(),r=nt(),[i,c]=v.useState(""),[d,f]=v.useState(""),[p,m]=v.useState([]),[h,x]=v.useState(null),[y,S]=v.useState(""),[w,_]=v.useState(!1),[j,E]=v.useState(!1),k=async(N,O=!1)=>{_(!0),S("");try{const A=await u5.dirs(N||"~");f(A.path),c(A.path),x(A.parent),m(A.entries)}catch(A){const M=A.message;S(M),O||r.error(M)}finally{_(!1)}};v.useEffect(()=>{e&&!d&&k(i||"~",!0)},[e]);const R=async()=>{const N=i.trim();if(!N){r.error(C("add_project.path_required"));return}E(!0);try{const O=await Qn.register(N);r.success(C("add_project.registered",{id:O.id})),await s("/projects"),c(""),n()}catch(O){r.error(O.message)}finally{E(!1)}};return o.jsx(ma,{open:e,onClose:n,title:C("add_project.title"),description:C("add_project.subtitle"),footer:o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"ghost",onClick:n,disabled:j,children:C("common.cancel")}),o.jsx(he,{variant:"primary",onClick:R,loading:j,children:C("add_project.register")})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx(fe,{label:C("add_project.path_label"),hint:C("add_project.path_hint"),children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ce,{autoFocus:!0,placeholder:C("add_project.path_placeholder"),value:i,onChange:N=>c(N.target.value),onKeyDown:N=>{N.key==="Enter"&&R()}}),o.jsxs(he,{onClick:()=>k(i||"~"),disabled:w,children:[o.jsx(Gu,{size:14})," ",C("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(he,{size:"sm",variant:"ghost",onClick:()=>k("~"),disabled:w,children:o.jsx(KN,{size:13})}),o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>h&&k(h),disabled:!h||w,children:".."})]})]}),o.jsxs("div",{className:"max-h-64 overflow-y-auto p-2",children:[w&&o.jsx(Je,{}),!w&&y&&o.jsx(ot,{children:C("add_project.browser_unavailable")}),!w&&!y&&p.length===0&&o.jsx(ot,{children:C("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(VN,{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 GL({onPaired:e}){const[n,s]=v.useState(""),[r,i]=v.useState(YL()),[c,d]=v.useState(!1),[f,p]=v.useState(null);async function m(){const h=n.trim();if(!h){p(C("pairing.err_required"));return}d(!0),p(null);try{const x=await tl.confirm({pairing_id:h,label:r.trim()||void 0});Hr(x.token);try{localStorage.setItem(Cn.token,x.token)}catch{}e()}catch(x){p(FL(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(ZN,{size:20})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-base font-semibold",children:C("pairing.title")}),o.jsx("p",{className:"text-xs text-muted-fg",children:C("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:C("pairing.steps_title")}),o.jsxs("li",{children:["1. ",C("pairing.step_1")]}),o.jsxs("li",{children:["2. ",C("pairing.step_2")]}),o.jsxs("li",{children:["3. ",C("pairing.step_3")]})]}),o.jsxs("form",{className:"space-y-3",onSubmit:h=>{h.preventDefault(),m()},children:[o.jsx(fe,{label:C("pairing.code_label"),children:o.jsx(Ce,{value:n,onChange:h=>s(h.target.value),placeholder:C("pairing.code_ph"),spellCheck:!1,autoComplete:"off"})}),o.jsx(fe,{label:C("pairing.label_label"),hint:C("pairing.revoke_hint"),children:o.jsx(Ce,{value:r,onChange:h=>i(h.target.value),placeholder:C("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(he,{type:"submit",variant:"primary",size:"md",loading:c,className:"w-full justify-center",children:C(c?"pairing.linking":"pairing.submit")})]})]})})}function YL(){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 FL(e){if(e instanceof rc){if(e.status===410)return C("pairing.err_expired");if(e.status===404||e.status===409)return C("pairing.err_unknown")}return C("pairing.err_generic")}function XL({...e}){return o.jsx(AS,{"data-slot":"sheet",...e})}function KL({...e}){return o.jsx(RS,{"data-slot":"sheet-portal",...e})}function QL({className:e,...n}){return o.jsx(yS,{"data-slot":"sheet-overlay",className:Pt("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 ZL({className:e,children:n,side:s="right",showCloseButton:r=!0,...i}){return o.jsxs(KL,{children:[o.jsx(QL,{}),o.jsxs(kS,{"data-slot":"sheet-content","data-side":s,className:Pt("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(_S,{"data-slot":"sheet-close",render:o.jsx(nl,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[o.jsx(ec,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function JL({className:e,...n}){return o.jsx("div",{"data-slot":"sheet-header",className:Pt("flex flex-col gap-0.5 p-4",e),...n})}function WL({className:e,...n}){return o.jsx(MS,{"data-slot":"sheet-title",className:Pt("font-heading text-base font-medium text-foreground",e),...n})}function e8({className:e,...n}){return o.jsx(jS,{"data-slot":"sheet-description",className:Pt("text-sm text-muted-foreground",e),...n})}function t8(){try{const e=localStorage.getItem(Cn.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 n8({open:e,onOpenChange:n}){const s=nt(),[r,i]=v.useState(t8),[c,d]=v.useState(""),[f,p]=v.useState(!1),[m,h]=v.useState(""),x=v.useRef(null);v.useEffect(()=>{const E=r.filter(k=>!k.pending);try{E.length?localStorage.setItem(Cn.robyChat,JSON.stringify(E)):localStorage.removeItem(Cn.robyChat)}catch{}},[r]);const y=()=>{if(!f){i([]),d("");try{localStorage.removeItem(Cn.robyChat)}catch{}}};v.useEffect(()=>()=>x.current?.abort(),[]);const S=()=>{x.current?.abort(),p(!1)},w=E=>i(k=>{const R=[...k],N=R[R.length-1];return N?.role==="assistant"&&(R[R.length-1]=E(N)),R}),_=async()=>{const E=c.trim();if(!E||f)return;const k=new Date().toISOString(),R=r.filter(M=>!M.pending).map(M=>({role:M.role,content:Cx(M)}));i(M=>[...M,{role:"user",parts:[{kind:"text",text:E}],ts:k},{role:"assistant",parts:[],ts:k,pending:!0}]),d(""),p(!0);const N=new AbortController;x.current=N;let O=!1;const A=M=>{if(M?.type==="error"){O=!0,s.error(M.error||"error"),i(B=>{const U=[...B],I=U[U.length-1];return I?.role==="assistant"&&I.pending&&U.pop(),U});return}w(B=>Ex(B,M))};try{await cS.stream(0,{prompt:E,previousMessages:R,model:m||void 0,channel:"web_sidebar"},A,N.signal),w(M=>({...M,pending:!1}))}catch(M){N.signal.aborted?w(B=>({...B,pending:!1,parts:[...B.parts,{kind:"text",text:C("project.chat.stopped_marker")}]})):O||(s.error(M.message),i(B=>{const U=[...B],I=U[U.length-1];return I?.role==="assistant"&&I.pending&&U.pop(),U}))}finally{x.current===N&&(x.current=null),p(!1)}},j=async E=>{try{await navigator.clipboard.writeText(E),s.info(C("project.chat.copied"))}catch{}};return o.jsx(XL,{open:e,onOpenChange:n,children:o.jsxs(ZL,{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(JL,{className:"pr-12",children:[o.jsxs(WL,{className:"flex items-center gap-2",children:[o.jsx(vn,{size:18})," ",C("roby.title"),o.jsx("span",{className:"text-xs font-normal text-muted-fg",children:C("roby.badge")})]}),o.jsx(e8,{children:C("roby.desc")})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:r.length===0?o.jsx("p",{className:"mt-6 text-center text-sm text-muted-fg",children:C("roby.empty")}):o.jsx(kx,{msgs:r,onCopy:j})}),o.jsx(i2,{msgs:r}),o.jsxs("div",{className:"border-t border-border p-3",children:[o.jsx(wx,{value:c,onValueChange:d,onSubmit:()=>void _(),onStop:S,busy:f,placeholder:C("roby.placeholder"),footer:o.jsx(Sx,{value:m,onChange:h,disabled:f})}),o.jsx("div",{className:"mt-1.5 flex justify-end",children:o.jsxs(nl,{size:"xs",variant:"ghost",onClick:y,disabled:f||r.length===0,children:[o.jsx(Nn,{className:"size-3"})," ",C("roby.new_chat")]})})]})]})})}function a8(){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 s8(){const[e,n]=v.useState({status:"loading"}),[s,r]=v.useState(0),i=v.useCallback(()=>{n({status:"loading"}),r(c=>c+1)},[]);return v.useEffect(()=>{let c=!1;return(async()=>{try{const h=await fetch("/health");if(!h.ok)throw new Error(`HTTP ${h.status}`)}catch(h){c||n({status:"error",reason:String(h)});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 h=await tl.confirm({pairing_id:p,label:a8(),kind:"web"});Hr(h.token);try{localStorage.setItem(Cn.token,h.token)}catch{}c||n({status:"ok"});return}catch{}}const m=f.get("token");if(m){Hr(m);try{localStorage.setItem(Cn.token,m)}catch{}history.replaceState(null,"",window.location.pathname+window.location.search)}else try{const h=localStorage.getItem(Cn.token);h&&Hr(h)}catch{}try{const h=await fetch("/admin/web-token");if(h.ok){const x=await h.json();if(x?.token){Hr(x.token);try{localStorage.setItem(Cn.token,x.token)}catch{}}}}catch{}if(!sx()){c||n({status:"unpaired"});return}try{await ge.get("/projects"),c||n({status:"ok"})}catch(h){if(h instanceof rc&&(h.status===401||h.status===403)){Hr(null);try{localStorage.removeItem(Cn.token)}catch{}c||n({status:"unpaired"})}else c||n({status:"error",reason:String(h)})}})(),()=>{c=!0}},[s]),{...e,reload:i}}function r8(){const e=s8();return e.status==="loading"?o.jsx(B_,{text:C("daemon.connecting")}):e.status==="error"?o.jsx(B_,{text:C("daemon.unreachable"),sub:`${C("daemon.unreachable_hint")}
|
|
565
|
-
|
|
566
|
-
${e.reason}`}):e.status==="unpaired"?o.jsx(GL,{onPaired:e.reload}):o.jsx(P4,{children:o.jsx(SM,{delay:300,children:o.jsx(o8,{})})})}function o8(){const e=Ua(),n=ea(),[s,r]=ij(),{theme:i,toggle:c}=_h(),d=s.get("action")==="add-project",[f,p]=v.useState(!1),m=()=>{const h=new URLSearchParams(s);h.delete("action"),r(h,{replace:!0})};return o.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground","data-testid":"app-shell",children:[o.jsx(k5,{onSelect:h=>e(h),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(l8,{onToggleTheme:c,isDark:i==="dark",pathname:n.pathname}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:o.jsxs(aj,{children:[o.jsx(qt,{path:"/",element:o.jsx(H4,{})}),o.jsx(qt,{path:"/settings/*",element:o.jsx(eL,{})}),o.jsx(qt,{path:"/m/voice/*",element:o.jsx(uL,{})}),o.jsx(qt,{path:"/m/desktop/*",element:o.jsx(pL,{})}),o.jsx(qt,{path:"/m/deck/*",element:o.jsx(EL,{})}),o.jsx(qt,{path:"/m/code/*",element:o.jsx(VL,{})}),o.jsx(qt,{path:"/p/:pid/*",element:o.jsx(l6,{})}),o.jsx(qt,{path:"*",element:o.jsx(u8,{})})]})})]}),o.jsx($L,{open:d,onClose:m}),o.jsx(n8,{open:f,onOpenChange:p})]})}function l8({onToggleTheme:e,isDark:n,pathname:s}){const{projects:r}=oc(),i=s.split("/").filter(Boolean),c=i[0]==="p"?r.find(x=>String(x.id)===i[1]):void 0,d=i[0]==="settings"?i8(i[1]):i[0]==="p"?c8(i[2]):"",f=i[0]==="p"&&i[1]==="0",p=c?.name||c?.path?.split("/").pop()||C("nav.project"),m=s==="/"?C("topbar.breadcrumb_root"):i[0]==="settings"?[C("topbar.breadcrumb_root"),C("nav.settings"),d].filter(Boolean).join(" › "):i[0]==="p"?f?[C("topbar.breadcrumb_root"),C("topbar.breadcrumb_base"),d].filter(Boolean).join(" › "):[C("topbar.breadcrumb_root"),C("topbar.breadcrumb_projects"),p,d].filter(Boolean).join(" › "):C("topbar.breadcrumb_root"),h=s==="/"?"":i[0]==="settings"?C("settings.subtitle"):i[0]==="p"?f?C("base.subtitle"):c?`${fS(c.kind)} · ${c.path}`:"":"";return o.jsxs("header",{className:"flex h-11 shrink-0 items-center justify-between gap-4 px-4",children:[o.jsxs("span",{className:"min-w-0 truncate text-xs tracking-wide text-muted-fg",children:[m,h&&o.jsxs("span",{className:"text-muted-fg/60",children:[" · ",h]})]}),o.jsx("button",{type:"button",onClick:e,title:C(n?"topbar.light":"topbar.dark"),className:"rounded-md p-1.5 text-muted-fg hover:bg-accent hover:text-accent-fg",children:n?o.jsx(pR,{size:16}):o.jsx(oR,{size:16})})]})}function i8(e){switch(e){case"super-agent":return C("settings.tabs.super_agent");case"engines":return C("settings.tabs.engines");case"telegram":return C("settings.tabs.telegram");case"devices":return C("settings.tabs.devices");case"appearance":return C("settings.appearance");case"config":case"advanced":return C("settings.tabs.advanced");case"identity":default:return e||""}}function c8(e){switch(e){case"chat":return C("project.nav.chat");case"threads":return C("project.nav.threads");case"telegram":return C("project.nav.telegram");case"agents":return C("project.nav.agents");case"routines":return C("project.nav.routines");case"tasks":return C("project.nav.tasks");case"mcps":return C("project.nav.mcps");case"config":return C("project.nav.config");case"workspaces":return C("base.workspaces_title");case"models":return C("settings.tabs.engines");case"agent-defaults":return C("base.defaults_title");case"sessions":return C("base.sessions_title");case"logs":return C("project.nav.logs");case"memories":return C("project.nav.memories");default:return""}}function B_({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:` ▄███████▄
|
|
567
|
-
█ ██ ██ █
|
|
568
|
-
█ ◔ ◔ █
|
|
569
|
-
█ ╰~╯ █
|
|
570
|
-
▀███████▀`}),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 u8(){return o.jsxs("div",{className:"p-8",children:[o.jsx("h1",{className:"text-2xl",children:C("not_found.title")}),o.jsx("p",{className:"text-muted-fg",children:C("not_found.message")})]})}YE.createRoot(document.getElementById("root")).render(o.jsx(Qi.StrictMode,{children:o.jsx(pN,{children:o.jsx(vR,{children:o.jsx(r8,{})})})}));
|
|
571
|
-
//# sourceMappingURL=index-63P_ji1a.js.map
|