@puddle-code/cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +20421 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/install.sh +222 -0
  6. package/dist/public/assets/Dashboard-B1JE6YHV.js +1 -0
  7. package/dist/public/assets/EditorZone-BO-Ob9Td.js +16 -0
  8. package/dist/public/assets/SettingsDialog-CVcCiV13.js +1 -0
  9. package/dist/public/assets/Terminal-BrP-ENHg.css +1 -0
  10. package/dist/public/assets/Terminal-CuEf-GeX.js +35 -0
  11. package/dist/public/assets/UbuntuSans-Italic-variable-RySnp6Km.woff2 +0 -0
  12. package/dist/public/assets/UbuntuSans-variable-D2Z3tJLW.woff2 +0 -0
  13. package/dist/public/assets/UbuntuSansMono-Italic-variable-DSY888gS.woff2 +0 -0
  14. package/dist/public/assets/UbuntuSansMono-variable-DaQTOezC.woff2 +0 -0
  15. package/dist/public/assets/Workspace-DctKubgC.js +2 -0
  16. package/dist/public/assets/abap-08VXUWAP.js +1 -0
  17. package/dist/public/assets/apex-BWPQTe0t.js +1 -0
  18. package/dist/public/assets/api-DeKerbkb.js +64 -0
  19. package/dist/public/assets/azcli-Bc_sGQ0U.js +1 -0
  20. package/dist/public/assets/bat-i0X4ZdIN.js +1 -0
  21. package/dist/public/assets/bicep-B5-_aFwp.js +2 -0
  22. package/dist/public/assets/cameligo-DMUM7wLl.js +1 -0
  23. package/dist/public/assets/clojure-Cm7r79vr.js +1 -0
  24. package/dist/public/assets/codicon-ngg6Pgfi.ttf +0 -0
  25. package/dist/public/assets/coffee-Ba7i2nA0.js +1 -0
  26. package/dist/public/assets/cpp-C7h46wYY.js +1 -0
  27. package/dist/public/assets/csharp-BKxtCVv1.js +1 -0
  28. package/dist/public/assets/csp-bTuwJoIa.js +1 -0
  29. package/dist/public/assets/css-DIMkf-bt.js +3 -0
  30. package/dist/public/assets/css.worker-yKcq13f2.js +89 -0
  31. package/dist/public/assets/cssMode-CSjHtANE.js +1 -0
  32. package/dist/public/assets/cypher-CVaqCwHa.js +1 -0
  33. package/dist/public/assets/dart-onAF5SnQ.js +1 -0
  34. package/dist/public/assets/dialog-VTyOt2M_.js +41 -0
  35. package/dist/public/assets/dockerfile-DZFCIeNp.js +1 -0
  36. package/dist/public/assets/ecl-D05T4iGw.js +1 -0
  37. package/dist/public/assets/editor-Br_kD0ds.css +1 -0
  38. package/dist/public/assets/editor.api2-4X9Vh9Zw.js +872 -0
  39. package/dist/public/assets/editor.worker-tytyn86m.js +26 -0
  40. package/dist/public/assets/elixir-6RTg0lbw.js +1 -0
  41. package/dist/public/assets/flow9-C5_-GSwl.js +1 -0
  42. package/dist/public/assets/folder-git-2-DX3SNYUW.js +1 -0
  43. package/dist/public/assets/freemarker2-DsOTa0Uq.js +3 -0
  44. package/dist/public/assets/fsharp-C8Ef5oNN.js +1 -0
  45. package/dist/public/assets/go-C-y9NEjX.js +1 -0
  46. package/dist/public/assets/graphql-fmXr3nnJ.js +1 -0
  47. package/dist/public/assets/handlebars-DGS-lUwt.js +1 -0
  48. package/dist/public/assets/hcl-CpzslTdj.js +1 -0
  49. package/dist/public/assets/history-logic-B2ZKE3AW.js +1 -0
  50. package/dist/public/assets/html-eVYoRhea.js +1 -0
  51. package/dist/public/assets/html.worker-DSJ9zmd7.js +502 -0
  52. package/dist/public/assets/htmlMode-CIHMS93l.js +1 -0
  53. package/dist/public/assets/index-CXBMvmhw.css +2 -0
  54. package/dist/public/assets/index-ZcdMfr13.js +10 -0
  55. package/dist/public/assets/ini-sBoK_t0W.js +1 -0
  56. package/dist/public/assets/java-BEtHBSE6.js +1 -0
  57. package/dist/public/assets/javascript-Cq9FwqGi.js +1 -0
  58. package/dist/public/assets/json.worker-Oa9UrkKE.js +58 -0
  59. package/dist/public/assets/jsonMode-BijgXT6I.js +7 -0
  60. package/dist/public/assets/julia-Bri6UV-V.js +1 -0
  61. package/dist/public/assets/kotlin-BOotOW0E.js +1 -0
  62. package/dist/public/assets/less-B9JPFI3C.js +2 -0
  63. package/dist/public/assets/lexon-CfSJPG6W.js +1 -0
  64. package/dist/public/assets/liquid-BcLxSFu3.js +1 -0
  65. package/dist/public/assets/lspLanguageFeatures-x2nWJpem.js +4 -0
  66. package/dist/public/assets/lua-CsQS60Ue.js +1 -0
  67. package/dist/public/assets/m3-D-oSqn_W.js +1 -0
  68. package/dist/public/assets/markdown-Cimd5fb3.js +1 -0
  69. package/dist/public/assets/mdx-BDgbCiou.js +1 -0
  70. package/dist/public/assets/mips-CIPQ_RoX.js +1 -0
  71. package/dist/public/assets/monaco.contribution-C0TYpF88.js +2 -0
  72. package/dist/public/assets/msdax-DauUninz.js +1 -0
  73. package/dist/public/assets/mysql-SOo6toE5.js +1 -0
  74. package/dist/public/assets/objective-c-FvmIjYaQ.js +1 -0
  75. package/dist/public/assets/pascal-DrH0SRf2.js +1 -0
  76. package/dist/public/assets/pascaligo-D-ptJ9y-.js +1 -0
  77. package/dist/public/assets/perl-oz_6vUea.js +1 -0
  78. package/dist/public/assets/pgsql-DTj74zXo.js +1 -0
  79. package/dist/public/assets/php-nr791fC2.js +1 -0
  80. package/dist/public/assets/pla-CopQ2nXW.js +1 -0
  81. package/dist/public/assets/postiats-43DmfD33.js +1 -0
  82. package/dist/public/assets/powerquery-D3hlyOfw.js +1 -0
  83. package/dist/public/assets/powershell-DmHpPYUd.js +1 -0
  84. package/dist/public/assets/preload-helper-Czpn1I53.js +1 -0
  85. package/dist/public/assets/protobuf-C531GsRP.js +2 -0
  86. package/dist/public/assets/pug-Z5eAx3Zn.js +1 -0
  87. package/dist/public/assets/python-D5mUty3a.js +1 -0
  88. package/dist/public/assets/qsharp-DkqhCAOL.js +1 -0
  89. package/dist/public/assets/r-BwWrilGY.js +1 -0
  90. package/dist/public/assets/razor-DAAn8j2s.js +1 -0
  91. package/dist/public/assets/redis-ClamHrr6.js +1 -0
  92. package/dist/public/assets/redshift-DT7zqm-g.js +1 -0
  93. package/dist/public/assets/restructuredtext-BYgofb2h.js +1 -0
  94. package/dist/public/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  95. package/dist/public/assets/ruby-DezsRK8O.js +1 -0
  96. package/dist/public/assets/rust-DdL9SqIa.js +1 -0
  97. package/dist/public/assets/sb-CcwsVR0C.js +1 -0
  98. package/dist/public/assets/scala-DHpiXF5c.js +1 -0
  99. package/dist/public/assets/scheme-BeGwcela.js +1 -0
  100. package/dist/public/assets/scss-gp-XZpBa.js +3 -0
  101. package/dist/public/assets/shell-CC2rA5mh.js +1 -0
  102. package/dist/public/assets/solidity-BEEn4gHE.js +1 -0
  103. package/dist/public/assets/sophia-CRfGWb83.js +1 -0
  104. package/dist/public/assets/sparql-D_Lu-MrJ.js +1 -0
  105. package/dist/public/assets/sql-NEE52Syq.js +1 -0
  106. package/dist/public/assets/ssh-mode-BR2ZdOHI.js +1 -0
  107. package/dist/public/assets/st-DbInun42.js +1 -0
  108. package/dist/public/assets/swift-Bxkupp3x.js +1 -0
  109. package/dist/public/assets/switch-Ck_7k8fh.js +1 -0
  110. package/dist/public/assets/systemverilog-Bz4Y3fRF.js +1 -0
  111. package/dist/public/assets/tcl-DISqw1ZD.js +1 -0
  112. package/dist/public/assets/ts.worker-BtjBFNHX.js +67734 -0
  113. package/dist/public/assets/tsMode-B7q3gz7a.js +11 -0
  114. package/dist/public/assets/twig-De2hgUGE.js +1 -0
  115. package/dist/public/assets/typescript-DvKdOnR-.js +1 -0
  116. package/dist/public/assets/typespec-B8J7ngcE.js +1 -0
  117. package/dist/public/assets/vb-DV3o63ZY.js +1 -0
  118. package/dist/public/assets/wgsl-DpFanUEy.js +298 -0
  119. package/dist/public/assets/workers-Ck67TJT4.js +1 -0
  120. package/dist/public/assets/xml-DDMTG7kD.js +1 -0
  121. package/dist/public/assets/yaml-hCGJvPOb.js +1 -0
  122. package/dist/public/index.html +18 -0
  123. package/dist/public/puddle.svg +18 -0
  124. package/package.json +28 -0
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorZone-BO-Ob9Td.js","assets/rolldown-runtime-QTnfLwEv.js","assets/api-DeKerbkb.js","assets/dialog-VTyOt2M_.js","assets/history-logic-B2ZKE3AW.js","assets/preload-helper-Czpn1I53.js","assets/index-ZcdMfr13.js","assets/index-CXBMvmhw.css","assets/editor.api2-4X9Vh9Zw.js","assets/editor-Br_kD0ds.css","assets/workers-Ck67TJT4.js","assets/monaco.contribution-C0TYpF88.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,f as r,m as i,t as a,u as o}from"./api-DeKerbkb.js";import{C as s,D as c,E as l,L as u,M as d,S as f,T as p,_ as m,a as h,b as g,d as _,f as v,g as y,h as b,i as x,j as S,k as C,m as w,n as T,o as E,p as D,r as O,t as k,v as A,w as j,x as M,y as N}from"./dialog-VTyOt2M_.js";import{b as ee,d as te,f as ne,g as re,i as ie,n as ae,p as P,v as oe,x as se,y as F}from"./history-logic-B2ZKE3AW.js";import{t as ce}from"./preload-helper-Czpn1I53.js";import{a as le,c as ue,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as ve}from"./switch-Ck_7k8fh.js";import{t as ye}from"./folder-git-2-DX3SNYUW.js";import{$ as be,A as xe,At as Se,C as Ce,D as we,Dt as I,E as Te,F as Ee,N as De,O as Oe,Ot as ke,Q as Ae,T as je,V as Me,Y as Ne,Z as Pe,_t as Fe,at as Ie,b as Le,dt as L,et as Re,f as ze,ft as R,gt as Be,h as Ve,ht as He,kt as Ue,l as We,lt as Ge,n as Ke,nt as qe,ot as Je,pt as z,q as Ye,rt as Xe,s as Ze,t as Qe,tt as $e,ut as et,v as tt,vt as nt,x as rt,y as it,yt as at,z as ot}from"./index-ZcdMfr13.js";import{t as st}from"./ssh-mode-BR2ZdOHI.js";var ct=y(`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`}]]),lt=y(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),ut=y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),dt=y(`ellipsis`,[[`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`}]]),ft=y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pt=y(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),mt=y(`folder-closed`,[[`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`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),ht=y(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),gt=y(`folder-x`,[[`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`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),_t=y(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),vt=y(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),yt=y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),bt=y(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),xt=y(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),St=y(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Ct=y(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),wt=y(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Tt=y(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Et=y(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Dt=y(`regex`,[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]),Ot=y(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),kt=y(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),At=y(`user-round-cog`,[[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`M2 21a8 8 0 0 1 10.434-7.62`,key:`1yezr2`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),jt=y(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]),B=r(),V=e(i(),1);function Mt(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Nt(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function Pt(e){return e/100*window.innerHeight}function Ft(e){return e/100*window.innerWidth}function It(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Lt({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=It(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Nt(t,i);break;case`em`:r=Mt(t,i);break;case`vh`:r=Pt(i);break;case`vw`:r=Ft(i);break}return r}function H(e){return parseFloat(e.toFixed(3))}function Rt({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function zt(e){let{panels:t}=e,n=Rt({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=H(Lt({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=H(Lt({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=H(Lt({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=H(Lt({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function U(e,t=`Assertion error`){if(!e)throw Error(t)}function Bt(e,t){return Array.from(t).sort(e===`horizontal`?Vt:Ht)}function Vt(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Ht(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Ut(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Wt(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Gt({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Wt(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return U(i,`No rect found`),i}var Kt;function qt(){return Kt===void 0&&(Kt=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),Kt}function Jt(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Bt(n,Array.from(t.children).filter(Ut).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Gt({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=qt()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Rt({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Yt=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Xt={cursorFlags:0,state:`inactive`},Zt=new Yt;function Qt(){return Xt}function $t(e){return Zt.addListener(`change`,e)}function en(e){let t=Xt,n={...Xt};n.cursorFlags=e,Xt=n,Zt.emit(`change`,{prev:t,next:n})}function tn(e){let t=Xt;Xt=e,Zt.emit(`change`,{prev:t,next:e})}var nn=e=>e,rn=()=>{},an=1,on=2,sn=4,cn=8,ln=3,un=12,dn;function fn(){return dn===void 0&&(dn=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(dn=!0)),dn}function pn({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&fn()){let t=(e&an)!==0,n=(e&on)!==0,r=(e&sn)!==0,i=(e&cn)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return fn()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var mn=new WeakMap;function hn(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=mn.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=Qt();switch(r.state){case`active`:case`hover`:{let e=pn({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}mn.set(e,{prevStyle:t,styleSheet:n})}var W=new Map,gn=new Yt;function _n(e){W=new Map(W),W.delete(e)}function vn(e,t){for(let[t]of W)if(t.id===e)return t}function G(e,t){for(let[t,n]of W)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function yn(){return W}function bn(e,t){return gn.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function K(e,t,n){let r=W.get(e);W=new Map(W),W.set(e,t),gn.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function xn(e){let t=Qt(),n=!1;switch(t.state){case`active`:tn({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(hn(e),n=!0,t.hitRegions.forEach(e=>{let t=G(e.group.id,!0);K(e.group,t,{isUserInteraction:!0})}))}return n}function Sn(e){e.defaultPrevented||xn(e.currentTarget)}function Cn(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Wt(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function wn(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Tn(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:jn(e),b:jn(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();U(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:An(kn(n.a)),b:An(kn(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var En=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dn(e){let t=getComputedStyle(Mn(e)??e).display;return t===`flex`||t===`inline-flex`}function On(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Dn(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||En.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function kn(e){let t=e.length;for(;t--;){let n=e[t];if(U(n,`Missing node`),On(n))return n}return null}function An(e){return e&&Number(getComputedStyle(e).zIndex)||0}function jn(e){let t=[];for(;e;)t.push(e),e=Mn(e);return t}function Mn(e){let{parentNode:t}=e;return wn(t)?t.host:t}function Nn(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Pn({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ut(n)||n.contains(e)||e.contains(n))return!0;if(Tn(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Nn(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Fn(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Jt(r),a=Cn(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Pn({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function In(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function q(e,t,n=0){return Math.abs(H(e)-H(t))<=n}function J(e,t){return q(e,t)?0:e>t?1:-1}function Ln({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(J(r,c)<0)if(a){let e=(i+c)/2;r=J(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=H(r),r}function Rn({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(q(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;U(u!=null,`Invalid first pivot index`),U(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];U(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(U(n!=null,`Previous layout not found for panel index ${t}`),q(n,i)){let t=o-n;J(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];U(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(U(n!=null,`Previous layout not found for panel index ${t}`),q(n,o)){let t=n-i;J(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];U(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&J(i,c)<0)if(e>0){let t=c-o,n=t/2;J(i+e,c)<0&&(e=J(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;J(i-e,c)<0&&(e=J(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];U(e!=null,`Previous layout not found for panel index ${r}`);let a=Ln({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];U(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Ln({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!q(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(In(c,l))return i;{let t=e<0?d:u,r=s[t];U(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Ln({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!q(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];U(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Ln({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(q(i,s)||(t-=s-i,l[r]=s),q(t,0))break;e>0?r--:r++}}}if(!q(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function zn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||J(e[n],t[n])!==0)return!1;return!0}function Bn({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!q(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];U(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];U(i!=null,`No layout data found for index ${e}`);let o=r[e];U(o!=null,`No layout data found for index ${e}`);let s=Ln({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!q(a,0))for(let e=0;e<t.length;e++){let n=r[e];U(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Ln({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,q(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Vn({groupId:e,panelId:t}){let n=()=>{let t=yn();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&q(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:H(100-e)}}return Rn({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=Bn({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});zn(c,u)||K(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&q(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Rt({group:t}),o=H(Lt({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function Hn(e){e.defaultPrevented||Fn(e,yn()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Vn({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Un(e){let t=yn();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Wn({groupId:e}){let t=()=>{let t=yn();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Bn({layout:e,panelConstraints:r});return n?o:(zn(o,c)||K(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Gn(e,t){let n=Un(e),r=G(n.id,!0),i=n.separators.find(t=>t.element===e);U(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);U(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Wn({groupId:n.id}).getLayout(),c=Bn({layout:Rn({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});zn(s,c)||K(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Kn(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Un(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Gn(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Gn(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Gn(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Gn(t,-5);break;case`End`:e.preventDefault(),Gn(t,100);break;case`Enter`:{e.preventDefault();let n=Un(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=G(n.id,!0),o=n.separators.find(e=>e.element===t);U(o,`Matching separator not found`);let s=a.get(o);U(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(U(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Gn(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Un(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);U(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Gn(t,-100);break}}function qn(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=yn(),n=Fn(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),tn({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function Jn({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=Rn({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(zn(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?an:on;break;case`vertical`:s|=d<0?sn:cn;break}}else K(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&ln:c|=s&ln,t.movementY===0?c|=o&un:c|=s&un,en(c),hn(e)}function Yn(e){let t=yn(),n=Qt();switch(n.state){case`active`:Jn({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Xn(e){if(e.defaultPrevented)return;let t=Qt(),n=yn();switch(t.state){case`active`:if(e.buttons===0){tn({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=G(e.group.id,!0);K(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Jn({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Fn(e,n);r.length===0?t.state!==`inactive`&&tn({cursorFlags:0,state:`inactive`}):tn({cursorFlags:0,hitRegions:r,state:`hover`}),hn(e.currentTarget);break}}}function Zn(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Qt().state){case`hover`:tn({cursorFlags:0,state:`inactive`})}}function Qn(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||xn(e.currentTarget)&&e.preventDefault()}function $n(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=H(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=H((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function er(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Rt({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:H(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function tr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function nr({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=H(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=H((r[e]??0)/a*l);else{let e=H(l/c.length);for(let t of c)u[t]=e}return u}function rr(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var ir=new Map;function ar(e){let t=!0;U(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Rt({group:e});if(t===0)return;let n=G(e.id);if(!n)return;let r=zt(e),i=n.defaultLayoutDeferred?$n(r):n.layout,a=Bn({layout:nr({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&zn(n.layout,a)&&tr(n.derivedPanelConstraints,r)&&n.groupSize===t)return;K(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else er(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{U(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Rt({group:e}),s=zt(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(rr(e.panels,l)||(l=void 0));let u=Bn({layout:e.mutableState.layouts[c]??l??$n(s),panelConstraints:s}),d=e.element.ownerDocument;ir.set(d,(ir.get(d)??0)+1);let f=new Map;return Jt(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),K(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{U(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Kn)}),ir.get(d)===1&&(d.addEventListener(`contextmenu`,Sn,!0),d.addEventListener(`dblclick`,Hn,!0),d.addEventListener(`pointerdown`,qn,!0),d.addEventListener(`pointerleave`,Yn),d.addEventListener(`pointermove`,Xn),d.addEventListener(`pointerout`,Zn),d.addEventListener(`pointerup`,Qn,!0)),function(){t=!1,ir.set(d,Math.max(0,(ir.get(d)??0)-1)),_n(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Kn)}),ir.get(d)||(d.removeEventListener(`contextmenu`,Sn,!0),d.removeEventListener(`dblclick`,Hn,!0),d.removeEventListener(`pointerdown`,qn,!0),d.removeEventListener(`pointerleave`,Yn),d.removeEventListener(`pointermove`,Xn),d.removeEventListener(`pointerout`,Zn),d.removeEventListener(`pointerup`,Qn,!0)),a.disconnect()}}function or(){let[e,t]=(0,V.useState)({});return[e,(0,V.useCallback)(()=>t({}),[])]}function sr(e){let t=(0,V.useId)();return`${e??t}`}var cr=typeof window<`u`?V.useLayoutEffect:V.useEffect;function lr(e){let t=(0,V.useRef)(e);return cr(()=>{t.current=e},[e]),(0,V.useCallback)((...e)=>t.current?.(...e),[t])}function ur(...e){return lr(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function dr(e){let t=(0,V.useRef)({...e});return cr(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var fr=(0,V.createContext)(null);function pr(e,t){let n=(0,V.useRef)({getLayout:()=>({}),setLayout:nn});(0,V.useImperativeHandle)(t,()=>n.current,[]),cr(()=>{Object.assign(n.current,Wn({groupId:e}))})}function mr({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,V.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=lr(e=>{zn(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=lr((e,t)=>{zn(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=sr(s),v=(0,V.useRef)(null),[y,b]=or(),x=(0,V.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=ur(v,a);pr(_,o);let C=lr((e,t)=>{let r=Qt(),i=vn(e),a=G(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=dr({defaultLayout:n,disableCursor:r}),T=(0,V.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Bt(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Bt(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=vn(_),i=G(_);r&&i&&K(r,{...i,derivedPanelConstraints:zt(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,V.useRef)(null);return cr(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=ar(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=G(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=bn(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=q(t.collapsedSize,i[t.panelId]),a=q(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Qt().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,V.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,B.jsx)(fr.Provider,{value:T,children:(0,B.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}mr.displayName=`Group`;function hr(){let e=(0,V.useContext)(fr);return U(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function gr(e,t){let{id:n}=hr(),r=(0,V.useRef)({collapse:rn,expand:rn,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:rn});(0,V.useImperativeHandle)(t,()=>r.current,[]),cr(()=>{Object.assign(r.current,Vn({groupId:n,panelId:e}))})}function _r({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=sr(c),_=dr({disabled:a}),v=(0,V.useRef)(null),y=ur(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=hr(),T=d!==null,E=lr((e,t,n)=>{d?.(e,c,n)});cr(()=>{let e=v.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return C(t)}},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,V.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),gr(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,V.useSyncExternalStore)(e=>bn(x,e),D,D),k;return k=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,B.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...vr,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,B.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}_r.displayName=`Panel`;var vr={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function yr({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Bn({layout:Rn({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Bn({layout:Rn({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function br({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=sr(a),l=dr({disabled:n,disableDoubleClick:r}),[u,d]=(0,V.useState)({}),[f,p]=(0,V.useState)(`inactive`),[m,h]=(0,V.useState)(!1),g=(0,V.useRef)(null),_=ur(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=hr(),C=b===`horizontal`?`vertical`:`horizontal`;cr(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=$t(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=bn(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(yr({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,V.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,B.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}br.displayName=`Separator`;function xr(e,t,n){let r=n.snapshot.explorer_pin,i=r===null?null:e.find(e=>e.id===r&&e.status!==`archived`)??null;return{session:i??e.find(e=>e.id===t)??null,pinned:i!==null,pin(e){n.update({explorer_pin:e})},unpin(){n.update({explorer_pin:null})}}}var Sr=(0,V.lazy)(()=>ce(()=>import(`./EditorZone-BO-Ob9Td.js`).then(e=>({default:e.EditorZone})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function Cr(e){return(0,B.jsx)(V.Suspense,{fallback:(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center bg-surface text-xs text-fg-muted`,children:`Loading editor…`}),children:(0,B.jsx)(Sr,{...e})})}var wr=(0,V.createContext)({openFile:()=>void 0,handler:null,setHandler:()=>void 0});function Tr({children:e}){let[t,n]=(0,V.useState)(null),r=(0,V.useCallback)(e=>n(()=>e),[]),i=(0,V.useCallback)((e,n,r)=>{if(!t){I(`The editor is not ready yet.`);return}t(e,n,r)},[t]),a=(0,V.useMemo)(()=>({openFile:i,handler:t,setHandler:r}),[i,t,r]);return(0,B.jsx)(wr.Provider,{value:a,children:e})}function Er(e){let{setHandler:t}=(0,V.useContext)(wr),n=(0,V.useRef)(e);n.current=e,(0,V.useEffect)(()=>(t((e,t,r)=>n.current(e,t,r)),()=>t(null)),[t])}function Dr(e,t){let n={};for(let r of t){let t=e[r];if(typeof t!=`number`)return;n[r]=t}return n}var Or={added:{letter:`A`,label:`added`,colourClass:`text-running`},modified:{letter:`M`,label:`modified`,colourClass:`text-fg-secondary`},deleted:{letter:`D`,label:`deleted`,colourClass:`text-interrupted`},renamed:{letter:`R`,label:`renamed`,colourClass:`text-waiting`}};function kr(e){return Or[e]}var Ar=[`modified`,`added`,`deleted`,`renamed`];function jr(e){let t=new Map;for(let n of e)t.set(n.status,(t.get(n.status)??0)+1);return Ar.filter(e=>t.has(e)).map(e=>`${t.get(e)} ${Or[e].label}`).join(` · `)}var Mr=[`var(--accent)`,`var(--status-running)`,`var(--status-waiting)`,`var(--ansi-magenta)`,`var(--ansi-cyan)`,`var(--status-interrupted)`];function Nr(e){return Mr[e%Mr.length]}function Pr(e){let t=[],n=0,r=0,i=()=>{let e=t.indexOf(null);return e===-1?t.length:e},a=()=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];r&&e.push({col:n,sha:r.sha,colour:Nr(r.colourIdx)})}return e},o=[],s=[];for(let c of e){let e=c.parents??[],l=[];for(let e=0;e<t.length;e++)t[e]?.sha===c.sha&&l.push(e);let u,d;l.length>0?(u=l[0],d=t[u].colourIdx):(u=i(),d=n++);let f=Nr(d);for(let e of l)t[e]=null;for(;t.length<=u;)t.push(null);let p=[];if(e.length>0){t[u]={sha:e[0],colourIdx:d},p.push(u);for(let r=1;r<e.length;r++){let a=e[r],o=t.findIndex(e=>e?.sha===a);if(o===-1){for(o=i();t.length<=o;)t.push(null);t[o]={sha:a,colourIdx:n++}}p.push(o)}}else t[u]=null;let m=a();o.push({sha:c.sha,col:u,colour:f,above:s,below:m,created:p}),s=m,r=Math.max(r,t.length)}return{rows:o,laneCount:r}}var Fr=7,Ir=14,Lr=4,Rr=1.5,zr=40,Br=22;function Vr(e){return e*Ir+Ir/2}function Hr(e,t,n,r){if(e===n)return`M ${e} ${t} L ${n} ${r}`;let i=(t+r)/2;return`M ${e} ${t} C ${e} ${i}, ${n} ${i}, ${n} ${r}`}function Ur({row:e,width:t}){let n=zr,r=n/2,i=Vr(e.col),a=new Set(e.created),o=[];for(let t of e.above){let n=Vr(t.col);t.sha===e.sha?o.push({d:Hr(n,0,i,r),colour:t.colour}):o.push({d:Hr(n,0,n,r),colour:t.colour})}for(let t of e.below){let e=Vr(t.col);a.has(t.col)?o.push({d:Hr(i,r,e,n),colour:t.colour}):o.push({d:Hr(e,r,e,n),colour:t.colour})}return(0,B.jsxs)(`svg`,{width:t,height:n,className:`shrink-0`,"aria-hidden":!0,children:[o.map((e,t)=>(0,B.jsx)(`path`,{d:e.d,fill:`none`,stroke:e.colour,strokeWidth:Rr},t)),(0,B.jsx)(`circle`,{cx:i,cy:r,r:Lr,fill:`var(--bg-surface)`,stroke:e.colour,strokeWidth:Rr})]})}function Wr({lanes:e,width:t}){return(0,B.jsx)(`svg`,{width:t,height:Br,className:`shrink-0`,"aria-hidden":!0,children:e.map(e=>{let t=Vr(e.col);return(0,B.jsx)(`path`,{d:`M ${t} 0 L ${t} ${Br}`,fill:`none`,stroke:e.colour,strokeWidth:Rr},e.col)})})}function Gr({session:e,sha:t,lanes:n,gutterW:r,onOpen:i}){let a=P(e,t),s=e=>(0,B.jsxs)(`div`,{className:`flex items-center`,style:{height:Br},children:[(0,B.jsx)(Wr,{lanes:n,width:r}),(0,B.jsx)(`span`,{className:`px-2 text-2xs text-fg-muted`,children:e})]});return a.isPending?s(`…`):a.error?s(a.error instanceof Error?a.error.message:`Failed to load commit`):a.data.files.length===0?s(`No file changes.`):(0,B.jsx)(B.Fragment,{children:a.data.files.map(e=>{let a=kr(e.status),s=e.status===`renamed`&&e.old_path?`${e.old_path} → ${e.path}`:e.path;return(0,B.jsxs)(`button`,{type:`button`,title:s,onClick:()=>i(e.path,t),className:`flex w-full items-center text-left transition-colors hover:bg-elevated`,style:{height:Br},children:[(0,B.jsx)(Wr,{lanes:n,width:r}),(0,B.jsx)(`span`,{className:o(`mr-1.5 w-3 shrink-0 text-center font-mono text-xs`,a.colourClass),children:a.letter}),(0,B.jsx)(`span`,{className:`truncate pr-3 font-mono text-2xs text-fg`,children:s})]},`${e.status}:${e.old_path??``}:${e.path}`)})})}function Kr({session:e,onOpenCommitFile:t}){let n=oe(e),[r,i]=(0,V.useState)(null),a=(0,V.useMemo)(()=>n.data?.pages.flatMap(e=>e.commits)??[],[n.data]),s=(0,V.useMemo)(()=>Pr(a),[a]),c=Math.max(1,s.laneCount)*Ir+Ir/2;return n.isPending?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`Loading history…`}):n.error?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:n.error instanceof Error?n.error.message:`Failed to load history`}):a.length===0?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No commits yet.`}):(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[s.rows.map((n,s)=>{let l=a[s],u=r===n.sha;return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(u?null:n.sha),className:o(`flex w-full items-center text-left transition-colors hover:bg-elevated`,u&&`bg-selection`),style:{height:zr},children:[(0,B.jsx)(Ur,{row:n,width:c}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 pr-3`,children:[(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-2xs text-fg-muted`,children:n.sha.slice(0,Fr)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg`,children:l.subject})]}),(0,B.jsxs)(`span`,{className:`truncate text-2xs text-fg-muted`,children:[l.author_name,` ·`,` `,(0,B.jsx)(`span`,{className:`tabular-nums`,children:ae(l.authored_at)})]})]})]}),u&&(0,B.jsx)(Gr,{session:e,sha:n.sha,lanes:n.below,gutterW:c,onOpen:t})]},n.sha)}),n.hasNextPage&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>void n.fetchNextPage(),disabled:n.isFetchingNextPage,className:`px-3 py-2 text-left font-mono text-xs text-fg-muted transition-colors hover:bg-elevated`,children:n.isFetchingNextPage?`Loading…`:`Show more`})]})}function qr(){return{dirs:new Map,files:[]}}function Jr(e){return e.path}function Yr(e,t){let n=[];for(let[r,i]of e.dirs){let e=t?`${t}/${r}`:r,a={type:`dir`,name:r,path:e,children:Yr(i,e)};for(;a.children.length===1&&a.children[0].type===`dir`;){let e=a.children[0];a={type:`dir`,name:`${a.name}/${e.name}`,path:e.path,children:e.children}}n.push(a)}n.sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}));let r=[...e.files].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}));return[...n,...r]}function Xr(e){let t=qr();for(let n of e){let e=Jr(n),r=e.split(`/`),i=r.pop(),a=t;for(let e of r){let t=a.dirs.get(e);t||(t=qr(),a.dirs.set(e,t)),a=t}a.files.push({type:`file`,name:i,path:e,entry:n})}return Yr(t,``)}function Zr(e){return e.map(e=>({type:`file`,name:Jr(e).split(`/`).pop()??Jr(e),path:Jr(e),entry:e})).sort((e,t)=>e.path.localeCompare(t.path,void 0,{sensitivity:`base`}))}function Qr({name:e,fullPath:t,status:n,depth:r,active:i,onOpen:a}){let s=kr(n);return(0,B.jsxs)(`button`,{type:`button`,title:t,onClick:()=>a(t),className:o(`flex w-full items-center gap-1.5 py-1 pr-3 text-left transition-colors hover:bg-elevated`,i&&`bg-selection`),style:{paddingLeft:8+r*12},children:[(0,B.jsx)(`span`,{className:o(`w-3 shrink-0 text-center font-mono text-xs`,s.colourClass),children:s.letter}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs text-fg`,children:e})]})}function $r({nodes:e,depth:t,activePath:n,onOpen:r}){let[i,a]=(0,V.useState)(new Set);return(0,B.jsx)(B.Fragment,{children:e.map(e=>{if(e.type===`file`)return(0,B.jsx)(Qr,{name:e.name,fullPath:e.path,status:e.entry.status,depth:t,active:n===e.path,onOpen:r},e.path);let o=i.has(e.path);return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>a(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n}),className:`flex w-full items-center gap-1 py-1 pr-3 text-left transition-colors hover:bg-elevated`,style:{paddingLeft:8+t*12},children:[o?(0,B.jsx)(ut,{className:`size-3.5 shrink-0 text-fg-muted`}):(0,B.jsx)(ve,{className:`size-3.5 shrink-0 text-fg-muted`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs text-fg-secondary`,children:e.name})]}),!o&&(0,B.jsx)($r,{nodes:e.children,depth:t+1,activePath:n,onOpen:r})]},e.path)})})}function ei({session:e,activePath:t,onOpen:n}){let[r,i]=(0,V.useState)(!1),a=re(e,{against:`head`}),o=a.data?.entries??[],s=(0,V.useMemo)(()=>r?null:Xr(o),[r,o]),c=(0,V.useMemo)(()=>r?Zr(o):null,[r,o]);return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-3`,children:[(0,B.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Uncommitted`}),o.length>0&&(0,B.jsx)(`span`,{className:`truncate font-mono text-2xs text-fg-muted`,children:jr(o)}),(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":!r,onClick:()=>i(e=>!e),className:`ml-auto rounded-sm p-1 text-fg-muted transition-colors hover:bg-elevated hover:text-fg`,children:[r?(0,B.jsx)(yt,{className:`size-3.5`}):(0,B.jsx)(ht,{className:`size-3.5`}),(0,B.jsx)(`span`,{className:`sr-only`,children:r?`Show as tree`:`Show as flat list`})]})}),(0,B.jsx)(R,{children:r?`Show as tree`:`Show as flat list`})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-1`,children:a.isPending?(0,B.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-fg-muted`,children:`Loading changes…`}):a.error?(0,B.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-fg-muted`,children:a.error instanceof Error?a.error.message:`Failed to load changes`}):o.length===0?(0,B.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-fg-muted`,children:`No uncommitted changes.`}):r?c.map(e=>(0,B.jsx)(Qr,{name:e.path,fullPath:e.path,status:e.entry.status,depth:0,active:t===e.path,onOpen:n},e.path)):(0,B.jsx)($r,{nodes:s,depth:0,activePath:t,onOpen:n})})]})}function ti({session:e,activeDiffPath:t,onOpenDiff:n,onOpenCommitFile:r}){return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`section`,{className:`flex max-h-[45%] min-h-0 flex-col`,children:(0,B.jsx)(ei,{session:e,activePath:t,onOpen:n})}),(0,B.jsx)(`div`,{className:`h-px shrink-0 bg-border`}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{className:`flex h-7 shrink-0 items-center px-3`,children:(0,B.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`History`})}),(0,B.jsx)(Kr,{session:e,onOpenCommitFile:r})]})]})}var ni=!1;function ri(){let[e,t]=V.useState(ni);return V.useEffect(()=>{ni||(ni=!0,t(!0))},[]),e}var ii=V.useSyncExternalStore;function ai(){return()=>{}}function oi(){return ii(ai,()=>!0,()=>!1)}var si=typeof ii==`function`?oi:ri,ci=`rovingFocusGroup.onEntryFocus`,li={bubbles:!1,cancelable:!0},ui=`RovingFocusGroup`,[di,fi,pi]=ue(ui),[mi,hi]=C(ui,[pi]),[gi,_i]=mi(ui),vi=V.forwardRef((e,t)=>(0,B.jsx)(di.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(di.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(yi,{...e,ref:t})})}));vi.displayName=ui;var yi=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,m=V.useRef(null),h=S(t,m),g=ge(a),[_,v]=A({prop:o,defaultProp:s??null,onChange:c,caller:ui}),[y,b]=V.useState(!1),x=j(l),C=fi(n),w=V.useRef(!1),[T,E]=V.useState(0);return V.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ci,x),()=>e.removeEventListener(ci,x)},[x]),(0,B.jsx)(gi,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:V.useCallback(e=>v(e),[v]),onItemShiftTab:V.useCallback(()=>b(!0),[]),onFocusableItemAdd:V.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:V.useCallback(()=>E(e=>e-1),[]),children:(0,B.jsx)(p.div,{tabIndex:y||T===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:`none`,...e.style},onMouseDown:d(e.onMouseDown,()=>{w.current=!0}),onFocus:d(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(ci,li);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);Ti([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}w.current=!1}),onBlur:d(e.onBlur,()=>b(!1))})})}),bi=`RovingFocusGroupItem`,xi=V.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=M(),l=a||c,u=_i(bi,n),m=u.currentTabStopId===l,h=fi(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=u,y=si();return f(()=>{if(!(!y||!r))return g(),()=>_()},[y,r,g,_]),V.useEffect(()=>{if(!(y||!r))return g(),()=>_()},[y,r,g,_]),(0,B.jsx)(di.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(p.span,{tabIndex:m?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:d(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:d(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:d(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=wi(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Ei(n,r+1):n.slice(r+1)}setTimeout(()=>Ti(n))}}),children:typeof o==`function`?o({isCurrentTabStop:m,hasTabStop:v!=null}):o})})});xi.displayName=bi;var Si={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ci(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function wi(e,t,n){let r=Ci(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Si[r]}function Ti(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ei(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Di=vi,Oi=xi,ki=[`Enter`,` `],Ai=[`ArrowDown`,`PageUp`,`Home`],ji=[`ArrowUp`,`PageDown`,`End`],Mi=[...Ai,...ji],Ni={ltr:[...ki,`ArrowRight`],rtl:[...ki,`ArrowLeft`]},Pi={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Fi=`Menu`,[Ii,Li,Ri]=ue(Fi),[zi,Bi]=C(Fi,[Ri,at,hi]),Vi=at(),Hi=hi(),[Ui,Y]=zi(Fi),[Wi,Gi]=zi(Fi),Ki=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Vi(t),[c,l]=V.useState(null),u=V.useRef(!1),d=j(a),f=ge(i);return V.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),V.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,B.jsx)(nt,{...s,children:(0,B.jsx)(Ui,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,B.jsx)(Wi,{scope:t,onClose:V.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ki.displayName=Fi;var qi=`MenuAnchor`,Ji=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Vi(n);return(0,B.jsx)(He,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`MenuPortal`,[Xi,Zi]=zi(Yi,{forceMount:void 0}),Qi=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Y(Yi,t);return(0,B.jsx)(Xi,{scope:t,forceMount:n,children:(0,B.jsx)(N,{present:n||a.open,children:(0,B.jsx)(g,{asChild:!0,container:i,children:r})})})};Qi.displayName=Yi;var X=`MenuContent`,[$i,ea]=zi(X),ta=V.forwardRef((e,t)=>{let n=Zi(X,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeMenu),o=Gi(X,e.__scopeMenu);return(0,B.jsx)(Ii.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(N,{present:r||a.open,children:(0,B.jsx)(Ii.Slot,{scope:e.__scopeMenu,children:o.modal?(0,B.jsx)(na,{...i,ref:t}):(0,B.jsx)(ra,{...i,ref:t})})})})}),na=V.forwardRef((e,t)=>{let n=Y(X,e.__scopeMenu),r=V.useRef(null),i=S(t,r);return V.useEffect(()=>{let e=r.current;if(e)return _(e)},[]),(0,B.jsx)(aa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ra=V.forwardRef((e,t)=>{let n=Y(X,e.__scopeMenu);return(0,B.jsx)(aa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ia=c(`MenuContent.ScrollLock`),aa=V.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,y=Y(X,n),b=Gi(X,n),x=Vi(n),C=Hi(n),T=Li(n),[E,O]=V.useState(null),k=V.useRef(null),A=S(t,k,y.onContentChange),j=V.useRef(0),M=V.useRef(``),N=V.useRef(0),ee=V.useRef(null),te=V.useRef(`right`),ne=V.useRef(0),re=g?v:V.Fragment,ie=g?{as:ia,allowPinchZoom:!0}:void 0,ae=e=>{let t=M.current+e,n=T().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ua(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){M.current=t,window.clearTimeout(j.current),t!==``&&(j.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};V.useEffect(()=>()=>window.clearTimeout(j.current),[]),D();let P=V.useCallback(e=>te.current===ee.current?.side&&Ga(e,ee.current?.area),[]);return(0,B.jsx)($i,{scope:n,searchRef:M,onItemEnter:V.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:V.useCallback(e=>{P(e)||(k.current?.focus(),O(null))},[P]),onTriggerLeave:V.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:N,onPointerGraceIntentChange:V.useCallback(e=>{ee.current=e},[]),children:(0,B.jsx)(re,{...ie,children:(0,B.jsx)(w,{asChild:!0,trapped:i,onMountAutoFocus:d(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,B.jsx)(s,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,B.jsx)(Di,{asChild:!0,...C,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:d(l,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,B.jsx)(Fe,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ra(y.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:A,style:{outline:`none`,..._.style},onKeyDown:d(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ae(e.key));let i=k.current;if(e.target!==i||!Mi.includes(e.key))return;e.preventDefault();let a=T().filter(e=>!e.disabled).map(e=>e.ref.current);ji.includes(e.key)&&a.reverse(),Va(a)}),onBlur:d(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),M.current=``)}),onPointerMove:d(e.onPointerMove,Ka(e=>{let t=e.target,n=ne.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ne.current?`right`:`left`;te.current=t,ne.current=e.clientX}}))})})})})})})});ta.displayName=X;var oa=`MenuGroup`,sa=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(p.div,{role:`group`,...r,ref:t})});sa.displayName=oa;var ca=`MenuLabel`,la=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(p.div,{...r,ref:t})});la.displayName=ca;var ua=`MenuItem`,da=`menu.itemSelect`,fa=V.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=V.useRef(null),o=Gi(ua,e.__scopeMenu),s=ea(ua,e.__scopeMenu),c=S(t,a),u=V.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(da,{bubbles:!0,cancelable:!0});e.addEventListener(da,e=>r?.(e),{once:!0}),l(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,B.jsx)(pa,{...i,ref:c,disabled:n,onClick:d(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:d(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:d(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||ki.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});fa.displayName=ua;var pa=V.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ea(ua,n),s=Hi(n),c=V.useRef(null),l=S(t,c),[u,f]=V.useState(!1),[m,h]=V.useState(``);return V.useEffect(()=>{let e=c.current;e&&h((e.textContent??``).trim())},[a.children]),(0,B.jsx)(Ii.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,B.jsx)(Oi,{asChild:!0,...s,focusable:!r,children:(0,B.jsx)(p.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:d(e.onPointerMove,Ka(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:d(e.onPointerLeave,Ka(e=>o.onItemLeave(e))),onFocus:d(e.onFocus,()=>f(!0)),onBlur:d(e.onBlur,()=>f(!1))})})})}),ma=`MenuCheckboxItem`,ha=V.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,B.jsx)(Ca,{scope:e.__scopeMenu,checked:n,children:(0,B.jsx)(fa,{role:`menuitemcheckbox`,"aria-checked":za(n)?`mixed`:n,...i,ref:t,"data-state":Ba(n),onSelect:d(i.onSelect,()=>r?.(za(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ha.displayName=ma;var ga=`MenuRadioGroup`,[_a,va]=zi(ga,{value:void 0,onValueChange:()=>{}}),ya=V.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=j(r);return(0,B.jsx)(_a,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,B.jsx)(sa,{...i,ref:t})})});ya.displayName=ga;var ba=`MenuRadioItem`,xa=V.forwardRef((e,t)=>{let{value:n,...r}=e,i=va(ba,e.__scopeMenu),a=n===i.value;return(0,B.jsx)(Ca,{scope:e.__scopeMenu,checked:a,children:(0,B.jsx)(fa,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ba(a),onSelect:d(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});xa.displayName=ba;var Sa=`MenuItemIndicator`,[Ca,wa]=zi(Sa,{checked:!1}),Ta=V.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=wa(Sa,n);return(0,B.jsx)(N,{present:r||za(a.checked)||a.checked===!0,children:(0,B.jsx)(p.span,{...i,ref:t,"data-state":Ba(a.checked)})})});Ta.displayName=Sa;var Ea=`MenuSeparator`,Da=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(p.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Da.displayName=Ea;var Oa=`MenuArrow`,ka=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Vi(n);return(0,B.jsx)(Be,{...i,...r,ref:t})});ka.displayName=Oa;var Aa=`MenuSub`,[ja,Ma]=zi(Aa),Na=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Y(Aa,t),o=Vi(t),[s,c]=V.useState(null),[l,u]=V.useState(null),d=j(i);return V.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,B.jsx)(nt,{...o,children:(0,B.jsx)(Ui,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,B.jsx)(ja,{scope:t,contentId:M(),triggerId:M(),trigger:s,onTriggerChange:c,children:n})})})};Na.displayName=Aa;var Pa=`MenuSubTrigger`,Fa=V.forwardRef((e,t)=>{let n=Y(Pa,e.__scopeMenu),r=Gi(Pa,e.__scopeMenu),i=Ma(Pa,e.__scopeMenu),a=ea(Pa,e.__scopeMenu),o=V.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=V.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);V.useEffect(()=>u,[u]),V.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let f=S(t,i.onTriggerChange);return(0,B.jsx)(Ji,{asChild:!0,...l,children:(0,B.jsx)(pa,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Ra(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:d(e.onPointerMove,Ka(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:d(e.onPointerLeave,Ka(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:d(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Ni[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Fa.displayName=Pa;var Ia=`MenuSubContent`,La=V.forwardRef((e,t)=>{let n=Zi(X,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Y(X,e.__scopeMenu),s=Gi(X,e.__scopeMenu),c=Ma(Ia,e.__scopeMenu),l=V.useRef(null),u=S(t,l);return(0,B.jsx)(Ii.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(N,{present:r||o.open,children:(0,B.jsx)(Ii.Slot,{scope:e.__scopeMenu,children:(0,B.jsx)(aa,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:d(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:d(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:d(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Pi[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});La.displayName=Ia;function Ra(e){return e?`open`:`closed`}function za(e){return e===`indeterminate`}function Ba(e){return za(e)?`indeterminate`:e?`checked`:`unchecked`}function Va(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ha(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ua(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ha(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Wa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ga(e,t){return t?Wa({x:e.clientX,y:e.clientY},t):!1}function Ka(e){return t=>t.pointerType===`mouse`?e(t):void 0}var qa=Ki,Ja=Ji,Ya=Qi,Xa=ta,Za=sa,Qa=la,$a=fa,eo=ha,to=ya,no=xa,ro=Ta,io=Da,ao=ka,oo=Na,so=Fa,co=La,lo=`ContextMenu`,[uo,fo]=C(lo,[Bi]),Z=Bi(),[po,mo]=uo(lo),ho=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=V.useRef(!1);{let e=V.useRef(!1);V.useEffect(()=>{i===!0&&!s.current&&!e.current&&(e.current=!0,console.warn("ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport."))},[i])}let[c,l]=A({prop:i,defaultProp:!1,onChange:r,caller:lo}),u=Z(t);return(0,B.jsx)(po,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,B.jsx)(qa,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})};ho.displayName=lo;var go=`ContextMenuTrigger`,_o=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=mo(go,n),o=Z(n),[s,c]=V.useState({x:0,y:0}),l=V.useMemo(()=>({current:{getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s})}}),[s]),u=V.useRef(0),f=V.useCallback(()=>window.clearTimeout(u.current),[]),m=e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)};return V.useEffect(()=>f,[f]),V.useEffect(()=>void(r&&f()),[r,f]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ja,{...o,virtualRef:l}),(0,B.jsx)(p.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:d(e.onContextMenu,e=>{f(),m(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:d(e.onPointerDown,Ko(e=>{f(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>m(e),700)})),onPointerMove:r?e.onPointerMove:d(e.onPointerMove,Ko(f)),onPointerCancel:r?e.onPointerCancel:d(e.onPointerCancel,Ko(f)),onPointerUp:r?e.onPointerUp:d(e.onPointerUp,Ko(f))})]})});_o.displayName=go;var vo=`ContextMenuPortal`,yo=e=>{let{__scopeContextMenu:t,...n}=e,r=Z(t);return(0,B.jsx)(Ya,{...r,...n})};yo.displayName=vo;var bo=`ContextMenuContent`,xo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=mo(bo,n),a=Z(n),o=V.useRef(!1);return(0,B.jsx)(Xa,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});xo.displayName=bo;var So=`ContextMenuGroup`,Co=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(Za,{...i,...r,ref:t})});Co.displayName=So;var wo=`ContextMenuLabel`,To=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(Qa,{...i,...r,ref:t})});To.displayName=wo;var Eo=`ContextMenuItem`,Do=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)($a,{...i,...r,ref:t})});Do.displayName=Eo;var Oo=`ContextMenuCheckboxItem`,ko=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(eo,{...i,...r,ref:t})});ko.displayName=Oo;var Ao=`ContextMenuRadioGroup`,jo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(to,{...i,...r,ref:t})});jo.displayName=Ao;var Mo=`ContextMenuRadioItem`,No=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(no,{...i,...r,ref:t})});No.displayName=Mo;var Po=`ContextMenuItemIndicator`,Fo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(ro,{...i,...r,ref:t})});Fo.displayName=Po;var Io=`ContextMenuSeparator`,Lo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(io,{...i,...r,ref:t})});Lo.displayName=Io;var Ro=`ContextMenuArrow`,zo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(ao,{...i,...r,ref:t})});zo.displayName=Ro;var Bo=`ContextMenuSub`,Vo=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Z(t),[s,c]=A({prop:i,defaultProp:a??!1,onChange:r,caller:Bo});return(0,B.jsx)(oo,{...o,open:s,onOpenChange:c,children:n})};Vo.displayName=Bo;var Ho=`ContextMenuSubTrigger`,Uo=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(so,{...i,...r,ref:t})});Uo.displayName=Ho;var Wo=`ContextMenuSubContent`,Go=V.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Z(n);return(0,B.jsx)(co,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Go.displayName=Wo;function Ko(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var qo=ho,Jo=_o,Yo=yo,Xo=xo,Zo=Do,Qo=qo,$o=Jo;function es({className:e,...t}){return(0,B.jsx)(Yo,{children:(0,B.jsx)(Xo,{className:o(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function ts({className:e,...t}){return(0,B.jsx)(Zo,{className:o(et,Ge,`[&_svg]:size-3.5`,e),...t})}var ns=14,rs=(0,V.createContext)(null);function is(){let e=(0,V.useContext)(rs);if(!e)throw Error(`TreeNode/DirEntries rendered outside <FileExplorer>`);return e}function as(e,t){let n=Array.from(e??[]).map(e=>e.webkitGetAsEntry?.()??null);return n.some(e=>e?.isDirectory)&&I.error(`Folders can't be uploaded yet — zip them first`),Array.from(t).filter((e,t)=>n[t]?.isDirectory!==!0)}function os({path:e,entry:t,depth:n}){let{sid:r,expanded:i,toggle:a,onOpenFile:s,onUpload:c,dropTarget:l,setDropTarget:u,activePath:d}=is(),f=t.type===`dir`,p=f&&i.has(e),m=f&&l===e,h=!f&&e===d,g=()=>f?a(e):s?.(r,e);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(Qo,{children:[(0,B.jsx)($o,{asChild:!0,children:(0,B.jsxs)(`div`,{role:`treeitem`,"aria-expanded":f?p:void 0,tabIndex:0,onClick:g,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),g())},onDragOver:t=>{f&&(t.preventDefault(),t.stopPropagation(),u(e))},onDragLeave:e=>{f&&e.currentTarget===e.target&&u(null)},onDrop:t=>{f&&(t.preventDefault(),t.stopPropagation(),u(null),c(e,as(t.dataTransfer.items,t.dataTransfer.files)))},style:{paddingLeft:n*ns+8},className:o(`flex h-6 cursor-pointer items-center gap-1 pr-2 text-sm transition-colors hover:bg-elevated`,h&&`bg-elevated`,m&&`bg-selection`),children:[f?(0,B.jsx)(ut,{className:o(`size-3.5 shrink-0 text-fg-muted transition-transform duration-150`,p&&`rotate-90`)}):(0,B.jsx)(`span`,{className:`size-3.5 shrink-0`}),f?p?(0,B.jsx)(Ce,{className:`size-3.5 shrink-0 text-fg-muted`}):(0,B.jsx)(mt,{className:`size-3.5 shrink-0 text-fg-muted`}):t.type===`symlink`?(0,B.jsx)(vt,{className:`size-3.5 shrink-0 text-fg-muted`}):(0,B.jsx)(pt,{className:`size-3.5 shrink-0 text-fg-muted`}),(0,B.jsx)(`span`,{className:o(`truncate font-mono`,t.name.startsWith(`.`)?`text-fg-muted`:`text-fg`),children:t.name})]})}),(0,B.jsxs)(es,{children:[(0,B.jsx)(ts,{onSelect:()=>void te(r,e).catch(e=>I.error(e instanceof Error?e.message:`Download failed`)),children:`Download`}),(0,B.jsx)(ts,{onSelect:()=>{navigator.clipboard.writeText(e),I.success(`Path copied`)},children:`Copy path`})]})]}),f&&p&&(0,B.jsx)(ss,{sid:r,path:e,depth:n+1})]})}function ss({sid:e,path:t,depth:n}){let r=ee(e,t),i={paddingLeft:n*ns+8};if(r.isLoading)return(0,B.jsx)(`div`,{style:i,className:`py-0.5 text-xs text-fg-muted`,children:`Loading…`});if(r.isError)return(0,B.jsx)(`div`,{style:i,className:`py-0.5 text-xs text-fg-muted`,children:r.error instanceof Error?r.error.message:`Couldn't load this folder.`});let a=r.data?.entries??[];return a.length===0?(0,B.jsx)(`div`,{style:i,className:`py-0.5 text-xs text-fg-muted`,children:`Empty`}):(0,B.jsx)(B.Fragment,{children:a.map(e=>(0,B.jsx)(os,{path:t?`${t}/${e.name}`:e.name,entry:e,depth:n},e.name))})}function cs({session:e,onOpenFile:t,activePath:n}){let r=e.id,i=u(),[a,s]=(0,V.useState)(new Set),[c,l]=(0,V.useState)(null),d=(0,V.useCallback)(e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,V.useCallback)((e,t)=>{t.length!==0&&ne(r,e,t).then(()=>{i.invalidateQueries({queryKey:[`wt-tree`,r,e]}),I.success(t.length===1?`Uploaded ${t[0].name}`:`Uploaded ${t.length} files`)}).catch(e=>I.error(e instanceof Error?e.message:`Upload failed`))},[r,i]),p={sid:r,expanded:a,toggle:d,onOpenFile:t,onUpload:f,dropTarget:c,setDropTarget:l,activePath:n??null};return(0,B.jsx)(rs.Provider,{value:p,children:(0,B.jsxs)(Qo,{children:[(0,B.jsx)($o,{asChild:!0,children:(0,B.jsx)(`div`,{tabIndex:-1,onPaste:e=>f(``,as(e.clipboardData.items,e.clipboardData.files)),onDragOver:e=>{e.preventDefault(),l(``)},onDragLeave:e=>{e.currentTarget===e.target&&l(null)},onDrop:e=>{e.preventDefault(),l(null),f(``,as(e.dataTransfer.items,e.dataTransfer.files))},className:o(`h-full overflow-y-auto py-1`,c===``&&`bg-selection`),children:(0,B.jsx)(ss,{sid:r,path:``,depth:0})})}),(0,B.jsxs)(es,{children:[(0,B.jsx)(ts,{onSelect:()=>void te(r,``).catch(e=>I.error(e instanceof Error?e.message:`Download failed`)),children:`Download worktree`}),(0,B.jsx)(ts,{onSelect:()=>{navigator.clipboard.writeText(e.worktree_path),I.success(`Path copied`)},children:`Copy path`})]})]})})}var ls=/[.*+?^${}()|[\]\\]/g;function us(e){if(e.query.length===0)return null;try{let t=e.regex?e.query:e.query.replace(ls,`\\$&`);return e.wholeWord&&(t=`\\b(?:${t})\\b`),new RegExp(t,e.caseSensitive?`g`:`gi`)}catch{return null}}function ds(e,t){if(!t)return[{text:e,hit:!1}];let n=[],r=0;t.lastIndex=0;let i;for(;(i=t.exec(e))!==null;){if(i[0].length===0){t.lastIndex++;continue}i.index>r&&n.push({text:e.slice(r,i.index),hit:!1}),n.push({text:i[0],hit:!0}),r=i.index+i[0].length}return r<e.length&&n.push({text:e.slice(r),hit:!1}),n.length>0?n:[{text:e,hit:!1}]}var fs=240;function ps(e){let t=e.replace(/^\s+/,``);return t.length>fs?`${t.slice(0,fs)}…`:t}var ms=250;function hs({active:e,label:t,onClick:n,children:r}){return(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:n,className:o(`rounded-sm p-1 transition-colors`,e?`bg-elevated text-accent`:`text-fg-muted hover:bg-elevated hover:text-fg`),children:[r,(0,B.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,B.jsx)(R,{children:t})]})}function gs({session:e,onOpen:t}){let[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=setTimeout(()=>a(n),ms);return()=>clearTimeout(e)},[n]);let f={query:i,regex:o,caseSensitive:c,wholeWord:u},p=F(e,f),m=(0,V.useMemo)(()=>us(f),[i,o,c,u]),h=p.data,g=!!h&&(h.files.length>0||h.content.length>0);return(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 px-2 py-1.5`,children:[(0,B.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Search files and contents`,spellCheck:!1,autoComplete:`off`,className:`rounded-md bg-elevated px-2 py-1 font-mono text-xs text-fg outline-none placeholder:text-fg-muted`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(hs,{active:c,label:`Match case`,onClick:()=>l(e=>!e),children:(0,B.jsx)(lt,{className:`size-3.5`})}),(0,B.jsx)(hs,{active:u,label:`Match whole word`,onClick:()=>d(e=>!e),children:(0,B.jsx)(jt,{className:`size-3.5`})}),(0,B.jsx)(hs,{active:o,label:`Use regular expression`,onClick:()=>s(e=>!e),children:(0,B.jsx)(Dt,{className:`size-3.5`})})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:i.length===0?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`Search file names and contents.`}):p.isPending?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`Searching…`}):p.error?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:p.error instanceof Error?p.error.message:`Search failed`}):g?(0,B.jsxs)(B.Fragment,{children:[h.files.length>0&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`div`,{className:`px-3 pb-0.5 pt-1.5 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Files`}),h.files.map(e=>(0,B.jsxs)(`button`,{type:`button`,title:e,onClick:()=>t(e),className:`flex w-full items-center gap-1.5 px-3 py-1 text-left transition-colors hover:bg-elevated`,children:[(0,B.jsx)(pt,{className:`size-3.5 shrink-0 text-fg-muted`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs text-fg`,children:e})]},e))]}),h.content.length>0&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`div`,{className:`px-3 pb-0.5 pt-2 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Contents`}),h.content.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`truncate px-3 py-1 font-mono text-2xs text-fg-secondary`,title:e.path,children:e.path}),e.matches.map((n,r)=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path,n.line),className:`flex w-full items-baseline gap-2 py-0.5 pl-6 pr-3 text-left transition-colors hover:bg-elevated`,children:[(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-2xs tabular-nums text-fg-muted`,children:n.line}),(0,B.jsx)(`span`,{className:`truncate font-mono text-2xs text-fg-secondary`,children:ds(ps(n.text),m).map((e,t)=>e.hit?(0,B.jsx)(`span`,{className:`text-accent`,children:e.text},t):(0,B.jsx)(`span`,{children:e.text},t))})]},`${n.line}:${r}`))]},e.path))]}),h.truncated&&(0,B.jsx)(`div`,{className:`px-3 py-2 text-2xs text-fg-muted`,children:`Showing the first results — refine the query for more.`})]}):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No results.`})})]})}var _s=new Set([`starting`,`running`,`waiting_input`]);function vs(e){return e.split(`/`).filter(Boolean).pop()??e}function ys({children:e,className:t}){return(0,B.jsx)(`span`,{className:o(`shrink-0 text-2xs`,t),children:e})}function bs({label:e,blockReason:t,onClick:n}){return(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,disabled:t!==null,onClick:n,className:`rounded-sm p-1 text-fg-muted opacity-0 transition-opacity hover:text-danger group-hover:opacity-100 disabled:pointer-events-none disabled:opacity-0`,children:[(0,B.jsx)(fe,{className:`size-3.5`}),(0,B.jsx)(`span`,{className:`sr-only`,children:e})]})}),(0,B.jsx)(R,{children:t?`Can't ${e.toLowerCase()} — ${t}`:e})]})}function xs({repoId:e,projectId:t,sessions:n}){let r=Re(e),i=Pe(e,t),a=Ee(e,t),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),u=i.isPending||a.isPending,d=(0,V.useMemo)(()=>{let e=new Map;for(let t of n)_s.has(t.status)&&e.set(t.worktree_path,(e.get(t.worktree_path)??0)+1);return e},[n]),f=(0,V.useMemo)(()=>{let e=new Map;for(let t of r.data?.worktrees??[]){let n=t.branch??`(detached)`;(e.get(n)??e.set(n,[]).get(n)).push(t)}return[...e.entries()].sort(([,e],[,t])=>!e.some(e=>e.is_primary)-+!t.some(e=>e.is_primary)||(e[0]?.branch??``).localeCompare(t[0]?.branch??``))},[r.data]),p=(0,V.useMemo)(()=>[...r.data?.orphan_branches??[]].sort((e,t)=>e.name.localeCompare(t.name)),[r.data]);return r.isPending?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`Loading worktrees…`}):r.error?(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:r.error instanceof Error?r.error.message:`Failed to load worktrees`}):(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[f.length===0&&p.length===0&&(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No worktrees.`}),f.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 pb-0.5 pt-2 text-2xs text-fg-muted`,children:[(0,B.jsx)(_t,{className:`size-3 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate font-mono`,children:e})]}),t.map(e=>{let t=d.get(e.path)??0,n=e.is_primary?`the repository clone`:e.dirty?`uncommitted changes`:t>0?`${t} running session${t>1?`s`:``}`:null;return(0,B.jsxs)(`div`,{className:`group flex items-center gap-2 px-3 py-1 pl-6 transition-colors hover:bg-elevated`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg`,title:e.path,children:vs(e.path)}),e.is_primary&&(0,B.jsx)(ys,{className:`text-fg-muted`,children:`clone`}),e.dirty&&(0,B.jsx)(ys,{className:`text-waiting`,children:`uncommitted`}),t>0&&(0,B.jsxs)(ys,{className:`text-running`,children:[t,` running`]}),(0,B.jsx)(bs,{label:`Prune`,blockReason:n,onClick:()=>{l(null),s({kind:`worktree`,path:e.path,branch:e.branch})}})]},e.path)})]},`wt:${e}`)),p.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`px-3 pb-0.5 pt-3 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Branches without a worktree`}),p.map(e=>(0,B.jsxs)(`div`,{className:`group flex items-center gap-2 px-3 py-1 transition-colors hover:bg-elevated`,children:[(0,B.jsx)(_t,{className:`size-3 shrink-0 text-fg-muted`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg`,title:e.name,children:e.name}),e.local_only&&(0,B.jsx)(ys,{className:`text-waiting`,children:`local only`}),(0,B.jsx)(bs,{label:`Delete branch`,blockReason:null,onClick:()=>{l(null),s({kind:`branch`,name:e.name,localOnly:e.local_only})}})]},`br:${e.name}`))]}),(0,B.jsx)(k,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,B.jsxs)(T,{children:[o?.kind===`branch`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(h,{children:[(0,B.jsx)(E,{children:`Delete branch`}),(0,B.jsxs)(O,{children:[`Delete branch `,(0,B.jsx)(`span`,{className:`font-mono`,children:o.name}),`? This removes the branch from the repository.`]})]}),o.localOnly&&(0,B.jsxs)(`p`,{className:`text-xs text-waiting`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:o.name}),` has commits on no remote — deleting it discards that work permanently.`]})]}):(0,B.jsxs)(h,{children:[(0,B.jsx)(E,{children:`Prune worktree`}),(0,B.jsxs)(O,{children:[`Remove `,(0,B.jsx)(`span`,{className:`font-mono`,children:o?vs(o.path):``}),`? The working directory is deleted; the branch`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:o?.branch??``}),` is kept.`]})]}),c&&(0,B.jsx)(`p`,{className:`text-xs text-danger`,children:c}),(0,B.jsxs)(x,{children:[(0,B.jsx)(m,{type:`button`,variant:`ghost`,onClick:()=>s(null),children:`Cancel`}),(0,B.jsx)(m,{type:`button`,variant:`danger`,disabled:u,onClick:()=>{if(!o)return;l(null);let e=e=>l(e.message),t=()=>s(null);o.kind===`worktree`?i.mutate(o.path,{onSuccess:t,onError:e}):a.mutate({name:o.name,confirm:!0},{onSuccess:t,onError:e})},children:o?.kind===`branch`?`Delete`:`Prune`})]})]})})]})}var Ss=`DropdownMenu`,[Cs,ws]=C(Ss,[Bi]),Q=Bi(),[Ts,Es]=Cs(Ss),Ds=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Q(t),l=V.useRef(null),[u,d]=A({prop:i,defaultProp:a??!1,onChange:o,caller:Ss});return(0,B.jsx)(Ts,{scope:t,triggerId:M(),triggerRef:l,contentId:M(),open:u,onOpenChange:d,onOpenToggle:V.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,B.jsx)(qa,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Ds.displayName=Ss;var Os=`DropdownMenuTrigger`,ks=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Es(Os,n),o=Q(n),s=S(t,a.triggerRef);return(0,B.jsx)(Ja,{asChild:!0,...o,children:(0,B.jsx)(p.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:d(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:d(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});ks.displayName=Os;var As=`DropdownMenuPortal`,js=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Q(t);return(0,B.jsx)(Ya,{...r,...n})};js.displayName=As;var Ms=`DropdownMenuContent`,Ns=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Es(Ms,n),a=Q(n),o=V.useRef(!1);return(0,B.jsx)(Xa,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:d(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:d(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ns.displayName=Ms;var Ps=`DropdownMenuGroup`,Fs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(Za,{...i,...r,ref:t})});Fs.displayName=Ps;var Is=`DropdownMenuLabel`,Ls=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(Qa,{...i,...r,ref:t})});Ls.displayName=Is;var Rs=`DropdownMenuItem`,zs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)($a,{...i,...r,ref:t})});zs.displayName=Rs;var Bs=`DropdownMenuCheckboxItem`,Vs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(eo,{...i,...r,ref:t})});Vs.displayName=Bs;var Hs=`DropdownMenuRadioGroup`,Us=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(to,{...i,...r,ref:t})});Us.displayName=Hs;var Ws=`DropdownMenuRadioItem`,Gs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(no,{...i,...r,ref:t})});Gs.displayName=Ws;var Ks=`DropdownMenuItemIndicator`,qs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(ro,{...i,...r,ref:t})});qs.displayName=Ks;var Js=`DropdownMenuSeparator`,Ys=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(io,{...i,...r,ref:t})});Ys.displayName=Js;var Xs=`DropdownMenuArrow`,Zs=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(ao,{...i,...r,ref:t})});Zs.displayName=Xs;var Qs=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Q(t),[s,c]=A({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,B.jsx)(oo,{...o,open:s,onOpenChange:c,children:n})},$s=`DropdownMenuSubTrigger`,ec=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(so,{...i,...r,ref:t})});ec.displayName=$s;var tc=`DropdownMenuSubContent`,nc=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,B.jsx)(co,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});nc.displayName=tc;var rc=Ds,ic=ks,ac=js,oc=Ns,sc=zs,cc=Ys,lc=Qs,uc=ec,dc=nc,fc=rc,pc=ic,mc=lc;function hc({className:e,sideOffset:t=4,...n}){return(0,B.jsx)(ac,{children:(0,B.jsx)(oc,{sideOffset:t,className:o(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...n})})}function $({className:e,...t}){return(0,B.jsx)(sc,{className:o(et,Ge,`[&_svg]:size-3.5`,e),...t})}function gc({className:e,children:t,...n}){return(0,B.jsxs)(uc,{className:o(et,Ge,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,B.jsx)(ut,{className:`ml-auto`})]})}function _c({className:e,...t}){return(0,B.jsx)(ac,{children:(0,B.jsx)(dc,{className:o(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function vc({className:e,...t}){return(0,B.jsx)(cc,{className:o(`-mx-1 my-1 h-px bg-border`,e),...t})}function yc({sessions:e,target:t}){let{session:n,pinned:r,pin:i,unpin:a}=t,s=e.filter(e=>e.status!==`archived`);return(0,B.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-1 px-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-fg-secondary`,children:n?n.branch||n.title||n.id.slice(0,8):`No worktree`}),(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:!n,title:r?`Unpin — follow the active session`:`Pin the sidebar to this worktree`,onClick:()=>r?a():n&&i(n.id),className:o(`rounded-sm p-1 transition-colors disabled:pointer-events-none disabled:opacity-40`,r?`text-fg`:`text-fg-muted hover:bg-elevated hover:text-fg`),children:[(0,B.jsx)(Tt,{className:o(`size-3.5`,r&&`fill-current`)}),(0,B.jsx)(`span`,{className:`sr-only`,children:r?`Unpin sidebar`:`Pin sidebar`})]}),(0,B.jsxs)(fc,{children:[(0,B.jsx)(pc,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,title:`Bind a different worktree`,className:`rounded-sm p-1 text-fg-muted transition-colors hover:bg-elevated hover:text-fg`,children:[(0,B.jsx)(ve,{className:`size-3.5`}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Choose a worktree`})]})}),(0,B.jsx)(hc,{align:`end`,children:s.length===0?(0,B.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-fg-muted`,children:`No sessions yet`}):s.map(e=>(0,B.jsx)($,{onSelect:()=>i(e.id),children:(0,B.jsxs)(`span`,{className:`truncate font-mono`,children:[e.branch,` — `,e.title??e.id.slice(0,8)]})},e.id))})]})]})}var bc=[{key:`files`,label:`Files`,icon:ht},{key:`search`,label:`Search`,icon:Le},{key:`changes`,label:`Changes`,icon:_t},{key:`worktrees`,label:`Worktrees`,icon:ye}];function xc(e){return e===`diff`||e===`history`||e===`changes`?`changes`:e===`search`?`search`:e===`worktrees`?`worktrees`:`files`}function Sc({mode:e,onExpand:t,onSelect:n}){return(0,B.jsxs)(`div`,{className:`flex h-full w-9 shrink-0 flex-col items-center gap-1 bg-surface py-1.5`,children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-elevated hover:text-fg`,children:[(0,B.jsx)(xt,{className:`size-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Show sidebar`})]})}),(0,B.jsx)(R,{side:`right`,children:`Show sidebar`})]}),bc.map(({key:t,label:r,icon:i})=>(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-current":e===t?`page`:void 0,onClick:()=>n(t),className:o(`flex items-center rounded-md p-1.5 transition-colors`,e===t?`bg-elevated text-fg`:`text-fg-muted hover:bg-elevated hover:text-fg`),children:[(0,B.jsx)(i,{className:`size-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:r})]})}),(0,B.jsx)(R,{side:`right`,children:r})]},t))]})}function Cc({mode:e,onModeChange:t,onCollapse:n,projectId:r,repoId:i,sessions:a,target:s,onOpenFile:c,activeFilePath:l,activeDiffPath:u,onOpenDiff:d,onOpenCommitFile:f,onOpenSearchFile:p}){let{session:m}=s;return(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5`,children:[bc.map(({key:n,label:r,icon:i})=>(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-current":e===n?`page`:void 0,onClick:()=>t(n),className:o(`flex items-center rounded-md p-1.5 transition-colors`,e===n?`bg-elevated text-fg`:`text-fg-muted hover:bg-elevated hover:text-fg`),children:[(0,B.jsx)(i,{className:`size-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:r})]})}),(0,B.jsx)(R,{children:r})]},n)),(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:`ml-auto flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-elevated hover:text-fg`,children:[(0,B.jsx)(bt,{className:`size-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Hide sidebar`})]})}),(0,B.jsx)(R,{children:`Hide sidebar`})]})]}),e!==`worktrees`&&(0,B.jsx)(yc,{sessions:a,target:s}),e===`worktrees`&&(0,B.jsx)(xs,{repoId:i,projectId:r,sessions:a}),e===`files`&&(m?(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,B.jsx)(cs,{session:m,onOpenFile:c,activePath:l})}):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No worktree to show.`})),e===`changes`&&(m?(0,B.jsx)(ti,{session:m.id,activeDiffPath:u,onOpenDiff:d,onOpenCommitFile:f},m.id):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No worktree to show.`})),e===`search`&&(m?(0,B.jsx)(gs,{session:m.id,onOpen:p},m.id):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:`No worktree to search.`}))]})}function wc({projectId:e,repoId:t,open:n,kind:r=`agent`,seedAccountId:i,onOpenChange:a,onCreated:s}){let c=r===`terminal`,l=je(),u=Oe(l??void 0),d=Ye(l??void 0),f=$e(),p=De(),[g,_]=(0,V.useState)(``),[v,y]=(0,V.useState)(``),[b,S]=(0,V.useState)(!0),[C,w]=(0,V.useState)(!0),[D,A]=(0,V.useState)(``),[j,M]=(0,V.useState)(``),[N,ee]=(0,V.useState)(!1),[te,ne]=(0,V.useState)(null),re=f.data?.find(e=>e.id===t),ie=be(n?t:void 0),ae=Re(n?t:void 0),P=u.data?.find(e=>String(e.id)===g),oe=d.data?.allowSkipPermissions===!0,se=!c&&oe&&P?.skip_permissions_default===!0,F=v.trim()||re?.default_base_branch||``,ce=(0,V.useMemo)(()=>(ae.data?.worktrees??[]).filter(e=>e.branch===F).map(e=>({path:e.path,is_primary:e.is_primary,label:e.is_primary?`${e.path.split(`/`).filter(Boolean).pop()??e.path} (clone)`:e.path.split(`/`).filter(Boolean).pop()??e.path})),[ae.data,F]),ue=!b&&!C,fe=ce.find(e=>e.is_primary)?.path??ce[0]?.path??``,ge=j||fe,ve=(0,V.useMemo)(()=>{let e=d.data?.default_account_id;return u.data?.find(e=>e.id===i)??u.data?.find(t=>typeof e==`number`&&t.id===e)??u.data?.[0]},[u.data,d.data,i]),ye=g||(ve?String(ve.id):``);(0,V.useEffect)(()=>{n&&i!==void 0&&_(String(i))},[n,i]),(0,V.useEffect)(()=>{n&&(S(!c),w(!c),M(``))},[n,c]);let xe=()=>{ne(null),p.mutate({project_id:e,...c?{kind:`terminal`}:{account_id:Number(ye)},...v.trim()?{base_branch:v.trim()}:{},separate_branch:b,...b&&D.trim()?{branch:D.trim()}:{},...b?{}:{separate_worktree:C},...ue&&ge?{join_worktree:ge}:{},...se&&N?{skip_permissions:!0}:{}},{onSuccess:e=>{a(!1),A(``),ee(!1),s(e)},onError:e=>ne(e.message)})},Se=c?`a shell`:`an agent`,Ce=b?`on a new branch off ${F||`…`}, in its own directory`:ue?`on ${F||`…`}, sharing an existing directory`:`on ${F||`…`}, in its own directory`;return(0,B.jsx)(k,{open:n,onOpenChange:a,children:(0,B.jsxs)(T,{children:[(0,B.jsxs)(h,{children:[(0,B.jsx)(E,{children:c?`New terminal`:`New session`}),(0,B.jsxs)(O,{children:[c?`Opens`:`Spawns`,` `,Se,` `,Ce,`.`]})]}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),(c||ye)&&xe()},children:[!c&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ie,{children:`Account`}),u.data?.length===0?(0,B.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`No accounts yet —`,` `,(0,B.jsx)(`button`,{type:`button`,className:`text-accent underline`,onClick:()=>Ve(`accounts`),children:`add one in settings`}),`.`]}):(0,B.jsxs)(pe,{value:ye,onValueChange:_,children:[(0,B.jsx)(le,{children:(0,B.jsx)(me,{placeholder:`pick an account`})}),(0,B.jsx)(he,{children:u.data?.map(e=>(0,B.jsxs)(de,{value:String(e.id),children:[(0,B.jsxs)(`span`,{className:`font-mono`,children:[e.agent_type,`/`,e.label]}),!e.logged_in&&(0,B.jsx)(`span`,{className:`ml-2 text-2xs text-waiting`,children:`not logged in`})]},e.id))})]})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,B.jsx)(Ie,{htmlFor:`base-branch`,children:`Base branch`}),(0,B.jsx)(ze,{id:`base-branch`,placeholder:re?.default_base_branch??`main`,value:v,onValueChange:y,hints:(ie.data?.branches??[]).filter(e=>e.name.toLowerCase().includes(v.trim().toLowerCase())).slice(0,20).map(e=>({value:e.name,badge:e.name===re?.default_base_branch?`default`:e.is_session?`session: ${e.session_title??`untitled`}`:void 0})),className:`font-mono`,hintsClassName:`w-max min-w-full max-w-[36rem]`})]}),b&&(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(Ie,{htmlFor:`session-branch`,children:`New branch`}),(0,B.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`optional`})]}),(0,B.jsx)(Je,{id:`session-branch`,placeholder:`leave blank for auto`,value:D,onChange:e=>A(e.target.value),className:`font-mono`})]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_e,{id:`separate-branch`,checked:b,onCheckedChange:e=>{S(e),e&&w(!0)}}),(0,B.jsx)(Ie,{htmlFor:`separate-branch`,children:`Use separate branch`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_e,{id:`separate-worktree`,checked:b?!0:C,disabled:b,onCheckedChange:w}),(0,B.jsx)(Ie,{htmlFor:`separate-worktree`,className:o(b&&`text-fg-muted`),children:`Use separate directory`})]})]}),ue&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ie,{htmlFor:`join-dir`,children:`Directory to join`}),ce.length===0?(0,B.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[`No existing directory on `,(0,B.jsx)(`span`,{className:`font-mono`,children:F||`…`}),` — a shared one will be created for later sessions to join.`]}):(0,B.jsxs)(pe,{value:ge,onValueChange:M,children:[(0,B.jsx)(le,{id:`join-dir`,children:(0,B.jsx)(me,{})}),(0,B.jsx)(he,{children:ce.map(e=>(0,B.jsxs)(de,{value:e.path,children:[(0,B.jsx)(`span`,{className:`truncate`,children:e.label}),(0,B.jsx)(`span`,{className:`ml-2 truncate font-mono text-2xs text-fg-muted`,children:e.path})]},e.path))})]})]}),!b&&!c&&(0,B.jsxs)(`p`,{className:`text-xs text-waiting`,children:[`The `,c?`shell`:`agent`,` commits straight to`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:F||`…`}),ue?` and shares its working directory with concurrent sessions — they can trample each other’s edits.`:`.`]}),se&&(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-surface px-3 py-2`,children:[(0,B.jsx)(_e,{id:`skip-permissions`,checked:N,onCheckedChange:ee}),(0,B.jsx)(Ie,{htmlFor:`skip-permissions`,className:`text-waiting`,children:`Skip permission prompts for this session`})]}),te&&(0,B.jsx)(`p`,{className:`text-xs text-danger`,children:te}),(0,B.jsxs)(x,{children:[(0,B.jsx)(m,{type:`button`,variant:`ghost`,onClick:()=>a(!1),children:`Cancel`}),(0,B.jsx)(m,{type:`submit`,disabled:!c&&!ye||p.isPending,children:c?`Open terminal`:`Start session`})]})]})]})})}function Tc(e,t,n){return`ssh -L ${e}:127.0.0.1:${e} ${t}@${n}`}var Ec=[`running`,`waiting_input`];function Dc({sessionId:e,status:t}){let n=Ec.includes(t),{data:r}=Xe(e,n),i=r?.ports??[];return!n||i.length===0?null:(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 font-mono text-xs`,children:[(0,B.jsx)(`span`,{className:`text-fg-muted`,children:`ports`}),(0,B.jsx)(`div`,{className:`flex items-center gap-1`,children:i.map(t=>(0,B.jsx)(Oc,{sessionId:e,port:t},t.port))})]})}function Oc({sessionId:e,port:t}){let r=ot().data;return(0,B.jsxs)(fc,{children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsx)(pc,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,className:`cursor-pointer rounded px-1.5 py-0.5 tabular-nums text-fg-secondary outline-none transition-colors hover:bg-elevated hover:text-fg focus-visible:bg-elevated focus-visible:text-fg`,children:t.port})})}),(0,B.jsxs)(R,{children:[t.command,` · pid `,t.pid]})]}),(0,B.jsxs)(hc,{align:`start`,children:[st()===null?(0,B.jsx)($,{asChild:!0,children:(0,B.jsx)(`a`,{href:`http://localhost:${t.port}`,target:`_blank`,rel:`noopener noreferrer`,children:`Open localhost`})}):(0,B.jsx)($,{onSelect:()=>{window.open(`/proxy/${e}/${t.port}/?puddle_token=${n.get()??``}`,`_blank`,`noopener,noreferrer`)},children:`Open via proxy`}),(0,B.jsx)($,{onSelect:()=>{r&&navigator.clipboard.writeText(Tc(t.port,r.username,r.hostname)).then(()=>I.success(`Copied`))},children:`Copy ssh -L`})]})]})}function kc({className:e}){return(0,B.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function Ac({className:e}){return(0,B.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":!0,children:[(0,B.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,B.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,B.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function jc({type:e,className:t}){switch(e){case`claude-code`:return(0,B.jsx)(kc,{className:t});case`codex`:return(0,B.jsx)(Ac,{className:t});default:return(0,B.jsx)(tt,{className:t})}}function Mc({status:e,kind:t=`agent`,className:n}){return(0,B.jsx)(`span`,{className:o(`status-dot`,n),"data-status":e,"data-kind":t,role:`img`,"aria-label":`${t===`terminal`?`terminal `:``}status: ${e.replace(`_`,` `)}`})}var Nc=[`starting`,`running`,`waiting_input`],Pc=[`exited`,`interrupted`];function Fc({session:e,onArchived:t}){let n=qe(`resume`),r=qe(`kill`),i=xe(),o=Ae(),s=Me(),c=Oe(je()??void 0),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),[p,g]=(0,V.useState)(!1),[_,v]=(0,V.useState)(e.title??``),[y,b]=(0,V.useState)(null),S=(c.data??[]).filter(t=>t.agent_type===e.agent_type),C=!e.worktree_missing&&e.status!==`archived`&&S.some(t=>t.id!==e.account_id),w=n=>{i.mutate({sessionId:e.id,force:n,deleteBranch:d},{onSuccess:()=>{u(null),f(!1),t?.(e.id)},onError:e=>{e instanceof a&&e.code===`worktree_dirty`&&!n?u(`archive-force`):(u(null),I.error(e.message))}})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(fc,{children:[(0,B.jsx)(pc,{asChild:!0,children:(0,B.jsxs)(m,{variant:`ghost`,size:`icon`,className:`size-6`,onClick:e=>e.preventDefault(),children:[(0,B.jsx)(dt,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Session actions`})]})}),(0,B.jsxs)(hc,{align:`end`,children:[Pc.includes(e.status)&&!e.worktree_missing&&(0,B.jsxs)($,{onSelect:()=>n.mutate(e.id,{onError:e=>I.error(e.message)}),children:[(0,B.jsx)(Et,{}),` Resume`]}),Nc.includes(e.status)&&(0,B.jsxs)($,{onSelect:()=>u(`kill`),children:[(0,B.jsx)(kt,{}),` Kill`]}),(0,B.jsxs)($,{onSelect:()=>g(!0),children:[(0,B.jsx)(wt,{}),` Rename`]}),C&&(0,B.jsxs)(mc,{children:[(0,B.jsxs)(gc,{children:[(0,B.jsx)(At,{}),` Move to account…`]}),(0,B.jsx)(_c,{children:S.map(t=>{let n=t.id===e.account_id;return(0,B.jsxs)($,{disabled:n,onSelect:()=>b(t),children:[t.label,n&&(0,B.jsx)(`span`,{className:`ml-auto text-fg-muted`,children:`current`})]},t.id)})})]}),!e.worktree_missing&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(vc,{}),(0,B.jsxs)($,{onSelect:()=>{window.location.href=Qe(`vscode`,e.worktree_path,Ke())},children:[(0,B.jsx)(ft,{}),` Open in VS Code`]}),(0,B.jsxs)($,{onSelect:()=>{window.location.href=Qe(`cursor`,e.worktree_path,Ke())},children:[(0,B.jsx)(ft,{}),` Open in Cursor`]})]}),Pc.includes(e.status)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(vc,{}),(0,B.jsxs)($,{onSelect:()=>u(`archive`),children:[(0,B.jsx)(ct,{}),` Archive`]})]})]})]}),(0,B.jsx)(k,{open:l!==null,onOpenChange:e=>{e||(u(null),f(!1))},children:(0,B.jsxs)(T,{children:[(0,B.jsxs)(h,{children:[(0,B.jsxs)(E,{children:[l===`kill`&&`Kill this session?`,l===`archive`&&`Archive this session?`,l===`archive-force`&&`Worktree has uncommitted changes`]}),(0,B.jsxs)(O,{children:[l===`kill`&&`The agent process stops (SIGTERM, then SIGKILL). The conversation stays resumable.`,l===`archive`&&(e.separate_branch?`Removes the worktree directory. The branch ${e.branch} and the terminal logs are kept.`:`The shared worktree on ${e.branch} is removed once its last session archives. The branch and the terminal logs are kept.`),l===`archive-force`&&`Archiving now discards uncommitted changes in the worktree. Committed work on the branch survives.`]})]}),(l===`archive`||l===`archive-force`)&&e.separate_branch&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_e,{id:`delete-branch`,checked:d,onCheckedChange:f}),(0,B.jsxs)(Ie,{htmlFor:`delete-branch`,children:[`Also delete the branch `,(0,B.jsx)(`span`,{className:`font-mono`,children:e.branch})]})]}),d&&(0,B.jsx)(`p`,{className:`text-xs text-danger`,children:`Anything on it that was never pushed is gone for good.`})]}),(0,B.jsxs)(x,{children:[(0,B.jsx)(m,{variant:`ghost`,onClick:()=>u(null),children:`Cancel`}),l===`kill`&&(0,B.jsx)(m,{variant:`danger`,disabled:r.isPending,onClick:()=>r.mutate(e.id,{onSuccess:()=>u(null),onError:e=>{u(null),I.error(e.message)}}),children:`Kill session`}),l===`archive`&&(0,B.jsx)(m,{variant:`danger`,disabled:i.isPending,onClick:()=>w(!1),children:`Archive`}),l===`archive-force`&&(0,B.jsx)(m,{variant:`danger`,disabled:i.isPending,onClick:()=>w(!0),children:`Discard changes and archive`})]})]})}),(0,B.jsx)(k,{open:p,onOpenChange:g,children:(0,B.jsxs)(T,{children:[(0,B.jsx)(h,{children:(0,B.jsx)(E,{children:`Rename session`})}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),_.trim()&&o.mutate({sessionId:e.id,title:_.trim()},{onSuccess:()=>g(!1),onError:e=>I.error(e.message)})},children:[(0,B.jsx)(Je,{value:_,onChange:e=>v(e.target.value),autoFocus:!0}),(0,B.jsxs)(x,{children:[(0,B.jsx)(m,{type:`button`,variant:`ghost`,onClick:()=>g(!1),children:`Cancel`}),(0,B.jsx)(m,{type:`submit`,disabled:!_.trim()||o.isPending,children:`Rename`})]})]})]})}),(0,B.jsx)(k,{open:y!==null,onOpenChange:e=>!e&&b(null),children:(0,B.jsxs)(T,{children:[(0,B.jsxs)(h,{children:[(0,B.jsxs)(E,{children:[`Move this session to `,y?.label,`?`]}),(0,B.jsx)(O,{children:`The conversation continues under that account’s credentials. If the session is running it is stopped first, then resumed on the new account.`})]}),(0,B.jsxs)(x,{children:[(0,B.jsx)(m,{variant:`ghost`,onClick:()=>b(null),children:`Cancel`}),(0,B.jsx)(m,{disabled:s.isPending,onClick:()=>{y&&s.mutate({sessionId:e.id,accountId:y.id},{onSuccess:()=>{b(null),I.success(`Moved to ${y.label}`)},onError:e=>{b(null),I.error(e.message)}})},children:`Move session`})]})]})})]})}function Ic(e){let t=Date.parse(e.created_at);return Number.isNaN(t)?0:t}function Lc(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(t.id)?r:i).push(t);return r.sort((e,t)=>n.get(e.id)-n.get(t.id)),i.sort((e,t)=>Ic(t)-Ic(e)),[...i,...r]}function Rc(e,t,n){if(t===n)return[...e];let r=e.filter(e=>e!==t),i=r.indexOf(n);return i===-1?[...e]:(r.splice(i,0,t),r)}function zc({icon:e,label:t,onClick:n}){return(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-elevated hover:text-fg`,children:[(0,B.jsx)(e,{className:`size-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,B.jsx)(R,{children:t})]})}function Bc({projectId:e,sessions:t,activeSessionId:n,order:r,onReorder:i,onExpand:a,onNewTerminal:s,onNewSession:c}){let[l,u]=(0,V.useState)(null),d=Lc(t.filter(e=>e.status!==`archived`),r),f=(e,t)=>{e!==t&&i(Rc(d.map(e=>e.id),e,t))};return(0,B.jsxs)(`div`,{className:`flex h-full w-9 shrink-0 flex-col items-center bg-surface py-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,B.jsx)(zc,{icon:Ct,label:`Show sessions`,onClick:a}),(0,B.jsx)(zc,{icon:it,label:`New terminal`,onClick:s}),(0,B.jsx)(zc,{icon:rt,label:`New session`,onClick:c})]}),d.length>0&&(0,B.jsx)(`div`,{className:`my-1.5 h-px w-5 shrink-0 bg-border`}),(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center gap-1 overflow-y-auto`,children:d.map(t=>(0,B.jsx)(`div`,{draggable:!0,onDragStart:()=>u(t.id),onDragEnd:()=>u(null),onDragOver:e=>{e.preventDefault(),l&&l!==t.id&&f(l,t.id)},className:o(`transition-opacity`,l===t.id&&`opacity-50`),children:(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsxs)(ke,{draggable:!1,"aria-current":t.id===n?`true`:void 0,to:`/project/${e}/session/${t.id}`,className:o(`flex items-center rounded-md p-1.5 transition-colors hover:bg-elevated`,t.id===n&&`bg-elevated`),children:[(0,B.jsx)(Mc,{status:t.status,kind:t.kind}),(0,B.jsx)(`span`,{className:`sr-only`,children:t.title??t.branch})]})}),(0,B.jsx)(R,{children:t.title??t.branch})]})},t.id))})]})}function Vc({projectId:e,sessions:t,accounts:n,activeSessionId:r,order:i,onReorder:a,onNewSession:s,onNewTerminal:c,onCollapse:l,onArchived:u}){let[d,f]=(0,V.useState)(null),p=Lc(t.filter(e=>e.status!==`archived`),i),m=new Map(n.map(e=>[e.id,e.label])),h=(e,t)=>{e!==t&&a(Rc(p.map(e=>e.id),e,t))};return(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5`,children:[(0,B.jsx)(zc,{icon:St,label:`Hide sessions`,onClick:l}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,B.jsx)(zc,{icon:it,label:`New terminal`,onClick:c}),(0,B.jsx)(zc,{icon:rt,label:`New session`,onClick:s})]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1.5`,children:[p.length===0&&(0,B.jsx)(`p`,{className:`px-3 py-3 text-xs text-fg-muted`,children:`No sessions yet — press ⌘K to start one.`}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:p.map(t=>(0,B.jsx)(`li`,{draggable:!0,onDragStart:()=>f(t.id),onDragEnd:()=>f(null),onDragOver:e=>{e.preventDefault(),d&&d!==t.id&&h(d,t.id)},className:o(`transition-opacity`,d===t.id&&`opacity-50`),children:(0,B.jsxs)(ke,{draggable:!1,to:`/project/${e}/session/${t.id}`,className:o(`group flex items-center gap-2 px-3 py-1.5 transition-colors hover:bg-elevated`,t.id===r&&`bg-elevated`),children:[(0,B.jsx)(Mc,{status:t.status,kind:t.kind}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-sans text-xs text-fg`,children:t.title??t.id.slice(0,8)}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1 truncate font-mono text-2xs text-fg-muted`,children:[(0,B.jsx)(_t,{className:`size-3 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:t.branch})]}),t.account_id!==null&&m.has(t.account_id)&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1 truncate font-mono text-2xs text-fg-muted`,children:[(0,B.jsx)(jc,{type:t.agent_type??``,className:`size-3 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:m.get(t.account_id)})]})]}),t.skip_permissions&&(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsx)(Ot,{className:`size-3.5 shrink-0 text-waiting`})}),(0,B.jsx)(R,{children:`Running with permission prompts skipped`})]}),t.worktree_missing&&(0,B.jsxs)(L,{children:[(0,B.jsx)(z,{asChild:!0,children:(0,B.jsx)(gt,{className:`size-3.5 shrink-0 text-interrupted`})}),(0,B.jsx)(R,{children:`Worktree directory is gone — archive only`})]}),(0,B.jsx)(`span`,{className:`hidden group-hover:inline-flex has-[[data-state=open]]:inline-flex`,children:(0,B.jsx)(Fc,{session:t,onArchived:u})})]})},t.id))})]})]})}function Hc({tabs:e,sessions:t,activeId:n,onActivate:r,onClose:i,onReorder:a}){let[s,c]=(0,V.useState)(null);if(e.length===0)return null;let l=(t,n)=>{if(t===n)return;let r=e.filter(e=>e!==t);r.splice(r.indexOf(n),0,t),a(r)};return(0,B.jsx)(`div`,{className:`flex h-9 shrink-0 items-stretch gap-0.5 overflow-x-auto bg-surface px-1 pt-1`,children:e.map(e=>{let a=t.find(t=>t.id===e);return a?(0,B.jsxs)(`div`,{draggable:!0,onDragStart:()=>c(e),onDragEnd:()=>c(null),onDragOver:t=>{t.preventDefault(),s&&s!==e&&l(s,e)},onClick:()=>r(e),className:o(`group flex min-w-0 max-w-52 cursor-pointer items-center gap-1.5 rounded-t-md px-2.5 text-xs transition-colors`,e===n?`bg-ground text-fg`:`text-fg-secondary hover:bg-elevated`,s===e&&`opacity-50`),children:[(0,B.jsx)(Mc,{status:a.status,kind:a.kind}),(0,B.jsx)(`span`,{className:`truncate font-mono`,children:a.title??a.id.slice(0,8)}),(0,B.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(e)},className:`rounded-sm p-0.5 text-fg-muted opacity-0 transition-opacity hover:text-fg group-hover:opacity-100`,children:[(0,B.jsx)(b,{className:`size-3`}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close tab`})]})]},e):null})})}var Uc=2e3,Wc=t.parse({});function Gc(e,t){return`puddle.ws.${e}.${t}`}function Kc(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:t.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function qc(e){let t=je(),[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(Wc),o=(0,V.useRef)(i);o.current=i;let s=(0,V.useRef)(null),c=(0,V.useMemo)(()=>se((e,t,n)=>{we(e,t,n).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},Uc),[]);return(0,V.useEffect)(()=>{if(e===void 0||t===null){s.current=null;return}let n=Gc(e,t);s.current=n;let i=!1;r(!1),a(Wc);let o;try{o=Kc(sessionStorage.getItem(n)),o.kind===`corrupt`&&sessionStorage.removeItem(n)}catch(e){console.warn(`ui-state read failed: ${e.message}`),o={kind:`absent`}}return o.kind===`present`?(a(o.snapshot),r(!0)):Te(e,t).then(e=>{i||(e&&a(e.ui_state),r(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),i||r(!0)}),()=>{i=!0,c.flush()}},[e,t,c]),{loaded:n,snapshot:i,update(n){if(e===void 0||t===null)return;let r={...o.current,...n};o.current=r,a(r);let i=s.current??Gc(e,t);c(e,t,r);try{sessionStorage.setItem(i,JSON.stringify(r))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}function Jc({session:e}){let t=qe(`resume`);return e.status!==`interrupted`&&e.status!==`exited`?null:(0,B.jsxs)(`div`,{className:`flex items-center gap-3 bg-elevated px-3 py-2`,children:[(0,B.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:e.status===`interrupted`?`This session was interrupted (daemon restart or crash).`:`The agent process exited.`}),!e.worktree_missing&&(0,B.jsxs)(m,{size:`sm`,className:`ml-auto`,disabled:t.isPending,onClick:()=>t.mutate(e.id,{onError:e=>I.error(e.message)}),children:[(0,B.jsx)(Et,{}),`Resume`]})]})}function Yc(){return(0,B.jsx)(Tr,{children:(0,B.jsx)(Xc,{})})}function Xc(){let e=Se(),t=Ue(),n=e.id??``,r=/^[0-9a-f]{10}$/.test(n),i=e.sid??null,a=Ne(r?n:void 0),o=(0,V.useMemo)(()=>a.data?.sessions??[],[a.data]),s=Oe(a.data?.project.profile_id).data??[],c=qc(r?n:void 0),l=c.snapshot.session_tabs,[u,d]=(0,V.useState)(!1),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(`agent`),[g,_]=(0,V.useState)(void 0),v=(0,V.useCallback)((e=`agent`)=>{_(void 0),h(e),p(!0)},[]),y=(0,V.useRef)(null),{setHandler:b}=Ze(),[x,S]=(0,V.useState)(null),C=(0,V.useCallback)((e,t)=>{c.update({editor_tabs:ie(c.snapshot.editor_tabs,e),active_editor_tab:e}),t&&(e.kind??`file`)===`file`&&S({session:e.session,path:e.path,line:t.line,column:t.column,nonce:Date.now()})},[c]),w=(0,V.useCallback)((e,t,n)=>C({kind:`file`,session:e,path:t},n),[C]);Er(w),(0,V.useEffect)(()=>(b(e=>{_(e?.accountId),h(e?.kind??`agent`),p(!0)}),()=>b(null)),[b]),(0,V.useEffect)(()=>{if(u||!c.loaded||!a.data)return;d(!0);let e=new Set(o.filter(e=>e.status!==`archived`).map(e=>e.id)),r=l.filter(t=>e.has(t));r.length!==l.length&&c.update({session_tabs:r});let s=c.snapshot.active_session;!i&&s&&e.has(s)&&t(`/project/${n}/session/${s}`,{replace:!0})},[u,c,a.data,o,l,i,t,n]),(0,V.useEffect)(()=>{if(u){if(!i){y.current=null;return}i!==y.current&&(y.current=null,l.includes(i)?c.snapshot.active_session!==i&&c.update({active_session:i}):c.update({session_tabs:[...l,i],active_session:i}))}},[u,i,l,c]),(0,V.useEffect)(()=>{let e=o.filter(e=>e.status===`waiting_input`).length,t=a.data?.project.name??`puddle`;return document.title=e>0?`● ${e} waiting — ${t}`:`${t} — puddle`,()=>{document.title=`puddle`}},[o,a.data?.project.name]);let T=(0,V.useCallback)(e=>{let r=i===e;r&&(y.current=e),c.update({session_tabs:l.filter(t=>t!==e),...r?{active_session:null}:{}}),r&&t(`/project/${n}`)},[c,l,i,t,n]),E=o.find(e=>e.id===i)??null,D=xr(o,i,c),O=D.session,k=c.snapshot.editor_tabs,A=xc(c.snapshot.sidebar_mode),j=c.snapshot.sidebar_collapsed,M=c.snapshot.sessions_collapsed,N=c.snapshot.active_editor_tab,ee=N?.kind===`diff`&&O&&N.session===O.id?N.path:null,te=N&&(N.kind??`file`)===`file`&&O&&N.session===O.id?N.path:null,ne=e=>{O&&C({kind:`diff`,session:O.id,path:e})},re=(e,t)=>{O&&C({kind:`commit`,session:O.id,path:e,sha:t})},ae=(e,t)=>{O&&w(O.id,e,t===void 0?void 0:{line:t,column:1})},P=(0,V.useCallback)(e=>c.update({layout:{...c.snapshot.layout,...e}}),[c]),oe=Dr(c.snapshot.layout,[...j?[]:[`nav`],`main`,...M?[]:[`sessions`]]),se=Dr(c.snapshot.layout,[...k.length>0?[`editor`]:[],`session`]);return r?!c.loaded||!a.data?(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-fg-muted`,children:`…`}):(0,B.jsxs)(`div`,{className:`flex h-full`,children:[j&&(0,B.jsx)(Sc,{mode:A,onExpand:()=>c.update({sidebar_collapsed:!1}),onSelect:e=>c.update({sidebar_collapsed:!1,sidebar_mode:e})}),(0,B.jsxs)(mr,{orientation:`horizontal`,className:`h-full min-w-0 flex-1`,defaultLayout:oe,onLayoutChanged:P,children:[!j&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_r,{id:`nav`,defaultSize:280,minSize:200,maxSize:560,children:(0,B.jsx)(Cc,{mode:A,onModeChange:e=>c.update({sidebar_mode:e}),onCollapse:()=>c.update({sidebar_collapsed:!0}),projectId:n,repoId:a.data.project.repo_id,sessions:o,target:D,onOpenFile:w,activeFilePath:te,activeDiffPath:ee,onOpenDiff:ne,onOpenCommitFile:re,onOpenSearchFile:ae})}),(0,B.jsx)(br,{className:`w-px bg-border transition-colors hover:bg-accent data-[resizing]:bg-accent`})]}),(0,B.jsx)(_r,{id:`main`,children:(0,B.jsxs)(mr,{orientation:`vertical`,className:`h-full`,defaultLayout:se,onLayoutChanged:P,children:[k.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_r,{id:`editor`,defaultSize:360,minSize:120,children:(0,B.jsx)(Cr,{uiState:c,sessions:o,reveal:x})}),(0,B.jsx)(br,{className:`h-px bg-border transition-colors hover:bg-accent data-[resizing]:bg-accent`})]}),(0,B.jsx)(_r,{id:`session`,minSize:160,children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-ground`,children:[(0,B.jsx)(Hc,{tabs:l,sessions:o,activeId:i,onActivate:e=>void t(`/project/${n}/session/${e}`),onClose:T,onReorder:e=>c.update({session_tabs:e})}),E&&(0,B.jsx)(Jc,{session:E}),E&&(0,B.jsx)(Dc,{sessionId:E.id,status:E.status}),(0,B.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[l.map(e=>(0,B.jsx)(`div`,{className:e===i?`absolute inset-0 py-1 pl-4 pr-2`:`hidden`,children:(0,B.jsx)(We,{stream:e,onOpenFile:(t,n,r)=>w(e,t,n===void 0?void 0:{line:n,column:r})})},e)),!i&&(0,B.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,B.jsx)(it,{className:`size-8 text-fg-muted`}),(0,B.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:o.filter(e=>e.status!==`archived`).length===0?`No sessions yet — press ⌘K to start one.`:`Pick a session from the sessions sidebar.`})]})]})]})})]})}),!M&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(br,{className:`w-px bg-border transition-colors hover:bg-accent data-[resizing]:bg-accent`}),(0,B.jsx)(_r,{id:`sessions`,defaultSize:260,minSize:180,maxSize:480,children:(0,B.jsx)(Vc,{projectId:n,sessions:o,accounts:s,activeSessionId:i,order:c.snapshot.session_order,onReorder:e=>c.update({session_order:e}),onNewSession:()=>v(`agent`),onNewTerminal:()=>v(`terminal`),onCollapse:()=>c.update({sessions_collapsed:!0}),onArchived:T})})]}),(0,B.jsx)(wc,{projectId:n,repoId:a.data.project.repo_id,open:f,kind:m,seedAccountId:g,onOpenChange:p,onCreated:e=>void t(`/project/${n}/session/${e.id}`)})]}),M&&(0,B.jsx)(Bc,{projectId:n,sessions:o,activeSessionId:i,order:c.snapshot.session_order,onReorder:e=>c.update({session_order:e}),onExpand:()=>c.update({sessions_collapsed:!1}),onNewTerminal:()=>v(`terminal`),onNewSession:()=>v(`agent`)})]}):null}export{Yc as Workspace};
@@ -0,0 +1 @@
1
+ var e={comments:{lineComment:`*`},brackets:[[`[`,`]`],[`(`,`)`]]},t={defaultToken:`invalid`,ignoreCase:!0,tokenPostfix:`.abap`,keywords:`abap-source.abbreviated.abstract.accept.accepting.according.activation.actual.add.add-corresponding.adjacent.after.alias.aliases.align.all.allocate.alpha.analysis.analyzer.and.append.appendage.appending.application.archive.area.arithmetic.as.ascending.aspect.assert.assign.assigned.assigning.association.asynchronous.at.attributes.authority.authority-check.avg.back.background.backup.backward.badi.base.before.begin.between.big.binary.bintohex.bit.black.blank.blanks.blob.block.blocks.blue.bound.boundaries.bounds.boxed.break-point.buffer.by.bypassing.byte.byte-order.call.calling.case.cast.casting.catch.center.centered.chain.chain-input.chain-request.change.changing.channels.character.char-to-hex.check.checkbox.ci_.circular.class.class-coding.class-data.class-events.class-methods.class-pool.cleanup.clear.client.clob.clock.close.coalesce.code.coding.col_background.col_group.col_heading.col_key.col_negative.col_normal.col_positive.col_total.collect.color.column.columns.comment.comments.commit.common.communication.comparing.component.components.compression.compute.concat.concat_with_space.concatenate.cond.condense.condition.connect.connection.constants.context.contexts.continue.control.controls.conv.conversion.convert.copies.copy.corresponding.country.cover.cpi.create.creating.critical.currency.currency_conversion.current.cursor.cursor-selection.customer.customer-function.dangerous.data.database.datainfo.dataset.date.dats_add_days.dats_add_months.dats_days_between.dats_is_valid.daylight.dd/mm/yy.dd/mm/yyyy.ddmmyy.deallocate.decimal_shift.decimals.declarations.deep.default.deferred.define.defining.definition.delete.deleting.demand.department.descending.describe.destination.detail.dialog.directory.disconnect.display.display-mode.distinct.divide.divide-corresponding.division.do.dummy.duplicate.duplicates.duration.during.dynamic.dynpro.edit.editor-call.else.elseif.empty.enabled.enabling.encoding.end.endat.endcase.endcatch.endchain.endclass.enddo.endenhancement.end-enhancement-section.endexec.endform.endfunction.endian.endif.ending.endinterface.end-lines.endloop.endmethod.endmodule.end-of-definition.end-of-editing.end-of-file.end-of-page.end-of-selection.endon.endprovide.endselect.end-test-injection.end-test-seam.endtry.endwhile.endwith.engineering.enhancement.enhancement-point.enhancements.enhancement-section.entries.entry.enum.environment.equiv.errormessage.errors.escaping.event.events.exact.except.exception.exceptions.exception-table.exclude.excluding.exec.execute.exists.exit.exit-command.expand.expanding.expiration.explicit.exponent.export.exporting.extend.extended.extension.extract.fail.fetch.field.field-groups.fields.field-symbol.field-symbols.file.filter.filters.filter-table.final.find.first.first-line.fixed-point.fkeq.fkge.flush.font.for.form.format.forward.found.frame.frames.free.friends.from.function.functionality.function-pool.further.gaps.generate.get.giving.gkeq.gkge.global.grant.green.group.groups.handle.handler.harmless.hashed.having.hdb.header.headers.heading.head-lines.help-id.help-request.hextobin.hide.high.hint.hold.hotspot.icon.id.identification.identifier.ids.if.ignore.ignoring.immediately.implementation.implementations.implemented.implicit.import.importing.in.inactive.incl.include.includes.including.increment.index.index-line.infotypes.inheriting.init.initial.initialization.inner.inout.input.insert.instance.instances.instr.intensified.interface.interface-pool.interfaces.internal.intervals.into.inverse.inverted-date.is.iso.job.join.keep.keeping.kernel.key.keys.keywords.kind.language.last.late.layout.leading.leave.left.left-justified.leftplus.leftspace.legacy.length.let.level.levels.like.line.lines.line-count.linefeed.line-selection.line-size.list.listbox.list-processing.little.llang.load.load-of-program.lob.local.locale.locator.logfile.logical.log-point.long.loop.low.lower.lpad.lpi.ltrim.mail.main.major-id.mapping.margin.mark.mask.match.matchcode.max.maximum.medium.members.memory.mesh.message.message-id.messages.messaging.method.methods.min.minimum.minor-id.mm/dd/yy.mm/dd/yyyy.mmddyy.mode.modif.modifier.modify.module.move.move-corresponding.multiply.multiply-corresponding.name.nametab.native.nested.nesting.new.new-line.new-page.new-section.next.no.no-display.no-extension.no-gap.no-gaps.no-grouping.no-heading.no-scrolling.no-sign.no-title.no-topofpage.no-zero.node.nodes.non-unicode.non-unique.not.null.number.object.objects.obligatory.occurrence.occurrences.occurs.of.off.offset.ole.on.only.open.option.optional.options.or.order.other.others.out.outer.output.output-length.overflow.overlay.pack.package.pad.padding.page.pages.parameter.parameters.parameter-table.part.partially.pattern.percentage.perform.performing.person.pf1.pf10.pf11.pf12.pf13.pf14.pf15.pf2.pf3.pf4.pf5.pf6.pf7.pf8.pf9.pf-status.pink.places.pool.pos_high.pos_low.position.pragmas.precompiled.preferred.preserving.primary.print.print-control.priority.private.procedure.process.program.property.protected.provide.public.push.pushbutton.put.queue-only.quickinfo.radiobutton.raise.raising.range.ranges.read.reader.read-only.receive.received.receiver.receiving.red.redefinition.reduce.reduced.ref.reference.refresh.regex.reject.remote.renaming.replace.replacement.replacing.report.request.requested.reserve.reset.resolution.respecting.responsible.result.results.resumable.resume.retry.return.returncode.returning.returns.right.right-justified.rightplus.rightspace.risk.rmc_communication_failure.rmc_invalid_status.rmc_system_failure.role.rollback.rows.rpad.rtrim.run.sap.sap-spool.saving.scale_preserving.scale_preserving_scientific.scan.scientific.scientific_with_leading_zero.scroll.scroll-boundary.scrolling.search.secondary.seconds.section.select.selection.selections.selection-screen.selection-set.selection-sets.selection-table.select-options.send.separate.separated.set.shared.shift.short.shortdump-id.sign_as_postfix.single.size.skip.skipping.smart.some.sort.sortable.sorted.source.specified.split.spool.spots.sql.sqlscript.stable.stamp.standard.starting.start-of-editing.start-of-selection.state.statement.statements.static.statics.statusinfo.step-loop.stop.structure.structures.style.subkey.submatches.submit.subroutine.subscreen.subtract.subtract-corresponding.suffix.sum.summary.summing.supplied.supply.suppress.switch.switchstates.symbol.syncpoints.syntax.syntax-check.syntax-trace.system-call.system-exceptions.system-exit.tab.tabbed.table.tables.tableview.tabstrip.target.task.tasks.test.testing.test-injection.test-seam.text.textpool.then.throw.time.times.timestamp.timezone.tims_is_valid.title.titlebar.title-lines.to.tokenization.tokens.top-lines.top-of-page.trace-file.trace-table.trailing.transaction.transfer.transformation.translate.transporting.trmac.truncate.truncation.try.tstmp_add_seconds.tstmp_current_utctimestamp.tstmp_is_valid.tstmp_seconds_between.type.type-pool.type-pools.types.uline.unassign.under.unicode.union.unique.unit_conversion.unix.unpack.until.unwind.up.update.upper.user.user-command.using.utf-8.valid.value.value-request.values.vary.varying.verification-message.version.via.view.visible.wait.warning.when.whenever.where.while.width.window.windows.with.with-heading.without.with-title.word.work.write.writer.xml.xsd.yellow.yes.yymmdd.zero.zone.abap_system_timezone.abap_user_timezone.access.action.adabas.adjust_numbers.allow_precision_loss.allowed.amdp.applicationuser.as_geo_json.as400.associations.balance.behavior.breakup.bulk.cds.cds_client.check_before_save.child.clients.corr.corr_spearman.cross.cycles.datn_add_days.datn_add_months.datn_days_between.dats_from_datn.dats_tims_to_tstmp.dats_to_datn.db2.db6.ddl.dense_rank.depth.deterministic.discarding.entities.entity.error.failed.finalize.first_value.fltp_to_dec.following.fractional.full.graph.grouping.hierarchy.hierarchy_ancestors.hierarchy_ancestors_aggregate.hierarchy_descendants.hierarchy_descendants_aggregate.hierarchy_siblings.incremental.indicators.lag.last_value.lead.leaves.like_regexpr.link.locale_sap.lock.locks.many.mapped.matched.measures.median.mssqlnt.multiple.nodetype.ntile.nulls.occurrences_regexpr.one.operations.oracle.orphans.over.parent.parents.partition.pcre.period.pfcg_mapping.preceding.privileged.product.projection.rank.redirected.replace_regexpr.reported.response.responses.root.row.row_number.sap_system_date.save.schema.session.sets.shortdump.siblings.spantree.start.stddev.string_agg.subtotal.sybase.tims_from_timn.tims_to_timn.to_blob.to_clob.total.trace-entry.tstmp_to_dats.tstmp_to_dst.tstmp_to_tims.tstmpl_from_utcl.tstmpl_to_utcl.unbounded.utcl_add_seconds.utcl_current.utcl_seconds_between.uuid.var.verbatim`.split(`.`),builtinFunctions:`abs.acos.asin.atan.bit-set.boolc.boolx.ceil.char_off.charlen.cmax.cmin.concat_lines_of.contains.contains_any_not_of.contains_any_of.cos.cosh.count.count_any_not_of.count_any_of.dbmaxlen.distance.escape.exp.find_any_not_of.find_any_of.find_end.floor.frac.from_mixed.ipow.line_exists.line_index.log.log10.matches.nmax.nmin.numofchar.repeat.rescale.reverse.round.segment.shift_left.shift_right.sign.sin.sinh.sqrt.strlen.substring.substring_after.substring_before.substring_from.substring_to.tan.tanh.to_lower.to_mixed.to_upper.trunc.utclong_add.utclong_current.utclong_diff.xsdbool.xstrlen`.split(`.`),typeKeywords:`b.c.d.decfloat16.decfloat34.f.i.int8.n.p.s.string.t.utclong.x.xstring.any.clike.csequence.decfloat.numeric.simple.xsequence.accp.char.clnt.cuky.curr.datn.dats.d16d.d16n.d16r.d34d.d34n.d34r.dec.df16_dec.df16_raw.df34_dec.df34_raw.fltp.geom_ewkb.int1.int2.int4.lang.lchr.lraw.numc.quan.raw.rawstring.sstring.timn.tims.unit.utcl.df16_scl.df34_scl.prec.varc.abap_bool.abap_false.abap_true.abap_undefined.me.screen.space.super.sy.syst.table_line.*sys*`.split(`.`),builtinMethods:[`class_constructor`,`constructor`],derivedTypes:[`%CID`,`%CID_REF`,`%CONTROL`,`%DATA`,`%ELEMENT`,`%FAIL`,`%KEY`,`%MSG`,`%PARAM`,`%PID`,`%PID_ASSOC`,`%PID_PARENT`,`%_HINTS`],cdsLanguage:[`@AbapAnnotation`,`@AbapCatalog`,`@AccessControl`,`@API`,`@ClientDependent`,`@ClientHandling`,`@CompatibilityContract`,`@DataAging`,`@EndUserText`,`@Environment`,`@LanguageDependency`,`@MappingRole`,`@Metadata`,`@MetadataExtension`,`@ObjectModel`,`@Scope`,`@Semantics`,`$EXTENSION`,`$SELF`],selectors:[`->`,`->*`,`=>`,`~`,`~*`],operators:` +. -./.*.**.div.mod.=.#.@.+=.-=.*=./=.**=.&&=.?=.&.&&.bit-and.bit-not.bit-or.bit-xor.m.o.z.<. >.<=.>=.<>.><.=<.=>.bt.byte-ca.byte-cn.byte-co.byte-cs.byte-na.byte-ns.ca.cn.co.cp.cs.eq.ge.gt.le.lt.na.nb.ne.np.ns.*/.*:.--./*.//`.split(`.`),symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":`type`,"@keywords":`keyword`,"@cdsLanguage":`annotation`,"@derivedTypes":`type`,"@builtinFunctions":`type`,"@builtinMethods":`type`,"@operators":`key`,"@default":`identifier`}}],[/<[\w]+>/,`identifier`],[/##[\w|_]+/,`comment`],{include:`@whitespace`},[/[:,.]/,`delimiter`],[/[{}()\[\]]/,`@brackets`],[/@symbols/,{cases:{"@selectors":`tag`,"@operators":`key`,"@default":``}}],[/'/,{token:`string`,bracket:`@open`,next:`@stringquote`}],[/`/,{token:`string`,bracket:`@open`,next:`@stringping`}],[/\|/,{token:`string`,bracket:`@open`,next:`@stringtemplate`}],[/\d+/,`number`]],stringtemplate:[[/[^\\\|]+/,`string`],[/\\\|/,`string`],[/\|/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringping:[[/[^\\`]+/,`string`],[/`/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringquote:[[/[^\\']+/,`string`],[/'/,{token:`string`,bracket:`@close`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/^\*.*$/,`comment`],[/\".*$/,`comment`]]}};export{e as conf,t as language};
@@ -0,0 +1 @@
1
+ var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))`),end:RegExp(`^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))`)}}},t=`abstract.activate.and.any.array.as.asc.assert.autonomous.begin.bigdecimal.blob.boolean.break.bulk.by.case.cast.catch.char.class.collect.commit.const.continue.convertcurrency.decimal.default.delete.desc.do.double.else.end.enum.exception.exit.export.extends.false.final.finally.float.for.from.future.get.global.goto.group.having.hint.if.implements.import.in.inner.insert.instanceof.int.interface.into.join.last_90_days.last_month.last_n_days.last_week.like.limit.list.long.loop.map.merge.native.new.next_90_days.next_month.next_n_days.next_week.not.null.nulls.number.object.of.on.or.outer.override.package.parallel.pragma.private.protected.public.retrieve.return.returning.rollback.savepoint.search.select.set.short.sort.stat.static.strictfp.super.switch.synchronized.system.testmethod.then.this.this_month.this_week.throw.throws.today.tolabel.tomorrow.transaction.transient.trigger.true.try.type.undelete.update.upsert.using.virtual.void.volatile.webservice.when.where.while.yesterday`.split(`.`),n=e=>e.charAt(0).toUpperCase()+e.substr(1),r=[];t.forEach(e=>{r.push(e),r.push(e.toUpperCase()),r.push(n(e))});var i={defaultToken:``,tokenPostfix:`.apex`,keywords:r,operators:`=.>.<.!.~.?.:.==.<=.>=.!=.&&.||.++.--.+.-.*./.&.|.^.%.<<.>>.>>>.+=.-=.*=./=.&=.|=.^=.%=.<<=.>>=.>>>=`.split(`.`),symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:`keyword.$0`},"@default":`identifier`}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:`keyword.$0`},"@default":`type.identifier`}}],{include:`@whitespace`},[/[{}()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/@\s*[a-zA-Z_\$][\w\$]*/,`annotation`],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,`number.float`],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,`number.float`],[/(@digits)[fFdD]/,`number.float`],[/(@digits)[lL]?/,`number`],[/[;,.]/,`delimiter`],[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/"/,`string`,`@string."`],[/'/,`string`,`@string.'`],[/'[^\\']'/,`string`],[/(')(@escapes)(')/,[`string`,`string.escape`,`string`]],[/'/,`string.invalid`]],whitespace:[[/[ \t\r\n]+/,``],[/\/\*\*(?!\/)/,`comment.doc`,`@apexdoc`],[/\/\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]],comment:[[/[^\/*]+/,`comment`],[/\*\//,`comment`,`@pop`],[/[\/*]/,`comment`]],apexdoc:[[/[^\/*]+/,`comment.doc`],[/\*\//,`comment.doc`,`@pop`],[/[\/*]/,`comment.doc`]],string:[[/[^\\"']+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/["']/,{cases:{"$#==$S2":{token:`string`,next:`@pop`},"@default":`string`}}]]}};export{e as conf,i as language};