maestro-flow 0.3.7 → 0.3.9
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/.claude/commands/learn-decompose.md +3 -3
- package/.claude/commands/learn-follow.md +5 -5
- package/.claude/commands/learn-investigate.md +3 -3
- package/.claude/commands/learn-retro.md +303 -0
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +123 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +137 -96
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-learn.md +74 -298
- package/.claude/commands/maestro-merge.md +77 -0
- package/.claude/commands/maestro-milestone-audit.md +72 -60
- package/.claude/commands/maestro-milestone-complete.md +67 -59
- package/.claude/commands/maestro-milestone-release.md +6 -6
- package/.claude/commands/maestro-plan.md +151 -130
- package/.claude/commands/maestro-quick.md +4 -4
- package/.claude/commands/maestro-roadmap.md +5 -5
- package/.claude/commands/maestro-spec-generate.md +5 -5
- package/.claude/commands/maestro-ui-design.md +3 -3
- package/.claude/commands/maestro-verify.md +106 -87
- package/.claude/commands/maestro.md +10 -4
- package/.claude/commands/manage-codebase-rebuild.md +4 -4
- package/.claude/commands/manage-codebase-refresh.md +1 -1
- package/.claude/commands/manage-harvest.md +5 -5
- package/.claude/commands/manage-issue-discover.md +1 -1
- package/.claude/commands/manage-issue-execute.md +6 -6
- package/.claude/commands/manage-issue.md +6 -6
- package/.claude/commands/manage-learn.md +23 -17
- package/.claude/commands/manage-memory-capture.md +15 -17
- package/.claude/commands/manage-memory.md +3 -3
- package/.claude/commands/manage-status.md +24 -24
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +4 -4
- package/.claude/commands/quality-integration-test.md +4 -4
- package/.claude/commands/quality-refactor.md +3 -3
- package/.claude/commands/quality-retrospective.md +7 -7
- package/.claude/commands/quality-review.md +4 -4
- package/.claude/commands/quality-sync.md +3 -3
- package/.claude/commands/quality-test-gen.md +4 -4
- package/.claude/commands/quality-test.md +9 -9
- package/.claude/commands/spec-add.md +2 -2
- package/.claude/commands/spec-load.md +8 -3
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +30 -5
- package/.codex/skills/maestro-analyze/SKILL.md +52 -14
- package/.codex/skills/maestro-execute/SKILL.md +27 -26
- package/.codex/skills/maestro-milestone-audit/SKILL.md +103 -209
- package/.codex/skills/maestro-milestone-complete/SKILL.md +149 -158
- package/.codex/skills/maestro-plan/SKILL.md +47 -17
- package/.codex/skills/maestro-roadmap/SKILL.md +3 -2
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +2 -2
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +1 -1
- package/README.md +115 -227
- package/README.zh-CN.md +169 -187
- package/bin/maestro-mcp.js +1 -1
- package/chains/_intent-map.json +21 -9
- package/chains/_router.json +30 -77
- package/chains/brainstorm-driven.json +17 -6
- package/chains/full-lifecycle.json +22 -23
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- package/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-A9yzYtpj.js → ArtifactsPage-DZNCi6tn.js} +12 -7
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +49 -0
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +22 -0
- package/dashboard/dist/assets/CollabPage-B4NAHXS2.js +1 -0
- package/dashboard/dist/assets/ExecutionPanel-CFt4LJyq.js +1 -0
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-CCXHaut3.js → MarkdownRenderer-X4af_WNb.js} +1 -1
- package/dashboard/dist/assets/McpPage-BKfCVIyU.js +21 -0
- package/dashboard/dist/assets/OutputPanel-BlBQFJSW.js +1 -0
- package/dashboard/dist/assets/ProblemsPanel-De3DLvoI.js +1 -0
- package/dashboard/dist/assets/{RequirementBoardPage-CEOvppGn.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-DpnbTEqY.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-CYqOfFkB.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-B2sZwkq8.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-CkZdCAVZ.js → TeamsPage-DsuM6OwC.js} +2 -2
- package/dashboard/dist/assets/TreeBrowser-Q12qobZs.js +6 -0
- package/dashboard/dist/assets/WorkflowPage-D_Fzdy3_.js +6 -0
- package/dashboard/dist/assets/{arrow-left-6fktHyjN.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-Cbxq2l1-.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Yts3bi8p.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-4Ci4Xolf.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-B25g9BTL.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-DzO2BlL7.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-BA5_XqeV.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-zxwuybO8.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-DV4oeCfU.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-CXCyQw8M.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-Bvjj8Vn9.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-BvScJmJM.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-Dj4i9N75.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-DwlFabsT.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-D7UzECt6.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-B9XRqHD9.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-BQbBTIYl.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-Clb1Lyd_.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BqxCXid2.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-6rN9B-EQ.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-DxUhG-gk.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js +5 -4
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +8 -4
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +20 -10
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js +3 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +4 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js +20 -7
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/index.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/git.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js +79 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js +14 -14
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js +7 -5
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js +43 -0
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +186 -25
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js +24 -2
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +4 -7
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js +5 -5
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +7 -1
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/package.json +59 -59
- package/dist/src/cli.js +3 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/{team.d.ts → collab.d.ts} +2 -2
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +391 -24
- package/dist/src/commands/collab.js.map +1 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +7 -1
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/msg.d.ts.map +1 -1
- package/dist/src/commands/msg.js +4 -3
- package/dist/src/commands/msg.js.map +1 -1
- package/dist/src/hooks/team-monitor.d.ts.map +1 -1
- package/dist/src/hooks/team-monitor.js +16 -0
- package/dist/src/hooks/team-monitor.js.map +1 -1
- package/dist/src/tools/collab-adapter.d.ts +85 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +320 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- package/dist/src/tools/namespace-guard.d.ts +2 -0
- package/dist/src/tools/namespace-guard.d.ts.map +1 -1
- package/dist/src/tools/namespace-guard.js +12 -0
- package/dist/src/tools/namespace-guard.js.map +1 -1
- package/dist/src/tools/phase-gate-evaluator.d.ts +45 -0
- package/dist/src/tools/phase-gate-evaluator.d.ts.map +1 -0
- package/dist/src/tools/phase-gate-evaluator.js +42 -0
- package/dist/src/tools/phase-gate-evaluator.js.map +1 -0
- package/dist/src/tools/team-members.d.ts +18 -0
- package/dist/src/tools/team-members.d.ts.map +1 -1
- package/dist/src/tools/team-members.js +50 -0
- package/dist/src/tools/team-members.js.map +1 -1
- package/dist/src/tools/team-tasks.d.ts +120 -0
- package/dist/src/tools/team-tasks.d.ts.map +1 -0
- package/dist/src/tools/team-tasks.js +365 -0
- package/dist/src/tools/team-tasks.js.map +1 -0
- package/dist/src/tools/transition-recorder.d.ts +3 -0
- package/dist/src/tools/transition-recorder.d.ts.map +1 -1
- package/dist/src/tools/transition-recorder.js +52 -1
- package/dist/src/tools/transition-recorder.js.map +1 -1
- package/dist/src/utils/get-version.d.ts.map +1 -1
- package/dist/src/utils/get-version.js +15 -4
- package/dist/src/utils/get-version.js.map +1 -1
- package/package.json +1 -1
- package/templates/config.json +7 -0
- package/templates/worktree-scope.json +10 -0
- package/templates/worktrees.json +27 -0
- package/workflows/analyze.md +86 -36
- package/workflows/brainstorm.md +17 -37
- package/workflows/delegate-usage.md +39 -41
- package/workflows/execute.md +247 -61
- package/workflows/fork.md +309 -0
- package/workflows/init.md +11 -2
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.codex.md +1 -1
- package/workflows/maestro-coordinate.md +24 -17
- package/workflows/maestro.md +54 -37
- package/workflows/memory.md +2 -1
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +131 -19
- package/workflows/retrospective.md +5 -5
- package/workflows/roadmap.md +12 -4
- package/workflows/spec-generate.md +9 -0
- package/workflows/status.md +76 -27
- package/workflows/ui-design.md +14 -12
- package/workflows/verify.md +44 -8
- package/.claude/commands/learn-retro-decision.md +0 -198
- package/.claude/commands/learn-retro-git.md +0 -160
- package/.claude/commands/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- package/.codex/skills/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-PuCvZZ3y.js +0 -67
- package/dashboard/dist/assets/ChatPage-v19GURYH.js +0 -8
- package/dashboard/dist/assets/CollabPage-I5k_mCbG.js +0 -1
- package/dashboard/dist/assets/KanbanPage-PDDBv5-9.js +0 -16
- package/dashboard/dist/assets/McpPage-CiqXpCHg.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-0VIMWclo.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-Csm23wUS.js +0 -6
- package/dashboard/dist/assets/git-branch-DL8p9kVC.js +0 -6
- package/dashboard/dist/assets/index-11DuhKhc.js +0 -231
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/wrench-BScEJFqC.js +0 -11
- package/dist/src/commands/team.d.ts.map +0 -1
- package/dist/src/commands/team.js.map +0 -1
- package/workflows/phase-add.md +0 -252
- package/workflows/phase-transition.md +0 -399
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{E as B,j as s,r as R,x as gn,d as Ae,y as vn,k as Pe,w as Ot,s as yt,p as bn,i as Be,c as yn,R as wn,P as Cn,O as kn,f as Tn,T as In,h as co,z as uo,D as Sn}from"./index-DWG-WrzT.js";import{Z as Bo}from"./zap-4uwlzVm0.js";import{M as jn}from"./MarkdownRenderer-X4af_WNb.js";import{C as $t}from"./chevron-right-Csu22t58.js";import{T as Nn}from"./terminal-BB3Xfuv5.js";import{C as Rn}from"./circle-alert-c3tH1P4z.js";const It=0,Oe=1,qe=2,Lo=4;function po(e){return()=>e}function zn(e){e()}function Ao(e,t){return o=>e(t(o))}function mo(e,t){return()=>e(t)}function En(e,t){return o=>e(t,o)}function Gt(e){return e!==void 0}function Hn(...e){return()=>{e.map(zn)}}function Ze(){}function St(e,t){return t(e),e}function Mn(e,t){return t(e)}function oe(...e){return e}function Q(e,t){return e(Oe,t)}function $(e,t){e(It,t)}function Ut(e){e(qe)}function se(e){return e(Lo)}function L(e,t){return Q(e,En(t,It))}function Se(e,t){const o=e(Oe,n=>{o(),t(n)});return o}function fo(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout(()=>{n(t)},e)}}function Oo(e,t){return e===t}function te(e=Oo){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function W(e){return t=>o=>{e(o)&&t(o)}}function z(e){return t=>Ao(t,e)}function Re(e){return t=>()=>{t(e)}}function k(e,...t){const o=Bn(...t);return((n,r)=>{switch(n){case qe:Ut(e);return;case Oe:return Q(e,o(r))}})}function ze(e,t){return o=>n=>{o(t=e(t,n))}}function Ve(e){return t=>o=>{e>0?e--:t(o)}}function He(e){let t=null,o;return n=>r=>{t=r,!o&&(o=setTimeout(()=>{o=void 0,n(t)},e))}}function G(...e){const t=new Array(e.length);let o=0,n=null;const r=2**e.length-1;return e.forEach((l,i)=>{const c=2**i;Q(l,a=>{const u=o;o|=c,t[i]=a,u!==r&&o===r&&n&&(n(),n=null)})}),l=>i=>{const c=()=>{l([i].concat(t))};o===r?c():n=c}}function Bn(...e){return t=>e.reduceRight(Mn,t)}function Ln(e){let t,o;const n=()=>t==null?void 0:t();return function(r,l){switch(r){case Oe:return l?o===l?void 0:(n(),o=l,t=Q(e,l),t):(n(),Ze);case qe:n(),o=null;return}}}function I(e){let t=e;const o=K();return((n,r)=>{switch(n){case It:t=r;break;case Oe:{r(t);break}case Lo:return t}return o(n,r)})}function ve(e,t){return St(I(t),o=>L(e,o))}function K(){const e=[];return((t,o)=>{switch(t){case It:e.slice().forEach(n=>{n(o)});return;case qe:e.splice(0,e.length);return;case Oe:return e.push(o),()=>{const n=e.indexOf(o);n>-1&&e.splice(n,1)}}})}function ke(e){return St(K(),t=>L(e,t))}function Y(e,t=[],{singleton:o}={singleton:!0}){return{constructor:e,dependencies:t,id:An(),singleton:o}}const An=()=>Symbol();function On(e){const t=new Map,o=({constructor:n,dependencies:r,id:l,singleton:i})=>{if(i&&t.has(l))return t.get(l);const c=n(r.map(a=>o(a)));return i&&t.set(l,c),c};return o(e)}function ue(...e){const t=K(),o=new Array(e.length);let n=0;const r=2**e.length-1;return e.forEach((l,i)=>{const c=2**i;Q(l,a=>{o[i]=a,n|=c,n===r&&$(t,o)})}),function(l,i){switch(l){case qe:{Ut(t);return}case Oe:return n===r&&i(o),Q(t,i)}}}function _(e,t=Oo){return k(e,te(t))}function Dt(...e){return function(t,o){switch(t){case qe:return;case Oe:return Hn(...e.map(n=>Q(n,o)))}}}const fe={DEBUG:0,INFO:1,WARN:2,ERROR:3},Dn={[fe.DEBUG]:"debug",[fe.ERROR]:"error",[fe.INFO]:"log",[fe.WARN]:"warn"},_n=()=>typeof globalThis>"u"?window:globalThis,De=Y(()=>{const e=I(fe.ERROR);return{log:I((t,o,n=fe.INFO)=>{const r=_n().VIRTUOSO_LOG_LEVEL??se(e);n>=r&&console[Dn[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)}),logLevel:e}},[],{singleton:!0});function $e(e,t,o){return Kt(e,t,o).callbackRef}function Kt(e,t,o){const n=B.useRef(null);let r=i=>{};const l=B.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const c=()=>{const a=i[0].target;a.offsetParent!==null&&e(a)};o?c():requestAnimationFrame(c)}):null,[e,o]);return r=i=>{i&&t?(l==null||l.observe(i),n.current=i):(n.current&&(l==null||l.unobserve(n.current)),n.current=null)},{callbackRef:r,ref:n}}function Wn(e,t,o,n,r,l,i,c,a){const u=B.useCallback(f=>{const v=Fn(f.children,t,c?"offsetWidth":"offsetHeight",r);let x=f.parentElement;for(;x.dataset.virtuosoScroller===void 0;)x=x.parentElement;const h=x.lastElementChild.dataset.viewportType==="window";let w;h&&(w=x.ownerDocument.defaultView);const b=i?c?i.scrollLeft:i.scrollTop:h?c?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:c?x.scrollLeft:x.scrollTop,g=i?c?i.scrollWidth:i.scrollHeight:h?c?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:c?x.scrollWidth:x.scrollHeight,m=i?c?i.offsetWidth:i.offsetHeight:h?c?w.innerWidth:w.innerHeight:c?x.offsetWidth:x.offsetHeight;n({scrollHeight:g,scrollTop:Math.max(b,0),viewportHeight:m}),l==null||l(c?ho("column-gap",getComputedStyle(f).columnGap,r):ho("row-gap",getComputedStyle(f).rowGap,r)),v!==null&&e(v)},[e,t,r,l,i,n,c]);return Kt(u,o,a)}function Fn(e,t,o,n){const r=e.length;if(r===0)return null;const l=[];for(let i=0;i<r;i++){const c=e.item(i);if(c.dataset.index===void 0)continue;const a=parseInt(c.dataset.index),u=parseFloat(c.dataset.knownSize),f=t(c,o);if(f===0&&n("Zero-sized element, this should not happen",{child:c},fe.ERROR),f===u)continue;const v=l[l.length-1];l.length===0||v.size!==f||v.endIndex!==a-1?l.push({endIndex:a,size:f,startIndex:a}):l[l.length-1].endIndex++}return l}function ho(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,fe.WARN),t==="normal"?0:parseInt(t??"0",10)}function Do(e,t,o){const n=B.useRef(null),r=B.useCallback(a=>{if(!(a!=null&&a.offsetParent))return;const u=a.getBoundingClientRect(),f=u.width;let v,x;if(t){const h=t.getBoundingClientRect(),w=u.top-h.top;x=h.height-Math.max(0,w),v=w+t.scrollTop}else{const h=i.current.ownerDocument.defaultView;x=h.innerHeight-Math.max(0,u.top),v=u.top+h.scrollY}n.current={listHeight:u.height,offsetTop:v,visibleHeight:x,visibleWidth:f},e(n.current)},[e,t]),{callbackRef:l,ref:i}=Kt(r,!0,o),c=B.useCallback(()=>{r(i.current)},[r,i]);return B.useEffect(()=>{var u;if(t){t.addEventListener("scroll",c);const f=new ResizeObserver(()=>{requestAnimationFrame(c)});return f.observe(t),()=>{t.removeEventListener("scroll",c),f.unobserve(t)}}const a=(u=i.current)==null?void 0:u.ownerDocument.defaultView;return a==null||a.addEventListener("scroll",c),a==null||a.addEventListener("resize",c),()=>{a==null||a.removeEventListener("scroll",c),a==null||a.removeEventListener("resize",c)}},[c,t,i]),l}const ye=Y(()=>{const e=K(),t=K(),o=I(0),n=K(),r=I(0),l=K(),i=K(),c=I(0),a=I(0),u=I(0),f=I(0),v=K(),x=K(),h=I(!1),w=I(!1),b=I(!1);return L(k(e,z(({scrollTop:g})=>g)),t),L(k(e,z(({scrollHeight:g})=>g)),i),L(t,r),{deviation:o,fixedFooterHeight:u,fixedHeaderHeight:a,footerHeight:f,headerHeight:c,horizontalDirection:w,scrollBy:x,scrollContainerState:e,scrollHeight:i,scrollingInProgress:h,scrollTo:v,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:n,statefulScrollTop:r,viewportHeight:l}},[],{singleton:!0}),rt={lvl:0};function _o(e,t){const o=e.length;if(o===0)return[];let{index:n,value:r}=t(e[0]);const l=[];for(let i=1;i<o;i++){const{index:c,value:a}=t(e[i]);l.push({end:c-1,start:n,value:r}),n=c,r=a}return l.push({end:1/0,start:n,value:r}),l}function q(e){return e===rt}function st(e,t){if(!q(e))return t===e.k?e.v:t<e.k?st(e.l,t):st(e.r,t)}function je(e,t,o="k"){if(q(e))return[-1/0,void 0];if(Number(e[o])===t)return[e.k,e.v];if(Number(e[o])<t){const n=je(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return je(e.l,t,o)}function Ce(e,t,o){return q(e)?Po(t,o,1):t===e.k?me(e,{k:t,v:o}):t<e.k?xo(me(e,{l:Ce(e.l,t,o)})):xo(me(e,{r:Ce(e.r,t,o)}))}function Ye(){return rt}function Xe(e,t,o){if(q(e))return[];const n=je(e,t)[0];return Pn(Wt(e,n,o))}function _t(e,t){if(q(e))return rt;const{k:o,l:n,r}=e;if(t===o){if(q(n))return r;if(q(r))return n;const[l,i]=Fo(n);return wt(me(e,{k:l,l:Wo(n),v:i}))}return t<o?wt(me(e,{l:_t(n,t)})):wt(me(e,{r:_t(r,t)}))}function Fe(e){return q(e)?[]:[...Fe(e.l),{k:e.k,v:e.v},...Fe(e.r)]}function Wt(e,t,o){if(q(e))return[];const{k:n,l:r,r:l,v:i}=e;let c=[];return n>t&&(c=c.concat(Wt(r,t,o))),n>=t&&n<=o&&c.push({k:n,v:i}),n<=o&&(c=c.concat(Wt(l,t,o))),c}function wt(e){const{l:t,lvl:o,r:n}=e;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(zt(t))return Vo(me(e,{lvl:o-1}));if(!q(t)&&!q(t.r))return me(t.r,{l:me(t,{r:t.r.l}),lvl:o,r:me(e,{l:t.r.r,lvl:o-1})});throw new Error("Unexpected empty nodes")}if(zt(e))return Ft(me(e,{lvl:o-1}));if(!q(n)&&!q(n.l)){const r=n.l,l=zt(r)?n.lvl-1:n.lvl;return me(r,{l:me(e,{lvl:o-1,r:r.l}),lvl:r.lvl+1,r:Ft(me(n,{l:r.r,lvl:l}))})}throw new Error("Unexpected empty nodes")}function me(e,t){return Po(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Wo(e){return q(e.r)?e.l:wt(me(e,{r:Wo(e.r)}))}function zt(e){return q(e)||e.lvl>e.r.lvl}function Fo(e){return q(e.r)?[e.k,e.v]:Fo(e.r)}function Po(e,t,o,n=rt,r=rt){return{k:e,l:n,lvl:o,r,v:t}}function xo(e){return Ft(Vo(e))}function Vo(e){const{l:t}=e;return!q(t)&&t.lvl===e.lvl?me(t,{r:me(e,{l:t.r})}):e}function Ft(e){const{lvl:t,r:o}=e;return!q(o)&&!q(o.r)&&o.lvl===t&&o.r.lvl===t?me(o,{l:me(e,{r:o.l}),lvl:t+1}):e}function Pn(e){return _o(e,({k:t,v:o})=>({index:t,value:o}))}function $o(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function lt(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Yt=Y(()=>({recalcInProgress:I(!1)}),[],{singleton:!0});function Go(e,t,o){return e[kt(e,t,o)]}function kt(e,t,o,n=0){let r=e.length-1;for(;n<=r;){const l=Math.floor((n+r)/2),i=e[l],c=o(i,t);if(c===0)return l;if(c===-1){if(r-n<2)return l-1;r=l-1}else{if(r===n)return l;n=l+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Vn(e,t,o,n){const r=kt(e,t,n),l=kt(e,o,n,r);return e.slice(r,l+1)}function Le(e,t){return Math.round(e.getBoundingClientRect()[t])}function jt(e){return!q(e.groupOffsetTree)}function Xt({index:e},t){return t===e?0:t<e?-1:1}function $n(){return{groupIndices:[],groupOffsetTree:Ye(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ye()}}function Gn(e,t){let o=q(e)?0:1/0;for(const n of t){const{endIndex:r,size:l,startIndex:i}=n;if(o=Math.min(o,i),q(e)){e=Ce(e,0,l);continue}const c=Xe(e,i-1,r+1);if(c.some(Zn(n)))continue;let a=!1,u=!1;for(const{end:f,start:v,value:x}of c)a?(r>=v||l===x)&&(e=_t(e,v)):(u=x!==l,a=!0),f>r&&r>=v&&x!==l&&(e=Ce(e,r+1,x));u&&(e=Ce(e,i,l))}return[e,o]}function Un(e){return typeof e.groupIndex<"u"}function Kn({offset:e},t){return t===e?0:t<e?-1:1}function it(e,t,o){if(t.length===0)return 0;const{index:n,offset:r,size:l}=Go(t,e,Xt),i=e-n,c=l*i+(i-1)*o+r;return c>0?c+o:c}function Uo(e,t){if(!jt(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function Ko(e,t,o){if(Un(e))return t.groupIndices[e.groupIndex]+1;const n=e.index==="LAST"?o:e.index;let r=Uo(n,t);return r=Math.max(0,r,Math.min(o,r)),r}function Yn(e,t,o,n=0){return n>0&&(t=Math.max(t,Go(e,n,Xt).offset)),_o(Vn(e,t,o,Kn),qn)}function Xn(e,[t,o,n,r]){t.length>0&&n("received item sizes",t,fe.DEBUG);const l=e.sizeTree;let i=l,c=0;if(o.length>0&&q(l)&&t.length===2){const x=t[0].size,h=t[1].size;i=o.reduce((w,b)=>Ce(Ce(w,b,x),b+1,h),i)}else[i,c]=Gn(i,t);if(i===l)return e;const{lastIndex:a,lastOffset:u,lastSize:f,offsetTree:v}=Pt(e.offsetTree,c,i,r);return{groupIndices:o,groupOffsetTree:o.reduce((x,h)=>Ce(x,h,it(h,v,r)),Ye()),lastIndex:a,lastOffset:u,lastSize:f,offsetTree:v,sizeTree:i}}function Qn(e){return Fe(e).map(({k:t,v:o},n,r)=>{const l=r[n+1];return{endIndex:l!==void 0?l.k-1:1/0,size:o,startIndex:t}})}function go(e,t){let o=0,n=0;for(;o<e;)o+=t[n+1]-t[n]-1,n++;return n-(o===e?0:1)}function Pt(e,t,o,n){let r=e,l=0,i=0,c=0,a=0;if(t!==0){a=kt(r,t-1,Xt),c=r[a].offset;const u=je(o,t-1);l=u[0],i=u[1],r.length&&r[a].size===je(o,t)[1]&&(a-=1),r=r.slice(0,a+1)}else r=[];for(const{start:u,value:f}of Xe(o,t,1/0)){const v=u-l,x=v*i+c+v*n;r.push({index:u,offset:x,size:f}),l=u,c=x,i=f}return{lastIndex:l,lastOffset:c,lastSize:i,offsetTree:r}}function qn(e){return{index:e.index,value:e}}function Zn(e){const{endIndex:t,size:o,startIndex:n}=e;return r=>r.start===n&&(r.end===t||r.end===1/0)&&r.value===o}const Jn={offsetHeight:"height",offsetWidth:"width"},Ee=Y(([{log:e},{recalcInProgress:t}])=>{const o=K(),n=K(),r=ve(n,0),l=K(),i=K(),c=I(0),a=I([]),u=I(void 0),f=I(void 0),v=I(void 0),x=I(void 0),h=I((d,y)=>Le(d,Jn[y])),w=I(void 0),b=I(0),g=$n(),m=ve(k(o,G(a,e,b),ze(Xn,g),te()),g),p=ve(k(a,te(),ze((d,y)=>({current:y,prev:d.current}),{current:[],prev:[]}),z(({prev:d})=>d)),[]);L(k(a,W(d=>d.length>0),G(m,b),z(([d,y,S])=>{const M=d.reduce((H,P,V)=>Ce(H,P,it(P,y.offsetTree,S)||V),Ye());return{...y,groupIndices:d,groupOffsetTree:M}})),m),L(k(n,G(m),W(([d,{lastIndex:y}])=>d<y),z(([d,{lastIndex:y,lastSize:S}])=>[{endIndex:y,size:S,startIndex:d}])),o),L(u,f);const T=ve(k(u,z(d=>d===void 0)),!0);L(k(f,W(d=>d!==void 0&&q(se(m).sizeTree)),z(d=>{const y=se(v),S=se(a).length>0;return y!==void 0&&y!==0?S?[{endIndex:0,size:y,startIndex:0},{endIndex:1,size:d,startIndex:1}]:[]:[{endIndex:0,size:d,startIndex:0}]})),o),L(k(x,W(d=>d!==void 0&&d.length>0&&q(se(m).sizeTree)),z(d=>{const y=[];let S=d[0],M=0;for(let H=1;H<d.length;H++){const P=d[H];P!==S&&(y.push({endIndex:H-1,size:S,startIndex:M}),S=P,M=H)}return y.push({endIndex:d.length-1,size:S,startIndex:M}),y})),o),L(k(a,G(v,f),W(([,d,y])=>d!==void 0&&y!==void 0),z(([d,y,S])=>{const M=[];for(let H=0;H<d.length;H++){const P=d[H],V=d[H+1];M.push({startIndex:P,endIndex:P,size:y}),V!==void 0&&M.push({startIndex:P+1,endIndex:V-1,size:S})}return M})),o);const E=ke(k(o,G(m),ze(({sizes:d},[y,S])=>({changed:S!==d,sizes:S}),{changed:!1,sizes:g}),z(d=>d.changed)));Q(k(c,ze((d,y)=>({diff:d.prev-y,prev:y}),{diff:0,prev:0}),z(d=>d.diff)),d=>{const{groupIndices:y}=se(m);if(d>0)$(t,!0),$(l,d+go(d,y));else if(d<0){const S=se(p);S.length>0&&(d-=go(-d,S)),$(i,d)}}),Q(k(c,G(e)),([d,y])=>{d<0&&y("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:c},fe.ERROR)});const j=ke(l);L(k(l,G(m),z(([d,y])=>{const S=y.groupIndices.length>0,M=[],H=y.lastSize;if(S){const P=st(y.sizeTree,0);let V=0,D=0;for(;V<d;){const C=y.groupIndices[D],A=y.groupIndices.length===D+1?1/0:y.groupIndices[D+1]-C-1;M.push({endIndex:C,size:P,startIndex:C}),M.push({endIndex:C+1+A-1,size:H,startIndex:C+1}),D++,V+=A+1}const U=Fe(y.sizeTree);return V!==d&&U.shift(),U.reduce((C,{k:A,v:J})=>{let he=C.ranges;return C.prevSize!==0&&(he=[...C.ranges,{endIndex:A+d-1,size:C.prevSize,startIndex:C.prevIndex}]),{prevIndex:A+d,prevSize:J,ranges:he}},{prevIndex:d,prevSize:0,ranges:M}).ranges}return Fe(y.sizeTree).reduce((P,{k:V,v:D})=>({prevIndex:V+d,prevSize:D,ranges:[...P.ranges,{endIndex:V+d-1,size:P.prevSize,startIndex:P.prevIndex}]}),{prevIndex:0,prevSize:H,ranges:[]}).ranges})),o);const O=ke(k(i,G(m,b),z(([d,{offsetTree:y},S])=>{const M=-d;return it(M,y,S)})));return L(k(i,G(m,b),z(([d,y,S])=>{if(y.groupIndices.length>0){if(q(y.sizeTree))return y;let H=Ye();const P=se(p);let V=0,D=0,U=0;for(;V<-d;){U=P[D];const C=P[D+1]-U-1;D++,V+=C+1}if(H=Fe(y.sizeTree).reduce((C,{k:A,v:J})=>Ce(C,Math.max(0,A+d),J),H),V!==-d){const C=st(y.sizeTree,U);H=Ce(H,0,C);const A=je(y.sizeTree,-d+1)[1];H=Ce(H,1,A)}return{...y,sizeTree:H,...Pt(y.offsetTree,0,H,S)}}const M=Fe(y.sizeTree).reduce((H,{k:P,v:V})=>Ce(H,Math.max(0,P+d),V),Ye());return{...y,sizeTree:M,...Pt(y.offsetTree,0,M,S)}})),m),{beforeUnshiftWith:j,data:w,defaultItemSize:f,firstItemIndex:c,fixedItemSize:u,fixedGroupSize:v,gap:b,groupIndices:a,heightEstimates:x,itemSize:h,listRefresh:E,shiftWith:i,shiftWithOffset:O,sizeRanges:o,sizes:m,statefulTotalCount:r,totalCount:n,trackItemSizes:T,unshiftWith:l}},oe(De,Yt),{singleton:!0});function er(e){return e.reduce((t,o)=>(t.groupIndices.push(t.totalCount),t.totalCount+=o+1,t),{groupIndices:[],totalCount:0})}const Yo=Y(([{groupIndices:e,sizes:t,totalCount:o},{headerHeight:n,scrollTop:r}])=>{const l=K(),i=K(),c=ke(k(l,z(er)));return L(k(c,z(a=>a.totalCount)),o),L(k(c,z(a=>a.groupIndices)),e),L(k(ue(r,t,n),W(([a,u])=>jt(u)),z(([a,u,f])=>je(u.groupOffsetTree,Math.max(a-f,0),"v")[0]),te(),z(a=>[a])),i),{groupCounts:l,topItemsIndexes:i}},oe(Ee,ye)),_e=Y(([{log:e}])=>{const t=I(!1),o=ke(k(t,W(n=>n),te()));return Q(t,n=>{n&&se(e)("props updated",{},fe.DEBUG)}),{didMount:o,propsReady:t}},oe(De),{singleton:!0}),tr=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Xo(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!tr)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const dt=Y(([{gap:e,listRefresh:t,sizes:o,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:l,footerHeight:i,headerHeight:c,scrollingInProgress:a,scrollTo:u,smoothScrollTargetReached:f,viewportHeight:v},{log:x}])=>{const h=K(),w=K(),b=I(0);let g=null,m=null,p=null;function T(){g!==null&&(g(),g=null),p!==null&&(p(),p=null),m&&(clearTimeout(m),m=null),$(a,!1)}return L(k(h,G(o,v,n,b,c,i,x),G(e,l,r),z(([[E,j,O,d,y,S,M,H],P,V,D])=>{const U=Xo(E),{align:C,behavior:A,offset:J}=U,he=d-1,ie=Ko(U,j,he);let we=it(ie,j.offsetTree,P)+S;C==="end"?(we+=V+je(j.sizeTree,ie)[1]-O+D,ie===he&&(we+=M)):C==="center"?we+=(V+je(j.sizeTree,ie)[1]-O+D)/2:we-=y,J!==void 0&&J!==0&&(we+=J);const Me=xe=>{T(),xe?(H("retrying to scroll to",{location:E},fe.DEBUG),$(h,E)):($(w,!0),H("list did not change, scroll successful",{},fe.DEBUG))};if(T(),A==="smooth"){let xe=!1;p=Q(t,Ue=>{xe=xe||Ue}),g=Se(f,()=>{Me(xe)})}else g=Se(k(t,or(150)),Me);return m=setTimeout(()=>{T()},1200),$(a,!0),H("scrolling from index to",{behavior:A,index:ie,top:we},fe.DEBUG),{behavior:A,top:we}})),u),{scrollTargetReached:w,scrollToIndex:h,topListHeight:b}},oe(Ee,ye,De),{singleton:!0});function or(e){return t=>{const o=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(o))}}}function Qt(e,t){e===0?t():requestAnimationFrame(()=>{Qt(e-1,t)})}function qt(e,t){const o=t-1;return typeof e=="number"?e:e.index==="LAST"?o:e.index}const pt=Y(([{defaultItemSize:e,listRefresh:t,sizes:o},{scrollTop:n},{scrollTargetReached:r,scrollToIndex:l},{didMount:i}])=>{const c=I(!0),a=I(0),u=I(!0);return L(k(i,G(a),W(([f,v])=>v!==0),Re(!1)),c),L(k(i,G(a),W(([f,v])=>v!==0),Re(!1)),u),Q(k(ue(t,i),G(c,o,e,u),W(([[,f],v,{sizeTree:x},h,w])=>f&&(!q(x)||Gt(h))&&!v&&!w),G(a)),([,f])=>{Se(r,()=>{$(u,!0)}),Qt(4,()=>{Se(n,()=>{$(c,!0)}),$(l,f)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:a,scrolledToInitialItem:c}},oe(Ee,ye,dt,_e),{singleton:!0});function Qo(e,t){return Math.abs(e-t)<1.01}const at="up",ot="down",nr="none",rr={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},sr=0,mt=Y(([{footerHeight:e,headerHeight:t,scrollBy:o,scrollContainerState:n,scrollTop:r,viewportHeight:l}])=>{const i=I(!1),c=I(!0),a=K(),u=K(),f=I(4),v=I(sr),x=ve(k(Dt(k(_(r),Ve(1),Re(!0)),k(_(r),Ve(1),Re(!1),fo(100))),te()),!1),h=ve(k(Dt(k(o,Re(!0)),k(o,Re(!1),fo(200))),te()),!1);L(k(ue(_(r),_(v)),z(([p,T])=>p<=T),te()),c),L(k(c,He(50)),u);const w=ke(k(ue(n,_(l),_(t),_(e),_(f)),ze((p,[{scrollHeight:T,scrollTop:E},j,O,d,y])=>{const S=E+j-T>-y,M={scrollHeight:T,scrollTop:E,viewportHeight:j};if(S){let P,V;return E>p.state.scrollTop?(P="SCROLLED_DOWN",V=p.state.scrollTop-E):(P="SIZE_DECREASED",V=p.state.scrollTop-E||p.scrollTopDelta),{atBottom:!0,atBottomBecause:P,scrollTopDelta:V,state:M}}let H;return M.scrollHeight>p.state.scrollHeight?H="SIZE_INCREASED":j<p.state.viewportHeight?H="VIEWPORT_HEIGHT_DECREASING":E<p.state.scrollTop?H="SCROLLING_UPWARDS":H="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:H,state:M}},rr),te((p,T)=>p!==void 0&&p.atBottom===T.atBottom))),b=ve(k(n,ze((p,{scrollHeight:T,scrollTop:E,viewportHeight:j})=>{if(!Qo(p.scrollHeight,T)){const O=T-(E+j)<1;return p.scrollTop!==E&&O?{changed:!0,jump:p.scrollTop-E,scrollHeight:T,scrollTop:E}:{changed:!0,jump:0,scrollHeight:T,scrollTop:E}}return{changed:!1,jump:0,scrollHeight:T,scrollTop:E}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),W(p=>p.changed),z(p=>p.jump)),0);L(k(w,z(p=>p.atBottom)),i),L(k(i,He(50)),a);const g=I(ot);L(k(n,z(({scrollTop:p})=>p),te(),ze((p,T)=>se(h)?{direction:p.direction,prevScrollTop:T}:{direction:T<p.prevScrollTop?at:ot,prevScrollTop:T},{direction:ot,prevScrollTop:0}),z(p=>p.direction)),g),L(k(n,He(50),Re(nr)),g);const m=I(0);return L(k(x,W(p=>!p),Re(0)),m),L(k(r,He(100),G(x),W(([p,T])=>T),ze(([p,T],[E])=>[T,E],[0,0]),z(([p,T])=>T-p)),m),{atBottomState:w,atBottomStateChange:a,atBottomThreshold:f,atTopStateChange:u,atTopThreshold:v,isAtBottom:i,isAtTop:c,isScrolling:x,lastJumpDueToItemResize:b,scrollDirection:g,scrollVelocity:m}},oe(ye)),ct="top",ut="bottom",vo="none";function bo(e,t,o){return typeof e=="number"?o===at&&t===ct||o===ot&&t===ut?e:0:o===at?t===ct?e.main:e.reverse:t===ut?e.main:e.reverse}function yo(e,t){return typeof e=="number"?e:e[t]??0}const Zt=Y(([{deviation:e,fixedHeaderHeight:t,headerHeight:o,scrollTop:n,viewportHeight:r}])=>{const l=K(),i=I(0),c=I(0),a=I(0),u=ve(k(ue(_(n),_(r),_(o),_(l,lt),_(a),_(i),_(t),_(e),_(c)),z(([f,v,x,[h,w],b,g,m,p,T])=>{const E=f-p,j=g+m,O=Math.max(x-E,0);let d=vo;const y=yo(T,ct),S=yo(T,ut);return h-=p,h+=x+m,w+=x+m,w-=p,h>f+j-y&&(d=at),w<f-O+v+S&&(d=ot),d!==vo?[Math.max(E-x-bo(b,ct,d)-y,0),E-O-m+v+bo(b,ut,d)+S]:null}),W(f=>f!==null),te(lt)),[0,0]);return{increaseViewportBy:c,listBoundary:l,overscan:a,topListHeight:i,visibleRange:u}},oe(ye),{singleton:!0});function lr(e,t,o){if(jt(t)){const n=Uo(e,t);return[{index:je(t.groupOffsetTree,n)[0],offset:0,size:0},{data:o==null?void 0:o[0],index:n,offset:0,size:0}]}return[{data:o==null?void 0:o[0],index:e,offset:0,size:0}]}const Et={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ct(e,t,o,n,r,l){const{lastIndex:i,lastOffset:c,lastSize:a}=r;let u=0,f=0;if(e.length>0){u=e[0].offset;const b=e[e.length-1];f=b.offset+b.size}const v=o-i,x=c+v*a+(v-1)*n,h=u,w=x-f;return{bottom:f,firstItemIndex:l,items:wo(e,r,l),offsetBottom:w,offsetTop:u,top:h,topItems:wo(t,r,l),topListHeight:t.reduce((b,g)=>g.size+b,0),totalCount:o}}function qo(e,t,o,n,r,l){let i=0;if(o.groupIndices.length>0)for(const f of o.groupIndices){if(f-i>=e)break;i++}const c=e+i,a=qt(t,c),u=Array.from({length:c}).map((f,v)=>({data:l[v+a],index:v+a,offset:0,size:0}));return Ct(u,[],c,r,o,n)}function wo(e,t,o){if(e.length===0)return[];if(!jt(t))return e.map(u=>({...u,index:u.index+o,originalIndex:u.index}));const n=e[0].index,r=e[e.length-1].index,l=[],i=Xe(t.groupOffsetTree,n,r);let c,a=0;for(const u of e){(!c||c.end<u.index)&&(c=i.shift(),a=t.groupIndices.indexOf(c.start));let f;u.index===c.start?f={index:a,type:"group"}:f={groupIndex:a,index:u.index-(a+1)+o},l.push({...f,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return l}function Co(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const Ge=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n,totalCount:r},l,{listBoundary:i,topListHeight:c,visibleRange:a},{initialTopMostItemIndex:u,scrolledToInitialItem:f},{topListHeight:v},x,{didMount:h},{recalcInProgress:w}])=>{const b=I([]),g=I(0),m=K(),p=I(0);L(l.topItemsIndexes,b);const T=ve(k(ue(h,w,_(a,lt),_(r),_(n),_(u),f,_(b),_(t),_(o),_(p),e),W(([d,y,,S,,,,,,,,M])=>{const H=M!==void 0&&M.length!==S;return d&&!y&&!H}),z(([,,[d,y],S,M,H,P,V,D,U,C,A])=>{var X,de;const J=M,{offsetTree:he,sizeTree:ie}=J,we=se(g);if(S===0)return{...Et,totalCount:S};if(d===0&&y===0)return we===0?{...Et,totalCount:S}:qo(we,H,M,D,U,A||[]);if(q(ie))return we>0?null:Ct(lr(qt(H,S),J,A),[],S,U,J,D);const Me=[];if(V.length>0){const ee=V[0],ne=V[V.length-1];let pe=0;for(const ae of Xe(ie,ee,ne)){const Z=ae.value,le=Math.max(ae.start,ee),be=Math.min(ae.end,ne);for(let ce=le;ce<=be;ce++)Me.push({data:A==null?void 0:A[ce],index:ce,offset:pe,size:Z}),pe+=Z}}if(!P)return Ct([],Me,S,U,J,D);const xe=V.length>0?V[V.length-1]+1:0,Ue=Yn(he,d,y,xe);if(Ue.length===0)return null;const Je=S-1,Ne=St([],ee=>{for(const ne of Ue){const pe=ne.value;let ae=pe.offset,Z=ne.start;const le=pe.size;if(pe.offset<d){Z+=Math.floor((d-pe.offset+U)/(le+U));const ce=Z-ne.start;ae+=ce*le+ce*U}Z<xe&&(ae+=(xe-Z)*le,Z=xe);const be=Math.min(ne.end,Je);for(let ce=Z;ce<=be&&!(ae>=y);ce++)ee.push({data:A==null?void 0:A[ce],index:ce,offset:ae,size:le}),ae+=le+U}}),et=Co(C,ct),N=Co(C,ut);if(Ne.length>0&&(et>0||N>0)){const ee=Ne[0],ne=Ne[Ne.length-1];if(et>0&&ee.index>xe){const pe=Math.min(et,ee.index-xe),ae=[];let Z=ee.offset;for(let le=ee.index-1;le>=ee.index-pe;le--){const be=((X=Xe(ie,le,le)[0])==null?void 0:X.value)??ee.size;Z-=be+U,ae.unshift({data:A==null?void 0:A[le],index:le,offset:Z,size:be})}Ne.unshift(...ae)}if(N>0&&ne.index<Je){const pe=Math.min(N,Je-ne.index);let ae=ne.offset+ne.size+U;for(let Z=ne.index+1;Z<=ne.index+pe;Z++){const le=((de=Xe(ie,Z,Z)[0])==null?void 0:de.value)??ne.size;Ne.push({data:A==null?void 0:A[Z],index:Z,offset:ae,size:le}),ae+=le+U}}}return Ct(Ne,Me,S,U,J,D)}),W(d=>d!==null),te()),Et);L(k(e,W(Gt),z(d=>d==null?void 0:d.length)),r),L(k(T,z(d=>d.topListHeight)),v),L(v,c),L(k(T,z(d=>[d.top,d.bottom])),i),L(k(T,z(d=>d.items)),m);const E=ke(k(T,W(({items:d})=>d.length>0),G(r,e),W(([{items:d},y])=>d[d.length-1].originalIndex===y-1),z(([,d,y])=>[d-1,y]),te(lt),z(([d])=>d))),j=ke(k(T,He(200),W(({items:d,topItems:y})=>d.length>0&&d[0].originalIndex===y.length),z(({items:d})=>d[0].index),te())),O=ke(k(T,W(({items:d})=>d.length>0),z(({items:d})=>{let y=0,S=d.length-1;for(;d[y].type==="group"&&y<S;)y++;for(;d[S].type==="group"&&S>y;)S--;return{endIndex:d[S].index,startIndex:d[y].index}}),te($o)));return{endReached:E,initialItemCount:g,itemsRendered:m,listState:T,minOverscanItemCount:p,rangeChanged:O,startReached:j,topItemsIndexes:b,...x}},oe(Ee,Yo,Zt,pt,dt,mt,_e,Yt),{singleton:!0}),Zo=Y(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:o,headerHeight:n},{listState:r}])=>{const l=K(),i=ve(k(ue(o,e,n,t,r),z(([c,a,u,f,v])=>c+a+u+f+v.offsetBottom+v.bottom)),0);return L(_(i),l),{totalListHeight:i,totalListHeightChanged:l}},oe(ye,Ge),{singleton:!0}),ir=Y(([{viewportHeight:e},{totalListHeight:t}])=>{const o=I(!1),n=ve(k(ue(o,e,t),W(([r])=>r),z(([,r,l])=>Math.max(0,r-l)),He(0),te()),0);return{alignToBottom:o,paddingTopAddition:n}},oe(ye,Zo),{singleton:!0}),Jo=Y(()=>({context:I(null)})),ar=({itemBottom:e,itemTop:t,locationParams:{align:o,behavior:n,...r},viewportBottom:l,viewportTop:i})=>t<i?{...r,align:o??"start",...n!==void 0?{behavior:n}:{}}:e>l?{...r,align:o??"end",...n!==void 0?{behavior:n}:{}}:null,en=Y(([{gap:e,sizes:t,totalCount:o},{fixedFooterHeight:n,fixedHeaderHeight:r,headerHeight:l,scrollingInProgress:i,scrollTop:c,viewportHeight:a},{scrollToIndex:u}])=>{const f=K();return L(k(f,G(t,a,o,l,r,n,c),G(e),z(([[v,x,h,w,b,g,m,p],T])=>{const{calculateViewLocation:E=ar,done:j,...O}=v,d=Ko(v,x,w-1),y=it(d,x.offsetTree,T)+b+g,S=y+je(x.sizeTree,d)[1],M=p+g,H=p+h-m,P=E({itemBottom:S,itemTop:y,locationParams:O,viewportBottom:H,viewportTop:M});return P!==null?j&&Se(k(i,W(V=>!V),Ve(se(i)?1:2)),j):j==null||j(),P}),W(v=>v!==null)),u),{scrollIntoView:f}},oe(Ee,ye,dt,Ge,De),{singleton:!0});function ko(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const cr=(e,t)=>typeof e=="function"?ko(e(t)):t&&ko(e),ur=Y(([{listRefresh:e,totalCount:t,fixedItemSize:o,data:n},{atBottomState:r,isAtBottom:l},{scrollToIndex:i},{scrolledToInitialItem:c},{didMount:a,propsReady:u},{log:f},{scrollingInProgress:v},{context:x},{scrollIntoView:h}])=>{const w=I(!1),b=K();let g=null;function m(j){$(i,{align:"end",behavior:j,index:"LAST"})}Q(k(ue(k(_(t),Ve(1)),a),G(_(w),l,c,v),z(([[j,O],d,y,S,M])=>{let H=O&&S,P="auto";return H&&(P=cr(d,y||M),H=H&&P!==!1),{followOutputBehavior:P,shouldFollow:H,totalCount:j}}),W(({shouldFollow:j})=>j)),({followOutputBehavior:j,totalCount:O})=>{g!==null&&(g(),g=null),se(o)!==void 0?requestAnimationFrame(()=>{se(f)("following output to ",{totalCount:O},fe.DEBUG),m(j)}):g=Se(e,()=>{se(f)("following output to ",{totalCount:O},fe.DEBUG),m(j),g=null})});function p(j){const O=Se(r,d=>{j&&!d.atBottom&&d.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(se(f)("scrolling to bottom due to increased size",{},fe.DEBUG),m("auto"))});setTimeout(O,100)}Q(k(ue(_(w),t,u),W(([j,,O])=>j!==!1&&O),ze(({value:j},[,O])=>({refreshed:j===O,value:O}),{refreshed:!1,value:0}),W(({refreshed:j})=>j),G(w,t)),([,j])=>{se(c)&&p(j!==!1)}),Q(b,()=>{p(se(w)!==!1)}),Q(ue(_(w),r),([j,O])=>{j!==!1&&!O.atBottom&&O.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&m("auto")});const T=I(null),E=K();return L(Dt(k(_(n),z(j=>(j==null?void 0:j.length)??0)),k(_(t))),E),Q(k(ue(k(E,Ve(1)),a),G(_(T),c,v,x),z(([[j,O],d,y,S,M])=>O&&y&&(d==null?void 0:d({context:M,totalCount:j,scrollingInProgress:S}))),W(j=>!!j),He(0)),j=>{g!==null&&(g(),g=null),se(o)!==void 0?requestAnimationFrame(()=>{se(f)("scrolling into view",{}),$(h,j)}):g=Se(e,()=>{se(f)("scrolling into view",{}),$(h,j),g=null})}),{autoscrollToBottom:b,followOutput:w,scrollIntoViewOnChange:T}},oe(Ee,mt,dt,pt,_e,De,ye,Jo,en)),dr=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n},{initialTopMostItemIndex:r},{initialItemCount:l,listState:i},{didMount:c}])=>(L(k(c,G(l),W(([,a])=>a!==0),G(r,n,t,o,e),z(([[,a],u,f,v,x,h=[]])=>qo(a,u,f,v,x,h))),i),{}),oe(Ee,pt,Ge,_e),{singleton:!0}),pr=Y(([{didMount:e},{scrollTo:t},{listState:o}])=>{const n=I(0);return Q(k(e,G(n),W(([,r])=>r!==0),z(([,r])=>({top:r}))),r=>{Se(k(o,Ve(1),W(l=>l.items.length>1)),()=>{requestAnimationFrame(()=>{$(t,r)})})}),{initialScrollTop:n}},oe(_e,ye,Ge),{singleton:!0}),tn=Y(([{scrollVelocity:e}])=>{const t=I(!1),o=K(),n=I(!1);return L(k(e,G(n,t,o),W(([r,l])=>l!==!1&&l!==void 0),z(([r,l,i,c])=>{const{enter:a,exit:u}=l;if(i){if(u(r,c))return!1}else if(a(r,c))return!0;return i}),te()),t),Q(k(ue(t,e,o),G(n)),([[r,l,i],c])=>{r&&c!==!1&&c!==void 0&&c.change&&c.change(l,i)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:o,scrollVelocity:e}},oe(mt),{singleton:!0}),Jt=Y(([{scrollContainerState:e,scrollTo:t}])=>{const o=K(),n=K(),r=K(),l=I(!1),i=I(void 0);return L(k(ue(o,n),z(([{scrollTop:c,viewportHeight:a},{offsetTop:u,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,c-u),viewportHeight:a}))),e),L(k(t,G(n),z(([c,{offsetTop:a}])=>({...c,top:c.top+a}))),r),{customScrollParent:i,useWindowScroll:l,windowScrollContainerState:o,windowScrollTo:r,windowViewportRect:n}},oe(ye)),mr=Y(([{sizeRanges:e,sizes:t},{headerHeight:o,scrollTop:n},{initialTopMostItemIndex:r},{didMount:l},{useWindowScroll:i,windowScrollContainerState:c,windowViewportRect:a}])=>{const u=K(),f=I(void 0),v=I(null),x=I(null);return L(c,v),L(a,x),Q(k(u,G(t,n,i,v,x,o)),([h,w,b,g,m,p,T])=>{const E=Qn(w.sizeTree);g&&m!==null&&p!==null&&(b=m.scrollTop-p.offsetTop),b-=T,h({ranges:E,scrollTop:b})}),L(k(f,W(Gt),z(fr)),r),L(k(l,G(f),W(([,h])=>h!==void 0),te(),z(([,h])=>h.ranges)),e),{getState:u,restoreStateFrom:f}},oe(Ee,ye,pt,_e,Jt));function fr(e){return{align:"start",index:0,offset:e.scrollTop}}const hr=Y(([{topItemsIndexes:e}])=>{const t=I(0);return L(k(t,W(o=>o>=0),z(o=>Array.from({length:o}).map((n,r)=>r))),e),{topItemCount:t}},oe(Ge));function on(e){let t=!1,o;return(()=>(t||(t=!0,o=e()),o))}const xr=on(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),gr=Y(([{deviation:e,scrollBy:t,scrollingInProgress:o,scrollTop:n},{isAtBottom:r,isScrolling:l,lastJumpDueToItemResize:i,scrollDirection:c},{listState:a},{beforeUnshiftWith:u,gap:f,shiftWithOffset:v,sizes:x},{log:h},{recalcInProgress:w}])=>{const b=ke(k(a,G(i),ze(([,m,p,T],[{bottom:E,items:j,offsetBottom:O,totalCount:d},y])=>{const S=E+O;let M=0;return p===d&&m.length>0&&j.length>0&&(j[0].originalIndex===0&&m[0].originalIndex===0||(M=S-T,M!==0&&(M+=y))),[M,j,d,S]},[0,[],0,0]),W(([m])=>m!==0),G(n,c,o,r,h,w),W(([,m,p,T,,,E])=>!E&&!T&&m!==0&&p===at),z(([[m],,,,,p])=>(p("Upward scrolling compensation",{amount:m},fe.DEBUG),m))));function g(m){m>0?($(t,{behavior:"auto",top:-m}),$(e,0)):($(e,0),$(t,{behavior:"auto",top:-m}))}return Q(k(b,G(e,l)),([m,p,T])=>{T&&xr()?$(e,p-m):g(-m)}),Q(k(ue(ve(l,!1),e,w),W(([m,p,T])=>!m&&!T&&p!==0),z(([m,p])=>p),He(1)),g),L(k(v,z(m=>({top:-m}))),t),Q(k(u,G(x,f),z(([m,{groupIndices:p,lastSize:T,sizeTree:E},j])=>{function O(H){return H*(T+j)}if(p.length===0)return O(m);let d=0;const y=st(E,0);let S=0,M=0;for(;S<m;){S++,d+=y;let H=p.length===M+1?1/0:p[M+1]-p[M]-1;S+H>m&&(d-=y,H=m-S+1),S+=H,d+=O(H),M++}return d})),m=>{$(e,m),requestAnimationFrame(()=>{$(t,{top:m}),requestAnimationFrame(()=>{$(e,0),$(w,!1)})})}),{deviation:e}},oe(ye,mt,Ge,Ee,De,Yt)),vr=Y(([e,t,o,n,r,l,i,c,a,u,f])=>({...e,...t,...o,...n,...r,...l,...i,...c,...a,...u,...f}),oe(Zt,dr,_e,tn,Zo,pr,ir,Jt,en,De,Jo)),nn=Y(([{data:e,defaultItemSize:t,firstItemIndex:o,fixedItemSize:n,fixedGroupSize:r,gap:l,groupIndices:i,heightEstimates:c,itemSize:a,sizeRanges:u,sizes:f,statefulTotalCount:v,totalCount:x,trackItemSizes:h},{initialItemFinalLocationReached:w,initialTopMostItemIndex:b,scrolledToInitialItem:g},m,p,T,E,{scrollToIndex:j},O,{topItemCount:d},{groupCounts:y},S])=>{const{listState:M,minOverscanItemCount:H,topItemsIndexes:P,rangeChanged:V,...D}=E;return L(V,S.scrollSeekRangeChanged),L(k(S.windowViewportRect,z(U=>U.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:o,fixedItemHeight:n,fixedGroupHeight:r,gap:l,groupCounts:y,heightEstimates:c,initialItemFinalLocationReached:w,initialTopMostItemIndex:b,scrolledToInitialItem:g,sizeRanges:u,topItemCount:d,topItemsIndexes:P,totalCount:x,...T,groupIndices:i,itemSize:a,listState:M,minOverscanItemCount:H,scrollToIndex:j,statefulTotalCount:v,trackItemSizes:h,rangeChanged:V,...D,...S,...m,sizes:f,...p}},oe(Ee,pt,ye,mr,ur,Ge,dt,gr,hr,Yo,vr));function br(e,t){const o={},n={};let r=0;const l=e.length;for(;r<l;)n[e[r]]=1,r+=1;for(const i in t)Object.hasOwn(n,i)||(o[i]=t[i]);return o}const xt=typeof document<"u"?B.useLayoutEffect:B.useEffect;function rn(e,t,o){const n=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),l=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),c=B.createContext({});function a(g,m){g.propsReady!==void 0&&$(g.propsReady,!1);for(const p of n){const T=g[t.required[p]];$(T,m[p])}for(const p of r)if(p in m){const T=g[t.optional[p]];$(T,m[p])}g.propsReady!==void 0&&$(g.propsReady,!0)}function u(g){return l.reduce((m,p)=>(m[p]=T=>{const E=g[t.methods[p]];$(E,T)},m),{})}function f(g){return i.reduce((m,p)=>(m[p]=Ln(g[t.events[p]]),m),{})}const v=B.forwardRef(function(g,m){const{children:p,...T}=g,[E]=B.useState(()=>St(On(e),d=>{a(d,T)})),[j]=B.useState(mo(f,E));xt(()=>{for(const d of i)d in T&&Q(j[d],T[d]);return()=>{Object.values(j).map(Ut)}},[T,j,E]),xt(()=>{a(E,T)}),B.useImperativeHandle(m,po(u(E)));const O=o;return s.jsx(c.Provider,{value:E,children:o!==void 0?s.jsx(O,{...br([...n,...r,...i],T),children:p}):p})}),x=g=>{const m=B.useContext(c);return B.useCallback(p=>{$(m[g],p)},[m,g])},h=g=>{const m=B.useContext(c)[g],p=B.useCallback(T=>Q(m,T),[m]);return B.useSyncExternalStore(p,()=>se(m),()=>se(m))},w=g=>{const m=B.useContext(c)[g],[p,T]=B.useState(mo(se,m));return xt(()=>Q(m,E=>{E!==p&&T(po(E))}),[m,p]),p},b=B.version.startsWith("18")?h:w;return{Component:v,useEmitter:(g,m)=>{const p=B.useContext(c)[g];xt(()=>Q(p,m),[m,p])},useEmitterValue:b,usePublisher:x}}const sn=B.createContext(void 0),ln=B.createContext(void 0),Ht="-webkit-sticky",To="sticky",eo=on(()=>{if(typeof document>"u")return To;const e=document.createElement("div");return e.style.position=Ht,e.style.position===Ht?Ht:To}),an=typeof document<"u"?B.useLayoutEffect:B.useEffect;function Mt(e){return"self"in e}function yr(e){return"body"in e}function cn(e,t,o,n=Ze,r,l){const i=B.useRef(null),c=B.useRef(null),a=B.useRef(null),u=B.useCallback(x=>{let h,w,b;const g=x.target;if(yr(g)||Mt(g)){const p=Mt(g)?g:g.defaultView;b=l===!0?p.scrollX:p.scrollY,h=l===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight,w=l===!0?p.innerWidth:p.innerHeight}else b=l===!0?g.scrollLeft:g.scrollTop,h=l===!0?g.scrollWidth:g.scrollHeight,w=l===!0?g.offsetWidth:g.offsetHeight;const m=()=>{e({scrollHeight:h,scrollTop:Math.max(b,0),viewportHeight:w})};x.suppressFlushSync===!0?m():gn.flushSync(m),c.current!==null&&(b===c.current||b<=0||b===h-w)&&(c.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t,l]);B.useEffect(()=>{const x=r||i.current;return n(r||i.current),u({suppressFlushSync:!0,target:x}),x.addEventListener("scroll",u,{passive:!0}),()=>{n(null),x.removeEventListener("scroll",u)}},[i,u,o,n,r]);function f(x){const h=i.current;if(!h||(l===!0?"offsetWidth"in h&&h.offsetWidth===0:"offsetHeight"in h&&h.offsetHeight===0))return;const w=x.behavior==="smooth";let b,g,m;Mt(h)?(g=Math.max(Le(h.document.documentElement,l===!0?"width":"height"),l===!0?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight),b=l===!0?h.innerWidth:h.innerHeight,m=l===!0?window.scrollX:window.scrollY):(g=h[l===!0?"scrollWidth":"scrollHeight"],b=Le(h,l===!0?"width":"height"),m=h[l===!0?"scrollLeft":"scrollTop"]);const p=g-b;if(x.top=Math.ceil(Math.max(Math.min(p,x.top),0)),Qo(b,g)||x.top===m){e({scrollHeight:g,scrollTop:m,viewportHeight:b}),w&&t(!0);return}w?(c.current=x.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,c.current=null,t(!0)},1e3)):c.current=null,l===!0&&(x={...x.behavior!==void 0?{behavior:x.behavior}:{},left:x.top}),h.scrollTo(x)}function v(x){l===!0&&(x={...x.behavior!==void 0?{behavior:x.behavior}:{},...x.top!==void 0?{left:x.top}:{}}),i.current.scrollBy(x)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:f}}function to(e){return e}const wr=Y(()=>{const e=I(c=>`Item ${c}`),t=I(c=>`Group ${c}`),o=I({}),n=I(to),r=I("div"),l=I(Ze),i=(c,a=null)=>ve(k(o,z(u=>u[c]),te()),a);return{components:o,computeItemKey:n,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),Cr=Y(([e,t])=>({...e,...t}),oe(nn,wr)),kr=({height:e})=>s.jsx("div",{style:{height:e}}),Tr={overflowAnchor:"none",position:eo(),zIndex:1},un={overflowAnchor:"none"},Ir={...un,display:"inline-block",height:"100%"},Io=B.memo(function({showTopList:e=!1}){const t=F("listState"),o=Te("sizeRanges"),n=F("useWindowScroll"),r=F("customScrollParent"),l=Te("windowScrollContainerState"),i=Te("scrollContainerState"),c=r||n?l:i,a=F("itemContent"),u=F("context"),f=F("groupContent"),v=F("trackItemSizes"),x=F("itemSize"),h=F("log"),w=Te("gap"),b=F("horizontalDirection"),{callbackRef:g}=Wn(o,x,v,e?Ze:c,h,w,r,b,F("skipAnimationFrameInResizeObserver")),[m,p]=B.useState(0);oo("deviation",D=>{m!==D&&p(D)});const T=F("EmptyPlaceholder"),E=F("ScrollSeekPlaceholder")??kr,j=F("ListComponent"),O=F("ItemComponent"),d=F("GroupComponent"),y=F("computeItemKey"),S=F("isSeeking"),M=F("groupIndices").length>0,H=F("alignToBottom"),P=F("initialItemFinalLocationReached"),V=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginLeft:m!==0?m:H?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:m!==0?m:H?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...P?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&T!==null&&T!==void 0?s.jsx(T,{...ge(T,u)}):s.jsx(j,{...ge(j,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:V,children:(e?t.topItems:t.items).map(D=>{const U=D.originalIndex,C=y(U+t.firstItemIndex,D.data,u);return S?R.createElement(E,{...ge(E,u),height:D.size,index:D.index,key:C,type:D.type||"item",...D.type==="group"?{}:{groupIndex:D.groupIndex}}):D.type==="group"?R.createElement(d,{...ge(d,u),"data-index":U,"data-item-index":D.index,"data-known-size":D.size,key:C,style:Tr},f(D.index,u)):R.createElement(O,{...ge(O,u),...Rr(O,D.data),"data-index":U,"data-item-group-index":D.groupIndex,"data-item-index":D.index,"data-known-size":D.size,key:C,style:b?Ir:un},M?a(D.index,D.groupIndex,D.data,u):a(D.index,D.data,u))})})}),Sr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},jr={outline:"none",overflowX:"auto",position:"relative"},Nt=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Nr={position:eo(),top:0,width:"100%",zIndex:1};function ge(e,t){if(typeof e!="string")return{context:t}}function Rr(e,t){return{item:typeof e=="string"?void 0:t}}const zr=B.memo(function(){const e=F("HeaderComponent"),t=Te("headerHeight"),o=F("HeaderFooterTag"),n=$e(B.useMemo(()=>l=>{t(Le(l,"height"))},[t]),!0,F("skipAnimationFrameInResizeObserver")),r=F("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),Er=B.memo(function(){const e=F("FooterComponent"),t=Te("footerHeight"),o=F("HeaderFooterTag"),n=$e(B.useMemo(()=>l=>{t(Le(l,"height"))},[t]),!0,F("skipAnimationFrameInResizeObserver")),r=F("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null});function dn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return B.memo(function({children:n,style:r,context:l,...i}){const c=o("scrollContainerState"),a=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),f=t("scrollerRef"),v=t("horizontalDirection")||!1,{scrollByCallback:x,scrollerRef:h,scrollToCallback:w}=cn(c,u,a,f,void 0,v);return e("scrollTo",w),e("scrollBy",x),s.jsx(a,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...v?jr:Sr,...r},tabIndex:0,...i,...ge(a,l),children:n})})}function pn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return B.memo(function({children:n,style:r,context:l,...i}){const c=o("windowScrollContainerState"),a=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),f=t("totalListHeight"),v=t("deviation"),x=t("customScrollParent"),h=B.useRef(null),w=t("scrollerRef"),{scrollByCallback:b,scrollerRef:g,scrollToCallback:m}=cn(c,u,a,w,x);return an(()=>{var p;return g.current=x||((p=h.current)==null?void 0:p.ownerDocument.defaultView),()=>{g.current=null}},[g,x]),e("windowScrollTo",m),e("scrollBy",b),s.jsx(a,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...f!==0?{height:f+v}:void 0},...i,...ge(a,l),children:n})})}const Hr=({children:e})=>{const t=B.useContext(sn),o=Te("viewportHeight"),n=Te("fixedItemHeight"),r=F("alignToBottom"),l=F("horizontalDirection"),i=B.useMemo(()=>Ao(o,a=>Le(a,l?"width":"height")),[o,l]),c=$e(i,!0,F("skipAnimationFrameInResizeObserver"));return B.useEffect(()=>{t&&(o(t.viewportHeight),n(t.itemHeight))},[t,o,n]),s.jsx("div",{"data-viewport-type":"element",ref:c,style:Nt(r),children:e})},Mr=({children:e})=>{const t=B.useContext(sn),o=Te("windowViewportRect"),n=Te("fixedItemHeight"),r=F("customScrollParent"),l=Do(o,r,F("skipAnimationFrameInResizeObserver")),i=F("alignToBottom");return B.useEffect(()=>{t&&(n(t.itemHeight),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,o,n]),s.jsx("div",{"data-viewport-type":"window",ref:l,style:Nt(i),children:e})},Br=({children:e})=>{const t=F("TopItemListComponent")??"div",o=F("headerHeight"),n={...Nr,marginTop:`${o}px`},r=F("context");return s.jsx(t,{style:n,...ge(t,r),children:e})},Lr=B.memo(function(e){const t=F("useWindowScroll"),o=F("topItemsIndexes").length>0,n=F("customScrollParent"),r=F("context");return s.jsxs(n||t?Dr:Or,{...e,context:r,children:[o&&s.jsx(Br,{children:s.jsx(Io,{showTopList:!0})}),s.jsxs(n||t?Mr:Hr,{children:[s.jsx(zr,{}),s.jsx(Io,{}),s.jsx(Er,{})]})]})}),{Component:Ar,useEmitter:oo,useEmitterValue:F,usePublisher:Te}=rn(Cr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Lr),Or=dn({useEmitter:oo,useEmitterValue:F,usePublisher:Te}),Dr=pn({useEmitter:oo,useEmitterValue:F,usePublisher:Te}),_r=Ar,Wr=Y(()=>{const e=I(u=>s.jsxs("td",{children:["Item $",u]})),t=I(null),o=I(u=>s.jsxs("td",{colSpan:1e3,children:["Group ",u]})),n=I(null),r=I(null),l=I({}),i=I(to),c=I(Ze),a=(u,f=null)=>ve(k(l,z(v=>v[u]),te()),f);return{components:l,computeItemKey:i,context:t,EmptyPlaceholder:a("EmptyPlaceholder"),FillerRow:a("FillerRow"),fixedFooterContent:r,fixedHeaderContent:n,itemContent:e,groupContent:o,ScrollerComponent:a("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TableBodyComponent:a("TableBody","tbody"),TableComponent:a("Table","table"),TableFooterComponent:a("TableFoot","tfoot"),TableHeadComponent:a("TableHead","thead"),TableRowComponent:a("TableRow","tr"),GroupComponent:a("Group","tr")}});oe(nn,Wr);eo();const So={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Fr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:jo,floor:Tt,max:nt,min:Bt,round:No}=Math;function Ro(e,t,o){return Array.from({length:t-e+1}).map((n,r)=>({data:o===null?null:o[r+e],index:r+e}))}function Pr(e){return{...Fr,items:e}}function gt(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function Vr(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const $r=Y(([{increaseViewportBy:e,listBoundary:t,overscan:o,visibleRange:n},{footerHeight:r,headerHeight:l,scrollBy:i,scrollContainerState:c,scrollTo:a,scrollTop:u,smoothScrollTargetReached:f,viewportHeight:v},x,h,{didMount:w,propsReady:b},{customScrollParent:g,useWindowScroll:m,windowScrollContainerState:p,windowScrollTo:T,windowViewportRect:E},j])=>{const O=I(0),d=I(0),y=I(So),S=I({height:0,width:0}),M=I({height:0,width:0}),H=K(),P=K(),V=I(0),D=I(null),U=I({column:0,row:0}),C=K(),A=K(),J=I(!1),he=I(0),ie=I(!0),we=I(!1),Me=I(!1);Q(k(w,G(he),W(([N,X])=>X!==0)),()=>{$(ie,!1)}),Q(k(ue(w,ie,M,S,he,we),W(([N,X,de,ee,,ne])=>N&&!X&&de.height!==0&&ee.height!==0&&!ne)),([,,,,N])=>{$(we,!0),Qt(1,()=>{$(H,N)}),Se(k(u),()=>{$(t,[0,0]),$(ie,!0)})}),L(k(A,W(N=>N!=null&&N.scrollTop>0),Re(0)),d),Q(k(w,G(A),W(([,N])=>N!=null)),([,N])=>{N&&($(S,N.viewport),$(M,N.item),$(U,N.gap),N.scrollTop>0&&($(J,!0),Se(k(u,Ve(1)),X=>{$(J,!1)}),$(a,{top:N.scrollTop})))}),L(k(S,z(({height:N})=>N)),v),L(k(ue(_(S,gt),_(M,gt),_(U,(N,X)=>N!==void 0&&N.column===X.column&&N.row===X.row),_(u)),z(([N,X,de,ee])=>({gap:de,item:X,scrollTop:ee,viewport:N}))),C),L(k(ue(_(O),n,_(U,Vr),_(M,gt),_(S,gt),_(D),_(d),_(J),_(ie),_(he)),W(([,,,,,,,N])=>!N),z(([N,[X,de],ee,ne,pe,ae,Z,,le,be])=>{const{column:ce,row:tt}=ee,{height:ft,width:Rt}=ne,{width:no}=pe;if(Z===0&&(N===0||no===0))return So;if(Rt===0){const ao=qt(be,N),xn=ao+Math.max(Z-1,0);return Pr(Ro(ao,xn,ae))}const ht=mn(no,Rt,ce);let Ke,We;le?X===0&&de===0&&Z>0?(Ke=0,We=Z-1):(Ke=ht*Tt((X+tt)/(ft+tt)),We=ht*jo((de+tt)/(ft+tt))-1,We=Bt(N-1,nt(We,ht-1)),Ke=Bt(We,nt(0,Ke))):(Ke=0,We=-1);const ro=Ro(Ke,We,ae),{bottom:so,top:lo}=zo(pe,ee,ne,ro),io=jo(N/ht),hn=io*ft+(io-1)*tt-so;return{bottom:so,itemHeight:ft,items:ro,itemWidth:Rt,offsetBottom:hn,offsetTop:lo,top:lo}})),y),L(k(D,W(N=>N!==null),z(N=>N.length)),O),L(k(ue(S,M,y,U),W(([N,X,{items:de}])=>de.length>0&&X.height!==0&&N.height!==0),z(([N,X,{items:de},ee])=>{const{bottom:ne,top:pe}=zo(N,ee,X,de);return[pe,ne]}),te(lt)),t);const xe=I(!1);L(k(u,G(xe),z(([N,X])=>X||N!==0)),xe);const Ue=ke(k(ue(y,O),W(([{items:N}])=>N.length>0),G(xe),W(([[N,X],de])=>{const ee=N.items[N.items.length-1].index===X-1;return(de||N.bottom>0&&N.itemHeight>0&&N.offsetBottom===0&&N.items.length===X)&&ee}),z(([[,N]])=>N-1),te())),Je=ke(k(_(y),W(({items:N})=>N.length>0&&N[0].index===0),Re(0),te())),Ne=ke(k(_(y),G(J),W(([{items:N},X])=>N.length>0&&!X),z(([{items:N}])=>({endIndex:N[N.length-1].index,startIndex:N[0].index})),te($o),He(0)));L(Ne,h.scrollSeekRangeChanged),L(k(H,G(S,M,O,U),z(([N,X,de,ee,ne])=>{const pe=Xo(N),{align:ae,behavior:Z,offset:le}=pe;let be=pe.index;be==="LAST"&&(be=ee-1),be=nt(0,be,Bt(ee-1,be));let ce=Vt(X,ne,de,be);return ae==="end"?ce=No(ce-X.height+de.height):ae==="center"&&(ce=No(ce-X.height/2+de.height/2)),le!==void 0&&le!==0&&(ce+=le),{behavior:Z,top:ce}})),a);const et=ve(k(y,z(N=>N.offsetBottom+N.bottom)),0);return L(k(E,z(N=>({height:N.visibleHeight,width:N.visibleWidth}))),S),{customScrollParent:g,data:D,deviation:V,footerHeight:r,gap:U,headerHeight:l,increaseViewportBy:e,initialItemCount:d,itemDimensions:M,overscan:o,restoreStateFrom:A,scrollBy:i,scrollContainerState:c,scrollHeight:P,scrollTo:a,scrollToIndex:H,scrollTop:u,smoothScrollTargetReached:f,totalCount:O,useWindowScroll:m,viewportDimensions:S,windowScrollContainerState:p,windowScrollTo:T,windowViewportRect:E,...h,gridState:y,horizontalDirection:Me,initialTopMostItemIndex:he,totalListHeight:et,...x,endReached:Ue,propsReady:b,rangeChanged:Ne,startReached:Je,stateChanged:C,stateRestoreInProgress:J,...j}},oe(Zt,ye,mt,tn,_e,Jt,De));function mn(e,t,o){return nt(1,Tt((e+o)/(Tt(t)+o)))}function zo(e,t,o,n){const{height:r}=o;if(r===void 0||n.length===0)return{bottom:0,top:0};const l=Vt(e,t,o,n[0].index);return{bottom:Vt(e,t,o,n[n.length-1].index)+r,top:l}}function Vt(e,t,o,n){const r=mn(e.width,o.width,t.column),l=Tt(n/r),i=l*o.height+nt(0,l-1)*t.row;return i>0?i+t.row:i}const Gr=Y(()=>{const e=I(v=>`Item ${v}`),t=I({}),o=I(null),n=I("virtuoso-grid-item"),r=I("virtuoso-grid-list"),l=I(to),i=I("div"),c=I(Ze),a=(v,x=null)=>ve(k(t,z(h=>h[v]),te()),x),u=I(!1),f=I(!1);return L(_(f),u),{components:t,computeItemKey:l,context:o,FooterComponent:a("Footer"),HeaderComponent:a("Header"),headerFooterTag:i,itemClassName:n,ItemComponent:a("Item","div"),itemContent:e,listClassName:r,ListComponent:a("List","div"),readyStateChanged:u,reportReadyState:f,ScrollerComponent:a("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder","div")}}),Ur=Y(([e,t])=>({...e,...t}),oe($r,Gr)),Kr=B.memo(function(){const e=re("gridState"),t=re("listClassName"),o=re("itemClassName"),n=re("itemContent"),r=re("computeItemKey"),l=re("isSeeking"),i=Ie("scrollHeight"),c=re("ItemComponent"),a=re("ListComponent"),u=re("ScrollSeekPlaceholder"),f=re("context"),v=Ie("itemDimensions"),x=Ie("gap"),h=re("log"),w=re("stateRestoreInProgress"),b=Ie("reportReadyState"),g=$e(B.useMemo(()=>m=>{const p=m.parentElement.parentElement.scrollHeight;i(p);const T=m.firstChild;if(T!==null){const{height:E,width:j}=T.getBoundingClientRect();v({height:E,width:j})}x({column:Eo("column-gap",getComputedStyle(m).columnGap,h),row:Eo("row-gap",getComputedStyle(m).rowGap,h)})},[i,v,x,h]),!0,!1);return an(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),w?null:s.jsx(a,{className:t,ref:g,...ge(a,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(m=>{const p=r(m.index,m.data,f);return l?s.jsx(u,{...ge(u,f),height:e.itemHeight,index:m.index,width:e.itemWidth},p):R.createElement(c,{...ge(c,f),className:o,"data-index":m.index,key:p},n(m.index,m.data,f))})})}),Yr=B.memo(function(){const e=re("HeaderComponent"),t=Ie("headerHeight"),o=re("headerFooterTag"),n=$e(B.useMemo(()=>l=>{t(Le(l,"height"))},[t]),!0,!1),r=re("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),Xr=B.memo(function(){const e=re("FooterComponent"),t=Ie("footerHeight"),o=re("headerFooterTag"),n=$e(B.useMemo(()=>l=>{t(Le(l,"height"))},[t]),!0,!1),r=re("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),Qr=({children:e})=>{const t=B.useContext(ln),o=Ie("itemDimensions"),n=Ie("viewportDimensions"),r=$e(B.useMemo(()=>l=>{n(l.getBoundingClientRect())},[n]),!0,!1);return B.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),o({height:t.itemHeight,width:t.itemWidth}))},[t,n,o]),s.jsx("div",{ref:r,style:Nt(!1),children:e})},qr=({children:e})=>{const t=B.useContext(ln),o=Ie("windowViewportRect"),n=Ie("itemDimensions"),r=re("customScrollParent"),l=Do(o,r,!1);return B.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,o,n]),s.jsx("div",{ref:l,style:Nt(!1),children:e})},Zr=B.memo(function({...e}){const t=re("useWindowScroll"),o=re("customScrollParent"),n=o||t?es:Jr,r=o||t?qr:Qr,l=re("context");return s.jsx(n,{...e,...ge(n,l),children:s.jsxs(r,{children:[s.jsx(Yr,{}),s.jsx(Kr,{}),s.jsx(Xr,{})]})})}),{useEmitter:fn,useEmitterValue:re,usePublisher:Ie}=rn(Ur,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Zr),Jr=dn({useEmitter:fn,useEmitterValue:re,usePublisher:Ie}),es=pn({useEmitter:fn,useEmitterValue:re,usePublisher:Ie});function Eo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,fe.WARN),t==="normal"?0:parseInt(t??"0",10)}const ts=150;function os({entries:e,itemCount:t}){const o=R.useRef(null),[n,r]=R.useState(!1),l=R.useRef(!1),i=R.useRef(0),c=R.useRef(e.length),a=R.useRef(0),u=R.useCallback((h="smooth")=>{o.current&&(a.current=Date.now(),o.current.scrollToIndex({index:t-1,behavior:h,align:"end"}))},[t]),f=R.useCallback(h=>l.current||!h?!1:"auto",[]),v=R.useCallback(h=>{r(!h),h&&(l.current=!1)},[]),x=R.useCallback(h=>{const b=h.target.scrollTop;if(Date.now()-a.current<ts){i.current=b;return}b-i.current<-10&&(l.current=!0),i.current=b},[]);return R.useEffect(()=>{const h=e.length,w=c.current,b=h>w;if(c.current=h,!b)return;const g=e[e.length-1];(g==null?void 0:g.type)==="user_message"&&(l.current=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.current&&(a.current=Date.now(),o.current.scrollToIndex({index:"LAST",behavior:"auto",align:"end"}))})}))},[e]),{virtuosoRef:o,handleScroll:x,handleAtBottomStateChange:v,handleFollowOutput:f,showScrollButton:n,scrollToBottom:u}}/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ns=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rs=Ae("chevron-up",ns);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ss=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],ls=Ae("file-code",ss);/**
|
|
12
|
+
* @license lucide-react v0.577.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const is=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],as=Ae("file-plus",is);/**
|
|
17
|
+
* @license lucide-react v0.577.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const cs=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],us=Ae("file-x",cs);/**
|
|
22
|
+
* @license lucide-react v0.577.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const ds=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],ps=Ae("file",ds);/**
|
|
27
|
+
* @license lucide-react v0.577.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const ms=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fs=Ae("shield-check",ms);/**
|
|
32
|
+
* @license lucide-react v0.577.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const hs=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xs=Ae("shield-question-mark",hs);/**
|
|
37
|
+
* @license lucide-react v0.577.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const gs=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],vs=Ae("shield-x",gs),bs=/^(\/[a-zA-Z0-9_-]+)\s*/,ys=/@([\w./\\-]+\.\w+)/g;function ws(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function Cs(e){const t=[];let o=0,n;const r=new RegExp(ys);for(;(n=r.exec(e))!==null;){n.index>o&&t.push(e.slice(o,n.index));const l=n[1];t.push(s.jsxs("span",{className:"inline-flex items-center gap-[3px] mx-[2px] px-[6px] py-[1px] rounded-[5px] text-[11px] font-mono align-middle",style:{backgroundColor:"var(--color-tint-exploring)",color:"var(--color-accent-blue)"},children:[s.jsx(ps,{size:10,strokeWidth:2}),l.split(/[\\/]/).pop()]},n.index)),o=r.lastIndex}return o<e.length&&t.push(e.slice(o)),t.length>0?t:e}function ks({entry:e}){const t=e.content.match(bs),o=t==null?void 0:t[1],n=t?e.content.slice(t[0].length):e.content;return s.jsxs("div",{className:"flex gap-[8px]",style:{paddingTop:10,paddingBottom:10},children:[s.jsx("div",{className:"shrink-0 w-6 h-6 rounded-[6px] flex items-center justify-center mt-[2px] text-[10px] font-bold",style:{backgroundColor:"var(--color-tint-exploring)",color:"var(--color-accent-blue)"},children:"U"}),s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-[5px] mb-[2px]",children:[s.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--color-text-primary)"},children:"You"}),s.jsx("span",{className:"text-[9px]",style:{color:"var(--color-text-placeholder)"},children:ws(e.timestamp)})]}),s.jsxs("div",{className:"text-[13px] leading-[1.6] whitespace-pre-wrap break-words",style:{color:"var(--color-text-primary)"},children:[o&&s.jsxs("span",{className:"inline-flex items-center gap-[4px] mr-[6px] px-[7px] py-[1px] rounded-[6px] text-[11px] font-semibold align-middle",style:{backgroundColor:"var(--color-tint-planning)",color:"var(--color-accent-purple)"},children:[s.jsx(Bo,{size:10,strokeWidth:2}),o]}),Cs(n)]})]})]})}function Ts({children:e,maxHeight:t=300,expandLabel:o="Show more",collapseLabel:n="Show less"}){var x;const r=R.useRef(null),[l,i]=R.useState(!1),[c,a]=R.useState(!1);R.useEffect(()=>{const h=r.current;if(!h)return;const w=()=>{const g=h.scrollHeight;i(g>t)};w();const b=new ResizeObserver(()=>{requestAnimationFrame(w)});return b.observe(h),()=>{b.disconnect()}},[t]);const u=R.useCallback(()=>a(h=>!h),[]),v=l&&!c?{maxHeight:`${t}px`,overflow:"hidden",maskImage:"linear-gradient(to bottom, black calc(100% - 60px), transparent)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 60px), transparent)",transition:"max-height 0.35s ease"}:{maxHeight:l?`${((x=r.current)==null?void 0:x.scrollHeight)??9999}px`:"none",overflow:"hidden",transition:"max-height 0.35s ease"};return s.jsxs("div",{children:[s.jsx("div",{ref:r,style:v,children:e}),l&&s.jsx("button",{type:"button",onClick:u,className:"flex items-center gap-1 mt-2 px-0 py-1 text-[12px] font-medium border-none bg-transparent cursor-pointer",style:{color:"color-mix(in srgb, var(--color-text-secondary) 80%, transparent)"},children:c?s.jsxs(s.Fragment,{children:[s.jsx(rs,{size:14}),n]}):s.jsxs(s.Fragment,{children:[s.jsx(vn,{size:14}),o]})})]})}const Qe={"claude-code":{label:"C",color:"var(--color-accent-purple)",tint:"var(--color-tint-planning)",className:"claude"},codex:{label:"Cx",color:"var(--color-accent-green)",tint:"var(--color-tint-completed)",className:"codex"},"codex-server":{label:"Cs",color:"var(--color-accent-green)",tint:"var(--color-tint-completed)",className:"codex"},gemini:{label:"G",color:"var(--color-accent-blue)",tint:"var(--color-tint-exploring)",className:"gemini"},"gemini-a2a":{label:"Ga",color:"var(--color-accent-blue)",tint:"var(--color-tint-exploring)",className:"gemini"},qwen:{label:"Q",color:"var(--color-accent-orange)",tint:"var(--color-tint-verifying)",className:"qwen"},opencode:{label:"O",color:"var(--color-text-tertiary)",tint:"var(--color-bg-secondary)",className:"opencode"},"agent-sdk":{label:"S",color:"var(--color-accent-purple)",tint:"var(--color-tint-planning)",className:"claude"}};function Is(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function Ss({entry:e,isGroupContinuation:t}){const o=Pe(i=>i.processes[e.processId]),n=o==null?void 0:o.type,r=(o==null?void 0:o.status)==="running"||(o==null?void 0:o.status)==="spawning",l=Qe[n??"claude-code"]??Qe["claude-code"];return s.jsxs("div",{className:"flex gap-[8px]",style:{paddingTop:t?0:10,paddingBottom:10},children:[t?s.jsx("div",{className:"shrink-0 w-6"}):s.jsxs("div",{className:"relative shrink-0 w-6 h-6 rounded-[6px] flex items-center justify-center mt-[2px] text-[10px] font-bold",style:{backgroundColor:l.tint,color:l.color},children:[l.label,r&&s.jsx("span",{className:"absolute inset-[-3px] rounded-[8px] pointer-events-none",style:{border:"1.5px solid currentColor",color:l.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1 contain-content",children:[!t&&s.jsxs("div",{className:"flex items-center gap-[5px] mb-[2px]",children:[s.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--color-text-primary)"},children:Ot[n??"claude-code"]??"Maestro"}),s.jsx("span",{className:"text-[9px]",style:{color:"var(--color-text-placeholder)"},children:Is(e.timestamp)})]}),e.partial?s.jsxs("div",{className:"text-text-primary text-[13px] leading-[1.6] whitespace-pre-wrap break-words",children:[e.content,s.jsx("span",{className:"inline-block w-[2px] h-[1em] ml-[2px] align-text-bottom",style:{backgroundColor:"var(--color-accent-orange)",animation:"blink-cursor 1s step-end infinite"},"aria-label":"Typing"})]}):s.jsx(Ts,{maxHeight:300,children:s.jsx(jn,{content:e.content})})]})]})}function js({entry:e}){const[t,o]=R.useState(!1),n=Pe(i=>i.entries[e.processId]??[]),r=R.useMemo(()=>{const i=n.findIndex(a=>a.id===e.id);return i===-1||i===n.length-1||!n[i+1]},[n,e.id]),l=R.useMemo(()=>{if(r)return"Thinking...";const i=n.findIndex(v=>v.id===e.id),c=n[i+1];if(!c)return"Thinking...";const a=new Date(e.timestamp).getTime(),u=new Date(c.timestamp).getTime(),f=Math.round((u-a)/1e3);return f<1?"Thought for <1s":`Thought for ${f}s`},[n,e.id,e.timestamp,r]);return s.jsxs("div",{className:"contain-content",children:[s.jsxs("button",{type:"button",onClick:()=>o(i=>!i),className:"flex items-center gap-[5px] w-full rounded-[6px] cursor-pointer transition-opacity hover:opacity-80",style:{padding:"6px 10px",backgroundColor:"var(--color-tint-planning)",margin:"3px 0",fontSize:"10px",color:"var(--color-accent-purple)",fontWeight:500,border:"none",textAlign:"left",fontFamily:"inherit"},children:[r&&s.jsxs("span",{className:"flex gap-[2px]",children:[s.jsx("span",{className:"w-[3px] h-[3px] rounded-full animate-bounce",style:{backgroundColor:"var(--color-accent-purple)",animationDelay:"0ms",opacity:.7}}),s.jsx("span",{className:"w-[3px] h-[3px] rounded-full animate-bounce",style:{backgroundColor:"var(--color-accent-purple)",animationDelay:"200ms",opacity:.7}}),s.jsx("span",{className:"w-[3px] h-[3px] rounded-full animate-bounce",style:{backgroundColor:"var(--color-accent-purple)",animationDelay:"400ms",opacity:.7}})]}),s.jsx("span",{className:"truncate",children:r?e.content.slice(0,60)||"Thinking...":l})]}),t&&s.jsx("div",{className:"text-[11px] leading-[1.6] italic mt-[2px] pl-[10px] whitespace-pre-wrap break-words",style:{color:"var(--color-text-tertiary)"},children:e.content})]})}const Ns={pending:{color:"var(--color-text-tertiary)",label:"Pending"},running:{color:"var(--color-accent-yellow)",label:"Running"},completed:{color:"var(--color-accent-green)",label:"Done"},failed:{color:"var(--color-accent-red, #D05454)",label:"Failed"}};function Rs(e){if(!e)return null;const t=e.file_path??e.path??e.command;return typeof t=="string"?t:null}function zs({name:e}){const t={width:11,height:11,color:"var(--color-text-tertiary)",flexShrink:0};return e==="Read"||e==="Glob"||e==="Grep"?s.jsxs("svg",{style:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"})]}):e==="Edit"||e==="Write"||e==="NotebookEdit"?s.jsxs("svg",{style:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M12 20h9"}),s.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}):e==="Bash"?s.jsxs("svg",{style:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"4 17 10 11 4 5"}),s.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}):s.jsx("svg",{style:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("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"})})}function Es({entry:e}){const[t,o]=R.useState(!1),n=Ns[e.status],r=Rs(e.input),l=e.name==="unknown"?"Tool Call":e.name;return s.jsxs("div",{className:"contain-content",children:[s.jsxs("button",{type:"button",onClick:()=>o(i=>!i),className:"flex items-center gap-[5px] w-full rounded-[5px] cursor-pointer transition-opacity hover:opacity-80",style:{padding:"4px 8px",backgroundColor:"var(--color-bg-secondary)",margin:"3px 0",fontSize:"10px",color:"var(--color-text-secondary)",border:"none",textAlign:"left",fontFamily:"inherit"},children:[s.jsx(zs,{name:l}),s.jsx("span",{className:"font-semibold",style:{color:"var(--color-text-primary)"},children:l}),r&&s.jsx("span",{className:"truncate font-mono text-[10px]",style:{color:"var(--color-text-tertiary)"},children:r}),s.jsx("span",{className:"ml-auto shrink-0 text-[9px] font-semibold",style:{color:n.color},children:n.label})]}),t&&s.jsxs("div",{className:"mt-[2px] space-y-[4px]",children:[e.input&&Object.keys(e.input).length>0&&s.jsx("pre",{className:"text-[11px] font-mono rounded-[6px] p-[6px_8px] overflow-x-auto max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words leading-[1.5]",style:{background:"var(--color-bg-primary)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-divider)"},children:JSON.stringify(e.input,null,2)}),e.result!=null&&e.result.length>0&&s.jsx("pre",{className:"text-[11px] font-mono rounded-[6px] p-[6px_8px] overflow-x-auto max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words leading-[1.5]",style:{background:"var(--color-bg-primary)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-divider)"},children:e.result})]})]})}const Hs={create:{icon:as,color:"var(--color-accent-green)",bg:"var(--color-status-bg-completed)",label:"Create"},modify:{icon:ls,color:"var(--color-accent-yellow)",bg:"var(--color-status-bg-executing)",label:"Modify"},delete:{icon:us,color:"var(--color-accent-red)",bg:"var(--color-status-bg-blocked)",label:"Delete"}};function Ms({entry:e}){const[t,o]=R.useState(!1),n=Hs[e.action],r=n.icon,l=e.diff!=null&&e.diff.length>0;return s.jsxs("div",{className:"rounded-[10px] border border-border overflow-hidden contain-content transition-shadow",style:{backgroundColor:"var(--color-bg-card)",transitionDuration:"var(--duration-slow)"},onMouseEnter:i=>{i.currentTarget.style.boxShadow="0 2px 12px rgba(45,42,38,0.06)"},onMouseLeave:i=>{i.currentTarget.style.boxShadow="none"},children:[s.jsxs("button",{type:"button",onClick:()=>l&&o(i=>!i),className:`flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-2)] text-left transition-colors ${l?"hover:bg-bg-hover cursor-pointer":"cursor-default"}`,style:{transitionDuration:"var(--duration-fast)"},children:[s.jsx(r,{size:14,className:"shrink-0",strokeWidth:1.8,style:{color:n.color}}),s.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--color-text-secondary)"},children:e.path}),s.jsx("span",{className:"ml-auto shrink-0 rounded-[var(--radius-sm)] px-[7px] py-[2px] text-[10px] font-bold uppercase tracking-[0.03em]",style:{backgroundColor:n.bg,color:n.color},children:n.label}),l&&s.jsx($t,{size:14,className:"shrink-0 transition-transform text-text-tertiary",style:{transitionDuration:"var(--duration-fast)",transform:t?"rotate(90deg)":"rotate(0deg)"}})]}),t&&l&&s.jsx("div",{className:"border-t border-border-divider",children:s.jsx("pre",{className:"text-[length:var(--font-size-xs)] font-mono p-[var(--spacing-3)] overflow-x-auto max-h-[300px] overflow-y-auto",style:{background:"var(--code-bg)",color:"var(--code-t1)"},children:e.diff.split(`
|
|
42
|
+
`).map((i,c)=>{const a=i.startsWith("+"),u=i.startsWith("-");return s.jsx("div",{style:{background:a?"rgba(90, 158, 120, 0.1)":u?"rgba(196, 101, 85, 0.1)":void 0,color:a?"#5A9E78":u?"#C46555":void 0},children:i},c)})})})]})}function Bs({entry:e}){const[t,o]=R.useState(!1),n=e.output!=null&&e.output.length>0,r=e.exitCode!=null&&e.exitCode!==0;return s.jsxs("div",{className:"rounded-[10px] border overflow-hidden contain-content font-mono",style:{backgroundColor:"var(--code-bg)",borderColor:r?"var(--color-accent-red)":"var(--code-border)"},children:[s.jsxs("button",{type:"button",onClick:()=>n&&o(l=>!l),className:`flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-2)] text-left transition-colors ${n?"cursor-pointer":"cursor-default"}`,style:{transitionDuration:"var(--duration-fast)"},onMouseEnter:l=>{n&&(l.currentTarget.style.backgroundColor="rgba(255,255,255,0.03)")},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent"},children:[s.jsx(Nn,{size:14,className:"shrink-0",style:{color:"var(--code-t2)"}}),s.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--code-t1)"},children:e.command}),e.exitCode!=null&&s.jsxs("span",{className:"ml-auto shrink-0 text-[10px] font-semibold px-[7px] py-[2px] rounded-[var(--radius-sm)]",style:{color:r?"#D4A07A":"#A3BE8C",backgroundColor:r?"rgba(196,101,85,0.15)":"rgba(90,158,120,0.15)"},children:["exit ",e.exitCode]}),n&&s.jsx($t,{size:14,className:"shrink-0 transition-transform",style:{color:"var(--code-t2)",transitionDuration:"var(--duration-fast)",transform:t?"rotate(90deg)":"rotate(0deg)"}})]}),t&&n&&s.jsx("div",{style:{borderTop:"1px solid var(--code-border)"},children:s.jsx("pre",{className:"text-[11px] leading-[1.5] p-[var(--spacing-3)] overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap break-words",style:{color:"var(--code-t2)"},children:e.output})})]})}function Lt({label:e,light:t}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:16,padding:"0 4px",borderRadius:3,fontSize:10,fontFamily:"monospace",fontWeight:600,lineHeight:1,backgroundColor:t?"rgba(255,255,255,0.2)":"var(--color-bg-hover)",color:t?"rgba(255,255,255,0.8)":"var(--color-text-tertiary)",border:t?"none":"1px solid var(--color-border-divider)"},children:e})}function Ls({entry:e}){function t(o){yt({action:"approve",processId:e.processId,requestId:e.requestId,allow:o})}return s.jsxs("div",{className:"rounded-[10px] overflow-hidden contain-content",style:{backgroundColor:"var(--color-tint-verifying)",border:"1.5px solid var(--color-accent-orange)"},children:[s.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[9px]",style:{borderBottom:"1px solid rgba(200,134,58,0.15)"},children:[s.jsx(xs,{size:15,className:"shrink-0",strokeWidth:1.8,style:{color:"var(--color-accent-orange)"}}),s.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"Permission Required"}),s.jsx("span",{className:"ml-auto shrink-0 rounded-[var(--radius-full)] px-[var(--spacing-2)] py-[2px] text-[10px] font-semibold",style:{backgroundColor:"rgba(200,134,58,0.12)",color:"var(--color-accent-orange)"},children:e.toolName})]}),s.jsx("div",{className:"px-[var(--spacing-3)] py-[10px]",children:s.jsx("pre",{className:"text-[11px] font-mono rounded-[var(--radius-default)] p-[8px_10px] overflow-x-auto max-h-[100px] overflow-y-auto whitespace-pre-wrap break-words",style:{color:"var(--color-text-secondary)",backgroundColor:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)"},children:JSON.stringify(e.toolInput,null,2)})}),s.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)]",style:{borderTop:"1px solid rgba(200,134,58,0.15)"},children:[s.jsxs("button",{type:"button",onClick:()=>t(!0),className:"rounded-[var(--radius-md)] px-[var(--spacing-4)] py-[5px] text-[12px] font-semibold transition-all hover:opacity-90 flex items-center gap-[6px]",style:{backgroundColor:"var(--color-accent-green)",color:"#fff"},children:["Allow",s.jsx(Lt,{label:"Y",light:!0})]}),s.jsxs("button",{type:"button",onClick:()=>t(!1),className:"rounded-[var(--radius-md)] px-[var(--spacing-4)] py-[5px] text-[12px] font-semibold border transition-all flex items-center gap-[6px]",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-accent-red)"},onMouseEnter:o=>{const n=o.currentTarget;n.style.borderColor="var(--color-accent-red)",n.style.backgroundColor="var(--color-tint-blocked)"},onMouseLeave:o=>{const n=o.currentTarget;n.style.borderColor="var(--color-border)",n.style.backgroundColor="var(--color-bg-card)"},children:["Deny",s.jsx(Lt,{label:"Esc"})]}),s.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-placeholder)"},children:[s.jsx(Lt,{label:"A"})," Always"]})]})]})}function As({entry:e}){const t=e.allowed?fs:vs,o=e.allowed?"var(--color-accent-green)":"var(--color-accent-red)",n=e.allowed?"var(--color-status-bg-completed)":"var(--color-status-bg-blocked)",r=e.allowed?"Allowed":"Denied";return s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("span",{className:"inline-flex items-center gap-[var(--spacing-1-5)] rounded-[var(--radius-full)] px-[var(--spacing-3)] py-[var(--spacing-1)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",style:{backgroundColor:n,color:o},children:[s.jsx(t,{size:12}),r]})})}function Os(e){const t=e.split(`
|
|
43
|
+
`)[0],o=t.length>100?t.slice(0,100)+"...":t,n=e.includes(`
|
|
44
|
+
`)||t.length>100;return{summary:o,hasMore:n}}function Ds({entry:e}){const[t,o]=R.useState(!1),{summary:n,hasMore:r}=Os(e.message);return s.jsxs("div",{className:"contain-content",children:[s.jsxs("button",{type:"button",onClick:()=>r&&o(l=>!l),className:"flex items-center gap-[5px] w-full rounded-[5px] transition-opacity hover:opacity-80",style:{padding:"4px 8px",backgroundColor:"rgba(208, 84, 84, 0.06)",margin:"3px 0",fontSize:"10px",color:"var(--color-accent-red, #D05454)",border:"none",textAlign:"left",fontFamily:"inherit",cursor:r?"pointer":"default"},children:[r&&s.jsx($t,{size:10,className:"shrink-0 transition-transform duration-150",style:{transform:t?"rotate(90deg)":"none"}}),s.jsx(Rn,{size:11,className:"shrink-0",strokeWidth:1.8}),s.jsx("span",{className:"truncate flex-1 min-w-0",style:{color:"var(--color-accent-red, #D05454)"},children:n}),e.code&&s.jsx("code",{className:"ml-auto shrink-0 font-mono text-[9px] px-[4px] py-[1px] rounded-[3px]",style:{backgroundColor:"rgba(208, 84, 84, 0.08)",color:"var(--color-accent-red, #D05454)"},children:e.code})]}),t&&r&&s.jsx("pre",{className:"text-[11px] font-mono rounded-[6px] p-[6px_8px] overflow-x-auto max-h-[160px] overflow-y-auto whitespace-pre-wrap break-words leading-[1.5] mt-[2px]",style:{background:"rgba(208, 84, 84, 0.04)",color:"var(--color-accent-red, #D05454)",border:"1px solid rgba(208, 84, 84, 0.12)"},children:e.message})]})}const _s={spawning:"var(--color-status-exploring)",running:"var(--color-status-executing)",paused:"var(--color-status-pending)",stopping:"var(--color-accent-orange)",stopped:"var(--color-status-pending)",error:"var(--color-accent-red)"},Ws={spawning:"var(--color-status-bg-exploring)",running:"var(--color-status-bg-executing)",paused:"var(--color-status-bg-pending)",stopping:"var(--color-status-bg-verifying)",stopped:"var(--color-status-bg-pending)",error:"var(--color-status-bg-blocked)"};function Fs({entry:e}){const t=_s[e.status]??"var(--color-text-tertiary)",o=Ws[e.status]??"var(--color-bg-secondary)";return s.jsxs("div",{className:"flex items-center justify-center gap-[var(--spacing-2)] py-[var(--spacing-1-5)]",children:[s.jsx("span",{className:"flex-1 max-w-[80px] h-[1px]",style:{backgroundColor:"var(--color-border-divider)"}}),s.jsxs("span",{className:"inline-flex items-center gap-[5px] rounded-[var(--radius-full)] px-[10px] py-[2px] text-[10px] font-semibold",style:{backgroundColor:o,color:t},children:[s.jsx(bn,{size:10,strokeWidth:2}),e.status,e.reason&&s.jsxs("span",{className:"text-text-tertiary",children:["-- ",e.reason]})]}),s.jsx("span",{className:"flex-1 max-w-[80px] h-[1px]",style:{backgroundColor:"var(--color-border-divider)"}})]})}function Ho(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ps({entry:e}){const t=e.inputTokens+e.outputTokens,n=Math.min(100,Math.round(t/2e5*100));return s.jsxs("div",{className:"flex items-center gap-[10px] px-3 py-[6px] rounded-[8px] border",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border-divider)"},children:[s.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--color-text-tertiary)"},children:"Tokens"}),s.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:"var(--color-text-secondary)"},children:Ho(t)}),s.jsx("div",{className:"flex-1 max-w-[60px] h-1 rounded-[2px] overflow-hidden",style:{backgroundColor:"var(--color-bg-tertiary)"},children:s.jsx("div",{className:"h-full rounded-[2px]",style:{width:`${n}%`,backgroundColor:"var(--color-accent-orange)"}})}),s.jsx("span",{className:"w-px h-3",style:{backgroundColor:"var(--color-border-divider)"}}),e.cacheReadTokens!=null&&e.cacheReadTokens>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--color-text-tertiary)"},children:"Cache"}),s.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:"var(--color-text-secondary)"},children:Ho(e.cacheReadTokens)})]}),"cost"in e&&typeof e.cost=="number"&&s.jsxs("span",{className:"text-[10px] ml-auto",style:{color:"var(--color-text-tertiary)"},children:["$",e.cost.toFixed(3)]})]})}function Vs({entry:e,isGroupContinuation:t}){switch(e.type){case"user_message":return s.jsx(ks,{entry:e});case"assistant_message":return s.jsx(Ss,{entry:e,isGroupContinuation:t});case"thinking":return s.jsx(js,{entry:e});case"tool_use":return s.jsx(Es,{entry:e});case"file_change":return s.jsx(Ms,{entry:e});case"command_exec":return s.jsx(Bs,{entry:e});case"approval_request":return s.jsx(Ls,{entry:e});case"approval_response":return s.jsx(As,{entry:e});case"error":return s.jsx(Ds,{entry:e});case"status_change":return s.jsx(Fs,{entry:e});case"token_usage":return s.jsx(Ps,{entry:e});default:return null}}const $s=new Set(["assistant_message","error","command_exec","tool_use"]);function Gs(e){const t={source_entry_id:e.id,source_process_id:e.processId};switch(e.type){case"assistant_message":return{...t,title:"Issue from assistant message",description:e.content.slice(0,2e3)};case"error":return{...t,title:`Error: ${e.message.slice(0,100)}`,description:e.message+(e.code?`
|
|
45
|
+
Code: ${e.code}`:""),type:"bug",priority:"high"};case"command_exec":return{...t,title:`Issue from command: ${e.command.slice(0,80)}`,description:[`Command: ${e.command}`,e.exitCode!==void 0?`Exit code: ${e.exitCode}`:"",e.output?`Output:
|
|
46
|
+
${e.output.slice(0,1500)}`:""].filter(Boolean).join(`
|
|
47
|
+
`),type:e.exitCode!==0?"bug":"task"};case"tool_use":return{...t,title:`Issue from tool: ${e.name}`,description:[`Tool: ${e.name}`,`Status: ${e.status}`,`Input: ${JSON.stringify(e.input,null,2).slice(0,500)}`,e.result?`Result: ${e.result.slice(0,1e3)}`:""].filter(Boolean).join(`
|
|
48
|
+
`),type:e.status==="failed"?"bug":"task"};default:return t}}function Us({entry:e,children:t,onCreateIssue:o}){const[n,r]=R.useState(null),l=R.useRef(null),i=$s.has(e.type),c=R.useCallback(u=>{i&&(u.preventDefault(),r({x:u.clientX,y:u.clientY}))},[i]);R.useEffect(()=>{if(!n)return;function u(){r(null)}function f(v){v.key==="Escape"&&r(null)}return document.addEventListener("click",u),document.addEventListener("keydown",f),()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",f)}},[n]);const a=R.useCallback(()=>{r(null),o(Gs(e))},[e,o]);return s.jsxs("div",{onContextMenu:c,className:"relative",children:[t,n&&s.jsx("div",{ref:l,className:Be("fixed z-[100] min-w-[160px] rounded-[var(--radius-default)]","border border-border bg-bg-primary shadow-lg","py-[var(--spacing-1)]","animate-in fade-in-0 zoom-in-95"),style:{left:n.x,top:n.y},role:"menu",children:s.jsxs("button",{type:"button",role:"menuitem",onClick:a,className:Be("flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-1-5)]","text-left text-[length:var(--font-size-sm)] text-text-secondary","hover:bg-bg-hover hover:text-text-primary","transition-colors duration-[var(--duration-fast)]"),children:[s.jsxs("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),s.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),"Create Issue"]})})]})}const Ks=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"improvement",label:"Improvement"},{value:"task",label:"Task"}],Ys=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"urgent",label:"Urgent"}],vt=Be("w-full px-[var(--spacing-3)] py-[var(--spacing-2)]","rounded-[var(--radius-default)] border border-border","bg-bg-secondary text-text-primary","text-[length:var(--font-size-sm)]","focus:outline-none focus:shadow-[var(--shadow-focus-ring)]","transition-shadow duration-[var(--duration-fast)]"),bt="block text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary mb-[var(--spacing-1)]";function Xs({open:e,onOpenChange:t,prefill:o}){const n=yn(b=>b.createIssue),[r,l]=R.useState(""),[i,c]=R.useState(""),[a,u]=R.useState("task"),[f,v]=R.useState("medium"),[x,h]=R.useState(!1);R.useEffect(()=>{e&&o&&(l(o.title??""),c(o.description??""),u(o.type??"task"),v(o.priority??"medium")),e||(l(""),c(""),u("task"),v("medium"))},[e,o]);const w=R.useCallback(async()=>{if(!r.trim())return;h(!0);const b={title:r.trim(),description:i,type:a,priority:f};o!=null&&o.source_entry_id&&(b.source_entry_id=o.source_entry_id),o!=null&&o.source_process_id&&(b.source_process_id=o.source_process_id),await n(b),h(!1),t(!1)},[r,i,a,f,o,n,t]);return s.jsx(wn,{open:e,onOpenChange:t,children:s.jsxs(Cn,{children:[s.jsx(kn,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),s.jsxs(Tn,{className:Be("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[560px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[s.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border shrink-0",children:[s.jsx(In,{className:"text-[length:var(--font-size-lg)] font-[var(--font-weight-semibold)] text-text-primary",children:"Create Issue"}),s.jsx(co,{className:Be("w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]"),"aria-label":"Close",children:s.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-[var(--spacing-6)] space-y-[var(--spacing-4)]",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"issue-title",className:bt,children:"Title"}),s.jsx("input",{id:"issue-title",type:"text",value:r,onChange:b=>l(b.target.value),placeholder:"Brief summary of the issue",className:vt,autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"issue-desc",className:bt,children:"Description"}),s.jsx("textarea",{id:"issue-desc",value:i,onChange:b=>c(b.target.value),placeholder:"Detailed description...",rows:6,className:Be(vt,"resize-y min-h-[120px]")})]}),s.jsxs("div",{className:"flex gap-[var(--spacing-4)]",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{htmlFor:"issue-type",className:bt,children:"Type"}),s.jsx("select",{id:"issue-type",value:a,onChange:b=>u(b.target.value),className:vt,children:Ks.map(b=>s.jsx("option",{value:b.value,children:b.label},b.value))})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{htmlFor:"issue-priority",className:bt,children:"Priority"}),s.jsx("select",{id:"issue-priority",value:f,onChange:b=>v(b.target.value),className:vt,children:Ys.map(b=>s.jsx("option",{value:b.value,children:b.label},b.value))})]})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-[var(--spacing-3)] px-[var(--spacing-6)] py-[var(--spacing-4)] border-t border-border shrink-0",children:[s.jsx(co,{className:Be("px-[var(--spacing-4)] py-[var(--spacing-2)]","rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]"),children:"Cancel"}),s.jsx("button",{type:"button",disabled:!r.trim()||x,onClick:w,className:Be("px-[var(--spacing-4)] py-[var(--spacing-2)]","rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","bg-[var(--color-accent-blue)] text-white","hover:opacity-90","disabled:opacity-50 disabled:cursor-not-allowed","transition-opacity duration-[var(--duration-fast)]"),children:x?"Creating...":"Create Issue"})]})]})]})})}const Mo=[];function Qs({agentType:e}){const t=Qe[e??"claude-code"]??Qe["claude-code"];return s.jsx("div",{className:"max-w-[700px] mx-auto px-4",children:s.jsxs("div",{className:"flex gap-[8px]",style:{paddingTop:10,paddingBottom:10},children:[s.jsxs("div",{className:"relative shrink-0 w-6 h-6 rounded-[6px] flex items-center justify-center mt-[2px] text-[10px] font-bold",style:{backgroundColor:t.tint,color:t.color},children:[t.label,s.jsx("span",{className:"absolute inset-[-3px] rounded-[8px] pointer-events-none",style:{border:"1.5px solid currentColor",color:t.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsxs("div",{className:"flex items-center gap-[3px] pt-[6px]",children:[s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"0ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"150ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"300ms",opacity:.7}})]})]})})}function gl({processId:e}){const t=Pe(p=>e?p.entries[e]??Mo:Mo),o=Pe(p=>e?p.processes[e]:void 0),{virtuosoRef:n,handleScroll:r,handleFollowOutput:l,handleAtBottomStateChange:i,showScrollButton:c,scrollToBottom:a}=os({entries:t,itemCount:t.length}),[u,f]=R.useState(!1),[v,x]=R.useState(),h=R.useCallback(p=>{x(p),f(!0)},[]),w=o==null?void 0:o.status,g=!((e==null?void 0:e.startsWith("cli-history-"))??!1)&&(w==="running"||w==="spawning"),m=R.useMemo(()=>{if(!g||t.length===0)return!1;const p=t[t.length-1];return!(p.type==="assistant_message"&&p.partial)},[g,t]);if(!e)return s.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select a session or start a new conversation"});if(t.length===0){if(g){const p=Qe[(o==null?void 0:o.type)??"claude-code"]??Qe["claude-code"];return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"relative w-8 h-8 rounded-[8px] flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:p.tint,color:p.color},children:[p.label,s.jsx("span",{className:"absolute inset-[-3px] rounded-[10px] pointer-events-none",style:{border:"1.5px solid currentColor",color:p.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"0ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"150ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"300ms",opacity:.7}})]}),s.jsx("span",{className:"text-[12px]",style:{color:"var(--color-text-tertiary)"},children:w==="spawning"?"Starting agent...":"Thinking..."})]})})}return s.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"No messages yet"})}return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex-1 relative",style:{minHeight:0},children:[s.jsx(_r,{ref:n,data:t,followOutput:l,atBottomStateChange:i,onScroll:r,atBottomThreshold:60,className:"h-full",style:{height:"100%"},components:m?{Footer:()=>s.jsx(Qs,{agentType:o==null?void 0:o.type})}:{},itemContent:(p,T)=>{let E=!1;if(T.type==="assistant_message"&&p>0)for(let j=p-1;j>=0;j--){const O=t[j];if(O.type==="assistant_message"){E=!0;break}if(O.type==="user_message")break}return s.jsx("div",{className:"max-w-[700px] mx-auto px-4",children:s.jsx(Us,{entry:T,onCreateIssue:h,children:s.jsx(Vs,{entry:T,isGroupContinuation:E})})})}}),c&&s.jsx("button",{type:"button",onClick:()=>a("smooth"),style:{position:"absolute",bottom:"16px",right:"16px",width:"36px",height:"36px",borderRadius:"50%",border:"1px solid var(--color-border)",background:"var(--color-bg-secondary)",color:"var(--color-text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",transition:"opacity 150ms ease",zIndex:10},"aria-label":"Scroll to bottom",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M8 3v10M4 9l4 4 4-4"})})})]}),s.jsx(Xs,{open:u,onOpenChange:f,prefill:v})]})}const qs=()=>{const e=R.useRef(!1);return{isComposing:e,compositionHandlers:{onCompositionStartCapture:()=>{e.current=!0},onCompositionEndCapture:()=>{e.current=!1}},createKeyDownHandler:(n,r)=>l=>{e.current||r!=null&&r(l)||l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),n())}}},Zs=/^\/([a-zA-Z0-9_-]*)$/;function Js(e){const t=e.match(Zs);return t?t[1]:null}function el(e){const{input:t,commands:o,onSelect:n}=e,r=R.useMemo(()=>Js(t),[t]),[l,i]=R.useState(0),[c,a]=R.useState(!1);R.useEffect(()=>{i(0),a(!1)},[r]);const u=R.useMemo(()=>{if(r===null)return[];const h=r.trim().toLowerCase();return h?o.filter(w=>w.name.toLowerCase().startsWith("/"+h)||w.name.toLowerCase().startsWith(h)):o},[o,r]),f=r!==null&&!c&&u.length>0,v=R.useCallback(h=>{const w=u[h];return w?(n(w.name),a(!0),!0):!1},[u,n]),x=R.useCallback(h=>f?h.key==="Escape"?(h.preventDefault(),a(!0),!0):h.key==="ArrowDown"?(h.preventDefault(),i(w=>(w+1)%u.length),!0):h.key==="ArrowUp"?(h.preventDefault(),i(w=>(w-1+u.length)%u.length),!0):h.key==="Enter"&&!h.shiftKey?(h.preventDefault(),v(l)):!1:!1,[l,v,u.length,f]);return{isOpen:f,activeIndex:l,filteredCommands:u,onKeyDown:x,onSelectByIndex:v,setDismissed:a,setActiveIndex:i}}const tl=30,ol=800;function nl(e,t){const[o,n]=R.useState(!1),r=R.useRef(null),l=R.useRef(!1);return R.useEffect(()=>{if(e.includes(`
|
|
49
|
+
`)){l.current=!0,n(!0);return}if(e.length>=ol){l.current=!0,n(!0);return}if(!e){l.current=!1,n(!1);return}const i=t.current;if(!i)return;const c=requestAnimationFrame(()=>{r.current||(r.current=document.createElement("canvas"));const a=r.current.getContext("2d");if(!a)return;const u=i.querySelector("textarea");if(!u)return;const f=getComputedStyle(u);a.font=`${f.fontWeight} ${f.fontSize} ${f.fontFamily}`;const v=a.measureText(e).width,x=parseFloat(f.paddingLeft)||0,h=parseFloat(f.paddingRight)||0,w=u.clientWidth-x-h,b=l.current;let g;b?g=v>w-tl:g=v>w,l.current=g,n(g)});return()=>cancelAnimationFrame(c)},[e,t]),{isMultiline:o}}const rl=2e5;function At(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString()}function sl(e){return e>=80?"var(--color-accent-red)":e>=50?"var(--color-accent-orange)":"var(--color-accent-green)"}function ll({processId:e,contextWindow:t=rl,size:o=24}){const n=Pe(x=>e?x.processTokenUsage[e]??null:null),[r,l]=R.useState(!1),{percentage:i,ringColor:c,strokeDashoffset:a,circumference:u}=R.useMemo(()=>{const x=n??{input:0,output:0},h=x.input+x.output,w=Math.min(h/t*100,100),g=(o-2.5)/2,m=2*Math.PI*g;return{percentage:w,ringColor:sl(w),strokeDashoffset:m-w/100*m,circumference:m}},[n,t,o]);if(!n)return null;const f=2.5,v=(o-f)/2;return s.jsxs("div",{className:"relative flex items-center justify-center cursor-default",style:{width:o,height:o},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,style:{transform:"rotate(-90deg)"},children:[s.jsx("circle",{cx:o/2,cy:o/2,r:v,fill:"none",stroke:"var(--color-border-divider)",strokeWidth:f}),s.jsx("circle",{cx:o/2,cy:o/2,r:v,fill:"none",stroke:c,strokeWidth:f,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:a,style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.3s ease"}})]}),r&&s.jsxs("div",{className:"absolute bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 px-[10px] py-[6px] rounded-[8px] text-[11px] font-medium whitespace-nowrap z-50 pointer-events-none",style:{backgroundColor:"var(--color-text-primary)",color:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[s.jsxs("div",{style:{marginBottom:2},children:[i.toFixed(1),"% context used"]}),s.jsxs("div",{className:"flex flex-col gap-[2px] text-[10px]",style:{opacity:.85},children:[s.jsxs("span",{children:["Input: ",At(n.input)]}),s.jsxs("span",{children:["Output: ",At(n.output)]}),(n.cacheRead>0||n.cacheWrite>0)&&s.jsxs("span",{children:["Cache: ",At(n.cacheRead+n.cacheWrite)]})]})]})]})}const il=["claude-code","codex","gemini","qwen","opencode","agent-sdk"],al={"claude-code":"C",codex:"Cx","codex-server":"Cs",gemini:"G","gemini-a2a":"Ga",qwen:"Q",opencode:"O","agent-sdk":"S"},cl=[{name:"/maestro-plan",desc:"Create detailed phase plan",color:"var(--color-accent-purple)",bg:"var(--color-tint-planning)"},{name:"/quality-review",desc:"Tiered code review",color:"var(--color-accent-green)",bg:"var(--color-tint-completed)"},{name:"/maestro-execute",desc:"Execute phase with parallelization",color:"var(--color-accent-orange)",bg:"var(--color-tint-verifying)"},{name:"/quality-debug",desc:"Parallel hypothesis debugging",color:"var(--color-accent-blue)",bg:"var(--color-tint-exploring)"}],ul=new Set(["claude-code"]);function vl({processId:e,executor:t}={}){const[o,n]=R.useState(""),[r,l]=R.useState("claude-code"),[i,c]=R.useState("inject"),a=R.useRef(null),u=R.useRef(null),f=R.useRef(null),v=R.useRef(null),{isMultiline:x}=nl(o,u),h=Pe(C=>C.activeProcessId),w=Pe(C=>C.processes),b=e!==void 0?e:h,g=b?w[b]??null:null,m=!!(b&&b.startsWith("cli-history-")&&(g==null?void 0:g.interactive)===!0),p=g!=null?g.interactive===!1:t!=null&&!ul.has(t),T=e!=null&&!b||!m&&p,{compositionHandlers:E,createKeyDownHandler:j}=qs(),O=R.useCallback(C=>{var A;n(C+" "),(A=a.current)==null||A.focus()},[]),d=el({input:o,commands:cl,onSelect:O}),y=R.useCallback(()=>{const C=o.trim();C&&(b&&g?m?yt({action:"delegate:message",processId:b,content:C,delivery:i}):yt({action:"message",processId:b,content:C}):e==null&&yt({action:"spawn",config:{type:r,prompt:C,workDir:"."}}),n(""),d.setDismissed(!0),a.current&&(a.current.style.height="auto"))},[o,b,g,r,e,d,m,i]),S=j(y,d.onKeyDown),M=R.useCallback(()=>{const C=a.current;C&&(C.style.height="auto",C.style.height=`${Math.min(C.scrollHeight,200)}px`)},[]),H=R.useCallback(C=>{n(C.target.value)},[]),P=R.useCallback(C=>{var J,he;const A=(J=C.target.files)==null?void 0:J[0];A&&(n(ie=>ie+(ie?" ":"")+`@${A.name}`),(he=a.current)==null||he.focus()),C.target.value=""},[]),V=R.useCallback(C=>{var J,he;const A=(J=C.target.files)==null?void 0:J[0];A&&(n(ie=>ie+(ie?" ":"")+`@${A.name}`),(he=a.current)==null||he.focus()),C.target.value=""},[]),D=!b&&e==null,U=(g==null?void 0:g.type)??r;return s.jsxs("div",{className:"shrink-0 px-4 pb-[10px] pt-1",style:{backgroundColor:"var(--color-bg-primary)"},children:[s.jsx("input",{ref:f,type:"file",className:"hidden",onChange:P}),s.jsx("input",{ref:v,type:"file",accept:"image/*",className:"hidden",onChange:V}),s.jsxs("div",{className:"max-w-[700px] mx-auto relative",children:[d.isOpen&&s.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-[6px] border rounded-[12px] p-[6px] max-h-[240px] overflow-y-auto z-50",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"0 -4px 20px rgba(0,0,0,0.06)",backdropFilter:"blur(12px)"},children:d.filteredCommands.map((C,A)=>s.jsxs("button",{type:"button",onClick:()=>d.onSelectByIndex(A),onMouseEnter:()=>d.setActiveIndex(A),className:"flex items-center gap-[10px] w-full px-[10px] py-[7px] rounded-[8px] cursor-pointer transition-colors duration-100 text-left border-none",style:{backgroundColor:A===d.activeIndex?"var(--color-bg-hover)":"transparent"},children:[s.jsx("span",{className:"w-7 h-7 rounded-[6px] flex items-center justify-center shrink-0",style:{backgroundColor:C.bg},children:s.jsx(Bo,{size:14,strokeWidth:1.8,stroke:C.color})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-[12px] font-semibold text-text-primary",children:C.name}),s.jsx("div",{className:"text-[11px]",style:{color:"var(--color-text-tertiary)"},children:C.desc})]})]},C.name))}),D&&s.jsxs("div",{className:"flex items-center justify-center gap-[3px] py-[4px]",children:[s.jsxs("div",{className:"flex items-center gap-[4px] px-[10px] py-[3px] rounded-full border text-[10px] font-semibold cursor-pointer transition-all duration-100",style:{borderColor:"var(--color-accent-orange)",backgroundColor:"var(--color-tint-verifying)",color:"var(--color-text-primary)"},children:[s.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),s.jsx("path",{d:"M2 17l10 5 10-5"}),s.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Maestro"]}),s.jsx("div",{className:"flex gap-[1px] ml-[2px]",children:il.map(C=>s.jsx("button",{type:"button",onClick:()=>l(C),title:Ot[C],className:"w-6 h-6 rounded-[4px] border-none flex items-center justify-center cursor-pointer text-[9px] font-bold transition-all duration-100",style:{backgroundColor:r===C?"var(--color-bg-active)":"transparent",color:r===C?"var(--color-text-primary)":"var(--color-text-tertiary)"},onMouseEnter:A=>{r!==C&&(A.currentTarget.style.backgroundColor="var(--color-bg-hover)")},onMouseLeave:A=>{r!==C&&(A.currentTarget.style.backgroundColor="transparent")},children:s.jsx("span",{className:"w-[14px] h-[14px] rounded-[3px] flex items-center justify-center text-[8px] font-bold text-white",style:{backgroundColor:uo[C]},children:al[C]})},C))})]}),s.jsxs("div",{ref:u,className:"border transition-[border-color,box-shadow]",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-card)",borderRadius:"10px",transitionDuration:"var(--duration-normal)"},onFocusCapture:C=>{const A=C.currentTarget;A.style.borderColor="var(--color-accent-blue)",A.style.boxShadow="0 0 0 3px rgba(74,144,217,0.08)"},onBlurCapture:C=>{if(!C.relatedTarget||!(C.relatedTarget instanceof Node)||!C.currentTarget.contains(C.relatedTarget)){const A=C.currentTarget;A.style.borderColor="var(--color-border)",A.style.boxShadow="none"}},children:[s.jsx("textarea",{ref:a,value:o,onChange:H,onInput:M,onKeyDown:S,...E,disabled:T,placeholder:m?"Queue a follow-up for this async delegate...":b?"Send a message...":"Send a message, / for commands...",rows:x?3:1,className:`w-full resize-none border-none leading-[1.5] bg-transparent outline-none disabled:opacity-40 disabled:cursor-not-allowed ${x?"min-h-[72px] max-h-[140px]":"min-h-[36px] max-h-[36px]"}`,style:{color:"var(--color-text-primary)",fontSize:"13px",padding:"8px 12px",fontFamily:"inherit"}}),s.jsxs("div",{className:"flex items-center gap-[4px] px-[5px] py-[3px]",style:{borderTop:"1px solid var(--color-border-divider)"},children:[s.jsx("button",{type:"button",onClick:()=>{var C;return(C=f.current)==null?void 0:C.click()},className:"w-[26px] h-[26px] rounded-[5px] border-none bg-transparent flex items-center justify-center cursor-pointer transition-all duration-100",style:{color:"var(--color-text-tertiary)"},onMouseEnter:C=>{C.currentTarget.style.backgroundColor="var(--color-bg-hover)",C.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent",C.currentTarget.style.color="var(--color-text-tertiary)"},children:s.jsx(Sn,{size:13,strokeWidth:2})}),s.jsx("button",{type:"button",onClick:()=>{var C;d.isOpen?d.setDismissed(!0):(n("/"),(C=a.current)==null||C.focus())},className:"px-[7px] py-[2px] rounded-[4px] border-none bg-transparent text-[10px] font-medium cursor-pointer transition-all duration-100",style:{color:"var(--color-text-tertiary)",fontFamily:"inherit"},onMouseEnter:C=>{C.currentTarget.style.backgroundColor="var(--color-bg-hover)",C.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent",C.currentTarget.style.color="var(--color-text-tertiary)"},children:"Skills"}),s.jsx(ll,{processId:b}),m&&s.jsxs("div",{className:"flex items-center gap-[5px] px-[10px] py-[3px] text-[11px] font-medium",style:{border:"var(--style-btn-secondary-border)",backgroundColor:"var(--style-btn-secondary-bg)",borderRadius:"var(--style-btn-secondary-radius)",color:"var(--color-text-secondary)"},children:[s.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Delivery"}),s.jsxs("select",{value:i,onChange:C=>c(C.target.value),className:"border-none bg-transparent cursor-pointer outline-none appearance-none text-[11px] font-medium",style:{color:"inherit"},children:[s.jsx("option",{value:"inject",children:"Inject"}),s.jsx("option",{value:"after_complete",children:"After Complete"})]})]}),!D&&s.jsxs("div",{className:"flex items-center gap-[5px] ml-auto px-[7px] py-[2px] text-[10px] font-medium",style:{color:"var(--color-text-tertiary)"},children:[s.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:uo[U]}}),Ot[U]??U]}),s.jsx("div",{className:"flex-1"}),s.jsx("button",{type:"button",onClick:y,disabled:!o.trim()||T,className:"shrink-0 w-[28px] h-[28px] rounded-[7px] flex items-center justify-center transition-all disabled:opacity-40 disabled:cursor-not-allowed border-none cursor-pointer",style:{backgroundColor:"var(--color-accent-orange)",color:"#fff",transition:"all 150ms cubic-bezier(0.34,1.56,0.64,1)"},onMouseEnter:C=>{T||(C.currentTarget.style.transform="scale(1.06)")},onMouseLeave:C=>{C.currentTarget.style.transform="scale(1)"},"aria-label":"Send message",children:s.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),s.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})]})]})}export{vl as C,gl as M};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var We=e=>{throw TypeError(e)};var He=(e,t,r)=>t.has(e)||We("Cannot "+r);var ie=(e,t,r)=>(He(e,t,"read from private field"),r?r.call(e):t.get(e)),Ve=(e,t,r)=>t.has(e)?We("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ue=(e,t,r,n)=>(He(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{d as kt,k as O,r as f,s as me,j as o,X as Ct,q as W,t as Jt,F as Ke,v as pe,w as zt,M as Qt}from"./index-DWG-WrzT.js";import{C as Ye,M as er}from"./ChatInput-Bvr-FeEq.js";import{T as tr}from"./TreeBrowser-Q12qobZs.js";import"./zap-4uwlzVm0.js";import"./MarkdownRenderer-X4af_WNb.js";import"./chevron-right-Csu22t58.js";import"./terminal-BB3Xfuv5.js";import"./circle-alert-c3tH1P4z.js";import"./search-SieXnOgr.js";import"./folder-CWq_lAnf.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const rr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],nr=kt("rows-2",rr);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const or=[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],sr=kt("square-split-horizontal",or);function ar(e){const t=O(n=>n.pendingApprovals),r=f.useMemo(()=>e?Object.values(t).find(n=>n.processId===e)??null:null,[e,t]);f.useEffect(()=>{if(!r)return;function n(a){const i=a.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)return;const p=a.key;if(p==="y"||p==="Y"){a.preventDefault(),me({action:"approve",processId:r.processId,requestId:r.id,allow:!0});return}if(p==="Escape"){a.preventDefault(),me({action:"approve",processId:r.processId,requestId:r.id,allow:!1});return}if(p==="a"||p==="A"){a.preventDefault(),me({action:"approve",processId:r.processId,requestId:r.id,allow:!0});return}}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r])}const Tt=f.createContext(null);function ir({children:e,content:t}){return o.jsx(Tt,{value:t,children:e})}function lr(){return f.useContext(Tt)}const cr={spawning:"var(--color-accent-blue)",running:"var(--color-accent-green, #4caf50)",paused:"var(--color-accent-yellow)",stopping:"var(--color-accent-orange)",stopped:"var(--color-text-tertiary)",error:"var(--color-accent-red, #e53935)"},Ze={spawning:"starting",running:"running",paused:"paused",stopping:"stopping",error:"error"},ur=f.memo(function({tab:t,isActive:r,isFocused:n,processStatus:a,onSelect:i,onClose:p,onDragStart:l,groupId:s}){const u=f.useCallback(()=>{i(t.id)},[i,t.id]),c=f.useCallback(g=>{g.stopPropagation(),p(t.id)},[p,t.id]),h=f.useCallback(g=>{l(t.id,g)},[l,t.id]),d=f.useCallback(g=>{g.preventDefault(),g.dataTransfer.dropEffect="move"},[]),m=a?cr[a]??"var(--color-text-tertiary)":void 0;return o.jsxs("div",{role:"tab","aria-selected":r,tabIndex:r?0:-1,className:`
|
|
12
|
+
group relative flex items-center gap-[var(--spacing-1)] h-[28px]
|
|
13
|
+
min-w-[100px] max-w-[240px] px-[var(--spacing-2)] cursor-pointer
|
|
14
|
+
select-none whitespace-nowrap transition-colors duration-100
|
|
15
|
+
text-[length:var(--font-size-xs)]
|
|
16
|
+
${r?"bg-bg-primary text-text-primary border-b-[2px] border-b-accent-blue":"text-text-tertiary hover:bg-bg-hover border-b-[2px] border-b-transparent"}
|
|
17
|
+
|
|
18
|
+
`,style:{flexShrink:1},onClick:u,onDragStart:h,onDragOver:d,draggable:!0,"data-tab-id":t.id,"data-group-id":s,title:t.title,children:[o.jsx("svg",{className:"shrink-0",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",stroke:m??"var(--color-accent-green)",children:o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),o.jsx("span",{className:"truncate flex-1 min-w-0",children:t.title}),a&&Ze[a]&&o.jsxs("span",{className:"text-[9px] font-normal shrink-0",style:{color:r?"var(--color-text-tertiary)":"var(--color-text-placeholder)"},children:["· ",Ze[a]]}),o.jsx("button",{className:`
|
|
19
|
+
p-[2px] rounded-[var(--radius-sm)] hover:bg-bg-active transition-opacity shrink-0
|
|
20
|
+
${r?"opacity-100":"opacity-0 group-hover:opacity-100"}
|
|
21
|
+
`,onClick:c,"aria-label":`Close ${t.title}`,tabIndex:-1,children:o.jsx(Ct,{size:12,className:"text-text-tertiary"})})]})}),Xe="application/json",qe="maestro-tab-drag";function Ce(e){return e.type==="leaf"?[e]:[...Ce(e.first),...Ce(e.second)]}const dr=f.memo(function({tabs:t,activeTabId:r,groupId:n,isFocused:a,onTabSelect:i,onTabClose:p}){const{state:l,dispatch:s}=W(),u=O(g=>g.processes),c=f.useRef(null),h=f.useCallback((g,x)=>{const y=t.find(b=>b.id===g);if(!y)return;const v={type:qe,tabId:g,sourceGroupId:n,processId:y.ref};x.dataTransfer.setData(Xe,JSON.stringify(v)),x.dataTransfer.effectAllowed="move"},[t,n]),d=f.useCallback(g=>{g.preventDefault();const x=g.dataTransfer.getData(Xe);if(!x)return;let y;try{y=JSON.parse(x)}catch{return}if(y.type!==qe)return;const v=Ce(l.editorArea).find(w=>w.id===y.sourceGroupId);if(!v)return;const b=v.tabs.find(w=>w.id===y.tabId);b&&(y.sourceGroupId===n?s({type:"SET_ACTIVE_TAB",groupId:n,tabId:y.tabId}):(s({type:"CLOSE_TAB",groupId:y.sourceGroupId,tabId:y.tabId}),s({type:"OPEN_TAB",groupId:n,tab:b})))},[l.editorArea,n,s]),m=f.useCallback(g=>{g.preventDefault(),g.dataTransfer.dropEffect="move"},[]);return o.jsxs("div",{className:"flex items-center h-[var(--size-tabbar-height)] min-h-[var(--size-tabbar-height)] bg-bg-secondary",onDrop:d,onDragOver:m,"data-tab-bar":n,children:[o.jsx("div",{ref:c,className:"flex items-end h-full overflow-x-auto scrollbar-none flex-1 min-w-0",role:"tablist","aria-label":"Open sessions",children:t.map(g=>{const x=g.id===r,y=g.ref?u[g.ref]:void 0,v=y==null?void 0:y.status;return o.jsx(ur,{tab:g,isActive:x,isFocused:a,processStatus:v,onSelect:i,onClose:p,onDragStart:h,groupId:n},g.id)})}),o.jsx(fr,{groupId:n})]})}),pr=[{type:"chat",label:"Chat",color:"var(--color-accent-green)",icon:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},{type:"file",label:"Code",color:"var(--color-accent-blue)",icon:""},{type:"agent",label:"Terminal",color:"var(--color-accent-orange)",icon:""}];let Je=0;function fr({groupId:e}){const[t,r]=f.useState(!1),{dispatch:n}=W(),a=f.useRef(null),[i,p]=f.useState({top:0,left:0}),l=f.useCallback(s=>{Je++;const u={id:`new-${s.type}-${Je}`,type:s.type,title:s.label,ref:""};n({type:"OPEN_TAB",groupId:e,tab:u}),r(!1)},[n,e]);return f.useEffect(()=>{if(t&&a.current){const s=a.current.getBoundingClientRect();p({top:s.bottom+2,left:s.left})}},[t]),o.jsxs("div",{className:"self-center ml-[2px] shrink-0",children:[o.jsx("button",{ref:a,type:"button",onClick:s=>{s.stopPropagation(),r(u=>!u)},className:"w-[22px] h-[22px] rounded-[4px] border-none bg-transparent flex items-center justify-center cursor-pointer transition-all duration-100",style:{color:"var(--color-text-placeholder)"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--color-bg-hover)",s.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:s=>{t||(s.currentTarget.style.backgroundColor="transparent",s.currentTarget.style.color="var(--color-text-placeholder)")},title:"New tab",children:o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),t&&Jt.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{position:"fixed",inset:0,zIndex:9998},onClick:()=>r(!1)}),o.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:9999,backgroundColor:"var(--color-bg-card)",border:"1px solid var(--color-border)",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.12)",minWidth:120,overflow:"hidden"},children:pr.map(s=>o.jsxs("button",{type:"button",onClick:()=>l(s),className:"flex items-center gap-[6px] w-full px-[10px] py-[6px] border-none bg-transparent cursor-pointer text-left transition-colors duration-100 text-[11px]",style:{color:"var(--color-text-primary)",fontFamily:"inherit"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="var(--color-bg-hover)"},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent"},children:[o.jsx(hr,{type:s.type,color:s.color}),o.jsx("span",{className:"font-medium",children:s.label})]},s.type))})]}),document.body)]})}function hr({type:e,color:t}){return e==="chat"?o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}):e==="file"?o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("polyline",{points:"16 18 22 12 16 6"}),o.jsx("polyline",{points:"8 6 2 12 8 18"})]}):o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("polyline",{points:"4 17 10 11 4 5"}),o.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}function Qe(e){if(e<60)return`${e}s`;const t=Math.floor(e/60),r=e%60;return`${t}m ${r}s`}function xr({processId:e}){const t=O(s=>e?s.processThoughts[e]:void 0),r=O(s=>e?s.processStreaming[e]??!1:!1),[n,a]=f.useState(0),i=f.useRef(Date.now());if(f.useEffect(()=>{if(!r&&!(t!=null&&t.subject)){a(0);return}i.current=Date.now(),a(0);const s=setInterval(()=>{a(Math.floor((Date.now()-i.current)/1e3))},1e3);return()=>clearInterval(s)},[r,t==null?void 0:t.subject]),!r&&!(t!=null&&t.subject))return null;const p=()=>{e&&me({action:"stop",processId:e})};if(r&&!(t!=null&&t.subject))return o.jsx("div",{style:et,children:o.jsxs("div",{style:tt,children:[o.jsx(rt,{}),o.jsxs("span",{style:{color:"var(--color-text-secondary)",fontSize:12},children:["Processing...",o.jsxs("span",{style:{marginLeft:6,opacity:.6},children:["(",Qe(n),")"]})]}),o.jsx(nt,{onClick:p})]})});const l=t&&t.description&&t.description!==t.subject;return o.jsx("div",{style:et,children:o.jsxs("div",{style:tt,children:[r&&o.jsx(rt,{}),(t==null?void 0:t.subject)&&o.jsx("span",{style:gr,children:t.subject}),l&&o.jsx("span",{style:{flex:1,fontSize:12,color:"var(--color-text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.description}),r&&o.jsxs("span",{style:{fontSize:11,color:"var(--color-text-tertiary)",whiteSpace:"nowrap"},children:["(",Qe(n),")"]}),r&&o.jsx(nt,{onClick:p})]})})}const et={background:"linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-primary) 100%)",borderRadius:10,padding:"8px 12px",margin:"0 16px 4px 16px",border:"1px solid var(--color-border-divider)"},tt={display:"flex",alignItems:"center",gap:8},gr={display:"inline-block",fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:6,backgroundColor:"var(--color-tint-exploring)",color:"var(--color-accent-blue)",whiteSpace:"nowrap"};function rt(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-accent-blue)",strokeWidth:"2.5",strokeLinecap:"round",style:{animation:"spin 1s linear infinite",flexShrink:0},children:[o.jsx("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})}function nt({onClick:e}){return o.jsx("button",{type:"button",onClick:e,style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:6,border:"1px solid var(--color-border)",backgroundColor:"var(--color-bg-card)",cursor:"pointer",color:"var(--color-text-tertiary)",flexShrink:0,padding:0,transition:"all 150ms"},onMouseEnter:t=>{const r=t.currentTarget;r.style.borderColor="var(--color-accent-red)",r.style.backgroundColor="var(--color-tint-blocked)",r.style.color="var(--color-accent-red)"},onMouseLeave:t=>{const r=t.currentTarget;r.style.borderColor="var(--color-border)",r.style.backgroundColor="var(--color-bg-card)",r.style.color="var(--color-text-tertiary)"},"aria-label":"Stop process",children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})})}function vr(e){var n;const t=((n=e.split(".").pop())==null?void 0:n.toLowerCase())??"";return{ts:"ts",tsx:"ts",js:"js",jsx:"js",mjs:"js",cjs:"js",json:"json",css:"css",html:"html",md:"md",yaml:"yaml",yml:"yaml",py:"py",rs:"rs",go:"go",sh:"sh",bash:"sh"}[t]??""}function mr(e,t){if(!t||t==="md")return[e];const r=[],n=t==="json"?[[/"(?:[^"\\]|\\.)*"/g,"var(--color-accent-green, #3D9B6F)"],[/\b(true|false|null)\b/g,"var(--color-accent-orange, #D4832E)"],[/\b\d+(?:\.\d+)?\b/g,"var(--color-accent-blue, #4A90D9)"]]:[[/\/\/.*$/gm,"var(--color-text-tertiary)"],[/(['"`])(?:(?!\1|\\).|\\.)*\1/g,"var(--color-accent-green, #3D9B6F)"],[/`[^`]*`/g,"var(--color-accent-green, #3D9B6F)"],[/\b(import|export|from|const|let|var|function|return|if|else|for|while|class|interface|type|extends|implements|new|async|await|try|catch|throw|switch|case|break|default|yield|of|in|as|is|typeof|instanceof|void|null|undefined|true|false|this|super|static|readonly|public|private|protected|abstract|enum|namespace|module|declare|require)\b/g,"var(--color-accent-purple, #8B6BBF)"],[/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/g,"var(--color-accent-blue, #4A90D9)"],[/\b([a-zA-Z_$]\w*)\s*\(/g,"var(--color-accent-orange, #D4832E)"]],a=[];for(const[s,u]of n){const c=new RegExp(s.source,s.flags);let h;for(;(h=c.exec(e))!==null;)h[1]&&s.source.includes("\\(")?a.push({start:h.index,end:h.index+h[1].length,text:h[1],color:u}):a.push({start:h.index,end:h.index+h[0].length,text:h[0],color:u})}a.sort((s,u)=>s.start-u.start);const i=[];let p=0;for(const s of a)s.start>=p&&(i.push(s),p=s.end);let l=0;for(const s of i)s.start>l&&r.push(e.slice(l,s.start)),r.push({text:s.text,color:s.color}),l=s.end;return l<e.length&&r.push(e.slice(l)),r.length>0?r:[e]}function yr({filePath:e,onClose:t,embedded:r}){const[n,a]=f.useState(null),[i,p]=f.useState(!0),[l,s]=f.useState(null);f.useEffect(()=>{let m=!1;return p(!0),s(null),fetch(`/api/workspace/file?path=${encodeURIComponent(e)}`).then(async g=>{m||(g.ok?a(await g.text()):(s(`Failed to load: ${g.status}`),a(null)))}).catch(()=>{m||s("Failed to fetch file")}).finally(()=>{m||p(!1)}),()=>{m=!0}},[e]);const u=e.split("/").pop()??e,c=vr(e),h=f.useMemo(()=>(n==null?void 0:n.split(`
|
|
22
|
+
`))??[],[n]),d=h.length>0?String(h.length).length:1;return o.jsxs("div",{className:"flex flex-col h-full",children:[!r&&o.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 py-2 border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-secondary)"},children:[o.jsx(Ke,{size:13,strokeWidth:1.8,style:{color:"var(--color-text-tertiary)"}}),o.jsx("span",{className:"text-[12px] font-medium truncate flex-1",style:{color:"var(--color-text-primary)"},title:e,children:u}),o.jsx("span",{className:"text-[10px] truncate max-w-[200px]",style:{color:"var(--color-text-tertiary)"},children:e}),o.jsx("button",{type:"button",onClick:t,className:"w-6 h-6 rounded flex items-center justify-center transition-colors",style:{color:"var(--color-text-tertiary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--color-bg-hover)",m.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent",m.currentTarget.style.color="var(--color-text-tertiary)"},"aria-label":"Close file viewer",children:o.jsx(Ct,{size:12,strokeWidth:2})})]}),r&&o.jsxs("div",{className:"shrink-0 flex items-center gap-[6px] px-3 h-[26px] border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-primary)"},children:[o.jsx(Ke,{size:12,strokeWidth:1.8,style:{color:"var(--color-text-tertiary)"}}),o.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--color-text-secondary)"},title:e,children:e})]}),o.jsxs("div",{className:"flex-1 overflow-auto",children:[i&&o.jsx("div",{className:"p-4 text-[12px] animate-pulse",style:{color:"var(--color-text-tertiary)"},children:"Loading..."}),l&&o.jsx("div",{className:"p-4 text-[12px]",style:{color:"var(--color-accent-red)"},children:l}),!i&&!l&&n!==null&&o.jsx("div",{className:"m-0 text-[12px] leading-[1.7]",style:{fontFamily:"var(--font-mono)",tabSize:2},children:h.map((m,g)=>o.jsxs("div",{className:"flex hover:bg-bg-hover",style:{minHeight:"1.7em"},children:[o.jsx("span",{className:"shrink-0 select-none text-right pr-[12px] pl-[12px]",style:{color:"var(--color-text-placeholder)",width:`${d+3}ch`,userSelect:"none"},children:g+1}),o.jsx("span",{className:"flex-1 whitespace-pre-wrap break-all pr-4",style:{color:"var(--color-text-primary)"},children:mr(m,c).map((x,y)=>typeof x=="string"?o.jsx("span",{children:x},y):o.jsx("span",{style:{color:x.color},children:x.text},y))})]},g))})]})]})}const br=2;function ze(e,t){if(e.type==="leaf")return e.id===t?0:-1;const r=ze(e.first,t);if(r>=0)return r+1;const n=ze(e.second,t);return n>=0?n+1:-1}function wr({tab:e}){switch(e.type){case"chat":case"agent":return e.ref?o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:o.jsx(er,{processId:e.ref})}),o.jsx(xr,{processId:e.ref}),o.jsx(Ye,{processId:e.ref})]}):o.jsx("div",{className:"flex-1 flex flex-col items-center justify-center h-full",children:o.jsxs("div",{className:"w-full px-4",style:{maxWidth:"clamp(360px, calc(100% - 32px), 700px)"},children:[o.jsxs("div",{className:"flex flex-col items-center mb-6",children:[o.jsx("h2",{className:"text-[16px] font-semibold mb-[6px]",style:{color:"var(--color-text-secondary)"},children:"Start a new conversation"}),o.jsx("p",{className:"text-[13px]",style:{color:"var(--color-text-tertiary)"},children:"Select an agent, type a message, and press Enter to begin."})]}),o.jsx(Ye,{processId:null})]})});case"file":return e.ref?o.jsx(yr,{filePath:e.ref,onClose:()=>{},embedded:!0}):o.jsx("div",{className:"flex items-center justify-center h-full text-[12px]",style:{color:"var(--color-text-placeholder)"},children:"Open a file from the Explorer sidebar"});default:return o.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[13px]",children:e.title})}}const Sr=f.memo(function({node:t}){const{state:r,dispatch:n}=W(),a=pe(v=>v.focusedGroupId),i=lr(),p=a===t.id,l=t.id==="editor-group-1",s=f.useRef(t.tabs);s.current=t.tabs;const u=f.useRef(t.activeTabId);u.current=t.activeTabId;const c=f.useRef(t.id);c.current=t.id;const h=f.useCallback(v=>{n({type:"SET_ACTIVE_TAB",groupId:t.id,tabId:v});const b=t.tabs.find(w=>w.id===v);(b==null?void 0:b.type)==="chat"&&b.ref&&O.getState().setActiveProcessId(b.ref)},[n,t.id,t.tabs]),d=f.useCallback(v=>{n({type:"CLOSE_TAB",groupId:t.id,tabId:v})},[n,t.id]),m=f.useCallback(()=>{n({type:"SPLIT_GROUP",groupId:t.id,direction:"horizontal"})},[n,t.id]),g=f.useCallback(()=>{n({type:"SPLIT_GROUP",groupId:t.id,direction:"vertical"})},[n,t.id]),x=f.useCallback(()=>{p||n({type:"SET_FOCUSED_GROUP",groupId:t.id})},[n,t.id,p]),y=ze(r.editorArea,t.id)<br;return f.useEffect(()=>{function v(b){const w=s.current,j=u.current,S=c.current;if(b.ctrlKey&&b.key==="Tab"&&!b.shiftKey){if(b.preventDefault(),w.length<2)return;const T=(w.findIndex(I=>I.id===j)+1)%w.length;n({type:"SET_ACTIVE_TAB",groupId:S,tabId:w[T].id});return}if(b.ctrlKey&&b.key==="Tab"&&b.shiftKey){if(b.preventDefault(),w.length<2)return;const T=(w.findIndex(I=>I.id===j)-1+w.length)%w.length;n({type:"SET_ACTIVE_TAB",groupId:S,tabId:w[T].id});return}if(b.ctrlKey&&b.key==="w"){if(b.preventDefault(),!j)return;n({type:"CLOSE_TAB",groupId:S,tabId:j});return}}return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n]),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden ",onMouseDown:x,"data-editor-group":t.id,children:[o.jsxs("div",{className:"flex items-center shrink-0 h-[28px] border-b border-border bg-bg-secondary",children:[o.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:o.jsx(dr,{tabs:t.tabs,activeTabId:t.activeTabId,groupId:t.id,isFocused:p,onTabSelect:h,onTabClose:d})}),y&&o.jsxs("div",{className:"flex items-center gap-[1px] px-1 shrink-0",children:[o.jsx("button",{className:"p-[3px] rounded-[var(--radius-sm)] hover:bg-bg-active text-text-tertiary hover:text-text-secondary transition-colors",onClick:m,title:"Split Right","aria-label":"Split right",children:o.jsx(sr,{size:13})}),o.jsx("button",{className:"p-[3px] rounded-[var(--radius-sm)] hover:bg-bg-active text-text-tertiary hover:text-text-secondary transition-colors",onClick:g,title:"Split Down","aria-label":"Split down",children:o.jsx(nr,{size:13})})]})]}),o.jsx("div",{className:"flex-1 overflow-hidden relative",children:t.tabs.length===0?l&&i?o.jsx("div",{className:"h-full overflow-y-auto",children:i}):o.jsx("div",{className:"flex items-center justify-center h-full text-[12px]",style:{color:"var(--color-text-placeholder)"},children:"Click + to open a new tab"}):t.tabs.map(v=>o.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{display:v.id===t.activeTabId?"flex":"none"},"data-tab-content":v.id,children:o.jsx(wr,{tab:v})},v.id))})]})});function jr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function kr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function Cr(e){return e/100*window.innerHeight}function zr(e){return e/100*window.innerWidth}function Tr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function ce({groupSize:e,panelElement:t,styleProp:r}){let n;const[a,i]=Tr(r);switch(i){case"%":{n=a/100*e;break}case"px":{n=a;break}case"rem":{n=kr(t,a);break}case"em":{n=jr(t,a);break}case"vh":{n=Cr(a);break}case"vw":{n=zr(a);break}}return n}function A(e){return parseFloat(e.toFixed(3))}function oe({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,a)=>(n+=t==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,n),0)}function Te(e){const{panels:t}=e,r=oe({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:a,panelConstraints:i}=n;let p=0;if(i.collapsedSize!==void 0){const c=ce({groupSize:r,panelElement:a,styleProp:i.collapsedSize});p=A(c/r*100)}let l;if(i.defaultSize!==void 0){const c=ce({groupSize:r,panelElement:a,styleProp:i.defaultSize});l=A(c/r*100)}let s=0;if(i.minSize!==void 0){const c=ce({groupSize:r,panelElement:a,styleProp:i.minSize});s=A(c/r*100)}let u=100;if(i.maxSize!==void 0){const c=ce({groupSize:r,panelElement:a,styleProp:i.maxSize});u=A(c/r*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:p,collapsible:i.collapsible===!0,defaultSize:l,disabled:i.disabled,minSize:s,maxSize:u,panelId:n.id}})}function N(e,t="Assertion error"){if(!e)throw Error(t)}function Le(e,t){return Array.from(t).sort(e==="horizontal"?Lr:Er)}function Lr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function Er(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Lt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Et(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Nr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let a,i=Number.MAX_VALUE;for(const p of t){const{x:l,y:s}=Et(n,p),u=e==="horizontal"?l:s;u<i&&(i=u,a=p)}return N(a,"No rect found"),a}let ge;function Ir(){return ge===void 0&&(typeof matchMedia=="function"?ge=!!matchMedia("(pointer:coarse)").matches:ge=!1),ge}function Nt(e){const{element:t,orientation:r,panels:n,separators:a}=e,i=Le(r,Array.from(t.children).filter(Lt).map(g=>({element:g}))).map(({element:g})=>g),p=[];let l=!1,s=!1,u=-1,c=-1,h=0,d,m=[];{let g=-1;for(const x of i)x.hasAttribute("data-panel")&&(g++,x.hasAttribute("data-disabled")||(h++,u===-1&&(u=g),c=g))}if(h>1){let g=-1;for(const x of i)if(x.hasAttribute("data-panel")){g++;const y=n.find(v=>v.element===x);if(y){if(d){const v=d.element.getBoundingClientRect(),b=x.getBoundingClientRect();let w;if(s){const j=r==="horizontal"?new DOMRect(v.right,v.top,0,v.height):new DOMRect(v.left,v.bottom,v.width,0),S=r==="horizontal"?new DOMRect(b.left,b.top,0,b.height):new DOMRect(b.left,b.top,b.width,0);switch(m.length){case 0:{w=[j,S];break}case 1:{const C=m[0],T=Nr({orientation:r,rects:[v,b],targetRect:C.element.getBoundingClientRect()});w=[C,T===v?S:j];break}default:{w=m;break}}}else m.length?w=m:w=[r==="horizontal"?new DOMRect(v.right,b.top,b.left-v.right,b.height):new DOMRect(b.left,v.bottom,b.width,b.top-v.bottom)];for(const j of w){let S="width"in j?j:j.element.getBoundingClientRect();const C=Ir()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<C){const I=C-S.width;S=new DOMRect(S.x-I/2,S.y,S.width+I,S.height)}if(S.height<C){const I=C-S.height;S=new DOMRect(S.x,S.y-I/2,S.width,S.height+I)}const T=g<=u||g>c;!l&&!T&&p.push({group:e,groupSize:oe({group:e}),panels:[d,y],separator:"width"in j?void 0:j,rect:S}),l=!1}}s=!1,d=y,m=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(l=!0);const y=a.find(v=>v.element===x);y?m.push(y):(d=void 0,m=[])}else s=!0}return p}var V;class It{constructor(){Ve(this,V,{})}addListener(t,r){const n=ie(this,V)[t];return n===void 0?ie(this,V)[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=ie(this,V)[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let a=!1,i=null;const p=Array.from(n);for(let l=0;l<p.length;l++){const s=p[l];try{s.call(null,r)}catch(u){i===null&&(a=!0,i=u)}}if(a)throw i}}removeAllListeners(){Ue(this,V,{})}removeListener(t,r){const n=ie(this,V)[t];if(n!==void 0){const a=n.indexOf(r);a>=0&&n.splice(a,1)}}}V=new WeakMap;let F=new Map;const Mt=new It;function Mr(e){F=new Map(F),F.delete(e)}function ot(e,t){for(const[r]of F)if(r.id===e)return r}function U(e,t){for(const[r,n]of F)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function q(){return F}function De(e,t){return Mt.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function G(e,t){const r=F.get(e);F=new Map(F),F.set(e,t),Mt.emit("groupChange",{group:e,prev:r,next:t})}function Dr(e,t,r){let n,a={x:1/0,y:1/0};for(const i of t){const p=Et(r,i.rect);switch(e){case"horizontal":{p.x<=a.x&&(n=i,a=p);break}case"vertical":{p.y<=a.y&&(n=i,a=p);break}}}return n?{distance:a,hitRegion:n}:void 0}function Rr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Pr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:it(e),b:it(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();N(n,"Stacking order can only be calculated for elements with a common ancestor");const a={a:at(st(r.a)),b:at(st(r.b))};if(a.a===a.b){const i=n.childNodes,p={a:r.a.at(-1),b:r.b.at(-1)};let l=i.length;for(;l--;){const s=i[l];if(s===p.a)return 1;if(s===p.b)return-1}}return Math.sign(a.a-a.b)}const Ar=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Or(e){const t=getComputedStyle(Dt(e)??e).display;return t==="flex"||t==="inline-flex"}function Br(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Or(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Ar.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function st(e){let t=e.length;for(;t--;){const r=e[t];if(N(r,"Missing node"),Br(r))return r}return null}function at(e){return e&&Number(getComputedStyle(e).zIndex)||0}function it(e){const t=[];for(;e;)t.push(e),e=Dt(e);return t}function Dt(e){const{parentNode:t}=e;return Rr(t)?t.host:t}function $r(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Fr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Lt(r)||r.contains(e)||e.contains(r))return!0;if(Pr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if($r(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Re(e,t){const r=[];return t.forEach((n,a)=>{if(a.disabled)return;const i=Nt(a),p=Dr(a.orientation,i,{x:e.clientX,y:e.clientY});p&&p.distance.x<=0&&p.distance.y<=0&&Fr({groupElement:a.element,hitRegion:p.hitRegion.rect,pointerEventTarget:e.target})&&r.push(p.hitRegion)}),r}function _r(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function P(e,t,r=0){return Math.abs(A(e)-A(t))<=r}function $(e,t){return P(e,t)?0:e>t?1:-1}function te({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:a=0,collapsible:i,disabled:p,maxSize:l=100,minSize:s=0}=t;if(p&&!e)return r;if($(n,s)<0)if(i){const u=(a+s)/2;$(n,u)<0?n=a:n=s}else n=s;return n=Math.min(l,n),n=A(n),n}function fe({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(P(e,0))return t;const p=i==="imperative-api",l=Object.values(t),s=Object.values(a),u=[...l],[c,h]=n;N(c!=null,"Invalid first pivot index"),N(h!=null,"Invalid second pivot index");let d=0;switch(i){case"keyboard":{{const x=e<0?h:c,y=r[x];N(y,`Panel constraints not found for index ${x}`);const{collapsedSize:v=0,collapsible:b,minSize:w=0}=y;if(b){const j=l[x];if(N(j!=null,`Previous layout not found for panel index ${x}`),P(j,v)){const S=w-j;$(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const x=e<0?c:h,y=r[x];N(y,`No panel constraints found for index ${x}`);const{collapsedSize:v=0,collapsible:b,minSize:w=0}=y;if(b){const j=l[x];if(N(j!=null,`Previous layout not found for panel index ${x}`),P(j,w)){const S=j-v;$(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const x=e<0?h:c,y=r[x];N(y,`Panel constraints not found for index ${x}`);const v=l[x],{collapsible:b,collapsedSize:w,minSize:j}=y;if(b&&$(v,j)<0)if(e>0){const S=j-w,C=S/2,T=v+e;$(T,j)<0&&(e=$(e,C)<=0?0:S)}else{const S=j-w,C=100-S/2,T=v-e;$(T,j)<0&&(e=$(100+e,C)>0?0:-S)}break}}{const x=e<0?1:-1;let y=e<0?h:c,v=0;for(;;){const w=l[y];N(w!=null,`Previous layout not found for panel index ${y}`);const j=te({overrideDisabledPanels:p,panelConstraints:r[y],prevSize:w,size:100})-w;if(v+=j,y+=x,y<0||y>=r.length)break}const b=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-b:b}{let x=e<0?c:h;for(;x>=0&&x<r.length;){const y=Math.abs(e)-Math.abs(d),v=l[x];N(v!=null,`Previous layout not found for panel index ${x}`);const b=v-y,w=te({overrideDisabledPanels:p,panelConstraints:r[x],prevSize:v,size:b});if(!P(v,w)&&(d+=v-w,u[x]=w,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(_r(s,u))return a;{const x=e<0?h:c,y=l[x];N(y!=null,`Previous layout not found for panel index ${x}`);const v=y+d,b=te({overrideDisabledPanels:p,panelConstraints:r[x],prevSize:y,size:v});if(u[x]=b,!P(b,v)){let w=v-b,j=e<0?h:c;for(;j>=0&&j<r.length;){const S=u[j];N(S!=null,`Previous layout not found for panel index ${j}`);const C=S+w,T=te({overrideDisabledPanels:p,panelConstraints:r[j],prevSize:S,size:C});if(P(S,T)||(w-=T-S,u[j]=T),P(w,0))break;e>0?j--:j++}}}const m=Object.values(u).reduce((x,y)=>y+x,0);if(!P(m,100,.1))return a;const g=Object.keys(a);return u.reduce((x,y,v)=>(x[g[v]]=y,x),{})}function Y(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||$(e[r],t[r])!==0)return!1;return!0}function Z({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],a=n.reduce((l,s)=>l+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!P(a,100)&&n.length>0)for(let l=0;l<t.length;l++){const s=n[l];N(s!=null,`No layout data found for index ${l}`);const u=100/a*s;n[l]=u}let i=0;for(let l=0;l<t.length;l++){const s=r[l];N(s!=null,`No layout data found for index ${l}`);const u=n[l];N(u!=null,`No layout data found for index ${l}`);const c=te({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:s,size:u});u!=c&&(i+=u-c,n[l]=c)}if(!P(i,0))for(let l=0;l<t.length;l++){const s=n[l];N(s!=null,`No layout data found for index ${l}`);const u=s+i,c=te({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:s,size:u});if(s!==c&&(i-=c-s,n[l]=c,P(i,0)))break}const p=Object.keys(e);return n.reduce((l,s,u)=>(l[p[u]]=s,l),{})}function Rt({groupId:e,panelId:t}){const r=()=>{const l=q();for(const[s,{defaultLayoutDeferred:u,derivedPanelConstraints:c,layout:h,groupSize:d,separatorToPanels:m}]of l)if(s.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:c,group:s,groupSize:d,layout:h,separatorToPanels:m};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(s=>s.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},a=()=>{const l=r().group.panels.find(s=>s.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},p=l=>{const s=i();if(l===s)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:c,group:h,groupSize:d,layout:m,separatorToPanels:g}=r(),x=h.panels.findIndex(w=>w.id===t),y=x===h.panels.length-1,v=fe({delta:y?s-l:l-s,initialLayout:m,panelConstraints:c,pivotIndices:y?[x-1,x]:[x,x+1],prevLayout:m,trigger:"imperative-api"}),b=Z({layout:v,panelConstraints:c});Y(m,b)||G(h,{defaultLayoutDeferred:u,derivedPanelConstraints:c,groupSize:d,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:l,collapsedSize:s}=n(),{mutableValues:u}=a(),c=i();l&&c!==s&&(u.expandToSize=c,p(s))},expand:()=>{const{collapsible:l,collapsedSize:s,minSize:u}=n(),{mutableValues:c}=a(),h=i();if(l&&h===s){let d=c.expandToSize??u;d===0&&(d=1),p(d)}},getSize:()=>{const{group:l}=r(),s=i(),{element:u}=a(),c=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:s,inPixels:c}},isCollapsed:()=>{const{collapsible:l,collapsedSize:s}=n(),u=i();return l&&P(s,u)},resize:l=>{const{group:s}=r(),{element:u}=a(),c=oe({group:s}),h=ce({groupSize:c,panelElement:u,styleProp:l}),d=A(h/c*100);p(d)}}}function lt(e){if(e.defaultPrevented)return;const t=q();Re(e,t).forEach(r=>{if(r.separator&&!r.separator.disableDoubleClick){const n=r.panels.find(a=>a.panelConstraints.defaultSize!==void 0);if(n){const a=n.panelConstraints.defaultSize,i=Rt({groupId:r.group.id,panelId:n.id});i&&a!==void 0&&(i.resize(a),e.preventDefault())}}})}function ye(e){const t=q();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function Pt({groupId:e}){const t=()=>{const r=q();for(const[n,a]of r)if(n.id===e)return{group:n,...a};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:a,group:i,groupSize:p,layout:l,separatorToPanels:s}=t(),u=Z({layout:r,panelConstraints:a});return n?l:(Y(l,u)||G(i,{defaultLayoutDeferred:n,derivedPanelConstraints:a,groupSize:p,layout:u,separatorToPanels:s}),u)}}}function K(e,t){const r=ye(e),n=U(r.id,!0),a=r.separators.find(c=>c.element===e);N(a,"Matching separator not found");const i=n.separatorToPanels.get(a);N(i,"Matching panels not found");const p=i.map(c=>r.panels.indexOf(c)),l=Pt({groupId:r.id}).getLayout(),s=fe({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:p,prevLayout:l,trigger:"keyboard"}),u=Z({layout:s,panelConstraints:n.derivedPanelConstraints});Y(l,u)||G(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function ct(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=ye(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&K(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&K(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&K(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&K(t,-5);break}case"End":{e.preventDefault(),K(t,100);break}case"Enter":{e.preventDefault();const n=ye(t),a=U(n.id,!0),{derivedPanelConstraints:i,layout:p,separatorToPanels:l}=a,s=n.separators.find(d=>d.element===t);N(s,"Matching separator not found");const u=l.get(s);N(u,"Matching panels not found");const c=u[0],h=i.find(d=>d.panelId===c.id);if(N(h,"Panel metadata not found"),h.collapsible){const d=p[c.id],m=h.collapsedSize===d?n.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;K(t,m-d)}break}case"F6":{e.preventDefault();const n=ye(t).separators.map(p=>p.element),a=Array.from(n).findIndex(p=>p===e.currentTarget);N(a!==null,"Index not found");const i=e.shiftKey?a>0?a-1:n.length-1:a+1<n.length?a+1:0;n[i].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),K(t,-100);break}}}let re={cursorFlags:0,state:"inactive"};const Pe=new It;function X(){return re}function Gr(e){return Pe.addListener("change",e)}function Wr(e){const t=re,r={...re};r.cursorFlags=e,re=r,Pe.emit("change",{prev:t,next:r})}function ne(e){const t=re;re=e,Pe.emit("change",{prev:t,next:e})}function ut(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=q(),r=Re(e,t),n=new Map;let a=!1;r.forEach(i=>{i.separator&&(a||(a=!0,i.separator.element.focus({preventScroll:!0})));const p=t.get(i.group);p&&n.set(i.group,p.layout)}),ne({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const Hr=e=>e,Se=()=>{},At=1,Ot=2,Bt=4,$t=8,dt=3,pt=12;let ve;function ft(){return ve===void 0&&(ve=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ve=!0)),ve}function Vr({cursorFlags:e,groups:t,state:r}){let n=0,a=0;switch(r){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{n++;break}case"vertical":{a++;break}}})}if(!(n===0&&a===0)){switch(r){case"active":{if(e&&ft()){const i=(e&At)!==0,p=(e&Ot)!==0,l=(e&Bt)!==0,s=(e&$t)!==0;if(i)return l?"se-resize":s?"ne-resize":"e-resize";if(p)return l?"sw-resize":s?"nw-resize":"w-resize";if(l)return"s-resize";if(s)return"n-resize"}break}}return ft()?n>0&&a>0?"move":n>0?"ew-resize":"ns-resize":n>0&&a>0?"grab":n>0?"col-resize":"row-resize"}}const ht=new WeakMap;function Ae(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=ht.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=X();switch(n.state){case"active":case"hover":{const a=Vr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(p=>p.group),state:n.state}),i=`*, *:hover {cursor: ${a} !important; }`;if(t===i)return;t=i,a?r.cssRules.length===0?r.insertRule(i):r.replaceSync(i):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}ht.set(e,{prevStyle:t,styleSheet:r})}function Ft({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:a,pointerDownAtPoint:i,prevCursorFlags:p}){let l=0;r.forEach(u=>{const{group:c,groupSize:h}=u,{orientation:d,panels:m}=c,{disableCursor:g}=c.mutableState;let x=0;i?d==="horizontal"?x=(t.clientX-i.x)/h*100:x=(t.clientY-i.y)/h*100:d==="horizontal"?x=t.clientX<0?-100:100:x=t.clientY<0?-100:100;const y=n.get(c),v=a.get(c);if(!y||!v)return;const{defaultLayoutDeferred:b,derivedPanelConstraints:w,groupSize:j,layout:S,separatorToPanels:C}=v;if(w&&S&&C){const T=fe({delta:x,initialLayout:y,panelConstraints:w,pivotIndices:u.panels.map(I=>m.indexOf(I)),prevLayout:S,trigger:"mouse-or-touch"});if(Y(T,S)){if(x!==0&&!g)switch(d){case"horizontal":{l|=x<0?At:Ot;break}case"vertical":{l|=x<0?Bt:$t;break}}}else G(u.group,{defaultLayoutDeferred:b,derivedPanelConstraints:w,groupSize:j,layout:T,separatorToPanels:C})}});let s=0;t.movementX===0?s|=p&dt:s|=l&dt,t.movementY===0?s|=p&pt:s|=l&pt,Wr(s),Ae(e)}function xt(e){const t=q(),r=X();switch(r.state){case"active":Ft({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}}function gt(e){var n,a;if(e.defaultPrevented)return;const t=X(),r=q();switch(t.state){case"active":{if(e.buttons===0){ne({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(i=>{const p=U(i.group.id,!0);G(i.group,p)});return}for(const i of t.hitRegions)if(i.separator){const{element:p}=i.separator;(n=p.hasPointerCapture)!=null&&n.call(p,e.pointerId)||((a=p.setPointerCapture)==null||a.call(p,e.pointerId))}Ft({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const i=Re(e,r);i.length===0?t.state!=="inactive"&&ne({cursorFlags:0,state:"inactive"}):ne({cursorFlags:0,hitRegions:i,state:"hover"}),Ae(e.currentTarget);break}}}function vt(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(X().state){case"hover":ne({cursorFlags:0,state:"inactive"})}}function mt(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=X();switch(t.state){case"active":ne({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Ae(e.currentTarget),t.hitRegions.forEach(r=>{const n=U(r.group.id,!0);G(r.group,n)}),e.preventDefault())}}function yt(e){let t=0,r=0;const n={};for(const i of e)if(i.defaultSize!==void 0){t++;const p=A(i.defaultSize);r+=p,n[i.panelId]=p}else n[i.panelId]=void 0;const a=e.length-t;if(a!==0){const i=A((100-r)/a);for(const p of e)p.defaultSize===void 0&&(n[p.panelId]=i)}return n}function Ur(e,t,r){if(!r[0])return;const n=e.panels.find(s=>s.element===t);if(!n||!n.onResize)return;const a=oe({group:e}),i=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,p=n.mutableValues.prevSize,l={asPercentage:A(i/a*100),inPixels:i};n.mutableValues.prevSize=l,n.onResize(l,n.id,p)}function Kr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Yr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let a=0,i=0,p=!1;const l=new Map,s=[];for(const h of e.panels){const d=n[h.id]??0;switch(h.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{p=!0;const m=d/100*r,g=A(m/t*100);l.set(h.id,g),a+=g;break}case"preserve-relative-size":default:{s.push(h.id),i+=d;break}}}if(!p||s.length===0)return n;const u=100-a,c={...n};if(l.forEach((h,d)=>{c[d]=h}),i>0)for(const h of s){const d=n[h]??0;c[h]=A(d/i*u)}else{const h=A(u/s.length);for(const d of s)c[d]=h}return c}function Zr(e,t){const r=e.map(a=>a.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r)if(!n.includes(a))return!1;return!0}const ee=new Map;function Xr(e){let t=!0;N(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,a=new Set,i=new r(g=>{for(const x of g){const{borderBoxSize:y,target:v}=x;if(v===e.element){if(t){const b=oe({group:e});if(b===0)return;const w=U(e.id);if(!w)return;const j=Te(e),S=w.defaultLayoutDeferred?yt(j):w.layout,C=Yr({group:e,nextGroupSize:b,prevGroupSize:w.groupSize,prevLayout:S}),T=Z({layout:C,panelConstraints:j});if(!w.defaultLayoutDeferred&&Y(w.layout,T)&&Kr(w.derivedPanelConstraints,j)&&w.groupSize===b)return;G(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:j,groupSize:b,layout:T,separatorToPanels:w.separatorToPanels})}}else Ur(e,v,y)}});i.observe(e.element),e.panels.forEach(g=>{N(!n.has(g.id),`Panel ids must be unique; id "${g.id}" was used more than once`),n.add(g.id),g.onResize&&i.observe(g.element)});const p=oe({group:e}),l=Te(e),s=e.panels.map(({id:g})=>g).join(",");let u=e.mutableState.defaultLayout;u&&(Zr(e.panels,u)||(u=void 0));const c=e.mutableState.layouts[s]??u??yt(l),h=Z({layout:c,panelConstraints:l}),d=e.element.ownerDocument;ee.set(d,(ee.get(d)??0)+1);const m=new Map;return Nt(e).forEach(g=>{g.separator&&m.set(g.separator,g.panels)}),G(e,{defaultLayoutDeferred:p===0,derivedPanelConstraints:l,groupSize:p,layout:h,separatorToPanels:m}),e.separators.forEach(g=>{N(!a.has(g.id),`Separator ids must be unique; id "${g.id}" was used more than once`),a.add(g.id),g.element.addEventListener("keydown",ct)}),ee.get(d)===1&&(d.addEventListener("dblclick",lt,!0),d.addEventListener("pointerdown",ut,!0),d.addEventListener("pointerleave",xt),d.addEventListener("pointermove",gt),d.addEventListener("pointerout",vt),d.addEventListener("pointerup",mt,!0)),function(){t=!1,ee.set(d,Math.max(0,(ee.get(d)??0)-1)),Mr(e),e.separators.forEach(g=>{g.element.removeEventListener("keydown",ct)}),ee.get(d)||(d.removeEventListener("dblclick",lt,!0),d.removeEventListener("pointerdown",ut,!0),d.removeEventListener("pointerleave",xt),d.removeEventListener("pointermove",gt),d.removeEventListener("pointerout",vt),d.removeEventListener("pointerup",mt,!0)),i.disconnect()}}function qr(){const[e,t]=f.useState({}),r=f.useCallback(()=>t({}),[]);return[e,r]}function Oe(e){const t=f.useId();return`${e??t}`}const J=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ue(e){const t=f.useRef(e);return J(()=>{t.current=e},[e]),f.useCallback((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[t])}function Be(...e){return ue(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function $e(e){const t=f.useRef({...e});return J(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const _t=f.createContext(null);function Jr(e,t){const r=f.useRef({getLayout:()=>({}),setLayout:Hr});f.useImperativeHandle(t,()=>r.current,[]),J(()=>{Object.assign(r.current,Pt({groupId:e}))})}function Gt({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:a,elementRef:i,groupRef:p,id:l,onLayoutChange:s,onLayoutChanged:u,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:d,...m}){const g=f.useRef({onLayoutChange:{},onLayoutChanged:{}}),x=ue(k=>{Y(g.current.onLayoutChange,k)||(g.current.onLayoutChange=k,s==null||s(k))}),y=ue(k=>{Y(g.current.onLayoutChanged,k)||(g.current.onLayoutChanged=k,u==null||u(k))}),v=Oe(l),b=f.useRef(null),[w,j]=qr(),S=f.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),C=Be(b,i);Jr(v,p);const T=ue((k,z)=>{const D=X(),E=ot(k),R=U(k);if(R){let B=!1;switch(D.state){case"active":{B=D.hitRegions.some(se=>se.group===E);break}}return{flexGrow:R.layout[z]??1,pointerEvents:B?"none":void 0}}if(r!=null&&r[z])return{flexGrow:r==null?void 0:r[z]}}),I=$e({defaultLayout:r,disableCursor:n}),L=f.useMemo(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:T,id:v,orientation:c,registerPanel:k=>{const z=S.current;return z.panels=Le(c,[...z.panels,k]),j(),()=>{z.panels=z.panels.filter(D=>D!==k),j()}},registerSeparator:k=>{const z=S.current;return z.separators=Le(c,[...z.separators,k]),j(),()=>{z.separators=z.separators.filter(D=>D!==k),j()}},updatePanelProps:(k,{disabled:z})=>{const D=S.current.panels.find(B=>B.id===k);D&&(D.panelConstraints.disabled=z);const E=ot(v),R=U(v);E&&R&&G(E,{...R,derivedPanelConstraints:Te(E)})},updateSeparatorProps:(k,{disabled:z,disableDoubleClick:D})=>{const E=S.current.separators.find(R=>R.id===k);E&&(E.disabled=z,E.disableDoubleClick=D)}}),[T,v,j,c,I]),M=f.useRef(null);return J(()=>{const k=b.current;if(k===null)return;const z=S.current;let D;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===z.panels.length){D={};for(const H of z.panels){const Q=I.defaultLayout[H.id];Q!==void 0&&(D[H.id]=Q)}}const E={disabled:!!a,element:k,id:v,mutableState:{defaultLayout:D,disableCursor:!!I.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:c,panels:z.panels,resizeTargetMinimumSize:z.resizeTargetMinimumSize,separators:z.separators};M.current=E;const R=Xr(E),{defaultLayoutDeferred:B,derivedPanelConstraints:se,layout:he}=U(E.id,!0);!B&&se.length>0&&(x(he),y(he));const ae=De(v,H=>{const{defaultLayoutDeferred:Q,derivedPanelConstraints:Ge,layout:xe}=H.next;if(Q||Ge.length===0)return;const Yt=E.panels.map(({id:_})=>_).join(",");E.mutableState.layouts[Yt]=xe,Ge.forEach(_=>{if(_.collapsible){const{layout:we}=H.prev??{};if(we){const Xt=P(_.collapsedSize,xe[_.panelId]),qt=P(_.collapsedSize,we[_.panelId]);Xt&&!qt&&(E.mutableState.expandedPanelSizes[_.panelId]=we[_.panelId])}}});const Zt=X().state!=="active";x(xe),Zt&&y(xe)});return()=>{M.current=null,R(),ae()}},[a,v,y,x,c,w,I]),f.useEffect(()=>{const k=M.current;k&&(k.mutableState.defaultLayout=r,k.mutableState.disableCursor=!!n)}),o.jsx(_t.Provider,{value:L,children:o.jsx("div",{...m,className:t,"data-group":!0,"data-testid":v,id:v,ref:C,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}Gt.displayName="Group";function Fe(){const e=f.useContext(_t);return N(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Qr(e,t){const{id:r}=Fe(),n=f.useRef({collapse:Se,expand:Se,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Se});f.useImperativeHandle(t,()=>n.current,[]),J(()=>{Object.assign(n.current,Rt({groupId:r,panelId:e}))})}function Ee({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:a,disabled:i,elementRef:p,groupResizeBehavior:l="preserve-relative-size",id:s,maxSize:u="100%",minSize:c="0%",onResize:h,panelRef:d,style:m,...g}){const x=!!s,y=Oe(s),v=$e({disabled:i}),b=f.useRef(null),w=Be(b,p),{getPanelStyles:j,id:S,orientation:C,registerPanel:T,updatePanelProps:I}=Fe(),L=h!==null,M=ue((E,R,B)=>{h==null||h(E,s,B)});J(()=>{const E=b.current;if(E!==null){const R={element:E,id:y,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:L?M:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:a,disabled:v.disabled,maxSize:u,minSize:c}};return T(R)}},[l,r,n,a,L,y,x,u,c,M,T,v]),f.useEffect(()=>{I(y,{disabled:i})},[i,y,I]),Qr(y,d);const k=()=>{const E=j(S,y);if(E)return JSON.stringify(E)},z=f.useSyncExternalStore(E=>De(S,E),k,k);let D;return z?D=JSON.parse(z):a?D={flexGrow:void 0,flexShrink:void 0,flexBasis:a}:D={flexGrow:1},o.jsx("div",{...g,"data-disabled":i||void 0,"data-panel":!0,"data-testid":y,id:y,ref:w,style:{...en,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...D},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...m,touchAction:C==="horizontal"?"pan-y":"pan-x"},children:e})})}Ee.displayName="Panel";const en={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function tn({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let a,i;const p=e[r],l=t.find(s=>s.panelId===r);if(l){const s=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,c=[n,n+1];i=Z({layout:fe({delta:u-p,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[r],a=Z({layout:fe({delta:s-p,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:a,valueMin:i,valueNow:p}}function Wt({children:e,className:t,disabled:r,disableDoubleClick:n,elementRef:a,id:i,style:p,...l}){const s=Oe(i),u=$e({disabled:r,disableDoubleClick:n}),[c,h]=f.useState({}),[d,m]=f.useState("inactive"),[g,x]=f.useState(!1),y=f.useRef(null),v=Be(y,a),{disableCursor:b,id:w,orientation:j,registerSeparator:S,updateSeparatorProps:C}=Fe(),T=j==="horizontal"?"vertical":"horizontal";J(()=>{const M=y.current;if(M!==null){const k={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:M,id:s},z=S(k),D=Gr(R=>{m(R.next.state!=="inactive"&&R.next.hitRegions.some(B=>B.separator===k)?R.next.state:"inactive")}),E=De(w,R=>{const{derivedPanelConstraints:B,layout:se,separatorToPanels:he}=R.next,ae=he.get(k);if(ae){const H=ae[0],Q=ae.indexOf(H);h(tn({layout:se,panelConstraints:B,panelId:H.id,panelIndex:Q}))}});return()=>{D(),E(),z()}}},[w,s,S,u]),f.useEffect(()=>{C(s,{disabled:r,disableDoubleClick:n})},[r,n,s,C]);let I;r&&!b&&(I="not-allowed");let L;if(r)L="disabled";else switch(d){case"active":{L="active";break}default:g?L="focus":L=d}return o.jsx("div",{...l,"aria-controls":c.valueControls,"aria-disabled":r||void 0,"aria-orientation":T,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":L,"data-testid":s,id:s,onBlur:()=>x(!1),onFocus:()=>x(!0),ref:v,role:"separator",style:{flexBasis:"auto",cursor:I,...p,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}Wt.displayName="Separator";const bt=15,rn=f.memo(function({node:t}){const{dispatch:r}=W(),n=Math.round(t.ratio*100),a=100-n,i=f.useCallback(p=>{const l=`${t.id}-first`,s=p[l];if(typeof s=="number"){const u=s/100;Math.abs(u-t.ratio)>.005&&r({type:"RESIZE_GROUP",branchId:t.id,ratio:u})}},[r,t.id,t.ratio]);return o.jsxs(Gt,{orientation:t.direction,id:t.id,className:"h-full",onLayoutChanged:i,children:[o.jsx(Ee,{id:`${t.id}-first`,defaultSize:`${n}%`,minSize:`${bt}%`,className:"overflow-hidden",style:{minWidth:"var(--size-editor-min-width)",minHeight:"var(--size-editor-min-height)"},children:o.jsx(Ne,{node:t.first})}),o.jsx(Wt,{id:`${t.id}-sep`,className:"group relative flex-shrink-0",style:{width:t.direction==="horizontal"?"1px":void 0,height:t.direction==="vertical"?"1px":void 0,backgroundColor:"var(--color-border)",transition:"background-color 150ms ease"},children:o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity",style:{backgroundColor:"var(--color-border-focused)",width:t.direction==="horizontal"?"3px":"100%",height:t.direction==="vertical"?"3px":"100%",left:t.direction==="horizontal"?"-1px":"0",top:t.direction==="vertical"?"-1px":"0"}})}),o.jsx(Ee,{id:`${t.id}-second`,defaultSize:`${a}%`,minSize:`${bt}%`,className:"overflow-hidden",style:{minWidth:"var(--size-editor-min-width)",minHeight:"var(--size-editor-min-height)"},children:o.jsx(Ne,{node:t.second})})]})}),Ne=f.memo(function({node:t}){return t.type==="branch"?o.jsx(rn,{node:t}):o.jsx(Sr,{node:t})}),nn={center:"bg-accent-blue/10 border-accent-blue/30",left:"bg-accent-blue/15 border-l-2 border-accent-blue/50",right:"bg-accent-blue/15 border-r-2 border-accent-blue/50",top:"bg-accent-blue/15 border-t-2 border-accent-blue/50",bottom:"bg-accent-blue/15 border-b-2 border-accent-blue/50"},wt={center:"Move to group",left:"Split left",right:"Split right",top:"Split up",bottom:"Split down"},on=f.memo(function({onDrop:t,visible:r}){const[n,a]=f.useState(null),i=f.useRef(null),p=f.useCallback((c,h)=>{var y;const d=(y=i.current)==null?void 0:y.getBoundingClientRect();if(!d)return"center";const m=(c-d.left)/d.width,g=(h-d.top)/d.height,x=.25;return m<x?"left":m>1-x?"right":g<x?"top":g>1-x?"bottom":"center"},[]),l=f.useCallback(c=>{c.preventDefault(),c.dataTransfer.dropEffect="move",a(p(c.clientX,c.clientY))},[p]),s=f.useCallback(()=>{a(null)},[]),u=f.useCallback(c=>{c.preventDefault();const h=p(c.clientX,c.clientY);a(null),t(h)},[p,t]);return r?o.jsx("div",{ref:i,className:"absolute inset-0 z-50",onDragOver:l,onDragLeave:s,onDrop:u,children:o.jsxs("div",{className:"relative w-full h-full",children:[o.jsx(le,{zone:"left",activeZone:n,className:"absolute left-0 top-0 bottom-0 w-[25%]"}),o.jsx(le,{zone:"right",activeZone:n,className:"absolute right-0 top-0 bottom-0 w-[25%]"}),o.jsx(le,{zone:"top",activeZone:n,className:"absolute left-[25%] right-[25%] top-0 h-[25%]"}),o.jsx(le,{zone:"bottom",activeZone:n,className:"absolute left-[25%] right-[25%] bottom-0 h-[25%]"}),o.jsx(le,{zone:"center",activeZone:n,className:"absolute left-[25%] right-[25%] top-[25%] bottom-[25%]"})]})}):null});function le({zone:e,activeZone:t,className:r}){const n=t===e;return o.jsx("div",{className:`${r} transition-all duration-150 ${n?nn[e]:"border border-transparent"}`,"aria-label":wt[e],children:n&&o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("span",{className:"text-[length:var(--font-size-xs)] text-accent-blue font-[var(--font-weight-medium)] bg-bg-primary/80 px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)]",children:wt[e]})})})}const je=2;function de(e,t){if(e.type==="leaf")return e.id===t?0:-1;const r=de(e.first,t);if(r>=0)return r+1;const n=de(e.second,t);return n>=0?n+1:-1}function Ie(e){return e.type==="leaf"?[e.id]:[...Ie(e.first),...Ie(e.second)]}function sn({children:e}){const{dispatch:t}=W(),r=pe(h=>h.editorArea),n=pe(h=>h.focusedGroupId),a=f.useRef(!1),i=f.useRef(null),[p,l]=f.useState(!1),s=f.useRef(r);s.current=r;const u=f.useRef(n);u.current=n,f.useEffect(()=>{function h(d){const m=s.current,g=u.current;if(d.ctrlKey&&d.key==="\\"&&!d.shiftKey&&!d.altKey){d.preventDefault(),de(m,g)<je&&t({type:"SPLIT_GROUP",groupId:g,direction:"horizontal"});return}if(d.ctrlKey&&d.key==="k"&&!d.shiftKey&&!d.altKey){d.preventDefault(),a.current=!0,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{a.current=!1},1e3);return}if(a.current&&d.ctrlKey&&d.key==="\\"){d.preventDefault(),a.current=!1,i.current&&(clearTimeout(i.current),i.current=null),de(m,g)<je&&t({type:"SPLIT_GROUP",groupId:g,direction:"vertical"});return}if(a.current&&(d.key==="ArrowRight"||d.key==="ArrowLeft")){d.preventDefault(),a.current=!1,i.current&&(clearTimeout(i.current),i.current=null);const x=Ie(m),y=x.indexOf(g);if(y>=0){const v=d.key==="ArrowRight"?(y+1)%x.length:(y-1+x.length)%x.length;t({type:"SET_FOCUSED_GROUP",groupId:x[v]})}return}}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t]);const c=f.useCallback(h=>{if(l(!1),!h||h==="center")return;const d=h==="left"||h==="right"?"horizontal":"vertical";de(r,n)>=je||t({type:"SPLIT_GROUP",groupId:n,direction:d})},[t,r,n]);return o.jsx(ir,{content:e??null,children:o.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative bg-bg-primary",children:[o.jsx(Ne,{node:r}),o.jsx(on,{visible:p,onDrop:c})]})})}function Ht(e){return e.type==="leaf"?e:Ht(e.first)}function be(e){return e.type==="leaf"?[e]:[...be(e.first),...be(e.second)]}function an(){const{dispatch:e}=W(),t=pe(s=>s.editorArea),r=pe(s=>s.focusedGroupId),n=O(s=>s.processes),a=O(s=>s.activeProcessId),i=f.useMemo(()=>{const u=Date.now();return Object.entries(n).filter(([c,h])=>h.status==="running"||h.status==="spawning"||h.status==="paused"||c===a?!0:h.status==="stopped"||h.status==="error"?u-new Date(h.startedAt).getTime()<12e4:!1)},[n,a]),p=f.useRef(new Set);f.useEffect(()=>{const s=be(t),u=new Set(i.map(([d])=>d)),c=new Set;for(const d of s)for(const m of d.tabs)m.ref&&c.add(m.ref);const h=r||Ht(t).id;for(const[d,m]of i){if(!c.has(d)){if(p.current.has(d))continue;const g=zt[m.type]??m.type,x=s.find(y=>y.id===h);if(x){const y=x.tabs.find(v=>v.type==="chat"&&!v.ref);y&&e({type:"CLOSE_TAB",groupId:h,tabId:y.id})}e({type:"OPEN_TAB",groupId:h,tab:{id:`chat-${d}`,type:"chat",title:g,ref:d,icon:Qt}})}p.current.add(d)}for(const d of s)for(const m of d.tabs)m.type==="chat"&&m.ref&&!u.has(m.ref)&&(e({type:"CLOSE_TAB",groupId:d.id,tabId:m.id}),p.current.delete(m.ref))},[i,r,e,t]);const l=f.useRef(a);return f.useEffect(()=>{if(!a||a===l.current){l.current=a;return}l.current=a;const s=`chat-${a}`,u=be(t);for(const c of u)if(c.tabs.some(h=>h.id===s)){c.activeTabId!==s&&e({type:"SET_ACTIVE_TAB",groupId:c.id,tabId:s});break}},[a,t,e]),o.jsx(sn,{})}const Vt=f.createContext({sidebarOpen:!0,setSidebarOpen:()=>{},activeTab:"chat",setActiveTab:()=>{},fileTreeOpen:!1,setFileTreeOpen:()=>{},historyOpen:!1,setHistoryOpen:()=>{}});function ln(){return f.useContext(Vt)}function cn(){const[e,t]=f.useState([]),[r,n]=f.useState(!0),a=f.useCallback(async()=>{n(!0);try{const i=await fetch("/api/workspace?tree=true");i.ok&&t(await i.json())}catch{}finally{n(!1)}},[]);return f.useEffect(()=>{a()},[a]),{tree:e,loading:r,refreshTree:a}}function un(e=15e3){const[t,r]=f.useState(""),[n,a]=f.useState([]),[i,p]=f.useState([]),[l,s]=f.useState([]),[u,c]=f.useState([]),[h,d]=f.useState(!0),[m,g]=f.useState(null),x=f.useRef(!0),y=f.useCallback(async()=>{d(!0),g(null);try{const[v,b]=await Promise.all([fetch("/api/git/status"),fetch("/api/git/log?limit=8")]);if(!x.current)return;if(v.ok){const w=await v.json();w.error?g(w.error):(r(w.branch??""),a(w.staged??[]),p(w.unstaged??[]),s(w.untracked??[]))}else g(`Status fetch failed (${v.status})`);if(b.ok){const w=await b.json();w.error||c(w.commits??[])}}catch(v){x.current&&g(v.message)}finally{x.current&&d(!1)}},[]);return f.useEffect(()=>{x.current=!0,y();const v=setInterval(y,e);return()=>{x.current=!1,clearInterval(v)}},[y,e]),{branch:t,staged:n,unstaged:i,untracked:l,commits:u,loading:h,error:m,refresh:y}}function dn(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"now";if(r<60)return`${r}m ago`;const n=Math.floor(r/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}const Ut={chat:{title:"Conversations",path:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},files:{title:"Explorer",path:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"},git:{title:"Source Control",path:""},search:{title:"Search",path:""}};function pn({tab:e}){return e==="git"?o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"18",cy:"18",r:"3"}),o.jsx("circle",{cx:"6",cy:"6",r:"3"}),o.jsx("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),o.jsx("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}):e==="search"?o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}):o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:Ut[e].path})})}function Me(e){return e.type==="leaf"?[e]:[...Me(e.first),...Me(e.second)]}function fn(){const e=O(c=>c.processes),t=O(c=>c.setActiveProcessId),r=O(c=>c.activeProcessId),[n,a]=f.useState(null),{state:i,dispatch:p}=W(),l=f.useCallback(async c=>{var y;t(c);const h=`chat-${c}`,d=Me(i.editorArea);for(const v of d)if(v.tabs.some(b=>b.id===h)){v.activeTabId!==h&&p({type:"SET_ACTIVE_TAB",groupId:v.id,tabId:h});break}const{entries:m,addEntry:g}=O.getState(),x=m[c];if(!(x&&x.some(v=>v.type==="user_message"||v.type==="assistant_message"))){a(c);try{const v=c.startsWith("cli-history-"),b=v?c.replace("cli-history-",""):c,w=v?`/api/cli-history/${encodeURIComponent(b)}/entries`:`/api/agents/${encodeURIComponent(c)}/entries`,j=await fetch(w);if(j.ok){const S=await j.json(),C=[];for(const L of S){const M={...L,processId:c};if(M.type==="assistant_message"){M.partial=!1;const k=C[C.length-1];if(k&&k.type==="assistant_message"){k.content+=M.content;continue}}if(M.type==="tool_use"&&(M.status==="completed"||M.status==="failed")){const k=C.findLastIndex(z=>z.type==="tool_use"&&z.status==="running");if(k!==-1){const z=C[k];C[k]={...z,status:M.status,result:M.result??z.result,input:z.input&&Object.keys(z.input).length>0?z.input:M.input};continue}}C.push(M)}const T=[];for(let L=0;L<C.length;L++)C[L].type==="token_usage"&&T.push(L);if(T.length>1)for(let L=T.length-2;L>=0;L--)C.splice(T[L],1);if(!C.some(L=>L.type==="user_message")){const L=O.getState().processes[c],M=(y=L==null?void 0:L.config)==null?void 0:y.prompt;if(M){const k={id:`synth-user-${c}`,processId:c,timestamp:L.startedAt,type:"user_message",content:M};C.unshift(k)}}for(const L of C)g(c,L)}}catch{}a(null)}},[t,i.editorArea,p]),{active:s,completed:u}=f.useMemo(()=>{const c=Object.values(e),h=[],d=[];for(const m of c)m.status==="running"||m.status==="spawning"?h.push(m):d.push(m);return h.sort((m,g)=>new Date(g.startedAt).getTime()-new Date(m.startedAt).getTime()),d.sort((m,g)=>new Date(g.startedAt).getTime()-new Date(m.startedAt).getTime()),{active:h,completed:d}},[e]);return s.length===0&&u.length===0?o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-text-tertiary)"},children:"No conversations yet"}):o.jsxs(o.Fragment,{children:[s.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-[0.04em] px-[6px] pt-[6px] pb-[2px]",style:{color:"var(--color-text-tertiary)"},children:["Active (",s.length,")"]}),s.map(c=>o.jsx(St,{process:c,isActive:c.id===r,loading:n===c.id,onSelect:l},c.id))]}),u.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-[0.04em] px-[6px] pt-[8px] pb-[2px]",style:{color:"var(--color-text-tertiary)"},children:["Completed (",u.length,")"]}),u.map(c=>o.jsx(St,{process:c,isActive:c.id===r,loading:n===c.id,onSelect:l},c.id))]})]})}function St({process:e,isActive:t,loading:r,onSelect:n}){var s,u;const i=e.status==="running"||e.status==="spawning"?"var(--color-accent-green)":e.status==="error"?"var(--color-accent-red, #D05454)":"var(--color-text-placeholder)",p=zt[e.type]??e.type,l=((u=(s=e.config)==null?void 0:s.prompt)==null?void 0:u.slice(0,40))||p;return o.jsxs("button",{type:"button",onClick:()=>n(e.id),className:"flex items-center gap-[7px] w-full rounded-[5px] border-none cursor-pointer transition-all duration-100 text-left",style:{padding:"5px 7px",backgroundColor:t?"var(--color-bg-active)":"transparent",fontFamily:"inherit"},onMouseEnter:c=>{t||(c.currentTarget.style.backgroundColor="var(--color-bg-hover)")},onMouseLeave:c=>{t||(c.currentTarget.style.backgroundColor="transparent")},children:[o.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:i}}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:"var(--color-text-primary)"},children:l}),o.jsxs("div",{className:"text-[9px]",style:{color:"var(--color-text-tertiary)"},children:[dn(e.startedAt)," · ",p.toLowerCase()]})]})]})}function _e(e){return e.type==="leaf"?e:_e(e.first)}function hn(){const{sidebarOpen:e,activeTab:t,setActiveTab:r}=ln(),[n,a]=f.useState(""),i=cn(),{state:p,dispatch:l}=W(),s=f.useCallback(u=>{const c=_e(p.editorArea),h=u.split(/[\\/]/).pop()??u;l({type:"OPEN_TAB",groupId:c.id,tab:{id:`file-${u}`,type:"file",title:h,ref:u}})},[p.editorArea,l]);return o.jsxs("div",{className:"shrink-0 flex flex-col overflow-hidden transition-[width] duration-200",style:{width:e?230:0,backgroundColor:"var(--color-bg-secondary)",borderRight:e?"1px solid var(--color-border)":"none"},children:[o.jsx("div",{className:"flex items-center shrink-0",style:{height:32,padding:"0 4px",borderBottom:"1px solid var(--color-border-divider)"},children:["chat","files","git","search"].map(u=>o.jsx("button",{type:"button",onClick:()=>r(u),title:Ut[u].title,className:"flex items-center justify-center border-none bg-transparent cursor-pointer transition-all duration-100",style:{width:30,height:32,color:t===u?"var(--color-text-primary)":"var(--color-text-tertiary)",borderBottom:t===u?"2px solid var(--color-text-primary)":"2px solid transparent"},onMouseEnter:c=>{t!==u&&(c.currentTarget.style.color="var(--color-text-primary)")},onMouseLeave:c=>{t!==u&&(c.currentTarget.style.color="var(--color-text-tertiary)")},children:o.jsx(pn,{tab:u})},u))}),o.jsx("div",{className:"px-[8px] py-[4px]",children:o.jsxs("div",{className:"relative",children:[o.jsxs("svg",{className:"absolute left-[7px] top-1/2 -translate-y-1/2 pointer-events-none",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-text-placeholder)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),o.jsx("input",{type:"text",value:n,onChange:u=>a(u.target.value),placeholder:"Search...",className:"w-full py-[4px] pl-[26px] pr-[7px] text-[11px] rounded-[5px] border outline-none transition-[border-color] duration-100",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-text-primary)",fontFamily:"inherit"},onFocus:u=>{u.currentTarget.style.borderColor="var(--color-accent-blue)"},onBlur:u=>{u.currentTarget.style.borderColor="var(--color-border)"}})]})}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-[6px] pb-[8px]",children:[t==="chat"&&o.jsx(fn,{}),t==="files"&&o.jsx(tr,{tree:i.tree,selectedPath:null,onSelectFile:s,loading:i.loading}),t==="git"&&o.jsx(vn,{}),t==="search"&&o.jsx(xn,{searchQuery:n,onSelectFile:s})]})]})}function xn({searchQuery:e,onSelectFile:t}){const[r,n]=f.useState([]),[a,i]=f.useState(0),[p,l]=f.useState(!1),[s,u]=f.useState(new Set),c=f.useRef(null);f.useEffect(()=>{if(c.current&&clearTimeout(c.current),e.length<2){n([]),i(0);return}return l(!0),c.current=setTimeout(async()=>{try{const m=await fetch(`/api/workspace/search?q=${encodeURIComponent(e)}&limit=30`);if(m.ok){const g=await m.json();n(g.results),i(g.total),u(new Set)}}catch{}l(!1)},300),()=>{c.current&&clearTimeout(c.current)}},[e]);const h=f.useMemo(()=>{const m=new Map;for(const g of r){const x=m.get(g.file);x?x.push(g):m.set(g.file,[g])}return m},[r]),d=f.useCallback(m=>{u(g=>{const x=new Set(g);return x.has(m)?x.delete(m):x.add(m),x})},[]);return e.length<2?o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-text-tertiary)"},children:"Type to search across files"}):p?o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-text-tertiary)"},children:"Searching..."}):r.length===0?o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-text-tertiary)"},children:"No results"}):o.jsxs("div",{children:[o.jsxs("div",{className:"text-[9px] px-[6px] py-[2px]",style:{color:"var(--color-text-tertiary)"},children:[a," result",a!==1?"s":""," in ",h.size," file",h.size!==1?"s":""]}),[...h.entries()].map(([m,g])=>o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>d(m),className:"flex items-center gap-[4px] w-full border-none bg-transparent cursor-pointer text-left",style:{padding:"4px 6px",fontFamily:"inherit"},children:[o.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"var(--color-text-tertiary)",style:{transform:s.has(m)?"rotate(0deg)":"rotate(90deg)",transition:"transform 100ms"},children:o.jsx("path",{d:"M2 1l4 3-4 3z"})}),o.jsx(Kt,{}),o.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-medium truncate",style:{color:"var(--color-text-primary)"},children:m}),o.jsx("span",{className:"text-[9px] shrink-0",style:{color:"var(--color-text-tertiary)"},children:g.length})]}),!s.has(m)&&g.map(x=>o.jsxs("button",{type:"button",onClick:()=>t(m),className:"flex items-center gap-[6px] w-full border-none bg-transparent cursor-pointer text-left transition-colors duration-75",style:{padding:"3px 7px 3px 22px",color:"var(--color-text-primary)",fontFamily:"inherit"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--color-bg-hover)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:[o.jsx("span",{className:"text-[10px] shrink-0 font-mono",style:{color:"var(--color-text-tertiary)",minWidth:28,textAlign:"right"},children:x.line}),o.jsx("span",{className:"text-[11px] truncate min-w-0",children:x.text.trim()})]},`${m}:${x.line}`))]},m))]})}const jt={M:{bg:"rgba(201,155,45,0.15)",color:"var(--color-accent-yellow)"},A:{bg:"rgba(61,155,111,0.15)",color:"var(--color-accent-green)"},D:{bg:"rgba(208,84,84,0.15)",color:"var(--color-accent-red)"},R:{bg:"rgba(130,130,200,0.15)",color:"var(--color-accent-blue)"}};function gn({status:e}){const t=jt[e]??jt.M;return o.jsx("span",{className:"text-[9px] font-semibold px-[5px] rounded-[3px] shrink-0",style:{backgroundColor:t.bg,color:t.color},children:e})}function Kt(){return o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",style:{opacity:.6},children:[o.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),o.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function ke({path:e,status:t,onClick:r}){return o.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-[6px] px-[7px] py-[3px] rounded-[4px] cursor-pointer w-full border-none bg-transparent text-left transition-colors duration-75",style:{color:"var(--color-text-primary)",fontFamily:"inherit"},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="var(--color-bg-hover)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent"},children:[o.jsx(Kt,{}),o.jsx("span",{className:"flex-1 min-w-0 text-[11px] truncate",children:e}),o.jsx(gn,{status:t})]})}function vn(){const e=un(),{state:t,dispatch:r}=W(),[n,a]=f.useState(!0),[i,p]=f.useState(!0),[l,s]=f.useState(!0),u=f.useCallback(d=>{const m=_e(t.editorArea),g=d.split(/[\\/]/).pop()??d;r({type:"OPEN_TAB",groupId:m.id,tab:{id:`file-${d}`,type:"file",title:g,ref:d}})},[t.editorArea,r]);if(e.loading&&!e.branch)return o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-text-tertiary)"},children:"Loading git status..."});if(e.error&&!e.branch)return o.jsx("div",{className:"px-[10px] py-[20px] text-center text-[11px]",style:{color:"var(--color-accent-red)"},children:e.error});const c=e.staged.length,h=e.unstaged.length+e.untracked.length;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-[5px] px-[7px] py-[4px] text-[11px] font-medium",style:{color:"var(--color-text-primary)"},children:[o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-accent-green)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[o.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),o.jsx("circle",{cx:"18",cy:"6",r:"3"}),o.jsx("circle",{cx:"6",cy:"18",r:"3"}),o.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),o.jsx("span",{className:"flex-1 min-w-0 truncate",children:e.branch||"unknown"}),o.jsx("button",{type:"button",onClick:e.refresh,title:"Refresh",className:"flex items-center justify-center border-none bg-transparent cursor-pointer rounded-[3px] transition-colors duration-75",style:{width:18,height:18,color:"var(--color-text-tertiary)"},onMouseEnter:d=>{d.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:d=>{d.currentTarget.style.color="var(--color-text-tertiary)"},children:o.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("polyline",{points:"23 4 23 10 17 10"}),o.jsx("polyline",{points:"1 20 1 14 7 14"}),o.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})})]}),c>0&&o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"flex items-center gap-[4px] w-full border-none bg-transparent cursor-pointer text-left",style:{padding:"4px 6px",fontFamily:"inherit"},children:[o.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"var(--color-text-tertiary)",style:{transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 100ms"},children:o.jsx("path",{d:"M2 1l4 3-4 3z"})}),o.jsxs("span",{className:"text-[9px] font-semibold uppercase tracking-[0.04em]",style:{color:"var(--color-text-tertiary)"},children:["Staged Changes (",c,")"]})]}),n&&e.staged.map(d=>o.jsx(ke,{path:d.path,status:d.status,onClick:()=>u(d.path)},`staged-${d.path}`))]}),h>0&&o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>p(d=>!d),className:"flex items-center gap-[4px] w-full border-none bg-transparent cursor-pointer text-left",style:{padding:"4px 6px",fontFamily:"inherit"},children:[o.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"var(--color-text-tertiary)",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 100ms"},children:o.jsx("path",{d:"M2 1l4 3-4 3z"})}),o.jsxs("span",{className:"text-[9px] font-semibold uppercase tracking-[0.04em]",style:{color:"var(--color-text-tertiary)"},children:["Changes (",h,")"]})]}),i&&o.jsxs(o.Fragment,{children:[e.unstaged.map(d=>o.jsx(ke,{path:d.path,status:d.status,onClick:()=>u(d.path)},`unstaged-${d.path}`)),e.untracked.map(d=>o.jsx(ke,{path:d,status:"A",onClick:()=>u(d)},`untracked-${d}`))]})]}),c===0&&h===0&&o.jsx("div",{className:"px-[7px] py-[10px] text-center text-[10px]",style:{color:"var(--color-text-tertiary)"},children:"No changes detected"}),e.commits.length>0&&o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>s(d=>!d),className:"flex items-center gap-[4px] w-full border-none bg-transparent cursor-pointer text-left",style:{padding:"4px 6px",marginTop:4,fontFamily:"inherit"},children:[o.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"var(--color-text-tertiary)",style:{transform:l?"rotate(90deg)":"rotate(0deg)",transition:"transform 100ms"},children:o.jsx("path",{d:"M2 1l4 3-4 3z"})}),o.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.04em]",style:{color:"var(--color-text-tertiary)"},children:"Recent Commits"})]}),l&&e.commits.map(d=>o.jsxs("div",{className:"flex items-center gap-[6px] px-[7px] py-[3px] text-[10px]",style:{color:"var(--color-text-primary)",opacity:.7},children:[o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",className:"shrink-0",children:o.jsx("circle",{cx:"6",cy:"6",r:"3",fill:"var(--color-text-tertiary)"})}),o.jsxs("span",{className:"truncate min-w-0",children:[o.jsx("span",{className:"font-mono",style:{color:"var(--color-accent-blue)",marginRight:4},children:d.shortHash}),d.message]})]},d.hash))]})]})}function En(){const e=O(u=>u.activeProcessId),[t,r]=f.useState(!0),[n,a]=f.useState("chat");ar(e);const i=t&&n==="files",p=f.useCallback(u=>{u?(r(!0),a("files")):n==="files"&&r(!1)},[n]),l=t&&n==="chat",s=f.useCallback(u=>{u?(r(!0),a("chat")):n==="chat"&&r(!1)},[n]);return o.jsx(Vt,{value:{sidebarOpen:t,setSidebarOpen:r,activeTab:n,setActiveTab:a,fileTreeOpen:i,setFileTreeOpen:p,historyOpen:l,setHistoryOpen:s},children:o.jsxs("div",{className:"h-full flex min-w-0 overflow-hidden relative",children:[o.jsx(hn,{}),o.jsx("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:o.jsx(an,{})})]})})}export{En as ChatPage};
|