blade-code 0.10.206 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/{chunk-65wc1h38.js → chunk-04qhtx2w.js} +1 -1
  3. package/dist/{chunk-9kj19a8t.js → chunk-0eajnhrj.js} +1 -1
  4. package/dist/{chunk-pga8gxtf.js → chunk-0kxya4ye.js} +1 -1
  5. package/dist/{chunk-nj6kpdte.js → chunk-0wxnrjes.js} +2 -2
  6. package/dist/{chunk-hv8nt7wj.js → chunk-1cy4ab77.js} +1 -1
  7. package/dist/chunk-21qsfewd.js +1 -0
  8. package/dist/{chunk-e45r1a8r.js → chunk-290p3r7a.js} +2 -2
  9. package/dist/{chunk-av799ng5.js → chunk-2fdghgmf.js} +2 -2
  10. package/dist/chunk-3d4wgfkr.js +1 -0
  11. package/dist/{chunk-az3rehz9.js → chunk-3ee357pw.js} +399 -392
  12. package/dist/{chunk-09kqfdpa.js → chunk-4e4qtpca.js} +2 -2
  13. package/dist/{chunk-3crwyd2r.js → chunk-5s2x98rx.js} +2 -2
  14. package/dist/chunk-634ymwg5.js +1 -0
  15. package/dist/chunk-65v1vjvg.js +1 -0
  16. package/dist/{chunk-870szc6v.js → chunk-6v23hdt8.js} +1 -1
  17. package/dist/{chunk-fc1gz532.js → chunk-6x5f6she.js} +2 -2
  18. package/dist/{chunk-erhaedch.js → chunk-7ajvrtb3.js} +1 -1
  19. package/dist/chunk-7p8r4q6f.js +1 -0
  20. package/dist/chunk-7rz5dt79.js +94 -0
  21. package/dist/{chunk-5k8k56f2.js → chunk-8q6zsznc.js} +11 -9
  22. package/dist/{chunk-1n4v80hy.js → chunk-9qxch6sy.js} +1 -1
  23. package/dist/{chunk-9sf1t8gw.js → chunk-a3dz41pd.js} +1 -1
  24. package/dist/{chunk-ed2hdrwe.js → chunk-a95jmx2j.js} +1 -1
  25. package/dist/{chunk-n34qsnks.js → chunk-amabfzc8.js} +1 -1
  26. package/dist/{chunk-6xzk4hsg.js → chunk-b22ab7yw.js} +1 -1
  27. package/dist/{chunk-dnpkf5mv.js → chunk-crv3sghv.js} +2 -2
  28. package/dist/chunk-d4xsrx3z.js +357 -0
  29. package/dist/{chunk-n5jzmwhy.js → chunk-ebvzp8tn.js} +6 -6
  30. package/dist/chunk-eg0s155w.js +1 -0
  31. package/dist/chunk-enmn892r.js +10 -0
  32. package/dist/{chunk-p8vpvx07.js → chunk-er6zghgg.js} +1 -1
  33. package/dist/{chunk-h6ahwwpa.js → chunk-f9qrjd2f.js} +1 -1
  34. package/dist/chunk-fb2x1026.js +171 -0
  35. package/dist/chunk-g0xtk1yy.js +8 -0
  36. package/dist/{chunk-pdna2qvv.js → chunk-g2295k8s.js} +2 -2
  37. package/dist/{chunk-826xegd8.js → chunk-g7pjgspy.js} +2 -2
  38. package/dist/chunk-gff7a5q0.js +1 -0
  39. package/dist/chunk-gymecxcc.js +1 -0
  40. package/dist/{chunk-sqk8cnej.js → chunk-h4b4fn3t.js} +2 -2
  41. package/dist/{chunk-e0ft3vwg.js → chunk-jbpasjg9.js} +1 -1
  42. package/dist/{chunk-xcq0cehr.js → chunk-k2rgg45h.js} +3 -3
  43. package/dist/chunk-kaj8jaj5.js +6 -0
  44. package/dist/{chunk-ewwrss2w.js → chunk-kehgewqh.js} +1 -1
  45. package/dist/{chunk-53vh6vpt.js → chunk-kkzznz4w.js} +1 -1
  46. package/dist/chunk-m2x6pb4f.js +2 -0
  47. package/dist/{chunk-0ef47wgr.js → chunk-n30najxq.js} +2 -2
  48. package/dist/{chunk-h4k69z1b.js → chunk-p36k2e96.js} +1 -1
  49. package/dist/chunk-p665f6pn.js +1 -0
  50. package/dist/chunk-pjeks4cz.js +1 -0
  51. package/dist/{chunk-50vwafn5.js → chunk-pm163dfm.js} +1 -1
  52. package/dist/{chunk-asgmmaec.js → chunk-px45q235.js} +2 -2
  53. package/dist/{chunk-28n945me.js → chunk-q6sr4979.js} +2 -2
  54. package/dist/{chunk-67wy9mm7.js → chunk-qa86anwd.js} +2 -2
  55. package/dist/{chunk-tzvb0nd2.js → chunk-qhcd0ww0.js} +1 -1
  56. package/dist/chunk-qyfbeg5h.js +1 -0
  57. package/dist/{chunk-fnmqxhv1.js → chunk-re8p2y22.js} +1 -1
  58. package/dist/{chunk-9tpzmy8v.js → chunk-s7x4x6xw.js} +1 -1
  59. package/dist/{chunk-gmpsfkgg.js → chunk-sdapqhj0.js} +1 -1
  60. package/dist/{chunk-tsm8rhmd.js → chunk-skktstg8.js} +1 -1
  61. package/dist/chunk-sqsfztrv.js +1 -0
  62. package/dist/chunk-t3pkk95s.js +1 -0
  63. package/dist/{chunk-fd0a8h55.js → chunk-tx9tb485.js} +2 -2
  64. package/dist/{chunk-v4cxk10d.js → chunk-v0eanse2.js} +1 -1
  65. package/dist/chunk-vemyfx92.js +14 -0
  66. package/dist/{chunk-yjjxv7fn.js → chunk-wan9q99y.js} +2 -2
  67. package/dist/{chunk-ebpg1srd.js → chunk-wnzr9h84.js} +2 -2
  68. package/dist/{chunk-t0gm0pn1.js → chunk-x6k5ye1z.js} +1 -1
  69. package/dist/{chunk-gz84aewr.js → chunk-xnys4bgs.js} +1 -1
  70. package/dist/{chunk-v5vx6nz9.js → chunk-xrgeakpy.js} +1 -1
  71. package/dist/{chunk-vx2g1faw.js → chunk-yeandcre.js} +1 -1
  72. package/dist/chunk-yjcp8jk1.js +2 -0
  73. package/dist/{chunk-28tzj187.js → chunk-ys8gysg8.js} +1 -1
  74. package/dist/{chunk-1j39te3t.js → chunk-zf72e5w8.js} +14 -6
  75. package/dist/{chunk-p2y1zqsb.js → chunk-zwe1a7xe.js} +2 -2
  76. package/dist/web/assets/ChatView-DysPZPwF.js +17 -0
  77. package/dist/web/assets/CodeBlockHighlighter-OvLyFs9U.js +8 -0
  78. package/dist/web/assets/FilePreview-CkSPwPdW.js +8 -0
  79. package/dist/web/assets/KanbanBoard-DH1wApt6.js +1 -0
  80. package/dist/web/assets/MarkdownRenderer-BTxnqChi.js +30 -0
  81. package/dist/web/assets/ScrollArea-BdOqyQ3g.js +1 -0
  82. package/dist/web/assets/SessionHistorySurface-DaKE2oKU.js +1 -0
  83. package/dist/web/assets/SettingsModal-CWlSSO_E.js +5 -0
  84. package/dist/web/assets/Sidebar-Dirk-XAQ.js +1 -0
  85. package/dist/web/assets/TaskSwitcher-DKelLFZm.js +1 -0
  86. package/dist/web/assets/TerminalPanel-D5Rieq62.js +1 -0
  87. package/dist/web/assets/archive-CsFSEMp9.js +1 -0
  88. package/dist/web/assets/arrow-left-gaino9Tb.js +1 -0
  89. package/dist/web/assets/calendar-clock-DfHUrEw9.js +1 -0
  90. package/dist/web/assets/chevron-right-Bvu2j6hB.js +1 -0
  91. package/dist/web/assets/clock-3-dWIDc9IF.js +1 -0
  92. package/dist/web/assets/copy-BPfhyh47.js +1 -0
  93. package/dist/web/assets/dist-RGayDvc-.js +11 -0
  94. package/dist/web/assets/download-BR2L5Wme.js +1 -0
  95. package/dist/web/assets/folder-8dmZJ2a6.js +1 -0
  96. package/dist/web/assets/index-B7RyuO2x.css +1 -0
  97. package/dist/web/assets/index-DSa8Dzp7.js +11 -0
  98. package/dist/web/assets/message-square-plus-BgC981WF.js +1 -0
  99. package/dist/web/assets/pause-DLZIDFMB.js +1 -0
  100. package/dist/web/assets/pencil-DkC0bPYD.js +1 -0
  101. package/dist/web/assets/play-BVeNn6fv.js +1 -0
  102. package/dist/web/assets/plus-kzdwas-3.js +1 -0
  103. package/dist/web/assets/preload-helper-DvgLbiBV.js +1 -0
  104. package/dist/web/assets/rolldown-runtime-hePW80VL.js +1 -0
  105. package/dist/web/assets/session-events-BuMTbIwu.js +23 -0
  106. package/dist/web/assets/settings-msYyNDKx.js +1 -0
  107. package/dist/web/assets/team-D3XOVbxL.js +1 -0
  108. package/dist/web/assets/teamService-Bus5RDi1.js +1 -0
  109. package/dist/web/assets/terminal-Cp5WYo8w.js +1 -0
  110. package/dist/web/assets/triangle-alert-cGqHxFsZ.js +1 -0
  111. package/dist/web/assets/vendor-radix-L0yJCKJX.js +41 -0
  112. package/dist/web/assets/vendor-react-CHEIQMI-.js +9 -0
  113. package/dist/web/assets/vendor-xterm-CANZO_wP.js +16 -0
  114. package/dist/web/assets/vendor-xterm-CHOd7Rch.css +1 -0
  115. package/dist/web/index.html +6 -4
  116. package/package.json +11 -10
  117. package/dist/chunk-514va7ce.js +0 -2
  118. package/dist/chunk-6p0hkf4f.js +0 -1
  119. package/dist/chunk-793wjhvz.js +0 -332
  120. package/dist/chunk-867bpjzg.js +0 -1
  121. package/dist/chunk-983hqzat.js +0 -1
  122. package/dist/chunk-af0m5227.js +0 -1
  123. package/dist/chunk-dpg006xj.js +0 -1
  124. package/dist/chunk-g7tphxme.js +0 -6
  125. package/dist/chunk-gpnkxh4c.js +0 -1
  126. package/dist/chunk-hpge30p8.js +0 -8
  127. package/dist/chunk-mtvbm7xe.js +0 -1
  128. package/dist/chunk-mys9mmcp.js +0 -1
  129. package/dist/chunk-new78c3h.js +0 -1
  130. package/dist/chunk-nng1xbsm.js +0 -10
  131. package/dist/chunk-pt0y4zrg.js +0 -14
  132. package/dist/chunk-q6abav45.js +0 -171
  133. package/dist/chunk-r4em0ha7.js +0 -1
  134. package/dist/chunk-rdzbd5vk.js +0 -1
  135. package/dist/chunk-sbfe9vh3.js +0 -94
  136. package/dist/chunk-w6zat4v4.js +0 -1
  137. package/dist/chunk-wsd3rn0q.js +0 -1
  138. package/dist/chunk-yzf2jpam.js +0 -2
  139. package/dist/web/assets/ChatView-lUD-61n0.js +0 -70
  140. package/dist/web/assets/CodeBlockHighlighter--TbfcBxW.js +0 -8
  141. package/dist/web/assets/FilePreview-R6OKQPf2.js +0 -55
  142. package/dist/web/assets/KanbanBoard-BHOKtiv5.js +0 -16
  143. package/dist/web/assets/MarkdownRenderer-DqxNq8pa.js +0 -30
  144. package/dist/web/assets/ScrollArea-Dhu0B-zB.js +0 -1
  145. package/dist/web/assets/SessionHistorySurface-aZvoj3ma.js +0 -6
  146. package/dist/web/assets/SettingsModal-C7QBnIqa.js +0 -20
  147. package/dist/web/assets/Sidebar-Bznnq91x.js +0 -31
  148. package/dist/web/assets/TaskSwitcher-DJczhDRp.js +0 -26
  149. package/dist/web/assets/TerminalPanel-Vk4p0V3p.js +0 -6
  150. package/dist/web/assets/archive-0hLYBKQf.js +0 -6
  151. package/dist/web/assets/arrow-left-CXb6Gqf3.js +0 -6
  152. package/dist/web/assets/calendar-clock-DiaFI9Jk.js +0 -6
  153. package/dist/web/assets/chevron-right-CcPXH37D.js +0 -6
  154. package/dist/web/assets/clock-3-D6VR6gJc.js +0 -6
  155. package/dist/web/assets/copy-C3eUAQgp.js +0 -6
  156. package/dist/web/assets/download-DHvS9tI3.js +0 -6
  157. package/dist/web/assets/external-link-BDVaEuqY.js +0 -11
  158. package/dist/web/assets/folder-B80Ac6rr.js +0 -11
  159. package/dist/web/assets/index-B5mUEr6D.js +0 -11
  160. package/dist/web/assets/index-VwIiNjc8.css +0 -1
  161. package/dist/web/assets/index-YqughEZk.js +0 -211
  162. package/dist/web/assets/message-square-plus-D15quyPH.js +0 -21
  163. package/dist/web/assets/pause-BjMlj6Bx.js +0 -6
  164. package/dist/web/assets/pencil-BMoJvcB7.js +0 -6
  165. package/dist/web/assets/play-BHh4py3p.js +0 -6
  166. package/dist/web/assets/plus-DeFz_gQq.js +0 -6
  167. package/dist/web/assets/session-events-DCHBz9We.js +0 -25
  168. package/dist/web/assets/settings-CI8xbId2.js +0 -6
  169. package/dist/web/assets/team-zZ803hH9.js +0 -6
  170. package/dist/web/assets/teamService-CgLBXgmv.js +0 -1
  171. package/dist/web/assets/terminal-1WxSJ47E.js +0 -6
  172. package/dist/web/assets/vendor-radix-D6QrtXqd.js +0 -45
  173. package/dist/web/assets/vendor-react-DofNRwfy.js +0 -49
  174. package/dist/web/assets/vendor-xterm-9CEnUXvW.css +0 -32
  175. package/dist/web/assets/vendor-xterm-DuYZoU4T.js +0 -49
@@ -1,31 +0,0 @@
1
- import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-Dhu0B-zB.js";import{c as pe,l as mt,u as se,a as d,a4 as He,a5 as Qe,a6 as Ve,t as Xe,j as w,L as te,b as K,d as $,K as Se,w as kt,ap as bt,C as vt,X as gt,A as Je,z as jt,R as yt,T as wt,n as Ye,af as Oe,$ as We,U as Nt,ab as Ze,ad as et,aq as St,ae as tt,s as be,ar as st,a0 as Tt,as as Ct,ah as Et,a1 as At,N as Dt}from"./index-YqughEZk.js";import{N as at,$ as G,a0 as Pt}from"./session-events-DCHBz9We.js";import{A as nt}from"./archive-0hLYBKQf.js";import{D as rt}from"./download-DHvS9tI3.js";import{P as It}from"./pencil-BMoJvcB7.js";import{S as it}from"./settings-CI8xbId2.js";import{P as _e}from"./plus-DeFz_gQq.js";import{T as ct}from"./terminal-1WxSJ47E.js";import{C as Rt}from"./chevron-right-CcPXH37D.js";import"./vendor-radix-D6QrtXqd.js";/**
2
- * @license lucide-react v0.300.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 Ot=pe("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
7
- * @license lucide-react v0.300.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 _t=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
12
- * @license lucide-react v0.300.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 Mt=pe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
17
- * @license lucide-react v0.300.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 Bt=pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
22
- * @license lucide-react v0.300.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 ot=pe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
27
- * @license lucide-react v0.300.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 Lt=pe("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);async function lt(t,a=!1){const r=await mt.exportSessionMarkdown(t,a),c=new Blob([r.markdown],{type:"text/markdown;charset=utf-8"}),o=URL.createObjectURL(c),l=document.createElement("a");l.href=o,l.download=r.filename,l.hidden=!0,document.body.appendChild(l);try{l.click()}finally{l.remove(),await new Promise(C=>{window.setTimeout(()=>{URL.revokeObjectURL(o),C()},0)})}return r}function Ut(){const t=se(),a=d(h=>h.archivedSessions),r=d(h=>h.archivedCatalogLoadState),c=d(h=>h.archivedCatalogError),o=d(h=>h.loadArchivedSessions),l=d(h=>h.unarchiveSession),C=d(h=>h.setError),b=d(h=>at(h.historySurfaceSelection)),[v,m]=D.useState(!1),[g,P]=D.useState(null),[R,j]=D.useState(null),T=h=>{h&&G(d.getState())||(m(h),h&&o())},B=()=>{G(d.getState())||o()};return b?null:e.jsxs(He,{open:v,onOpenChange:T,children:[e.jsx(Qe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex h-8 w-full items-center justify-between rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]","aria-label":t("archive.open"),children:[e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(nt,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),t("archive.title")]}),a.length>0&&e.jsx("span",{className:"rounded-sm bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 text-[9px] text-[hsl(var(--deck-ink-faint))]",children:a.length})]})}),e.jsxs(Ve,{role:"dialog","aria-label":t("archive.title"),side:"right",align:"end",sideOffset:8,className:"w-[340px] overflow-hidden p-0",children:[e.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-[hsl(var(--deck-hairline))] px-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.08em] text-[hsl(var(--deck-ink))]",children:t("archive.title")}),e.jsx("div",{className:"text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:t("archive.subtitle")})]}),e.jsx("button",{type:"button",onClick:B,"aria-label":t("archive.refresh"),className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Xe,{className:w("h-3 w-3",(r==="loading"||r==="hydrating")&&"animate-spin")})})]}),c?e.jsxs("div",{className:"px-3 py-4 text-[11px] text-red-600 dark:text-red-400",children:[e.jsx("div",{children:c}),e.jsx("button",{type:"button",onClick:B,className:"mt-2 font-mono text-[10px] text-[hsl(var(--deck-accent))] focus-visible:outline-none focus-visible:underline",children:t("archive.retry")})]}):a.length===0&&(r==="loading"||r==="hydrating")?e.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(te,{className:"h-3 w-3 animate-spin"}),t("archive.loading")]}):a.length===0?e.jsx("div",{className:"flex h-24 items-center justify-center px-6 text-center text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("archive.empty")}):e.jsx(ze,{className:"max-h-[340px]",children:e.jsx("div",{className:"divide-y divide-[hsl(var(--deck-hairline))]",children:a.map(h=>{var A;const E=K(h),M=$(E),_=g===M,Y=h.projectPath.split("/").filter(Boolean).at(-1)??h.projectPath;return e.jsxs("div",{className:"flex min-h-[58px] items-center gap-2 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-mono text-[11.5px] text-[hsl(var(--deck-ink))]",children:Se(h,t)}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{className:"truncate",children:Y}),h.archivedAt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:new Date(h.archivedAt).toLocaleString()})]})]}),h.archivedBySessionId!==h.sessionId&&e.jsx("div",{className:"mt-0.5 truncate text-[9px] text-[hsl(var(--deck-accent))]",children:t("archive.inherited",{id:((A=h.archivedBySessionId)==null?void 0:A.slice(0,8))??""})})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx("button",{type:"button",disabled:R!==null,onClick:async()=>{if(!G(d.getState())){j(M);try{await lt(E)}catch(U){C(U instanceof Error?U.message:"Session export failed")}finally{j(null)}}},"aria-label":t("session.action.export",{title:Se(h,t)}),title:t("session.action.exportShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-35",children:R===M?e.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(rt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",disabled:_||h.archivedBySessionId!==h.sessionId,onClick:async()=>{if(!G(d.getState())){P(M);try{await l(E)}finally{P(null)}}},"aria-label":t("archive.restore",{title:Se(h,t)}),title:h.archivedBySessionId!==h.sessionId?t("archive.restoreAncestor"):t("archive.restoreShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-35",children:_?e.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ot,{className:"h-3.5 w-3.5"})})]})]},M)})})})]})]})}const Me={en:"sidebar.language.en",zh:"sidebar.language.zh"};function dt({className:t,variant:a="pill"}){const{locale:r,setLocale:c}=kt(),o=se();if(a==="compact"){const l=r==="en"?"zh":"en";return e.jsx("button",{type:"button",onClick:()=>c(l),"aria-label":o("sidebar.language.aria"),title:o("sidebar.language.label"),className:w("flex justify-center items-center w-10 h-10 font-mono font-medium rounded-md transition-colors text-[11px] text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",t),children:o(Me[r])})}return e.jsx("div",{role:"group","aria-label":o("sidebar.language.aria"),className:w("inline-flex h-8 items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-[2px] font-mono text-[11px]",t),children:bt.map(l=>{const C=l===r;return e.jsx("button",{type:"button",onClick:()=>c(l),"aria-pressed":C,className:w("flex justify-center items-center px-2 h-full transition-colors min-w-[28px] rounded-[4px]",C?"bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:o(Me[l])},l)})})}function Ft({summary:t,isActive:a,onSelect:r}){const c=se(),o=t.title??t.locator.sessionId,l=c(t.capabilities.connection==="offline"?"history.connection.offline":t.capabilities.connection==="local"?"history.connection.local":"history.connection.online");return e.jsxs("div",{className:w("flex relative items-center w-full transition-colors min-h-[54px]",a?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[a&&e.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),e.jsxs("button",{type:"button","aria-label":c("session.action.select",{title:o}),"aria-current":a?"true":void 0,onClick:r,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx("span",{className:w("h-1.5 w-1.5 shrink-0 rounded-full",t.capabilities.connection==="offline"?"bg-amber-500":"bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)]"),title:l}),e.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[e.jsxs("span",{className:w("flex gap-2 items-center text-left truncate text-[12px]",a?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[e.jsx("span",{className:"truncate",children:o}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded border border-[hsl(var(--deck-border))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-ink-faint))]",children:c("history.badge.remote")}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded border border-[hsl(var(--deck-border))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-ink-faint))]",children:l}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-accent))]",children:c("history.badge.historyOnly")})]}),e.jsx("span",{className:"mt-0.5 block truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:t.displayCwd})]})]})]})}const qt={running:"bg-blue-500 dark:bg-blue-400 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",queued:"bg-amber-400 dark:bg-amber-300",interrupted:"bg-orange-500 dark:bg-orange-400",failed:"bg-red-500 dark:bg-red-400",cancelled:"bg-zinc-400 dark:bg-zinc-500",completed:"bg-[hsl(var(--deck-accent))]"};function Gt({session:t,isActive:a,isForking:r,isUnread:c,anyForking:o,isEditing:l,editingTitle:C,title:b,context:v,isCancelling:m,isRetrying:g,isExporting:P,onSelect:R,onCancelTask:j,onRetryTask:T,onFork:B,onArchive:h,onExport:E,onStartRename:M,onDelete:_,onEditingTitleChange:Y,onSaveRename:A,onCancelRename:U}){const y=se(),[F,z]=D.useState(!1),ae=D.useRef(null),q=D.useRef(null);return l?e.jsxs("div",{className:"flex h-9 w-full items-center gap-2 bg-[hsl(var(--deck-surface))] px-3",children:[e.jsx("input",{type:"text",value:C,onChange:S=>Y(S.target.value),onKeyDown:S=>{S.key==="Enter"&&A(),S.key==="Escape"&&U()},autoFocus:!0,className:"flex-1 rounded bg-[hsl(var(--deck-canvas))] px-2 py-1 font-mono text-[13px] text-[hsl(var(--deck-ink))] outline-none focus:ring-1 focus:ring-[hsl(var(--deck-accent))]"}),e.jsx("button",{"aria-label":y("session.action.save",{title:b}),onClick:A,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-canvas))]",children:e.jsx(vt,{className:"w-3 h-3"})}),e.jsx("button",{"aria-label":y("session.action.cancel",{title:b}),onClick:U,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-canvas))]",children:e.jsx(gt,{className:"w-3 h-3"})})]}):e.jsxs("div",{className:w("flex relative items-center w-full transition-colors group min-h-[54px]",a?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[a&&e.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),e.jsxs("button",{type:"button","aria-label":y("session.action.select",{title:b}),"aria-current":a?"true":void 0,"aria-busy":r?"true":void 0,onClick:R,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx("span",{className:w("h-1.5 w-1.5 shrink-0 rounded-full",t.pendingInteraction?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":qt[t.taskStatus]),title:t.pendingInteraction?y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):t.taskStatus}),e.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[e.jsxs("span",{className:w("flex gap-2 items-center text-left truncate text-[12px]",a?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[e.jsx("span",{className:"truncate",children:b}),c&&e.jsx("span",{title:y("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),t.pendingInteraction&&e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[8.5px] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"),children:[e.jsx(Je,{className:"h-2.5 w-2.5"}),y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")]}),t.relationType==="fork"&&t.parentId&&e.jsxs("span",{title:`${y("session.forkedFrom")} ${t.parentId.slice(0,6)}`,"aria-label":`${y("session.forkedFrom")} ${t.parentId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:[y("session.forkedFrom")," ",t.parentId.slice(0,6)]}),t.taskRetriedFrom&&e.jsx("span",{title:`${y("session.retriedFrom")} ${t.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:y("session.retryShort")})]}),e.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{className:"truncate",children:v.project}),e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"truncate",children:v.environment}),v.queue&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"text-amber-700 truncate dark:text-amber-400",children:v.queue})]}),v.diff&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"truncate text-[hsl(var(--deck-accent))]",children:v.diff})]})]}),v.reason&&e.jsx("span",{title:v.reason,className:"mt-0.5 block truncate text-[9.5px] text-red-600 dark:text-red-400",children:v.reason})]}),r&&e.jsx(te,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"})]}),e.jsxs("div",{className:w("flex items-center gap-0.5 pr-2 transition-opacity group-focus-within:opacity-100",t.taskStatus==="running"||t.taskStatus==="queued"||t.taskRetryAvailable&&(t.taskStatus==="failed"||t.taskStatus==="interrupted"||t.taskStatus==="cancelled")?"opacity-100":"opacity-50 group-hover:opacity-100"),children:[(t.taskStatus==="running"||t.taskStatus==="queued")&&e.jsx("button",{type:"button","aria-label":y(m?"session.action.stopping":"session.action.stop",{title:b}),disabled:m,onClick:S=>{S.stopPropagation(),j()},className:"flex h-6 w-6 items-center justify-center rounded text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:m?e.jsx(te,{className:"h-3 w-3 animate-spin"}):e.jsx(jt,{className:"h-3 w-3"})}),t.taskRetryAvailable&&(t.taskStatus==="failed"||t.taskStatus==="interrupted"||t.taskStatus==="cancelled")&&e.jsx("button",{ref:ae,type:"button","aria-label":y(g?"session.action.retrying":"session.action.retry",{title:b}),disabled:g,onClick:S=>{S.stopPropagation(),T()},className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:g?e.jsx(te,{className:"h-3 w-3 animate-spin"}):e.jsx(yt,{className:"h-3 w-3"})}),e.jsxs(He,{open:F,onOpenChange:z,children:[e.jsx(Qe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":y("session.action.more",{title:b}),"aria-expanded":F,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-canvas))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Lt,{className:"h-3.5 w-3.5"})})}),e.jsxs(Ve,{ref:q,role:"menu","aria-label":y("session.action.more",{title:b}),side:"right",align:"start",sideOffset:6,className:"w-40 p-1",onOpenAutoFocus:S=>{var H,ie;S.preventDefault(),(ie=(H=q.current)==null?void 0:H.querySelector('[role="menuitem"]:not([disabled])'))==null||ie.focus()},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),z(!1),window.setTimeout(()=>{var H;return(H=ae.current)==null?void 0:H.focus()},0))},children:[e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.fork",{title:b}),disabled:o,onClick:S=>{S.stopPropagation(),B(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",children:[e.jsx(Mt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.forkShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.rename",{title:b}),onClick:S=>{M(S),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none",children:[e.jsx(It,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.renameShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.archive",{title:b}),disabled:t.taskStatus==="running"||t.taskStatus==="queued",onClick:S=>{S.stopPropagation(),h(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-35",children:[e.jsx(nt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.archiveShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.export",{title:b}),disabled:P,onClick:S=>{S.stopPropagation(),E(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-wait disabled:opacity-45",children:[P?e.jsx(te,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):e.jsx(rt,{className:"h-3 w-3","aria-hidden":!0}),y(P?"session.action.exportingShort":"session.action.exportShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.delete",{title:b}),onClick:S=>{_(S),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-red-600 transition-colors hover:bg-red-500/10 focus-visible:bg-red-500/10 focus-visible:outline-none dark:text-red-400",children:[e.jsx(wt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.deleteShort")]})]})]})]})]})}function Kt({onExpand:t,onNewChat:a,onOpenBoard:r,onOpenTaskSwitcher:c,onToggleTerminal:o,onToggleSettings:l,isTerminalOpen:C,taskEventsConnected:b,unreadCount:v,boardActive:m,terminalDisabled:g=!1,taskSwitcherDisabled:P=!1,className:R}){const j=se(),T=[{icon:it,action:l,labelKey:"sidebar.section.settings"}];return e.jsxs("div",{className:w("flex flex-col gap-2 items-center py-5 h-screen border-r w-[64px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",R),children:[e.jsx("button",{onClick:t,className:"rounded-md p-1 transition-colors hover:bg-[hsl(var(--deck-surface))]","aria-label":j("sidebar.action.expand"),children:e.jsx(Ye,{size:28})}),e.jsx("button",{onClick:a,"aria-label":j("sidebar.action.newTaskShort"),title:j("sidebar.action.newTaskShort"),className:"mt-6 flex h-10 w-10 items-center justify-center rounded-md bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/85",children:e.jsx(_e,{className:"h-4 w-4 stroke-[2.5]"})}),e.jsx("button",{type:"button",onClick:r,"aria-label":j("sidebar.action.taskBoard"),"aria-current":m?"page":void 0,title:j("sidebar.action.taskBoard"),className:w("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",m?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:e.jsx(ot,{className:"h-4 w-4"})}),e.jsx("button",{onClick:o,disabled:g,"aria-label":j("sidebar.action.terminalToggle"),title:j("sidebar.action.terminal"),className:w("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",g&&"cursor-not-allowed opacity-35",C?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:e.jsx(ct,{className:"w-4 h-4"})}),e.jsxs("button",{onClick:c,disabled:P,"aria-label":j("sidebar.action.searchTasks"),title:`${j("sidebar.action.searchTasks")} (${Oe("searchTasks")})`,className:w("relative flex h-10 w-10 items-center justify-center rounded-md border border-transparent text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",P&&"cursor-not-allowed opacity-35"),children:[e.jsx(We,{className:"h-4 w-4"}),v>0&&e.jsx("span",{"aria-label":j("sidebar.unreadTasks",{count:v}),className:"absolute right-0.5 top-0.5 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-[hsl(var(--deck-accent))] px-1 font-mono text-[8px] font-semibold text-white",children:v>99?"99+":v})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"my-2 h-px w-6 bg-[hsl(var(--deck-hairline))]"}),T.map(({icon:B,action:h,labelKey:E})=>e.jsx("button",{"data-settings-trigger":!0,onClick:h,"aria-label":j(E),title:j(E),className:"flex h-10 w-10 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:e.jsx(B,{className:"w-4 h-4"})},E)),e.jsx(dt,{variant:"compact"}),e.jsx("div",{className:"mt-1",children:e.jsx("div",{role:"status","aria-label":j(b?"sidebar.status.feedLive":"sidebar.status.feedOffline"),className:w("h-2 w-2 rounded-full",b?"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60"),title:j(b?"sidebar.status.feedLive":"sidebar.status.feedOffline")})})]})}const ht="blade.sidebar.project-order.v1";function ve(t){const a=new Set,r=[];for(const c of t)typeof c!="string"||!c||a.has(c)||(a.add(c),r.push(c));return r}function $t(){if(typeof window>"u")return[];try{const t=JSON.parse(window.localStorage.getItem(ht)??"[]");return Array.isArray(t)?ve(t):[]}catch{return[]}}function Be(t){if(!(typeof window>"u"))try{window.localStorage.setItem(ht,JSON.stringify(ve(t)))}catch{}}function Le(t,a){const r=new Map(ve(a).map((o,l)=>[o,l])),c=r.size;return t.map((o,l)=>({project:o,rank:r.get(o.path)??c+l})).sort((o,l)=>o.rank-l.rank).map(({project:o})=>o)}function Ue(t,a,r){const c=ve(t),o=c.indexOf(a),l=c.indexOf(r);if(o<0||l<0||o===l)return c;const[C]=c.splice(o,1);return c.splice(l,0,C),c}function Fe(t,a,r){const c=ve(t),o=c.indexOf(a),l=o+r;return o<0||l<0||l>=c.length||([c[o],c[l]]=[c[l],c[o]]),c}function qe({name:t,path:a,count:r,countIsPartial:c=!1,isActive:o,hasRunning:l,unreadCount:C,collapsed:b,onToggle:v,onSelect:m,onCreateTask:g,reorderPosition:P,reorderCount:R,isDragging:j=!1,onDragStart:T,onDragEnd:B,onReorderKeyDown:h}){const E=se();return e.jsxs("div",{className:w("group/proj flex w-full items-center gap-2 px-5 pb-1.5 pt-3 text-left transition-colors","hover:bg-[hsl(var(--deck-surface))]/40"),children:[e.jsx("button",{type:"button",draggable:!0,"data-project-drag-handle":a,onDragStart:T,onDragEnd:B,onKeyDown:h,"aria-label":E("sidebar.project.reorder",{name:t,position:P,count:R}),title:E("sidebar.project.reorderHint"),className:w("-ml-2 flex h-6 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-45 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink-muted))] hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] active:cursor-grabbing group-hover/proj:opacity-100",j&&"cursor-grabbing opacity-100 text-[hsl(var(--deck-accent))]"),children:e.jsx(Bt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:v,"aria-expanded":!b,"aria-label":E(b?"sidebar.project.expand":"sidebar.project.collapse",{name:t}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Rt,{className:w("h-3 w-3 text-[hsl(var(--deck-ink-faint))] transition-transform duration-150",!b&&"rotate-90")})}),e.jsxs("button",{type:"button",onClick:m??v,title:a,"aria-current":o?"true":void 0,className:"flex min-h-6 min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx(Nt,{className:w("h-3.5 w-3.5 shrink-0",o?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),e.jsx("span",{className:w("flex-1 truncate font-mono text-[11.5px] font-medium tracking-[-0.01em]",o?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:t}),l&&e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse dark:bg-blue-400","aria-hidden":!0}),C>0&&e.jsx("span",{"aria-label":E("sidebar.unreadTasks",{count:C}),className:"shrink-0 rounded-full bg-[hsl(var(--deck-accent))] px-1.5 py-0.5 font-mono text-[8px] font-semibold text-white",children:C}),e.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[r.toString().padStart(2,"0"),c?"+":""]})]}),g&&e.jsx("button",{type:"button",onClick:g,title:E("sidebar.project.newTask",{name:t}),"aria-label":E("sidebar.project.newTask",{name:t}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-0 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-accent))] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] group-hover/proj:opacity-100",children:e.jsx(_e,{className:"h-3.5 w-3.5"})})]})}const zt=["running","queued","interrupted","failed","cancelled","completed"],Ht={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},ue=t=>t.length>1?t.replace(/\/+$/,""):t;function ut(t){const a=new Map;for(const r of t){if(!r)continue;const c=$(K(r));a.has(c)||a.set(c,r)}return Array.from(a.values())}function Qt(t){const a=ut(t),r=[];for(const c of zt){const o=a.filter(l=>l.taskStatus===c).sort(Ze);o.length>0&&r.push({code:Ht[c],status:c,sessions:o})}return r}function Vt(t,a,r=[]){const c=ut(t),o=new Map,l=r.map(ue),C=new Map(l.map((m,g)=>[m,g]));for(const m of l)o.set(m,[]);for(const m of c){const g=et(m,a),P=o.get(g);P?P.push(m):o.set(g,[m])}const b=a?ue(a):null,v=Array.from(o.entries()).map(([m,g])=>{const P=[...g].sort(Ze),R=g.reduce((j,T)=>Math.max(j,St(T)),0);return{path:m,name:tt(m),isActive:b?ue(m)===b:!1,isBound:C.has(ue(m)),hasRunning:g.some(j=>j.taskStatus==="running"),lastActivity:R,sessions:P}});return v.sort((m,g)=>m.isBound!==g.isBound?m.isBound?-1:1:m.isBound&&g.isBound?(C.get(ue(m.path))??Number.MAX_SAFE_INTEGER)-(C.get(ue(g.path))??Number.MAX_SAFE_INTEGER):g.lastActivity-m.lastActivity),v}const Ne=12,Xt=["running","queued","interrupted","failed","cancelled","completed"],Ge={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},Ke={RUNNING:"text-blue-700 dark:text-blue-400",QUEUED:"text-amber-700 dark:text-amber-400",INTERRUPTED:"text-orange-700 dark:text-orange-400",FAILED:"text-red-700 dark:text-red-400",CANCELLED:"text-[hsl(var(--deck-ink-faint))]",DONE:"text-[hsl(var(--deck-accent))]"},Jt={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"};function xe(t){return t.length>1?t.replace(/\/+$/,""):t}function Te(t){const a=t.lastMessageTime||t.firstMessageTime;if(!a)return 0;const r=new Date(a).getTime();return Number.isNaN(r)?0:r}function Yt(t,a){if(t.locator.workspace.kind!=="local")throw new Error("Expected a local Session surface summary");return a&&Te(a)>=Te(t)?a:{...a??{sessionId:t.locator.sessionId,projectPath:t.locator.workspace.projectPath,rootId:t.rootId,taskStatus:t.taskStatus,messageCount:t.messageCount,firstMessageTime:t.firstMessageTime,lastMessageTime:t.lastMessageTime,hasErrors:t.hasErrors},sessionId:t.locator.sessionId,projectPath:t.locator.workspace.projectPath,title:t.title,rootId:t.rootId,parentId:t.parentId,relationType:t.relationType,taskStatus:t.taskStatus,messageCount:t.messageCount,firstMessageTime:t.firstMessageTime,lastMessageTime:t.lastMessageTime,hasErrors:t.hasErrors,archivedAt:t.archivedAt,selectedModelId:t.selectedModelId}}function $e(t){return t.kind==="local"?t.session.taskStatus:t.summary.taskStatus}function Wt(t,a){return a.activityTime-t.activityTime}function Re(t){return[...t].sort(Wt)}function Zt({view:t,sessions:a,surfaceCatalog:r,activeProjectPath:c,boundProjects:o,currentSessionRef:l,historySurfaceSelection:C,unreadTaskKeys:b,catalogLoadState:v,onSelectProject:m,onCreateTask:g,onRetryCatalog:P,renderLocalRow:R,renderRemoteRow:j}){const T=se(),[B,h]=D.useState({}),[E,M]=D.useState({}),[_,Y]=D.useState($t),[A,U]=D.useState(null),[y,F]=D.useState(null),[z,ae]=D.useState(""),q=v==="ready"||r.length>0,S=v==="loading"||v==="hydrating",H=S||v==="error",ie=q?r.length:a.length,Ce=D.useMemo(()=>t==="status"?Qt(a):[],[a,t]),ne=D.useMemo(()=>t==="project"?Vt(a,c,o.map(n=>n.path)):[],[c,o,a,t]),Q=D.useMemo(()=>Le(ne,_),[ne,_]),V=D.useMemo(()=>{if(!q)return[];const n=new Map(a.map(p=>[$(K(p)),p])),k=[];for(const p of r){if(p.locator.workspace.kind==="local"){const I={sessionId:p.locator.sessionId,projectPath:p.locator.workspace.projectPath},i=n.get($(I)),u=Yt(p,i);k.push({kind:"local",path:i?et(u,c):p.locator.workspace.projectPath,activityTime:Te(u),session:u});continue}k.push({kind:"remote",activityTime:Te(p),summary:p})}return k},[c,a,r,q]),Ee=D.useMemo(()=>!q||t!=="status"?[]:Xt.flatMap(n=>{const k=Re(V.filter(p=>$e(p)===n));return k.length===0?[]:[{code:Jt[n],entries:k}]}),[V,q,t]),X=D.useMemo(()=>{if(!q||t!=="project")return[];const n=o.map(u=>xe(u.path)),k=new Map(n.map((u,x)=>[u,x])),p=new Map;for(const u of n)p.set(u,[]);for(const u of V){if(u.kind!=="local")continue;const x=p.get(u.path);x?x.push(u):p.set(u.path,[u])}const I=c?xe(c):null,i=Array.from(p.entries()).map(([u,x])=>({path:u,name:tt(u),isActive:I?xe(u)===I:!1,isBound:k.has(xe(u)),hasRunning:x.some(f=>$e(f)==="running"),lastActivity:x.reduce((f,L)=>Math.max(f,L.activityTime),0),entries:Re(x)}));return i.sort((u,x)=>u.isBound!==x.isBound?u.isBound?-1:1:u.isBound&&x.isBound?(k.get(xe(u.path))??Number.MAX_SAFE_INTEGER)-(k.get(xe(x.path))??Number.MAX_SAFE_INTEGER):x.lastActivity-u.lastActivity),Le(i,_)},[c,o,V,_,q,t]),ce=D.useMemo(()=>t==="project"?Re(V.filter(n=>n.kind==="remote")):[],[V,t]),ge=n=>n.kind==="local"&&!!n.session.pendingInteraction,je=n=>n.kind==="local"&&b.includes($(K(n.session))),fe=n=>n.kind==="local"?!!(l&&be(K(n.session),l)):!!(C&&st(n.summary.locator,C.locator)),ye=(n,k)=>{const p=E[n]??!1,I=p?k:k.filter((x,f)=>{if(f<Ne)return!0;const L=K(x);return!!x.pendingInteraction||b.includes($(L))||!!(l&&be(L,l))}),i=k.length-I.length,u=p?k.length>Ne:i>0;return e.jsxs(e.Fragment,{children:[I.map(R),u&&e.jsx("button",{type:"button",onClick:()=>M(x=>({...x,[n]:!p})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:p?T("sidebar.group.showLess"):T("sidebar.group.showMore",{count:i})})]})},W=(n,k)=>{const p=E[n]??!1,I=p?k:k.filter((x,f)=>f<Ne?!0:ge(x)||je(x)||fe(x)),i=k.length-I.length,u=p?k.length>Ne:i>0;return e.jsxs(e.Fragment,{children:[I.map(x=>x.kind==="local"?R(x.session):j(x.summary)),u&&e.jsx("button",{type:"button",onClick:()=>M(x=>({...x,[n]:!p})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:p?T("sidebar.group.showLess"):T("sidebar.group.showMore",{count:i})})]})},oe=S?e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-[hsl(var(--deck-surface))]/55 px-3 py-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(te,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),e.jsx("span",{className:"flex-1 min-w-0",children:T("sidebar.catalog.syncing")}),e.jsx("span",{className:"tabular-nums shrink-0",children:T("sidebar.catalog.loaded",{count:ie})})]}):v==="error"?e.jsxs("div",{role:"alert",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-amber-50/80 px-3 py-2 font-mono text-[9.5px] text-amber-800 dark:bg-amber-950/35 dark:text-amber-300",children:[e.jsx(Je,{className:"w-3 h-3 shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0",children:T("sidebar.catalog.incomplete")}),e.jsxs("button",{type:"button",onClick:P,className:"inline-flex min-h-6 shrink-0 items-center gap-1 rounded px-1.5 font-medium hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 dark:hover:bg-amber-900/50",children:[e.jsx(Xe,{className:"h-2.5 w-2.5"}),T("sidebar.catalog.retry")]})]}):null;if(q){if(t==="status")return e.jsxs("div",{className:"flex flex-col",children:[oe,Ee.map((i,u)=>e.jsxs("div",{children:[e.jsxs("div",{className:w("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",Ke[i.code]??"text-[hsl(var(--deck-ink-faint))]",u===0&&"pt-2"),children:[e.jsx("span",{children:T(Ge[i.code])}),e.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[i.entries.length.toString().padStart(2,"0"),H?"+":""]})]}),W(`status:${i.code}`,i.entries)]},i.code))]});const n=X.some(i=>i.isActive||i.entries.some(fe)),k=i=>i.entries.some(fe),p=(i,u)=>{if(i.join("\0")===X.map(f=>f.path).join("\0"))return;Y(i),Be(i);const x=X.find(f=>f.path===u);ae(T("sidebar.project.reordered",{name:(x==null?void 0:x.name)??u,position:i.indexOf(u)+1}))},I=(i,u)=>{const x=i.entries.filter(je).length,f=k(i),L=x>0,re=i.entries.some(ge),Z=B[i.path]??(n&&!i.isActive&&!(f||i.hasRunning||L||re));return e.jsxs("div",{"data-project-group":i.path,onDragEnter:O=>{!A||A===i.path||(O.preventDefault(),F(i.path))},onDragOver:O=>{!A||A===i.path||(O.preventDefault(),O.dataTransfer.dropEffect="move")},onDrop:O=>{O.preventDefault();const ee=A||O.dataTransfer.getData("text/plain");ee&&ee!==i.path&&p(Ue(X.map(ke=>ke.path),ee,i.path),ee),U(null),F(null)},className:w("relative transition-colors",y===i.path&&A!==i.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[e.jsx(qe,{name:i.name,path:i.path,count:i.entries.length,countIsPartial:H,isActive:i.isActive,hasRunning:i.hasRunning,unreadCount:x,collapsed:Z,onSelect:()=>m(i.path),onCreateTask:()=>g(i.path),reorderPosition:u+1,reorderCount:X.length,isDragging:A===i.path,onDragStart:O=>{O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",i.path),U(i.path)},onDragEnd:()=>{U(null),F(null)},onReorderKeyDown:O=>{if(O.key!=="ArrowUp"&&O.key!=="ArrowDown")return;O.preventDefault();const ee=Fe(X.map(ke=>ke.path),i.path,O.key==="ArrowUp"?-1:1);p(ee,i.path)},onToggle:()=>h(O=>({...O,[i.path]:!Z}))}),!Z&&W(`project:${i.path}`,i.entries)]},i.path)};return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"sr-only","aria-live":"polite",children:z}),oe,ce.length>0&&e.jsxs("section",{"data-remote-session-group":!0,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{children:T("sidebar.project.remoteSessions")}),e.jsx("span",{children:ce.length.toString().padStart(2,"0")})]}),W("remote-sessions",ce)]}),X.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:T("sidebar.project.projects")}),X.map(I)]})]})}if(t==="status")return e.jsxs("div",{className:"flex flex-col",children:[oe,Ce.map((n,k)=>e.jsxs("div",{children:[e.jsxs("div",{className:w("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",Ke[n.code]??"text-[hsl(var(--deck-ink-faint))]",k===0&&"pt-2"),children:[e.jsx("span",{children:T(Ge[n.code])}),e.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[n.sessions.length.toString().padStart(2,"0"),H?"+":""]})]}),ye(`status:${n.code}`,n.sessions)]},n.code))]});const le=Q.some(n=>n.isActive),me=n=>!!(l&&n.sessions.some(k=>be(K(k),l))),de=(n,k)=>{if(n.join("\0")===Q.map(I=>I.path).join("\0"))return;Y(n),Be(n);const p=Q.find(I=>I.path===k);ae(T("sidebar.project.reordered",{name:(p==null?void 0:p.name)??k,position:n.indexOf(k)+1}))},we=(n,k)=>{const p=n.sessions.filter(f=>b.includes($(K(f)))).length,I=me(n),i=p>0,u=n.sessions.some(f=>!!f.pendingInteraction),x=B[n.path]??(le&&!n.isActive&&!(I||n.hasRunning||i||u));return e.jsxs("div",{"data-project-group":n.path,onDragEnter:f=>{!A||A===n.path||(f.preventDefault(),F(n.path))},onDragOver:f=>{!A||A===n.path||(f.preventDefault(),f.dataTransfer.dropEffect="move")},onDrop:f=>{f.preventDefault();const L=A||f.dataTransfer.getData("text/plain");L&&L!==n.path&&de(Ue(Q.map(re=>re.path),L,n.path),L),U(null),F(null)},className:w("relative transition-colors",y===n.path&&A!==n.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[e.jsx(qe,{name:n.name,path:n.path,count:n.sessions.length,countIsPartial:H,isActive:n.isActive,hasRunning:n.hasRunning,unreadCount:p,collapsed:x,onSelect:()=>m(n.path),onCreateTask:()=>g(n.path),reorderPosition:k+1,reorderCount:Q.length,isDragging:A===n.path,onDragStart:f=>{f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",n.path),U(n.path)},onDragEnd:()=>{U(null),F(null)},onReorderKeyDown:f=>{if(f.key!=="ArrowUp"&&f.key!=="ArrowDown")return;f.preventDefault();const L=Fe(Q.map(re=>re.path),n.path,f.key==="ArrowUp"?-1:1);de(L,n.path)},onToggle:()=>h(f=>({...f,[n.path]:!x}))}),!x&&ye(`project:${n.path}`,n.sessions)]},n.path)};return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"sr-only","aria-live":"polite",children:z}),oe,Q.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:T("sidebar.project.projects")}),Q.map(we)]})]})}function us({className:t,onNavigate:a}){const r=se(),{toggleSettings:c,toggleSidebar:o,isSidebarOpen:l,isTerminalOpen:C,toggleTerminal:b,sidebarView:v,setSidebarView:m,setTaskSwitcherOpen:g,mainView:P,setMainView:R,setBoardProjectPath:j,setFilePreviewOpen:T}=Pt(),B=d(s=>s.sessions),h=d(s=>s.surfaceCatalog),E=d(s=>s.surfaceCatalogLoadState),M=d(s=>s.historySurfaceSelection),_=at(M),Y=d(s=>s.currentSessionRef),A=d(s=>s.forkingSessionRef),U=d(s=>s.selectSession),y=d(s=>s.openHistorySurface),F=d(s=>s.startTemporarySession),z=d(s=>s.deleteSession),ae=d(s=>s.archiveSession),q=d(s=>s.forkSession),S=d(s=>s.updateSession),H=d(s=>s.loadSessions),ie=d(s=>s.loadSurfaceCatalog),Ce=d(s=>s.setError),ne=d(s=>s.taskEventsConnected),Q=d(s=>s.taskWorkspaceInfo),V=d(s=>s.boundProjects),Ee=d(s=>s.selectedProjectPath),X=d(s=>s.bindProject),ce=d(s=>s.selectProject),ge=d(s=>s.cancelTask),je=d(s=>s.cancellingTaskKeys),fe=d(s=>s.retryTask),ye=d(s=>s.retryingTaskKeys),W=d(s=>s.unreadTaskKeys),[oe,le]=D.useState(null),[me,de]=D.useState(""),[we,n]=D.useState(null),[k,p]=D.useState(!1),I=Ee??(Q==null?void 0:Q.cwd)??null,i=s=>Se(s,r),u=s=>{const N=s.taskSourceProjectPath||s.projectPath,J=N.split("/").filter(Boolean).at(-1)||N,he=s.taskIsolation==="worktree"?s.taskWorktreeBranch||r("session.env.worktree"):r("session.env.local"),Ae=s.taskDiffStat?`+${s.taskDiffStat.additions} −${s.taskDiffStat.deletions}`:void 0,De=s.taskStatus==="queued"&&s.taskQueuePosition?r("session.queued",{position:s.taskQueuePosition,depth:s.taskQueueDepth??s.taskQueuePosition}):void 0,Pe=Dt(s,r);return{project:J,environment:he,diff:Ae,queue:De,reason:Pe}},x=()=>{R("workspace"),F(I??void 0),a==null||a()},f=()=>{d.getState().closeHistorySurface(),T(!1),j(I),R("board"),a==null||a()},L=async s=>{V.some(N=>N.path===s)?ce(s):await X(s),R("workspace"),F(s),a==null||a()},re=async s=>{V.some(N=>N.path===s)?ce(s):await X(s),R("workspace"),F(s),a==null||a()},Z=s=>{s(),a==null||a()},O=()=>{G(d.getState())||Z(b)},ee=async(s,N)=>{s.stopPropagation(),!G(d.getState())&&await z(K(N))},ke=async s=>{if(G(d.getState()))return;const N=K(s),J=$(N);if(!we){n(J);try{await lt(N)}catch(he){Ce(he instanceof Error?he.message:"Session export failed")}finally{n(null)}}},xt=(s,N)=>{s.stopPropagation(),!G(d.getState())&&(le($(K(N))),de(i(N)))},pt=async s=>{if(!G(d.getState())){if(!me.trim()){le(null);return}try{await S(K(s),me.trim()),le(null),await H()}catch(N){console.error("Failed to rename session:",N)}}},ft=()=>{le(null),de("")};return l?e.jsxs("div",{className:w("flex flex-col h-screen border-r w-[260px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",t),children:[e.jsxs("div",{className:"flex flex-col gap-6 px-5 pt-5 pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(Ye,{size:26}),e.jsx("span",{className:"font-mono text-[15px] font-semibold tracking-[-0.01em] text-[hsl(var(--deck-ink))]",children:"Blade"}),e.jsx("span",{className:"ml-1 rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.brand.badge")})]}),e.jsx("button",{onClick:o,"aria-label":r("sidebar.action.collapse"),className:"flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-[hsl(var(--deck-surface))]",children:e.jsx(_t,{className:"h-3 w-3 text-[hsl(var(--deck-ink-muted))]"})})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:x,className:"flex h-9 w-full items-center justify-between rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[13px] font-medium text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/88",children:[e.jsxs("span",{className:"flex gap-2 items-center",children:[e.jsx(_e,{className:"h-3.5 w-3.5 stroke-[2.5]"}),r("sidebar.action.newTask")]}),e.jsx("span",{className:"rounded-sm bg-white/10 px-1.5 py-[1px] font-mono text-[10px] text-white/80",children:Oe("newTask")})]}),e.jsxs("button",{type:"button",onClick:f,"aria-current":P==="board"?"page":void 0,className:w("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",P==="board"?"border-[hsl(var(--deck-accent)/0.45)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[e.jsx(ot,{className:"h-3.5 w-3.5"}),r("sidebar.action.taskBoard")]}),e.jsxs("button",{onClick:O,disabled:_,className:w("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",C?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[e.jsx(ct,{className:"h-3.5 w-3.5"}),r("sidebar.action.terminal")]}),!_&&e.jsxs("button",{type:"button",onClick:()=>Z(()=>g(!0)),className:"flex h-9 w-full items-center justify-between rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-3.5 w-3.5"}),r("sidebar.action.searchTasks")]}),e.jsx("span",{className:"rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:W.length>0?W.length:Oe("searchTasks")})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"flex flex-1 items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["project","status"].map(s=>e.jsx("button",{type:"button",onClick:()=>m(s),"aria-pressed":v===s,"aria-label":r(s==="project"?"sidebar.view.projectAria":"sidebar.view.statusAria"),className:w("flex-1 rounded-[5px] py-1 font-mono text-[11px] tracking-[0.02em] transition-colors",v===s?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:r(s==="project"?"sidebar.view.project":"sidebar.view.status")},s))}),e.jsx("button",{type:"button",onClick:()=>p(!0),disabled:_,title:r("projects.bind.action"),"aria-label":r("projects.bind.action"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-faint))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-accent))]",children:e.jsx(Tt,{className:"h-3.5 w-3.5"})})]})]}),e.jsx(ze,{className:"flex-1 px-0",children:e.jsxs("div",{className:"flex flex-col",children:[(B.length>0||h.length>0||V.length>0||E==="loading"||E==="hydrating"||E==="error")&&e.jsx(Zt,{view:v,sessions:B,surfaceCatalog:h,activeProjectPath:I,boundProjects:V,currentSessionRef:Y,historySurfaceSelection:M,unreadTaskKeys:W,catalogLoadState:E,onRetryCatalog:()=>{ie()},onSelectProject:s=>void L(s).catch(()=>{}),onCreateTask:s=>void re(s).catch(()=>{}),renderLocalRow:s=>{const N=K(s),J=$(N),he=be(N,Y),Ae=oe===J,De=be(N,A),Pe=!!A;return e.jsx(Gt,{session:s,sessionRef:N,isActive:he,isForking:De,isUnread:W.includes($(N)),anyForking:Pe,isEditing:Ae,editingTitle:me,title:i(s),context:u(s),isCancelling:je.includes($(N)),isRetrying:ye.includes($(N)),isExporting:we===J,onSelect:()=>(a==null||a(),R("workspace"),U(N)),onCancelTask:()=>{G(d.getState())||ge(N).catch(()=>{})},onRetryTask:()=>{G(d.getState())||fe(N).catch(()=>{})},onFork:()=>{G(d.getState())||q(s)},onArchive:()=>{G(d.getState())||ae(N)},onExport:()=>void ke(s),onStartRename:Ie=>xt(Ie,s),onDelete:Ie=>ee(Ie,s),onEditingTitleChange:de,onSaveRename:()=>pt(s),onCancelRename:ft},J)},renderRemoteRow:s=>e.jsx(Ft,{summary:s,isActive:st(s.locator,M==null?void 0:M.locator),onSelect:()=>(a==null||a(),R("workspace"),y(s.locator))},Ct(s.locator))}),h.length===0&&B.length===0&&e.jsx("div",{className:"px-5 mt-6",children:e.jsxs("div",{className:"rounded-md border border-dashed border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/60 px-4 py-6 text-center",children:[e.jsx("div",{className:"mx-auto mb-2 inline-flex h-8 w-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))]",children:e.jsx(Et,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"})}),e.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:r("sidebar.empty.title")}),e.jsx("div",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.empty.hint")})]})})]})}),e.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-3 pb-5",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 border-t border-[hsl(var(--deck-hairline))] pt-3",children:[!_&&e.jsx(Ut,{}),[{icon:it,action:()=>Z(c),labelKey:"sidebar.section.settings"}].map(({icon:s,action:N,labelKey:J})=>e.jsxs("button",{"data-settings-trigger":!0,onClick:N,className:"flex h-8 w-full items-center gap-2.5 rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[e.jsx(s,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),r(J)]},J))]}),e.jsxs("div",{className:"flex gap-2 justify-between items-center",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.language.label")}),e.jsx(dt,{})]}),e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-[hsl(var(--deck-canvas-veil))]",children:e.jsx("div",{className:"h-2 w-2 rounded-full bg-[hsl(var(--deck-ink))]"})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-[1px]",children:[e.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:r("sidebar.status.user")}),e.jsxs("span",{className:w("flex gap-1 items-center font-mono text-[10px]",ne?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]"),children:[e.jsx("span",{className:w("h-1 w-1 rounded-full",ne?"bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60")}),r(ne?"sidebar.status.feedLive":"sidebar.status.feedOffline")]})]})]})]}),!_&&e.jsx(At,{open:k,onOpenChange:p})]}):e.jsx(Kt,{className:t,onExpand:o,onNewChat:x,onOpenBoard:f,onOpenTaskSwitcher:()=>Z(()=>g(!0)),onToggleTerminal:O,onToggleSettings:()=>Z(c),isTerminalOpen:C,taskEventsConnected:ne,unreadCount:W.length,boardActive:P==="board",terminalDisabled:_,taskSwitcherDisabled:_})}export{us as Sidebar};
@@ -1,26 +0,0 @@
1
- import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as I,j as N,ab as Ke,d as $,b as A,K as Be,ac as Oe,ad as z,ae as ne,u as $e,a as i,af as B,ag as ze,ah as He,J as We,D as Qe,e as Ue,ai as Ve,g as Ge,h as Je,$ as ee,s as _e,A as we,x as Xe,G as Ye,L as O,z as Ze,R as et}from"./index-YqughEZk.js";import{a0 as p,N as tt,$ as te}from"./session-events-DCHBz9We.js";import{A as Se,F as nt}from"./folder-B80Ac6rr.js";import{P as st}from"./plus-DeFz_gQq.js";import{T as at}from"./terminal-1WxSJ47E.js";import{S as rt}from"./settings-CI8xbId2.js";import{C as it}from"./clock-3-D6VR6gJc.js";import"./vendor-radix-D6QrtXqd.js";/**
2
- * @license lucide-react v0.300.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 ct=I("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
7
- * @license lucide-react v0.300.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 ot=I("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
12
- * @license lucide-react v0.300.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 lt=I("Keyboard",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",ry:"2",key:"15u882"}],["path",{d:"M6 8h.001",key:"1ej0i3"}],["path",{d:"M10 8h.001",key:"1x2st2"}],["path",{d:"M14 8h.001",key:"1vkmyp"}],["path",{d:"M18 8h.001",key:"kfsenl"}],["path",{d:"M8 12h.001",key:"1sjpby"}],["path",{d:"M12 12h.001",key:"al75ts"}],["path",{d:"M16 12h.001",key:"931bgk"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
17
- * @license lucide-react v0.300.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 dt=I("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"9",x2:"9",y1:"3",y2:"21",key:"13tij5"}]]);/**
22
- * @license lucide-react v0.300.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 mt=I("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function pt(t,a){const s=a.trim().toLocaleLowerCase();return s?t.filter(r=>`${r.label} ${r.description} ${r.keywords}`.toLocaleLowerCase().includes(s)):t}function ut({actions:t,selectedIndex:a,onSelect:s,onRun:r}){return t.map((c,u)=>{const x=u===a,m=c.icon;return n.jsx("div",{id:`command-center-result-${u}`,"data-task-result-index":u,role:"option","aria-selected":x,onMouseMove:()=>{x||s(u)},className:N("group flex min-h-[58px] w-full items-center rounded-lg border border-transparent text-left transition-colors",x?"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:n.jsxs("button",{type:"button",onClick:()=>r(c),className:"flex min-h-[58px] min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[n.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-accent))]",children:n.jsx(m,{className:"h-3.5 w-3.5"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate font-mono text-[12.5px] font-medium text-[hsl(var(--deck-ink))]",children:c.label}),n.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:c.description})]}),c.shortcut&&n.jsx("span",{className:"shrink-0 rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:c.shortcut}),n.jsx(Se,{className:N("h-3.5 w-3.5 shrink-0 transition-all",x?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]})},c.id)})}const ht={running:"running active 进行中 运行中",queued:"queued waiting 排队中 等待中",interrupted:"interrupted paused 已暂停 已中断",failed:"failed error 已失败 错误",cancelled:"cancelled canceled 已取消",completed:"completed done finished 已完成 完成"};function se(t){return Be(t,Oe)}function kt(t){const a=t.lastMessageTime||t.firstMessageTime;if(!a)return"";const s=new Date(a);return Number.isNaN(s.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(s)}function H(t){return t.normalize("NFKC").toLocaleLowerCase().trim()}function xt(t,a){var r,c;const s=z(t,a);return H([se(t),ne(s),s,t.projectPath,t.gitBranch,t.taskWorktreeBranch,t.taskStatus,ht[t.taskStatus],((r=t.pendingInteraction)==null?void 0:r.type)==="question"?"needs answer question attention 等待回答 需要回答":((c=t.pendingInteraction)==null?void 0:c.type)==="elicitation"?"mcp input elicitation attention MCP 输入 等待输入":t.pendingInteraction?"needs approval permission attention 等待审批 需要授权":"",t.sessionId].filter(Boolean).join(" "))}function je(t,a,s){if(!a)return 0;const r=H(se(t)),c=H(ne(z(t,s)));return r===a?500:r.startsWith(a)?400:r.includes(a)?300:c===a?250:c.startsWith(a)?200:100}function ft(t,a,s,r=50){const c=H(a),u=c.split(/\s+/).filter(Boolean),x=new Set;return t.filter(m=>{if(u.length===0)return!0;const h=xt(m,s);return u.every(y=>h.includes(y))}).sort((m,h)=>{const y=+!!h.pendingInteraction-+!!m.pendingInteraction;return y!==0?y:je(h,c,s)-je(m,c,s)||Ke(m,h)}).filter(m=>{const h=$(A(m));return x.has(h)?!1:(x.add(h),!0)}).slice(0,r)}const gt={running:"sidebar.group.running",queued:"sidebar.group.queued",interrupted:"sidebar.group.interrupted",failed:"sidebar.group.failed",cancelled:"sidebar.group.cancelled",completed:"sidebar.group.done"};function Mt(){const t=$e(),a=p(e=>e.isTaskSwitcherOpen),s=p(e=>e.taskSwitcherMode),r=p(e=>e.setTaskSwitcherOpen),c=p(e=>e.setTaskSwitcherMode),u=p(e=>e.setMainView),x=p(e=>e.toggleSidebar),m=p(e=>e.isFilePreviewOpen),h=p(e=>e.setFilePreviewOpen),y=p(e=>e.openFilePreview),W=p(e=>e.toggleTerminal),w=p(e=>e.openSettings),b=i(e=>e.sessions),Ne=i(e=>e.isLoading),C=i(e=>e.catalogLoadState),Q=C==="loading"||C==="hydrating",U=i(e=>e.currentSessionRef),V=i(e=>tt(e.historySurfaceSelection)),ae=i(e=>e.closeHistorySurface),re=i(e=>e.isTemporarySession),ie=i(e=>e.startTemporarySession),G=i(e=>e.unreadTaskKeys),Ce=i(e=>e.boundProjects),P=i(e=>{var o;return e.selectedProjectPath??((o=e.taskWorkspaceInfo)==null?void 0:o.cwd)??null}),Te=i(e=>e.selectProject),Me=i(e=>e.selectSession),De=i(e=>e.cancelTask),Ae=i(e=>e.retryTask),Ie=i(e=>e.cancellingTaskKeys),Pe=i(e=>e.retryingTaskKeys),[v,ce]=l.useState(""),[T,oe]=l.useState(null),[Re,J]=l.useState(null),[le,R]=l.useState(null),de=l.useRef(null),me=l.useRef(null),M=l.useRef(!1),pe=l.useMemo(()=>[{id:"new-task",label:t("commandCenter.action.newTask"),description:t("commandCenter.action.newTaskDescription"),keywords:"create compose session",icon:st,shortcut:B("newTask"),run:()=>{ae(),u("workspace"),ie(),requestAnimationFrame(()=>We())}},{id:"toggle-preview",label:t("commandCenter.action.preview"),description:t("commandCenter.action.previewDescription"),keywords:"diff files logs artifact review",icon:ze,run:()=>{te(i.getState())||(m?h(!1):y((!U||re)&&p.getState().previewRequestId===0?{tab:"files"}:void 0))}},{id:"toggle-terminal",label:t("commandCenter.action.terminal"),description:t("commandCenter.action.terminalDescription"),keywords:"shell console command line",icon:at,run:()=>{te(i.getState())||W()}},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:rt,run:()=>w("general")},{id:"open-models",label:t("commandCenter.action.models"),description:t("commandCenter.action.modelsDescription"),keywords:"provider llm api configuration",icon:ot,run:()=>w("models")},{id:"open-shortcuts",label:t("commandCenter.action.shortcuts"),description:t("commandCenter.action.shortcutsDescription"),keywords:"keyboard hotkey key binding",icon:lt,shortcut:B("openCommands"),run:()=>w("shortcuts")},{id:"open-skills",label:t("commandCenter.action.skills"),description:t("commandCenter.action.skillsDescription"),keywords:"capabilities workflow",icon:He,run:()=>w("skills")},{id:"open-mcp",label:t("commandCenter.action.mcp"),description:t("commandCenter.action.mcpDescription"),keywords:"server tools protocol integration",icon:mt,run:()=>w("mcp")},{id:"toggle-sidebar",label:t("commandCenter.action.sidebar"),description:t("commandCenter.action.sidebarDescription"),keywords:"navigation layout panel projects",icon:dt,shortcut:B("toggleSidebar"),run:x}],[U,ae,m,re,y,w,h,u,ie,t,x,W]),g=l.useMemo(()=>ft(b,v,P),[P,v,b]),j=l.useMemo(()=>pt(pe,v),[pe,v]),L=l.useMemo(()=>s==="tasks"?g.map(e=>$(A(e))):j.map(e=>e.id),[s,g,j]),F=JSON.stringify([a,s,v]),k=Math.max(0,(T==null?void 0:T.scope)===F&&T.key!==null?L.indexOf(T.key):-1),ue=L[k]??null,q=e=>oe({scope:F,key:L[e]??null}),D=L.length,he=l.useMemo(()=>b.filter(e=>!!e.pendingInteraction).length,[b]),_=s==="tasks"?g[k]??null:null,X=s==="commands"?j[k]??null:null;l.useEffect(()=>{M.current=!1,a&&(ce(""),J(null),R(null))},[s,a]),l.useEffect(()=>{V&&a&&r(!1)},[V,a,r]),l.useEffect(()=>{oe({scope:F,key:ue})},[F,ue]),l.useEffect(()=>{var o,d;const e=(o=me.current)==null?void 0:o.querySelector(`[data-task-result-index="${k}"]`);(d=e==null?void 0:e.scrollIntoView)==null||d.call(e,{block:"nearest"})},[k]);const ke=async e=>{const o=A(e),d=$(o),f=z(e,P);J(d),Ce.some(S=>S.path===f)&&Te(f);try{u("workspace"),await Me(o),r(!1)}catch(S){R(S instanceof Error?S.message:t("taskSwitcher.action.failed"))}finally{J(null)}},xe=async(e,o)=>{if(!te(i.getState())){R(null);try{const d=A(o);e==="cancel"?await De(d):(await Ae(d),r(!1))}catch(d){R(d instanceof Error?d.message:t("taskSwitcher.action.failed"))}}},fe=e=>{r(!1),requestAnimationFrame(e.run)},ge=e=>M.current||e.isComposing||e.keyCode===229,Le=e=>{ge(e.nativeEvent)||(e.key==="ArrowDown"?(e.preventDefault(),q(D===0?0:(k+1)%D)):e.key==="ArrowUp"?(e.preventDefault(),q(D===0?0:(k-1+D)%D)):e.key==="Enter"&&_?(e.preventDefault(),ke(_)):e.key==="Enter"&&X?(e.preventDefault(),fe(X)):e.key==="Escape"&&(e.preventDefault(),r(!1)))};return V?null:n.jsx(Qe,{open:a,onOpenChange:r,children:n.jsxs(Ue,{hideCloseButton:!0,onEscapeKeyDown:e=>{ge(e)&&e.preventDefault()},onCloseAutoFocus:Ve,className:"top-3 w-[min(680px,calc(100vw-32px))] max-w-none translate-y-0 gap-0 overflow-hidden rounded-xl border-[hsl(var(--deck-border-strong))] bg-[hsl(var(--deck-canvas))] p-0 shadow-2xl sm:top-[18%]",children:[n.jsx(Ge,{className:"sr-only",children:t("commandCenter.title")}),n.jsx(Je,{className:"sr-only",children:t("commandCenter.description")}),n.jsxs("div",{className:"flex h-14 items-center gap-3 border-b border-[hsl(var(--deck-hairline))] px-4",children:[n.jsx(ee,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]"}),n.jsx("input",{ref:de,autoFocus:!0,role:"combobox","aria-expanded":"true","aria-controls":"task-switcher-results","aria-activedescendant":_?`task-switcher-result-${k}`:X?`command-center-result-${k}`:void 0,"aria-label":t(s==="tasks"?"taskSwitcher.searchAria":"commandCenter.searchAria"),placeholder:t(s==="tasks"?"taskSwitcher.placeholder":"commandCenter.placeholder"),value:v,onChange:e=>ce(e.target.value),onCompositionStart:()=>{M.current=!0},onCompositionEnd:()=>{M.current=!1},onBlur:()=>{M.current=!1},onKeyDown:Le,className:"h-full min-w-0 flex-1 bg-transparent font-mono text-[14px] text-[hsl(var(--deck-ink))] outline-none placeholder:text-[hsl(var(--deck-ink-faint))]"}),n.jsx("span",{className:"rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:"ESC"})]}),n.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 pb-2 pt-3",children:[n.jsx("div",{role:"tablist","aria-label":t("commandCenter.modeAria"),className:"flex items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["tasks","commands"].map(e=>n.jsx("button",{type:"button",role:"tab","aria-selected":s===e,onClick:()=>{c(e),requestAnimationFrame(()=>{var o;return(o=de.current)==null?void 0:o.focus()})},className:N("rounded-[5px] px-2.5 py-1 font-mono text-[9.5px] uppercase tracking-[0.1em] transition-colors",s===e?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:t(e==="tasks"?"commandCenter.mode.tasks":"commandCenter.mode.commands")},e))}),n.jsx("span",{children:n.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:s==="commands"?t("commandCenter.actions",{count:j.length}):v?t("taskSwitcher.results",{count:g.length}):Q?b.length===0?t("taskSwitcher.indexing"):t("taskSwitcher.indexingLoaded",{count:b.length}):C==="error"?t("sidebar.catalog.incomplete"):he>0?t("taskSwitcher.needsAction",{count:he}):G.length>0?t("taskSwitcher.unread",{count:G.length}):t("taskSwitcher.scope",{count:b.length})})})]}),le&&n.jsx("div",{role:"alert",className:"mx-4 mb-2 rounded-md border border-red-300/70 bg-red-50 px-3 py-2 font-mono text-[10.5px] text-red-700 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300",children:le}),n.jsxs("div",{id:"task-switcher-results",ref:me,role:"listbox","aria-label":t(s==="tasks"?"taskSwitcher.resultsAria":"commandCenter.resultsAria"),className:"max-h-[min(460px,60vh)] overflow-y-auto px-2 pb-2",children:[s==="commands"&&n.jsx(ut,{actions:j,selectedIndex:k,onSelect:q,onRun:fe}),s==="tasks"&&g.map((e,o)=>{const d=A(e),f=$(d),S=z(e,P),Fe=ne(S),ye=_e(d,U),E=o===k,qe=Re===f,Ee=G.includes(f),K=se(e),be=e.taskStatus==="running"||e.taskStatus==="queued",ve=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),Y=Ie.includes(f),Z=Pe.includes(f);return n.jsxs("div",{id:`task-switcher-result-${o}`,"data-task-result-index":o,"data-session-ref":f,role:"option","aria-selected":E,onMouseMove:()=>{E||q(o)},className:N("group flex min-h-[68px] w-full items-center rounded-lg border border-transparent text-left transition-colors",E?"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[n.jsxs("button",{type:"button",onClick:()=>void ke(e),"aria-label":t("session.action.select",{title:K}),className:"flex min-h-[68px] min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[n.jsx("span",{className:N("flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-[hsl(var(--deck-canvas))]",ye?"border-[hsl(var(--deck-accent)/0.5)] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] text-[hsl(var(--deck-ink-faint))]"),children:e.pendingInteraction?n.jsx(we,{className:"h-3.5 w-3.5 animate-pulse text-amber-600 dark:text-amber-400"}):e.taskStatus==="running"?n.jsx(ct,{className:"h-3.5 w-3.5 animate-pulse"}):n.jsx(Xe,{className:"h-3.5 w-3.5"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"truncate font-mono text-[12.5px] font-medium text-[hsl(var(--deck-ink))]",children:K}),ye&&n.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.1em] text-[hsl(var(--deck-accent))]",children:t("taskSwitcher.current")}),Ee&&n.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.1em] text-[hsl(var(--deck-accent))]",children:t("taskSwitcher.new")}),e.pendingInteraction&&n.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.08em] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",children:t(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")}),e.taskRetriedFrom&&n.jsx("span",{title:`${t("session.retriedFrom")} ${e.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] text-[hsl(var(--deck-accent))]",children:t("session.retryShort")})]}),n.jsxs("span",{className:"mt-1 flex min-w-0 items-center gap-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(nt,{className:"h-2.5 w-2.5 shrink-0"}),n.jsx("span",{className:"truncate",children:Fe})]}),(e.taskWorktreeBranch||e.gitBranch)&&n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(Ye,{className:"h-2.5 w-2.5 shrink-0"}),n.jsx("span",{className:"truncate",children:e.taskWorktreeBranch||e.gitBranch})]}),n.jsx("span",{className:"shrink-0",children:e.taskStatus==="queued"&&e.taskQueuePosition!==void 0&&e.taskQueueDepth!==void 0?t("session.queued",{position:e.taskQueuePosition,depth:e.taskQueueDepth}):e.pendingInteraction?t(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):t(gt[e.taskStatus])}),n.jsxs("span",{className:"ml-auto inline-flex shrink-0 items-center gap-1",children:[n.jsx(it,{className:"h-2.5 w-2.5"}),kt(e)]})]})]}),qe?n.jsx(O,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}):n.jsx(Se,{className:N("h-3.5 w-3.5 shrink-0 transition-all",E?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]}),(be||ve)&&n.jsxs("div",{className:"flex shrink-0 items-center pr-2",children:[be&&n.jsx("button",{type:"button","aria-label":t(Y?"session.action.stopping":"session.action.stop",{title:K}),disabled:Y,onClick:()=>void xe("cancel",e),className:"flex h-8 w-8 items-center justify-center rounded-md text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:Y?n.jsx(O,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ze,{className:"h-3.5 w-3.5"})}),ve&&n.jsx("button",{type:"button","aria-label":t(Z?"session.action.retrying":"session.action.retry",{title:K}),disabled:Z,onClick:()=>void xe("retry",e),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:Z?n.jsx(O,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(et,{className:"h-3.5 w-3.5"})})]})]},f)}),s==="tasks"&&g.length===0&&Q&&n.jsxs("div",{className:"flex min-h-36 items-center justify-center gap-2 font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsx(O,{className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("taskSwitcher.indexing")]}),s==="tasks"&&g.length===0&&!Q&&C!=="error"&&!Ne&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(ee,{className:"mb-3 h-5 w-5 text-[hsl(var(--deck-ink-faint))]"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("taskSwitcher.empty")}),n.jsx("p",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("taskSwitcher.emptyHint")})]}),s==="tasks"&&g.length===0&&C==="error"&&n.jsxs("div",{role:"alert",className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(we,{className:"mb-3 h-5 w-5 text-amber-500"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("sidebar.catalog.incomplete")})]}),s==="commands"&&j.length===0&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(ee,{className:"mb-3 h-5 w-5 text-[hsl(var(--deck-ink-faint))]"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("commandCenter.empty")}),n.jsx("p",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("commandCenter.emptyHint")})]})]}),n.jsxs("div",{className:"flex items-center gap-4 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-4 py-2 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsxs("span",{children:["↑↓ ",t("taskSwitcher.hint.navigate")]}),n.jsxs("span",{children:["↵ ",t("taskSwitcher.hint.open")]}),n.jsxs("span",{className:"ml-auto",children:[B(s==="tasks"?"openCommands":"searchTasks")," ",t(s==="tasks"?"commandCenter.mode.commands":"commandCenter.mode.tasks")]})]})]})})}export{Mt as TaskSwitcher};
@@ -1,6 +0,0 @@
1
- import{r,j as a}from"./vendor-react-DofNRwfy.js";import{D as R,o as C,L as N}from"./vendor-xterm-DuYZoU4T.js";import{c as M,u as F,a as x,ao as T,j as p,X as W}from"./index-YqughEZk.js";import{a0 as I,$ as L,N as A}from"./session-events-DCHBz9We.js";import{T as D}from"./terminal-1WxSJ47E.js";import"./vendor-radix-D6QrtXqd.js";/**
2
- * @license lucide-react v0.300.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 $=M("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),J=({workspacePath:b})=>{const c=F(),E=x(e=>e.historySurfaceSelection),{isTerminalOpen:l,toggleTerminal:z}=I(),[s,j]=r.useState(!1),[y,u]=r.useState(!1),h=T(),g=r.useRef(null),i=r.useRef(null),m=r.useRef(null),o=r.useRef(null),S=r.useRef(null),v=r.useCallback(()=>{var f;if(L(x.getState())||((f=o.current)==null?void 0:f.readyState)===WebSocket.OPEN)return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal/ws`,t=b?`${e}?cwd=${encodeURIComponent(b)}`:e,n=new WebSocket(t);o.current=n,n.onopen=()=>{u(!0)},n.onmessage=w=>{var d;(d=i.current)==null||d.write(w.data)},n.onclose=()=>{u(!1)},n.onerror=()=>{u(!1)}},[b]),k=r.useCallback(()=>{o.current&&(o.current.close(),o.current=null),u(!1)},[]),B=r.useCallback(e=>{var t;A(x.getState().historySurfaceSelection)||((t=o.current)==null?void 0:t.readyState)===WebSocket.OPEN&&o.current.send(e)},[]);return r.useEffect(()=>(S.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{var e;return(e=S.current)==null?void 0:e.focus({preventScroll:!0})}),[]),r.useEffect(()=>{if(!l||!g.current||i.current)return;const e={background:"#ffffff",foreground:"#111827",cursor:"#111827",cursorAccent:"#ffffff",selectionBackground:"#E5E7EB",black:"#111827",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#111827",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#a855f7",brightCyan:"#22d3ee",brightWhite:"#111827"},t=new R({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:"JetBrains Mono, Menlo, Monaco, Consolas, monospace",allowTransparency:!0,scrollback:1e4,theme:h?{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}:e}),n=new C,f=new N;t.loadAddon(n),t.loadAddon(f),t.open(g.current),n.fit();const w=requestAnimationFrame(()=>t.focus());return t.onData(d=>{B(d)}),i.current=t,m.current=n,v(),()=>{cancelAnimationFrame(w),k(),t.dispose(),i.current=null,m.current=null}},[E,l,v,k,B]),r.useEffect(()=>{i.current&&(i.current.options.theme=h?{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}:{background:"#ffffff",foreground:"#111827",cursor:"#111827",cursorAccent:"#ffffff",selectionBackground:"#E5E7EB",black:"#111827",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#111827",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#a855f7",brightCyan:"#22d3ee",brightWhite:"#111827"})},[h]),r.useEffect(()=>{if(!l||s)return;const e=()=>{var n;(n=m.current)==null||n.fit()};window.addEventListener("resize",e);const t=setTimeout(e,100);return()=>{window.removeEventListener("resize",e),clearTimeout(t)}},[l,s]),!l||A(E)?null:a.jsxs("div",{role:"region","aria-label":c("terminal.title"),className:p("fixed bottom-0 left-0 right-0 z-40 bg-white dark:bg-[#0a0a0a] border-t border-[#E5E7EB] dark:border-zinc-800 transition-all duration-200",s?"h-10":"h-[min(18rem,45dvh)]"),children:[a.jsxs("div",{className:"flex items-center justify-between h-10 px-3 border-b border-[#E5E7EB] dark:border-zinc-800 bg-[#F9FAFB] dark:bg-zinc-900/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(D,{className:"h-4 w-4 text-[#9CA3AF] dark:text-zinc-400"}),a.jsx("span",{className:"text-sm text-[#6B7280] dark:text-zinc-400",children:c("terminal.title")}),a.jsx("span",{role:"status","aria-label":c(y?"terminal.status.connected":"terminal.status.disconnected"),className:p("w-2 h-2 rounded-full",y?"bg-green-500":"bg-zinc-600")})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",onClick:()=>j(!s),"aria-label":c(s?"terminal.action.restore":"terminal.action.minimize"),className:"p-1.5 rounded hover:bg-[#E5E7EB] text-[#9CA3AF] hover:text-[#111827] dark:hover:bg-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 transition-colors",children:a.jsx($,{className:"h-4 w-4"})}),a.jsx("button",{type:"button",onClick:()=>{k(),z()},"aria-label":c("terminal.action.close"),className:"p-1.5 rounded hover:bg-[#E5E7EB] text-[#9CA3AF] hover:text-[#111827] dark:hover:bg-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 transition-colors",children:a.jsx(W,{className:"h-4 w-4"})})]})]}),a.jsx("div",{ref:g,className:p("h-[calc(100%-40px)] p-2",s&&"hidden")})]})};export{J as TerminalPanel};
@@ -1,6 +0,0 @@
1
- import{c as e}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 t=e("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);export{t as A};
@@ -1,6 +0,0 @@
1
- import{c as e}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 t=e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);export{t as A};
@@ -1,6 +0,0 @@
1
- import{c as a}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 k=a("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.25V14",key:"re2vv1"}],["path",{d:"M22 16a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z",key:"ame013"}]]);export{k as C};
@@ -1,6 +0,0 @@
1
- import{c as t}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 h=t("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);export{h as C};
@@ -1,6 +0,0 @@
1
- import{c}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 e=c("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);export{e as C};
@@ -1,6 +0,0 @@
1
- import{c}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 t=c("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);export{t as C};
@@ -1,6 +0,0 @@
1
- import{c as o}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
@@ -1,11 +0,0 @@
1
- import{c as a}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 t=a("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
7
- * @license lucide-react v0.300.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 n=a("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);export{t as A,n as E};
@@ -1,11 +0,0 @@
1
- import{c as a}from"./index-YqughEZk.js";/**
2
- * @license lucide-react v0.300.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 o=a("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
7
- * @license lucide-react v0.300.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 r=a("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);export{o as A,r as F};
@@ -1,11 +0,0 @@
1
- import{r as u,R as T}from"./vendor-react-DofNRwfy.js";function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function be(e){if(Array.isArray(e))return e}function ye(e,t,r){return(t=Ee(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,s,p=[],g=!0,v=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(g=(n=i.call(r)).done)&&(p.push(n.value),p.length!==t);g=!0);}catch(P){v=!0,o=P}finally{try{if(!g&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(v)throw o}}return p}}function Oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(r),!0).forEach(function(n){ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function je(e,t){if(e==null)return{};var r,n,o=Me(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Me(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Pe(e,t){return be(e)||we(e,t)||Re(e,t)||Oe()}function Se(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ee(e){var t=Se(e,"string");return typeof t=="symbol"?t:t+""}function Re(e,t){if(e){if(typeof e=="string")return ie(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ie(e,t):void 0}}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(n){Ie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ce(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function q(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,p=new Array(s),g=0;g<s;g++)p[g]=arguments[g];return t.apply(r,[].concat(o,p))}}}function K(e){return{}.toString.call(e).includes("Object")}function Le(e){return!Object.keys(e).length}function U(e){return typeof e=="function"}function Ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Te(e,t){return K(t)||E("changeType"),Object.keys(t).some(function(r){return!Ae(e,r)})&&E("changeField"),t}function $e(e){U(e)||E("selectorType")}function De(e){U(e)||K(e)||E("handlerType"),K(e)&&Object.values(e).some(function(t){return!U(t)})&&E("handlersType")}function Ve(e){e||E("initialIsRequired"),K(e)||E("initialType"),Le(e)&&E("initialContent")}function xe(e,t){throw new Error(e[t]||e.default)}var Ne={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},E=q(xe)(Ne),_={changes:Te,selector:$e,handler:De,initial:Ve};function qe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_.initial(e),_.handler(t);var r={current:e},n=q(Fe)(r,t),o=q(Ue)(r),i=q(_.changes)(e),s=q(ze)(r);function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(P){return P};return _.selector(v),v(r.current)}function g(v){Ce(n,o,i,s)(v)}return[p,g]}function ze(e,t){return U(t)?t(e.current):t}function Ue(e,t){return e.current=le(le({},e.current),t),t}function Fe(e,t,r){return U(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var He={create:qe},We={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function _e(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,p=new Array(s),g=0;g<s;g++)p[g]=arguments[g];return t.apply(r,[].concat(o,p))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||se("configIsRequired"),Be(e)||se("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(fe.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var fe={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
- You are using deprecated way of configuration.
4
-
5
- Instead of using
6
- monaco.config({ urls: { monacoBase: '...' } })
7
- use
8
- monaco.config({ paths: { vs: '...' } })
9
-
10
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
- `},se=_e(Ye)(fe),Je={config:Ke},Qe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,s){return s(i)},o)}};function de(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],de(e[r],t[r]))}),ue(ue({},e),t)}var Xe={type:"cancelation",msg:"operation is manually canceled"};function te(e){var t=!1,r=new Promise(function(n,o){e.then(function(i){return t?o(Xe):n(i)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var Ze=["monaco"],ke=He.create({config:We,isInitialized:!1,resolve:null,reject:null,monaco:null}),pe=Pe(ke,2),F=pe[0],Y=pe[1];function et(e){var t=Je.config(e),r=t.monaco,n=je(t,Ze);Y(function(o){return{config:de(o.config,n),monaco:r}})}function tt(){var e=F(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(Y({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),te(re);if(window.monaco&&window.monaco.editor)return ge(window.monaco),e.resolve(window.monaco),te(re);Qe(rt,ot)(it)}return te(re)}function rt(e){return document.body.appendChild(e)}function nt(e){var t=document.createElement("script");return e&&(t.src=e),t}function ot(e){var t=F(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=nt("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function it(){var e=F(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m||r;ge(n),e.resolve(n)},function(r){e.reject(r)})}function ge(e){F().monaco||Y({monaco:e})}function at(){return F(function(e){var t=e.monaco;return t})}var re=new Promise(function(e,t){return Y({resolve:e,reject:t})}),G={config:et,init:tt,__getMonacoInstance:at},ut={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ne=ut,ct={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},lt=ct;function st({children:e}){return T.createElement("div",{style:lt.container},e)}var ft=st,dt=ft;function pt({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:s}){return T.createElement("section",{style:{...ne.wrapper,width:e,height:t},...s},!r&&T.createElement(dt,null,n),T.createElement("div",{ref:o,style:{...ne.fullWidth,...!r&&ne.hide},className:i}))}var gt=pt,he=u.memo(gt);function ht(e){u.useEffect(e,[])}var oe=ht;function vt(e,t,r=!0){let n=u.useRef(!0);u.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var j=vt;function z(){}function A(e,t,r,n){return mt(e,n)||bt(e,t,r,n)}function mt(e,t){return e.editor.getModel(ve(e,t))}function bt(e,t,r,n){return e.editor.createModel(t,r,n?ve(e,n):void 0)}function ve(e,t){return e.Uri.parse(t)}function yt({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:p=!1,keepCurrentModifiedModel:g=!1,theme:v="light",loading:P="Loading...",options:M={},height:J="100%",width:Q="100%",className:X,wrapperProps:Z={},beforeMount:k=z,onMount:ee=z}){let[w,$]=u.useState(!1),[R,m]=u.useState(!0),b=u.useRef(null),h=u.useRef(null),D=u.useRef(null),y=u.useRef(ee),l=u.useRef(k),I=u.useRef(!1);oe(()=>{let a=G.init();return a.then(f=>(h.current=f)&&m(!1)).catch(f=>(f==null?void 0:f.type)!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>b.current?V():a.cancel()}),j(()=>{if(b.current&&h.current){let a=b.current.getOriginalEditor(),f=A(h.current,e||"",n||r||"text",i||"");f!==a.getModel()&&a.setModel(f)}},[i],w),j(()=>{if(b.current&&h.current){let a=b.current.getModifiedEditor(),f=A(h.current,t||"",o||r||"text",s||"");f!==a.getModel()&&a.setModel(f)}},[s],w),j(()=>{let a=b.current.getModifiedEditor();a.getOption(h.current.editor.EditorOption.readOnly)?a.setValue(t||""):t!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[t],w),j(()=>{var a,f;(f=(a=b.current)==null?void 0:a.getModel())==null||f.original.setValue(e||"")},[e],w),j(()=>{let{original:a,modified:f}=b.current.getModel();h.current.editor.setModelLanguage(a,n||r||"text"),h.current.editor.setModelLanguage(f,o||r||"text")},[r,n,o],w),j(()=>{var a;(a=h.current)==null||a.editor.setTheme(v)},[v],w),j(()=>{var a;(a=b.current)==null||a.updateOptions(M)},[M],w);let H=u.useCallback(()=>{var S;if(!h.current)return;l.current(h.current);let a=A(h.current,e||"",n||r||"text",i||""),f=A(h.current,t||"",o||r||"text",s||"");(S=b.current)==null||S.setModel({original:a,modified:f})},[r,t,o,e,n,i,s]),W=u.useCallback(()=>{var a;!I.current&&D.current&&(b.current=h.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...M}),H(),(a=h.current)==null||a.editor.setTheme(v),$(!0),I.current=!0)},[M,v,H]);u.useEffect(()=>{w&&y.current(b.current,h.current)},[w]),u.useEffect(()=>{!R&&!w&&W()},[R,w,W]);function V(){var f,S,C,x;let a=(f=b.current)==null?void 0:f.getModel();p||((S=a==null?void 0:a.original)==null||S.dispose()),g||((C=a==null?void 0:a.modified)==null||C.dispose()),(x=b.current)==null||x.dispose()}return T.createElement(he,{width:Q,height:J,isEditorReady:w,loading:P,_ref:D,className:X,wrapperProps:Z})}var wt=yt,It=u.memo(wt);function Ot(){let[e,t]=u.useState(G.__getMonacoInstance());return oe(()=>{let r;return e||(r=G.init(),r.then(n=>{t(n)})),()=>r==null?void 0:r.cancel()}),e}var Ct=Ot;function jt(e){let t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}var Mt=jt,B=new Map;function Pt({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:s="light",line:p,loading:g="Loading...",options:v={},overrideServices:P={},saveViewState:M=!0,keepCurrentModel:J=!1,width:Q="100%",height:X="100%",className:Z,wrapperProps:k={},beforeMount:ee=z,onMount:w=z,onChange:$,onValidate:R=z}){let[m,b]=u.useState(!1),[h,D]=u.useState(!0),y=u.useRef(null),l=u.useRef(null),I=u.useRef(null),H=u.useRef(w),W=u.useRef(ee),V=u.useRef(),a=u.useRef(n),f=Mt(i),S=u.useRef(!1),C=u.useRef(!1);oe(()=>{let c=G.init();return c.then(d=>(y.current=d)&&D(!1)).catch(d=>(d==null?void 0:d.type)!=="cancelation"&&console.error("Monaco initialization: error:",d)),()=>l.current?me():c.cancel()}),j(()=>{var d,O,N,L;let c=A(y.current,e||n||"",t||o||"",i||r||"");c!==((d=l.current)==null?void 0:d.getModel())&&(M&&B.set(f,(O=l.current)==null?void 0:O.saveViewState()),(N=l.current)==null||N.setModel(c),M&&((L=l.current)==null||L.restoreViewState(B.get(i))))},[i],m),j(()=>{var c;(c=l.current)==null||c.updateOptions(v)},[v],m),j(()=>{!l.current||n===void 0||(l.current.getOption(y.current.editor.EditorOption.readOnly)?l.current.setValue(n):n!==l.current.getValue()&&(C.current=!0,l.current.executeEdits("",[{range:l.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),l.current.pushUndoStop(),C.current=!1))},[n],m),j(()=>{var d,O;let c=(d=l.current)==null?void 0:d.getModel();c&&o&&((O=y.current)==null||O.editor.setModelLanguage(c,o))},[o],m),j(()=>{var c;p!==void 0&&((c=l.current)==null||c.revealLine(p))},[p],m),j(()=>{var c;(c=y.current)==null||c.editor.setTheme(s)},[s],m);let x=u.useCallback(()=>{var c;if(!(!I.current||!y.current)&&!S.current){W.current(y.current);let d=i||r,O=A(y.current,n||e||"",t||o||"",d||"");l.current=(c=y.current)==null?void 0:c.editor.create(I.current,{model:O,automaticLayout:!0,...v},P),M&&l.current.restoreViewState(B.get(d)),y.current.editor.setTheme(s),p!==void 0&&l.current.revealLine(p),b(!0),S.current=!0}},[e,t,r,n,o,i,v,P,M,s,p]);u.useEffect(()=>{m&&H.current(l.current,y.current)},[m]),u.useEffect(()=>{!h&&!m&&x()},[h,m,x]),a.current=n,u.useEffect(()=>{var c,d;m&&$&&((c=V.current)==null||c.dispose(),V.current=(d=l.current)==null?void 0:d.onDidChangeModelContent(O=>{C.current||$(l.current.getValue(),O)}))},[m,$]),u.useEffect(()=>{if(m){let c=y.current.editor.onDidChangeMarkers(d=>{var N;let O=(N=l.current.getModel())==null?void 0:N.uri;if(O&&d.find(L=>L.path===O.path)){let L=y.current.editor.getModelMarkers({resource:O});R==null||R(L)}});return()=>{c==null||c.dispose()}}return()=>{}},[m,R]);function me(){var c,d;(c=V.current)==null||c.dispose(),J?M&&B.set(i,l.current.saveViewState()):(d=l.current.getModel())==null||d.dispose(),l.current.dispose()}return T.createElement(he,{width:Q,height:X,isEditorReady:m,loading:g,_ref:I,className:Z,wrapperProps:k})}var St=Pt,Et=u.memo(St),Lt=Et;export{It as DiffEditor,Et as Editor,Lt as default,G as loader,Ct as useMonaco};