claude-mux 0.30.13 → 0.30.14

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 (361) hide show
  1. package/CLAUDE.md +14 -3
  2. package/dist/fleet-places.d.ts +7 -1
  3. package/dist/fleet-places.d.ts.map +1 -1
  4. package/dist/fleet-places.js +14 -1
  5. package/dist/fleet-places.js.map +1 -1
  6. package/dist/server/dictation-marks.d.ts.map +1 -1
  7. package/dist/server/dictation-marks.js +23 -1
  8. package/dist/server/dictation-marks.js.map +1 -1
  9. package/dist/transcript/parser.d.ts +7 -0
  10. package/dist/transcript/parser.d.ts.map +1 -1
  11. package/dist/transcript/parser.js +19 -3
  12. package/dist/transcript/parser.js.map +1 -1
  13. package/dist/transcript/past-sessions.d.ts.map +1 -1
  14. package/dist/transcript/past-sessions.js +4 -1
  15. package/dist/transcript/past-sessions.js.map +1 -1
  16. package/dist/utils/version.d.ts +1 -1
  17. package/dist/utils/version.js +1 -1
  18. package/dist/web/client/_app/immutable/chunks/{sULMfRFG.js → B4FaHfAQ.js} +2 -2
  19. package/dist/web/client/_app/immutable/chunks/{sULMfRFG.js.map → B4FaHfAQ.js.map} +1 -1
  20. package/dist/web/client/_app/immutable/chunks/{W5_HMZ5E.js → B5Hkb2u5.js} +2 -2
  21. package/dist/web/client/_app/immutable/chunks/{W5_HMZ5E.js.map → B5Hkb2u5.js.map} +1 -1
  22. package/{web/.svelte-kit/output/client/_app/immutable/chunks/BQzv8cqz.js → dist/web/client/_app/immutable/chunks/BOpEbBRb.js} +2 -2
  23. package/{web/.svelte-kit/output/client/_app/immutable/chunks/BQzv8cqz.js.map → dist/web/client/_app/immutable/chunks/BOpEbBRb.js.map} +1 -1
  24. package/dist/web/client/_app/immutable/chunks/{Q5yhzux8.js → BeYjnogg.js} +2 -2
  25. package/{web/.svelte-kit/output/client/_app/immutable/chunks/Q5yhzux8.js.map → dist/web/client/_app/immutable/chunks/BeYjnogg.js.map} +1 -1
  26. package/dist/web/client/_app/immutable/chunks/{VceCNUd7.js → C00rm3mY.js} +2 -2
  27. package/{web/.svelte-kit/output/client/_app/immutable/chunks/VceCNUd7.js.map → dist/web/client/_app/immutable/chunks/C00rm3mY.js.map} +1 -1
  28. package/dist/web/client/_app/immutable/chunks/{CtjkAirr.js → CKg7gbPm.js} +9 -9
  29. package/dist/web/client/_app/immutable/chunks/CKg7gbPm.js.map +1 -0
  30. package/dist/web/client/_app/immutable/chunks/CPEphjdk.js +4 -0
  31. package/dist/web/client/_app/immutable/chunks/CPEphjdk.js.map +1 -0
  32. package/dist/web/client/_app/immutable/chunks/{BQQ3-rqs.js → CPlFo88J.js} +2 -2
  33. package/dist/web/client/_app/immutable/chunks/{BQQ3-rqs.js.map → CPlFo88J.js.map} +1 -1
  34. package/dist/web/client/_app/immutable/chunks/{BvX4FYxp.js → CtnjySwS.js} +2 -2
  35. package/dist/web/client/_app/immutable/chunks/{BvX4FYxp.js.map → CtnjySwS.js.map} +1 -1
  36. package/dist/web/client/_app/immutable/chunks/{XgSsj0QY.js → D3EW0jRH.js} +2 -2
  37. package/{web/.svelte-kit/output/client/_app/immutable/chunks/XgSsj0QY.js.map → dist/web/client/_app/immutable/chunks/D3EW0jRH.js.map} +1 -1
  38. package/dist/web/client/_app/immutable/chunks/{CtlIfY1C.js → D3umr-Qr.js} +2 -2
  39. package/{web/.svelte-kit/output/client/_app/immutable/chunks/CtlIfY1C.js.map → dist/web/client/_app/immutable/chunks/D3umr-Qr.js.map} +1 -1
  40. package/dist/web/client/_app/immutable/chunks/{CM0CI9GL.js → D8-_Y-M6.js} +3 -3
  41. package/dist/web/client/_app/immutable/chunks/{CM0CI9GL.js.map → D8-_Y-M6.js.map} +1 -1
  42. package/dist/web/client/_app/immutable/chunks/{cvsGFvDx.js → DDvK7Qo9.js} +2 -2
  43. package/{web/.svelte-kit/output/client/_app/immutable/chunks/cvsGFvDx.js.map → dist/web/client/_app/immutable/chunks/DDvK7Qo9.js.map} +1 -1
  44. package/dist/web/client/_app/immutable/chunks/{CiU8KBun.js → _VFi-7U7.js} +2 -2
  45. package/dist/web/client/_app/immutable/chunks/{CiU8KBun.js.map → _VFi-7U7.js.map} +1 -1
  46. package/dist/web/client/_app/immutable/chunks/{DlENCZqZ.js → mQ6hkLuy.js} +2 -2
  47. package/dist/web/client/_app/immutable/chunks/{DlENCZqZ.js.map → mQ6hkLuy.js.map} +1 -1
  48. package/dist/web/client/_app/immutable/entry/{app.BwTbN8wB.js → app.CTFza_OS.js} +3 -3
  49. package/{web/.svelte-kit/output/client/_app/immutable/entry/app.BwTbN8wB.js.map → dist/web/client/_app/immutable/entry/app.CTFza_OS.js.map} +1 -1
  50. package/dist/web/client/_app/immutable/entry/start.B-zlkyrt.js +2 -0
  51. package/dist/web/client/_app/immutable/entry/start.B-zlkyrt.js.map +1 -0
  52. package/{web/.svelte-kit/output/client/_app/immutable/nodes/0.BnHV-ElR.js → dist/web/client/_app/immutable/nodes/0.Cztuq8Ih.js} +2 -2
  53. package/dist/web/client/_app/immutable/nodes/{0.BnHV-ElR.js.map → 0.Cztuq8Ih.js.map} +1 -1
  54. package/dist/web/client/_app/immutable/nodes/{1.Dc3ryOCf.js → 1.BOOL0V7K.js} +2 -2
  55. package/dist/web/client/_app/immutable/nodes/{1.Dc3ryOCf.js.map → 1.BOOL0V7K.js.map} +1 -1
  56. package/dist/web/client/_app/immutable/nodes/{2.DUrpAceY.js → 2.CArUpZNe.js} +2 -2
  57. package/dist/web/client/_app/immutable/nodes/{2.DUrpAceY.js.map → 2.CArUpZNe.js.map} +1 -1
  58. package/dist/web/client/_app/immutable/nodes/{3.BaCofjAn.js → 3.DSvIWalA.js} +2 -2
  59. package/dist/web/client/_app/immutable/nodes/{3.BaCofjAn.js.map → 3.DSvIWalA.js.map} +1 -1
  60. package/dist/web/client/_app/immutable/nodes/{4.v1wYkrvS.js → 4.H6RMG_cy.js} +2 -2
  61. package/dist/web/client/_app/immutable/nodes/{4.v1wYkrvS.js.map → 4.H6RMG_cy.js.map} +1 -1
  62. package/dist/web/client/_app/immutable/nodes/{5.Bn4A77jK.js → 5.BHSt0Suo.js} +2 -2
  63. package/dist/web/client/_app/immutable/nodes/{5.Bn4A77jK.js.map → 5.BHSt0Suo.js.map} +1 -1
  64. package/dist/web/client/_app/immutable/nodes/{6.C2hEoITj.js → 6.CzLoA0w7.js} +2 -2
  65. package/dist/web/client/_app/immutable/nodes/{6.C2hEoITj.js.map → 6.CzLoA0w7.js.map} +1 -1
  66. package/dist/web/client/_app/immutable/nodes/{7.BcHOjWdp.js → 7.fqq2vVa9.js} +2 -2
  67. package/dist/web/client/_app/immutable/nodes/{7.BcHOjWdp.js.map → 7.fqq2vVa9.js.map} +1 -1
  68. package/dist/web/client/_app/immutable/nodes/{8.D7NtqIYy.js → 8.DNFFjTla.js} +2 -2
  69. package/dist/web/client/_app/immutable/nodes/{8.D7NtqIYy.js.map → 8.DNFFjTla.js.map} +1 -1
  70. package/dist/web/client/_app/immutable/nodes/{9.D-211z9-.js → 9.0kMPrp2-.js} +2 -2
  71. package/dist/web/client/_app/immutable/nodes/{9.D-211z9-.js.map → 9.0kMPrp2-.js.map} +1 -1
  72. package/dist/web/client/_app/version.json +1 -1
  73. package/dist/web/server/chunks/{0-CvglVGCY.js → 0-B_KxXX-N.js} +14 -14
  74. package/dist/web/server/chunks/{0-CvglVGCY.js.map → 0-B_KxXX-N.js.map} +1 -1
  75. package/dist/web/server/chunks/{1-D-gJDFrG.js → 1-BmEKuUDK.js} +4 -4
  76. package/dist/web/server/chunks/{1-D-gJDFrG.js.map → 1-BmEKuUDK.js.map} +1 -1
  77. package/dist/web/server/chunks/{2-BCmEU5Qq.js → 2-BJ3dzws2.js} +13 -13
  78. package/dist/web/server/chunks/{2-BCmEU5Qq.js.map → 2-BJ3dzws2.js.map} +1 -1
  79. package/dist/web/server/chunks/{3-CHn5Kw-T.js → 3-CLYKGzT3.js} +10 -10
  80. package/dist/web/server/chunks/{3-CHn5Kw-T.js.map → 3-CLYKGzT3.js.map} +1 -1
  81. package/dist/web/server/chunks/{4-Cxg7VcZ7.js → 4-CsoWHVgX.js} +12 -12
  82. package/dist/web/server/chunks/{4-Cxg7VcZ7.js.map → 4-CsoWHVgX.js.map} +1 -1
  83. package/dist/web/server/chunks/{5-DSgvnHF_.js → 5-oPM6ncgT.js} +9 -9
  84. package/dist/web/server/chunks/{5-DSgvnHF_.js.map → 5-oPM6ncgT.js.map} +1 -1
  85. package/dist/web/server/chunks/{6-B0rymWRR.js → 6-gvgju2ZN.js} +5 -5
  86. package/dist/web/server/chunks/{6-B0rymWRR.js.map → 6-gvgju2ZN.js.map} +1 -1
  87. package/dist/web/server/chunks/{7-CNomBJux.js → 7-D8hylKrz.js} +10 -10
  88. package/dist/web/server/chunks/{7-CNomBJux.js.map → 7-D8hylKrz.js.map} +1 -1
  89. package/dist/web/server/chunks/{8-TYbX-1bO.js → 8-Br4hTtby.js} +12 -12
  90. package/dist/web/server/chunks/{8-TYbX-1bO.js.map → 8-Br4hTtby.js.map} +1 -1
  91. package/dist/web/server/chunks/{9-XGQQvTLc.js → 9-9uvmfsEs.js} +9 -9
  92. package/dist/web/server/chunks/{9-XGQQvTLc.js.map → 9-9uvmfsEs.js.map} +1 -1
  93. package/dist/web/server/chunks/{_layout.svelte-yrPX5VFm.js → _layout.svelte-DamAAFpK.js} +58 -37
  94. package/dist/web/server/chunks/_layout.svelte-DamAAFpK.js.map +1 -0
  95. package/dist/web/server/chunks/{_page.svelte-C_kFA0Lq.js → _page.svelte-DFE4jmT9.js} +4 -4
  96. package/dist/web/server/chunks/{_page.svelte-C_kFA0Lq.js.map → _page.svelte-DFE4jmT9.js.map} +1 -1
  97. package/dist/web/server/chunks/{_page.svelte-DvxpwsgS.js → _page.svelte-DHPGbCS1.js} +6 -6
  98. package/dist/web/server/chunks/{_page.svelte-DvxpwsgS.js.map → _page.svelte-DHPGbCS1.js.map} +1 -1
  99. package/dist/web/server/chunks/{_server.ts-Dz01Gvhk.js → _server.ts-0RT4n9LX.js} +2 -2
  100. package/dist/web/server/chunks/{_server.ts-Dz01Gvhk.js.map → _server.ts-0RT4n9LX.js.map} +1 -1
  101. package/dist/web/server/chunks/{_server.ts-D2Tvcncu.js → _server.ts-3kbpguQ1.js} +3 -3
  102. package/dist/web/server/chunks/{_server.ts-D2Tvcncu.js.map → _server.ts-3kbpguQ1.js.map} +1 -1
  103. package/dist/web/server/chunks/{_server.ts-TN_Ka6cR.js → _server.ts-4m17ESHV.js} +2 -2
  104. package/dist/web/server/chunks/{_server.ts-TN_Ka6cR.js.map → _server.ts-4m17ESHV.js.map} +1 -1
  105. package/dist/web/server/chunks/{_server.ts-Bj1Eewby.js → _server.ts-8Bs2jUgD.js} +2 -2
  106. package/dist/web/server/chunks/{_server.ts-Bj1Eewby.js.map → _server.ts-8Bs2jUgD.js.map} +1 -1
  107. package/dist/web/server/chunks/{_server.ts-BWVtnpJh.js → _server.ts-95cbXKdT.js} +3 -3
  108. package/dist/web/server/chunks/{_server.ts-BWVtnpJh.js.map → _server.ts-95cbXKdT.js.map} +1 -1
  109. package/dist/web/server/chunks/{_server.ts-CyOA1rOq.js → _server.ts-B56-XF-Z.js} +3 -3
  110. package/dist/web/server/chunks/{_server.ts-CyOA1rOq.js.map → _server.ts-B56-XF-Z.js.map} +1 -1
  111. package/dist/web/server/chunks/{_server.ts-1ZhqL5o8.js → _server.ts-BAC_No-1.js} +2 -2
  112. package/dist/web/server/chunks/{_server.ts-1ZhqL5o8.js.map → _server.ts-BAC_No-1.js.map} +1 -1
  113. package/dist/web/server/chunks/{_server.ts-ji7L8HUR.js → _server.ts-BCpfYsYw.js} +3 -3
  114. package/dist/web/server/chunks/{_server.ts-ji7L8HUR.js.map → _server.ts-BCpfYsYw.js.map} +1 -1
  115. package/dist/web/server/chunks/{_server.ts-9iRpDv9e.js → _server.ts-BGToJuLp.js} +2 -2
  116. package/dist/web/server/chunks/{_server.ts-9iRpDv9e.js.map → _server.ts-BGToJuLp.js.map} +1 -1
  117. package/dist/web/server/chunks/{_server.ts-DQJ-tygD.js → _server.ts-BW87LYkE.js} +2 -2
  118. package/dist/web/server/chunks/{_server.ts-DQJ-tygD.js.map → _server.ts-BW87LYkE.js.map} +1 -1
  119. package/dist/web/server/chunks/{_server.ts-VgbTPrqV.js → _server.ts-BXjUy61V.js} +2 -2
  120. package/dist/web/server/chunks/{_server.ts-VgbTPrqV.js.map → _server.ts-BXjUy61V.js.map} +1 -1
  121. package/dist/web/server/chunks/{_server.ts-FoPsfjo3.js → _server.ts-BYyaN7ik.js} +2 -2
  122. package/dist/web/server/chunks/{_server.ts-FoPsfjo3.js.map → _server.ts-BYyaN7ik.js.map} +1 -1
  123. package/dist/web/server/chunks/{_server.ts-CNBy2p2U.js → _server.ts-Bjzi1JAu.js} +2 -2
  124. package/dist/web/server/chunks/{_server.ts-CNBy2p2U.js.map → _server.ts-Bjzi1JAu.js.map} +1 -1
  125. package/dist/web/server/chunks/{_server.ts-CSK1ReRS.js → _server.ts-CBU5vhD8.js} +2 -2
  126. package/dist/web/server/chunks/{_server.ts-CSK1ReRS.js.map → _server.ts-CBU5vhD8.js.map} +1 -1
  127. package/dist/web/server/chunks/{_server.ts-Cv8SUkC5.js → _server.ts-CG-7TORV.js} +3 -3
  128. package/dist/web/server/chunks/{_server.ts-Cv8SUkC5.js.map → _server.ts-CG-7TORV.js.map} +1 -1
  129. package/dist/web/server/chunks/{_server.ts-DPctaiWC.js → _server.ts-COCrEIiW.js} +2 -2
  130. package/dist/web/server/chunks/{_server.ts-DPctaiWC.js.map → _server.ts-COCrEIiW.js.map} +1 -1
  131. package/dist/web/server/chunks/{_server.ts-C7uhdF7Y.js → _server.ts-CPCsEz_B.js} +4 -4
  132. package/dist/web/server/chunks/{_server.ts-C7uhdF7Y.js.map → _server.ts-CPCsEz_B.js.map} +1 -1
  133. package/dist/web/server/chunks/{_server.ts-DsyqZudf.js → _server.ts-CPGa_LDW.js} +2 -2
  134. package/dist/web/server/chunks/{_server.ts-DsyqZudf.js.map → _server.ts-CPGa_LDW.js.map} +1 -1
  135. package/dist/web/server/chunks/{_server.ts-B9RfKfyc.js → _server.ts-CT1m86tm.js} +2 -2
  136. package/dist/web/server/chunks/{_server.ts-B9RfKfyc.js.map → _server.ts-CT1m86tm.js.map} +1 -1
  137. package/dist/web/server/chunks/{_server.ts-CwFbAWCg.js → _server.ts-CXzAFIps.js} +2 -2
  138. package/dist/web/server/chunks/{_server.ts-CwFbAWCg.js.map → _server.ts-CXzAFIps.js.map} +1 -1
  139. package/dist/web/server/chunks/{_server.ts-DHuyjZQx.js → _server.ts-C_H2gKKu.js} +2 -2
  140. package/dist/web/server/chunks/{_server.ts-DHuyjZQx.js.map → _server.ts-C_H2gKKu.js.map} +1 -1
  141. package/dist/web/server/chunks/{_server.ts-DVgdt6Zu.js → _server.ts-CjH9MxGk.js} +3 -3
  142. package/dist/web/server/chunks/{_server.ts-DVgdt6Zu.js.map → _server.ts-CjH9MxGk.js.map} +1 -1
  143. package/dist/web/server/chunks/{_server.ts-DrFiP32b.js → _server.ts-CrQk3PtI.js} +3 -3
  144. package/dist/web/server/chunks/{_server.ts-DrFiP32b.js.map → _server.ts-CrQk3PtI.js.map} +1 -1
  145. package/dist/web/server/chunks/{_server.ts-CA8nszPb.js → _server.ts-Cy5Matw4.js} +3 -3
  146. package/dist/web/server/chunks/{_server.ts-CA8nszPb.js.map → _server.ts-Cy5Matw4.js.map} +1 -1
  147. package/dist/web/server/chunks/{_server.ts-CovkmnvY.js → _server.ts-D9PPu5p4.js} +3 -3
  148. package/dist/web/server/chunks/{_server.ts-CovkmnvY.js.map → _server.ts-D9PPu5p4.js.map} +1 -1
  149. package/dist/web/server/chunks/{_server.ts-vhti5VvF.js → _server.ts-DGvNQ4Mq.js} +3 -3
  150. package/dist/web/server/chunks/{_server.ts-vhti5VvF.js.map → _server.ts-DGvNQ4Mq.js.map} +1 -1
  151. package/dist/web/server/chunks/{_server.ts-iK8ih9Bi.js → _server.ts-DJOSnwXV.js} +2 -2
  152. package/dist/web/server/chunks/{_server.ts-iK8ih9Bi.js.map → _server.ts-DJOSnwXV.js.map} +1 -1
  153. package/dist/web/server/chunks/{_server.ts-DK-6ddNq.js → _server.ts-DPoluZc6.js} +3 -3
  154. package/dist/web/server/chunks/{_server.ts-DK-6ddNq.js.map → _server.ts-DPoluZc6.js.map} +1 -1
  155. package/dist/web/server/chunks/{_server.ts-BozsVs8t.js → _server.ts-DS6kibxL.js} +2 -2
  156. package/dist/web/server/chunks/{_server.ts-BozsVs8t.js.map → _server.ts-DS6kibxL.js.map} +1 -1
  157. package/dist/web/server/chunks/{_server.ts-DozhhYwq.js → _server.ts-DUl0ucUP.js} +3 -3
  158. package/dist/web/server/chunks/{_server.ts-DozhhYwq.js.map → _server.ts-DUl0ucUP.js.map} +1 -1
  159. package/dist/web/server/chunks/{_server.ts-78nODRDJ.js → _server.ts-DWj22oj9.js} +2 -2
  160. package/dist/web/server/chunks/{_server.ts-78nODRDJ.js.map → _server.ts-DWj22oj9.js.map} +1 -1
  161. package/dist/web/server/chunks/{_server.ts-CA1j9wWk.js → _server.ts-DZrVaelC.js} +2 -2
  162. package/dist/web/server/chunks/{_server.ts-CA1j9wWk.js.map → _server.ts-DZrVaelC.js.map} +1 -1
  163. package/dist/web/server/chunks/{_server.ts-CzcknkWq.js → _server.ts-DrG3j6Ao.js} +2 -2
  164. package/dist/web/server/chunks/{_server.ts-CzcknkWq.js.map → _server.ts-DrG3j6Ao.js.map} +1 -1
  165. package/dist/web/server/chunks/{_server.ts-AAllMdwT.js → _server.ts-Dwy38J9J.js} +2 -2
  166. package/dist/web/server/chunks/{_server.ts-AAllMdwT.js.map → _server.ts-Dwy38J9J.js.map} +1 -1
  167. package/dist/web/server/chunks/{_server.ts-CgChlIKq.js → _server.ts-DxGjRezI.js} +2 -2
  168. package/dist/web/server/chunks/{_server.ts-CgChlIKq.js.map → _server.ts-DxGjRezI.js.map} +1 -1
  169. package/dist/web/server/chunks/{_server.ts-KbQyErIR.js → _server.ts-XMUjHO61.js} +2 -2
  170. package/dist/web/server/chunks/{_server.ts-KbQyErIR.js.map → _server.ts-XMUjHO61.js.map} +1 -1
  171. package/dist/web/server/chunks/{_server.ts-DGTSZoLn.js → _server.ts-dvT2bXEB.js} +2 -2
  172. package/dist/web/server/chunks/{_server.ts-DGTSZoLn.js.map → _server.ts-dvT2bXEB.js.map} +1 -1
  173. package/dist/web/server/chunks/{_server.ts-BxscGs8D.js → _server.ts-m835uDm6.js} +2 -2
  174. package/dist/web/server/chunks/{_server.ts-BxscGs8D.js.map → _server.ts-m835uDm6.js.map} +1 -1
  175. package/dist/web/server/chunks/{checkbox-DiJTAtHi.js → checkbox-BYzlWW56.js} +2 -2
  176. package/dist/web/server/chunks/{checkbox-DiJTAtHi.js.map → checkbox-BYzlWW56.js.map} +1 -1
  177. package/dist/web/server/chunks/{create-id-DpoSQWrl.js → create-id-s6T_m-1j.js} +3 -3
  178. package/dist/web/server/chunks/{create-id-DpoSQWrl.js.map → create-id-s6T_m-1j.js.map} +1 -1
  179. package/dist/web/server/chunks/{discover-DjR28OqK.js → discover-DykzHz0t.js} +2 -2
  180. package/dist/web/server/chunks/{discover-DjR28OqK.js.map → discover-DykzHz0t.js.map} +1 -1
  181. package/dist/web/server/chunks/{drafts.svelte-DsFAtH-s.js → drafts.svelte-c94J-DBB.js} +3 -3
  182. package/dist/web/server/chunks/{drafts.svelte-DsFAtH-s.js.map → drafts.svelte-c94J-DBB.js.map} +1 -1
  183. package/dist/web/server/chunks/{end-session-BbBa9yD0.js → end-session-Czy_WW42.js} +2 -2
  184. package/dist/web/server/chunks/{end-session-BbBa9yD0.js.map → end-session-Czy_WW42.js.map} +1 -1
  185. package/dist/web/server/chunks/{files-4i3igWea.js → files-DNH191y7.js} +2 -2
  186. package/dist/web/server/chunks/{files-4i3igWea.js.map → files-DNH191y7.js.map} +1 -1
  187. package/dist/web/server/chunks/{fleet-DZJSFWuH.js → fleet-CWHlZjSd.js} +4 -4
  188. package/dist/web/server/chunks/{fleet-DZJSFWuH.js.map → fleet-CWHlZjSd.js.map} +1 -1
  189. package/dist/web/server/chunks/{git-D9dLEKUF.js → git-CHO9UIOQ.js} +13 -5
  190. package/dist/web/server/chunks/git-CHO9UIOQ.js.map +1 -0
  191. package/dist/web/server/chunks/{git-history-De9t0yF-.js → git-history-CxyH4jQb.js} +2 -2
  192. package/dist/web/server/chunks/{git-history-De9t0yF-.js.map → git-history-CxyH4jQb.js.map} +1 -1
  193. package/dist/web/server/chunks/{hooks.server-C3Uglne7.js → hooks.server-DgHxEf6H.js} +6 -6
  194. package/dist/web/server/chunks/{hooks.server-C3Uglne7.js.map → hooks.server-DgHxEf6H.js.map} +1 -1
  195. package/dist/web/server/chunks/{message-queue-sFcJCRjz.js → message-queue-DhLshpoF.js} +13 -2
  196. package/dist/web/server/chunks/message-queue-DhLshpoF.js.map +1 -0
  197. package/dist/web/server/chunks/{project-CbPa8Mu7.js → project-CBPdIh2n.js} +2 -2
  198. package/dist/web/server/chunks/{project-CbPa8Mu7.js.map → project-CBPdIh2n.js.map} +1 -1
  199. package/dist/web/server/chunks/{project-icons-CSb1bfT9.js → project-icons-bWhaFSVy.js} +4 -4
  200. package/dist/web/server/chunks/{project-icons-CSb1bfT9.js.map → project-icons-bWhaFSVy.js.map} +1 -1
  201. package/dist/web/server/chunks/{push-BJ7P9DGd.js → push-LMlCp4Lc.js} +5 -5
  202. package/dist/web/server/chunks/{push-BJ7P9DGd.js.map → push-LMlCp4Lc.js.map} +1 -1
  203. package/dist/web/server/chunks/{remote-control-C1d9R3w4.js → remote-control-BvYkVDhx.js} +2 -2
  204. package/dist/web/server/chunks/{remote-control-C1d9R3w4.js.map → remote-control-BvYkVDhx.js.map} +1 -1
  205. package/dist/web/server/chunks/{start-session-CKbupnLS.js → start-session-HljgutDe.js} +3 -3
  206. package/dist/web/server/chunks/{start-session-CKbupnLS.js.map → start-session-HljgutDe.js.map} +1 -1
  207. package/dist/web/server/chunks/{version-BqEJmw2g.js → version-ox9yLZ0P.js} +2 -2
  208. package/dist/web/server/chunks/version-ox9yLZ0P.js.map +1 -0
  209. package/dist/web/server/chunks/{web-preview-Bi5fjydK.js → web-preview-H5eiWlBD.js} +2 -2
  210. package/dist/web/server/chunks/{web-preview-Bi5fjydK.js.map → web-preview-H5eiWlBD.js.map} +1 -1
  211. package/dist/web/server/chunks/{ws-handlers-zemeJ8Si.js → ws-handlers-k_sOue-0.js} +6 -5
  212. package/dist/web/server/chunks/ws-handlers-k_sOue-0.js.map +1 -0
  213. package/dist/web/server/chunks/{ws-managers-C5VXKb_r.js → ws-managers-D2qC6Gla.js} +2 -2
  214. package/dist/web/server/chunks/{ws-managers-C5VXKb_r.js.map → ws-managers-D2qC6Gla.js.map} +1 -1
  215. package/dist/web/server/chunks/{ws-messages-jOSwT1Yq.js → ws-messages-B81v2RXg.js} +7 -2
  216. package/dist/web/server/chunks/ws-messages-B81v2RXg.js.map +1 -0
  217. package/dist/web/server/index.js +2 -2
  218. package/dist/web/server/index.js.map +1 -1
  219. package/dist/web/server/manifest.js +53 -53
  220. package/dist/web/server/manifest.js.map +1 -1
  221. package/package.json +1 -1
  222. package/src/fleet-places.ts +17 -1
  223. package/src/server/dictation-marks.ts +24 -1
  224. package/src/transcript/parser.ts +20 -3
  225. package/src/transcript/past-sessions.ts +3 -1
  226. package/src/utils/version.ts +1 -1
  227. package/tests/fleet-places.test.ts +20 -0
  228. package/tests/server/dictation-marks.test.ts +16 -0
  229. package/tests/transcript/parser.test.ts +34 -0
  230. package/tests/transcript/past-sessions.test.ts +5 -0
  231. package/web/.svelte-kit/adapter-bun/chunks/git.js +13 -4
  232. package/web/.svelte-kit/adapter-bun/chunks/git.js.map +1 -1
  233. package/web/.svelte-kit/adapter-bun/chunks/internal2.js +1 -1
  234. package/web/.svelte-kit/adapter-bun/chunks/internal2.js.map +1 -1
  235. package/web/.svelte-kit/adapter-bun/chunks/message-queue.js +14 -1
  236. package/web/.svelte-kit/adapter-bun/chunks/message-queue.js.map +1 -1
  237. package/web/.svelte-kit/adapter-bun/chunks/version.js +1 -1
  238. package/web/.svelte-kit/adapter-bun/chunks/version.js.map +1 -1
  239. package/web/.svelte-kit/adapter-bun/chunks/ws-handlers.js +2 -1
  240. package/web/.svelte-kit/adapter-bun/chunks/ws-handlers.js.map +1 -1
  241. package/web/.svelte-kit/adapter-bun/chunks/ws-messages.js +6 -1
  242. package/web/.svelte-kit/adapter-bun/chunks/ws-messages.js.map +1 -1
  243. package/web/.svelte-kit/adapter-bun/entries/pages/_layout.svelte.js +72 -45
  244. package/web/.svelte-kit/adapter-bun/entries/pages/_layout.svelte.js.map +1 -1
  245. package/web/.svelte-kit/adapter-bun/manifest-full.js +1 -1
  246. package/web/.svelte-kit/adapter-bun/manifest.js +1 -1
  247. package/web/.svelte-kit/adapter-bun/nodes/0.js +1 -1
  248. package/web/.svelte-kit/adapter-bun/nodes/1.js +1 -1
  249. package/web/.svelte-kit/adapter-bun/nodes/2.js +1 -1
  250. package/web/.svelte-kit/adapter-bun/nodes/3.js +1 -1
  251. package/web/.svelte-kit/adapter-bun/nodes/4.js +1 -1
  252. package/web/.svelte-kit/adapter-bun/nodes/5.js +1 -1
  253. package/web/.svelte-kit/adapter-bun/nodes/6.js +1 -1
  254. package/web/.svelte-kit/adapter-bun/nodes/7.js +1 -1
  255. package/web/.svelte-kit/adapter-bun/nodes/8.js +1 -1
  256. package/web/.svelte-kit/adapter-bun/nodes/9.js +1 -1
  257. package/web/.svelte-kit/generated/server/internal.js +1 -1
  258. package/web/.svelte-kit/output/client/.vite/manifest.json +237 -237
  259. package/web/.svelte-kit/output/client/_app/immutable/chunks/{sULMfRFG.js → B4FaHfAQ.js} +2 -2
  260. package/web/.svelte-kit/output/client/_app/immutable/chunks/{sULMfRFG.js.map → B4FaHfAQ.js.map} +1 -1
  261. package/web/.svelte-kit/output/client/_app/immutable/chunks/{W5_HMZ5E.js → B5Hkb2u5.js} +2 -2
  262. package/web/.svelte-kit/output/client/_app/immutable/chunks/{W5_HMZ5E.js.map → B5Hkb2u5.js.map} +1 -1
  263. package/{dist/web/client/_app/immutable/chunks/BQzv8cqz.js → web/.svelte-kit/output/client/_app/immutable/chunks/BOpEbBRb.js} +2 -2
  264. package/{dist/web/client/_app/immutable/chunks/BQzv8cqz.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/BOpEbBRb.js.map} +1 -1
  265. package/web/.svelte-kit/output/client/_app/immutable/chunks/{Q5yhzux8.js → BeYjnogg.js} +2 -2
  266. package/{dist/web/client/_app/immutable/chunks/Q5yhzux8.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/BeYjnogg.js.map} +1 -1
  267. package/web/.svelte-kit/output/client/_app/immutable/chunks/{VceCNUd7.js → C00rm3mY.js} +2 -2
  268. package/{dist/web/client/_app/immutable/chunks/VceCNUd7.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/C00rm3mY.js.map} +1 -1
  269. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CtjkAirr.js → CKg7gbPm.js} +9 -9
  270. package/web/.svelte-kit/output/client/_app/immutable/chunks/CKg7gbPm.js.map +1 -0
  271. package/web/.svelte-kit/output/client/_app/immutable/chunks/CPEphjdk.js +4 -0
  272. package/web/.svelte-kit/output/client/_app/immutable/chunks/CPEphjdk.js.map +1 -0
  273. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BQQ3-rqs.js → CPlFo88J.js} +2 -2
  274. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BQQ3-rqs.js.map → CPlFo88J.js.map} +1 -1
  275. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BvX4FYxp.js → CtnjySwS.js} +2 -2
  276. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BvX4FYxp.js.map → CtnjySwS.js.map} +1 -1
  277. package/web/.svelte-kit/output/client/_app/immutable/chunks/{XgSsj0QY.js → D3EW0jRH.js} +2 -2
  278. package/{dist/web/client/_app/immutable/chunks/XgSsj0QY.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/D3EW0jRH.js.map} +1 -1
  279. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CtlIfY1C.js → D3umr-Qr.js} +2 -2
  280. package/{dist/web/client/_app/immutable/chunks/CtlIfY1C.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/D3umr-Qr.js.map} +1 -1
  281. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CM0CI9GL.js → D8-_Y-M6.js} +3 -3
  282. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CM0CI9GL.js.map → D8-_Y-M6.js.map} +1 -1
  283. package/web/.svelte-kit/output/client/_app/immutable/chunks/{cvsGFvDx.js → DDvK7Qo9.js} +2 -2
  284. package/{dist/web/client/_app/immutable/chunks/cvsGFvDx.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/DDvK7Qo9.js.map} +1 -1
  285. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CiU8KBun.js → _VFi-7U7.js} +2 -2
  286. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CiU8KBun.js.map → _VFi-7U7.js.map} +1 -1
  287. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DlENCZqZ.js → mQ6hkLuy.js} +2 -2
  288. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DlENCZqZ.js.map → mQ6hkLuy.js.map} +1 -1
  289. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.BwTbN8wB.js → app.CTFza_OS.js} +3 -3
  290. package/{dist/web/client/_app/immutable/entry/app.BwTbN8wB.js.map → web/.svelte-kit/output/client/_app/immutable/entry/app.CTFza_OS.js.map} +1 -1
  291. package/web/.svelte-kit/output/client/_app/immutable/entry/start.B-zlkyrt.js +2 -0
  292. package/web/.svelte-kit/output/client/_app/immutable/entry/start.B-zlkyrt.js.map +1 -0
  293. package/{dist/web/client/_app/immutable/nodes/0.BnHV-ElR.js → web/.svelte-kit/output/client/_app/immutable/nodes/0.Cztuq8Ih.js} +2 -2
  294. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.BnHV-ElR.js.map → 0.Cztuq8Ih.js.map} +1 -1
  295. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.Dc3ryOCf.js → 1.BOOL0V7K.js} +2 -2
  296. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.Dc3ryOCf.js.map → 1.BOOL0V7K.js.map} +1 -1
  297. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.DUrpAceY.js → 2.CArUpZNe.js} +2 -2
  298. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.DUrpAceY.js.map → 2.CArUpZNe.js.map} +1 -1
  299. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.BaCofjAn.js → 3.DSvIWalA.js} +2 -2
  300. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.BaCofjAn.js.map → 3.DSvIWalA.js.map} +1 -1
  301. package/web/.svelte-kit/output/client/_app/immutable/nodes/4.H6RMG_cy.js +2 -0
  302. package/web/.svelte-kit/output/client/_app/immutable/nodes/{4.v1wYkrvS.js.map → 4.H6RMG_cy.js.map} +1 -1
  303. package/web/.svelte-kit/output/client/_app/immutable/nodes/5.BHSt0Suo.js +2 -0
  304. package/web/.svelte-kit/output/client/_app/immutable/nodes/{5.Bn4A77jK.js.map → 5.BHSt0Suo.js.map} +1 -1
  305. package/web/.svelte-kit/output/client/_app/immutable/nodes/{6.C2hEoITj.js → 6.CzLoA0w7.js} +2 -2
  306. package/web/.svelte-kit/output/client/_app/immutable/nodes/{6.C2hEoITj.js.map → 6.CzLoA0w7.js.map} +1 -1
  307. package/web/.svelte-kit/output/client/_app/immutable/nodes/{7.BcHOjWdp.js → 7.fqq2vVa9.js} +2 -2
  308. package/web/.svelte-kit/output/client/_app/immutable/nodes/{7.BcHOjWdp.js.map → 7.fqq2vVa9.js.map} +1 -1
  309. package/web/.svelte-kit/output/client/_app/immutable/nodes/8.DNFFjTla.js +2 -0
  310. package/web/.svelte-kit/output/client/_app/immutable/nodes/{8.D7NtqIYy.js.map → 8.DNFFjTla.js.map} +1 -1
  311. package/web/.svelte-kit/output/client/_app/immutable/nodes/9.0kMPrp2-.js +2 -0
  312. package/web/.svelte-kit/output/client/_app/immutable/nodes/{9.D-211z9-.js.map → 9.0kMPrp2-.js.map} +1 -1
  313. package/web/.svelte-kit/output/client/_app/version.json +1 -1
  314. package/web/.svelte-kit/output/server/chunks/git.js +13 -4
  315. package/web/.svelte-kit/output/server/chunks/git.js.map +1 -1
  316. package/web/.svelte-kit/output/server/chunks/internal2.js +1 -1
  317. package/web/.svelte-kit/output/server/chunks/internal2.js.map +1 -1
  318. package/web/.svelte-kit/output/server/chunks/message-queue.js +14 -1
  319. package/web/.svelte-kit/output/server/chunks/message-queue.js.map +1 -1
  320. package/web/.svelte-kit/output/server/chunks/version.js +1 -1
  321. package/web/.svelte-kit/output/server/chunks/version.js.map +1 -1
  322. package/web/.svelte-kit/output/server/chunks/ws-handlers.js +2 -1
  323. package/web/.svelte-kit/output/server/chunks/ws-handlers.js.map +1 -1
  324. package/web/.svelte-kit/output/server/chunks/ws-messages.js +6 -1
  325. package/web/.svelte-kit/output/server/chunks/ws-messages.js.map +1 -1
  326. package/web/.svelte-kit/output/server/entries/pages/_layout.svelte.js +72 -45
  327. package/web/.svelte-kit/output/server/entries/pages/_layout.svelte.js.map +1 -1
  328. package/web/.svelte-kit/output/server/manifest-full.js +1 -1
  329. package/web/.svelte-kit/output/server/manifest.js +1 -1
  330. package/web/.svelte-kit/output/server/nodes/0.js +1 -1
  331. package/web/.svelte-kit/output/server/nodes/1.js +1 -1
  332. package/web/.svelte-kit/output/server/nodes/2.js +1 -1
  333. package/web/.svelte-kit/output/server/nodes/3.js +1 -1
  334. package/web/.svelte-kit/output/server/nodes/4.js +1 -1
  335. package/web/.svelte-kit/output/server/nodes/5.js +1 -1
  336. package/web/.svelte-kit/output/server/nodes/6.js +1 -1
  337. package/web/.svelte-kit/output/server/nodes/7.js +1 -1
  338. package/web/.svelte-kit/output/server/nodes/8.js +1 -1
  339. package/web/.svelte-kit/output/server/nodes/9.js +1 -1
  340. package/web/src/lib/components/AllSessionsPanel.svelte +9 -1
  341. package/web/src/lib/components/FolderPicker.svelte +49 -21
  342. package/dist/web/client/_app/immutable/chunks/CtjkAirr.js.map +0 -1
  343. package/dist/web/client/_app/immutable/chunks/Dck--FBb.js +0 -4
  344. package/dist/web/client/_app/immutable/chunks/Dck--FBb.js.map +0 -1
  345. package/dist/web/client/_app/immutable/entry/start.B2ZPizAt.js +0 -2
  346. package/dist/web/client/_app/immutable/entry/start.B2ZPizAt.js.map +0 -1
  347. package/dist/web/server/chunks/_layout.svelte-yrPX5VFm.js.map +0 -1
  348. package/dist/web/server/chunks/git-D9dLEKUF.js.map +0 -1
  349. package/dist/web/server/chunks/message-queue-sFcJCRjz.js.map +0 -1
  350. package/dist/web/server/chunks/version-BqEJmw2g.js.map +0 -1
  351. package/dist/web/server/chunks/ws-handlers-zemeJ8Si.js.map +0 -1
  352. package/dist/web/server/chunks/ws-messages-jOSwT1Yq.js.map +0 -1
  353. package/web/.svelte-kit/output/client/_app/immutable/chunks/CtjkAirr.js.map +0 -1
  354. package/web/.svelte-kit/output/client/_app/immutable/chunks/Dck--FBb.js +0 -4
  355. package/web/.svelte-kit/output/client/_app/immutable/chunks/Dck--FBb.js.map +0 -1
  356. package/web/.svelte-kit/output/client/_app/immutable/entry/start.B2ZPizAt.js +0 -2
  357. package/web/.svelte-kit/output/client/_app/immutable/entry/start.B2ZPizAt.js.map +0 -1
  358. package/web/.svelte-kit/output/client/_app/immutable/nodes/4.v1wYkrvS.js +0 -2
  359. package/web/.svelte-kit/output/client/_app/immutable/nodes/5.Bn4A77jK.js +0 -2
  360. package/web/.svelte-kit/output/client/_app/immutable/nodes/8.D7NtqIYy.js +0 -2
  361. package/web/.svelte-kit/output/client/_app/immutable/nodes/9.D-211z9-.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"mappings":";ijDAgBA,MAAMA,GAAYC,GAA6B,yBAA0B,CACxE,gBAAiB,GACjB,UAAW,G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,IAAMA,EAAGH,EAAAC,EAAA,SAAa,IAAI,EAAMO,EAASC,GAAAR,EAAAS,EAAA,wCAGzCkrC,+CAA0EprC,EAAS,KAAtD,KAAQ,iBAAR,IAAQqR,EAAA,uBAF9B,yECJR,UAGC,IAAM1R,EAAGH,EAAAC,EAAA,SAAa,IAAI,EAAMO,EAASC,GAAAR,EAAAS,EAAA,wCAGzCmrC,+CAA0ErrC,EAAS,KAAtD,KAAQ,iBAAR,IAAQqR,EAAA,uBAF9B,gFCJR,UAGC,IACC1R,EAAGH,EAAAC,EAAA,SAAa,IAAI,EACpBjE,gBAAiB,EAAK,EACnBwE,EAAAC,GAAAR,EAAAS,EAAA,wCAIJorC,uCAAyEtrC,EAAS,KAAxD,KAAQ,iBAAR,IAAQqR,EAAA,OAAC,UAAS,aAAT,SAASA,EAAA,uBAFrC,CCGR,SAASk6B,GAAU92B,EAAkB8kB,EAA2B,CAC/D,GAAI9kB,EAAE,SAAW8kB,EAAE,OAAQ,MAAO,GAClC,QAASxiB,EAAI,EAAGA,EAAItC,EAAE,OAAQsC,IAAK,CAClC,MAAMxO,EAAIkM,EAAEsC,CAAC,EACPvO,EAAI+wB,EAAExiB,CAAC,EACb,GACCxO,EAAE,QAAUC,EAAE,OACdD,EAAE,OAASC,EAAE,MACbD,EAAE,SAAWC,EAAE,QACfD,EAAE,UAAYC,EAAE,SAChBD,EAAE,WAAaC,EAAE,SAEjB,MAAO,EAET,CACA,MAAO,EACR,CAEA,MAAMgjC,EAAoB,IACA9zC,KAAO,EAAE,OAAlC,wCAAAE,EAAA,iBAEA,IAAI6zC,EAA8B,CAC7BF,GAAU,KAAK,QAASE,CAAO,IACnC,KAAK,QAAUA,EAChB,CAEA,OAAc,CACT,KAAK,QAAQ,SAAW,IAC5B,KAAK,QAAU,GAChB,CACD,CAEO,MAAMC,GAAsB,IAAIF","names":["persisted","createPersisted","PreferencesStore","#prefs","$.state","$.proxy","value","key","preferences","box","initialValue","current","BoxSymbol","isWritableSymbol","$.get","v","$.set","boxFrom","boxWith","boxFlatten","toReadonlyBox","isBox","isWritableBox","getElemDirection","elem","getNextKey","dir","orientation","kbd.ARROW_LEFT","kbd.ARROW_RIGHT","kbd.ARROW_DOWN","getPrevKey","kbd.ARROW_UP","getDirectionalKeys","RovingFocusGroup","#opts","#currentTabStopId","opts","candidates","#ownCandidates","rootNode","rootAttr","rootSelector","node","items","e","both","currentIndex","nextKey","prevKey","loop","keyToIndex","kbd.HOME","kbd.END","altNextKey","altPrevKey","itemIndex","itemToFocus","anyActive","id","currentTabStopId","currentTabStop","isHTMLElement","blockedAnimationStyle","MountAnimationGuard","#prevented","open","watch","measureWithoutAnimation","animationName","transitionDuration","rect","CustomEventDispatcher","eventName","options","detail","element","event","callback","handler","on","getNextMatch","values","search","currentMatch","lowerSearch","searchWithoutSpace","currentMatchLowercase","spacedMatches","currentMatchIndex","wrapArray","match","normalizedSearch","char","normalizedLowerSearch","wrappedValues","nextMatch","array","startIndex","_","index","collapsibleAttrs","createBitsAttrs","CollapsibleRootContext","Context","CollapsibleRootState","attachRef","PresenceManager","#props","$.derived","getDataOpenClosed","boolToEmptyStrOrUndef","CollapsibleContentState","#present","#mountAnimationGuard","#width","#height","root","hiddenUntilFound","active","afterTick","#snippetProps","getDataTransitionAttrs","CollapsibleTriggerState","#isDisabled","kbd.SPACE","kbd.ENTER","boolToStr","uid","$.props_id","$.prop","$$props","createId","ref","disabled","onOpenChange","noop","onOpenChangeComplete","restProps","$.rest_props","rest_excludes","rootState","mergedProps","mergeProps","div","$.attribute_effect","forceMount","contentState","triggerState","button","defaultOptions","boxAutoReset","defaultValue","afterMs","onChange","getWindow","timeout","resetAfter","$.user_effect","DOMTypeahead","#search","#onMatch","#getCurrentItem","currentItem","item","newItem","tooltip","FloatingAnchorState","untrack","SELECTION_KEYS","FIRST_KEYS","kbd.PAGE_UP","LAST_KEYS","kbd.PAGE_DOWN","FIRST_LAST_KEYS","isMouseEvent","focus","select","doc","getDocument","previouslyFocusedElement","isSelectableInput","focusFirst","getActiveElement","candidate","isUsingKeyboard","IsUsingKeyboard","$.effect_root","callbacksToDispose","handlePointer","handleKeydown","executeCallbacks","getTabbableOptions","getTabbableFrom","currentNode","direction","isTabbable","getTabbableFromFocusable","allTabbable","tabbable","activeIndex","isFocusable","allFocusable","focusable","MenuRootContext","MenuMenuContext","MenuContentContext","MenuOpenEvent","menuAttrs","MenuSubmenuIntent","#cleanupDocMove","#fallbackTimer","#active","#target","#apex","#pointerPoint","#launchPoint","triggerNode","contentNode","enabled","#reset","onTriggerMove","#preview","onTriggerLeave","#engage","onContentMove","onContentLeave","isElement","selector","matchedSubContent","onTriggerEnter","#disengage","onContentEnter","onDestroyEffect","#parentTargetRect","parent","#computePolygons","pointerPt","target","triggerRect","contentRect","side","getSide","apex","targetRect","sourceRect","getCorridorPolygon","getIntentPolygon","#isInSafeZone","pt","corridor","intent","isPointInPolygon","related","geo","isInsideRect","#clearVisuals","#attachDocMove","#startFallback","#disengageTimer","wasReturning","#detachDocMove","#clearFallback","#clearDisengageTimer","#intentExit","pointerPoint","#isPointerInDescendantSubContent","el","subContent","#onDocMove","isInsideInsetRect","point","polygon","x","y","inside","j","xi","yi","xj","yj","inset","triggerCenterX","triggerCenterY","contentCenterX","contentCenterY","deltaX","deltaY","exitPoint","effectiveSide","flipSide","top","bottom","left","right","MenuRootState","part","MenuMenuState","#contentId","parentMenu","MenuContentState","#timer","#handleTypeaheadSearch","#isSub","DOMContext","#dispatchPointerMoveToHoveredSubTrigger","#getCandidateNodes","#isPointerMovingToSubmenu","parentContentNode","hoveredNode","hoveredSubTrigger","rootMenu","nodeToFocus","kbd.TAB","currentTarget","isKeydownInside","isModifierKey","isCharacterKey","candidateNodes","isElementOrSVGElement","triggerId","MenuItemSharedState","#isFocused","content","MenuItemState","#handleSelect","selectEvent","isTypingAhead","press","MenuSeparatorState","ContextMenuTriggerState","#point","simpleBox","#longPressTimer","isDisabled","#clearLongPressTimer","#handleOpen","CONTEXT_MENU_TRIGGER_ATTR","FloatingLayer","$$anchor","onSelect","closeOnSelect","itemState","useId","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","preventScroll","sideOffset","align","onEscapeKeydown","trapFocus","isValidEvent","handleInteractOutside","handleEscapeKeydown","subContentSelector","PopperLayerForceMount","$.spread_props","$$arg0","props","wrapperProps","finalProps","getFloatingContentCSSVars","$0","div_1","node_3","$.child","$.reset","PopperLayer","div_2","div_3","node_6","$.append","$$render","consequent_1","consequent_3","FloatingLayer_Anchor","separatorState","type","openOnHover","openDelay","closeDelay","PopoverTriggerState","FloatingLayerAnchor","DialogRootState","closeState","DialogCloseState","preventOverflowTextSelection","restoreScrollDelay","DialogContentState","FocusScope","focusScopeProps","EscapeLayer","DismissibleLayer","TextSelectionLayer","ScrollLock","consequent","node_4","$.sibling","consequent_2","toggleAttrs","ToggleRootState","getToggleDataState","boolToTrueOrUndef","condition","pressed","onPressedChange","toggleState","$.snippet","node_2","$.noop","ContextMenuPrimitive_Portal","ContextMenuPortal","cn","ContextMenuPrimitive_Content","$$value","variant","ContextMenuPrimitive_Item","ContextMenuPrimitive_Separator","ContextMenuPrimitive_Trigger","ContextMenuPrimitive_Root","span","span_1","text","$.only_child","span_2","text_1","$.set_attribute","$.set_text","info","error","loading","seq","load","mine","res","sessionApiAt","body","err","sessionId","cwd","urls","root_9","p","p_1","root_1","dl","root_8","dt","dd","dd_1","node_1","$.template_effect","text_3","root_2","root_3","alternate","dd_2","ul","root_5","name","url","$$item","$$array","li","root_4","text_4","a","span_3","root_6","text_6","pre","$.first_child","fragment_1","consequent_4","consequent_5","alternate_1","text_2","alternate_2","toggleVariants","tv","size","TogglePrimitive_Root","LOADERS","__vitePreload","core","m","highlightLines","lines","language","hljs","line","STEP","reading","opened","canOpen","base","diffRows","rows","out","gaps","r","row","count","n","i","gap","end","read","was","SIGN","PAINT_LIMIT","painted","languageFor","stale","html","$.index","some","iconify_icon","button_1","$.delegated","button_2","iconify_icon_1","$.set_custom_element_data","$.set_class","text_5","text_7","span_4","node_5","text_8","consequent_6","alternate_3","inRepo","gitMissing","wanted","source","listing","listError","loadingList","listStamp","listSeq","again","loadList","src","$.update","next","pulse","turns","turn","t","files","totals","sumCounts","chips","showGenerated","split","generated","kept","f","isGenerated","displayPath","shown","selected","pick","file","setSource","setTurn","NO_PROMPT","revealTurn","diff","diffError","diffSeq","diffText","loadDiff","turnId","q","diffKey","workingText","shownDiff","shownError","hunkCount","onKey","at","root_21","bind_set","Toggle","bind_set_1","bind_get_2","bind_set_2","$.each","bind_get_3","text_9","span_5","text_10","node_9","div_4","span_6","text_11","node_10","Button","p_2","root_10","text_14","div_5","root_20","nav","node_12","letter","statusLetter","root_13","span_7","text_15","span_8","bdi","node_13","span_9","root_11","span_10","text_17","consequent_11","span_11","text_18","consequent_12","consequent_10","classes_1","consequent_13","section","div_6","fragment_8","span_12","text_20","node_18","span_13","root_14","text_21","consequent_14","root_15","consequent_15","node_20","p_3","text_22","p_4","root_16","DiffLines","p_5","root_17","consequent_16","consequent_19","p_6","root_19","consequent_20","consequent_7","consequent_9","consequent_8","classes","PopoverPrimitive_Trigger","GRAMMARS","THEME","HIGHLIGHT_LIMIT_CHARS","highlighter","createHighlighterCore","createJavaScriptRegexEngine","theme","highlightFile","shiki","FilesPaneStore","#state","patch","filesPaneStore","isBrowser","toastsCounter","getToastId","data","ToastState","#pendingRemovals","#findToastIdx","idx","toast","#findHeightIdx","toastId","height","message","toastIdx","toastToUpdate","delay","rest","dismissible","alreadyExists","promise","shouldDismiss","response","constructPromiseErrorMessage","component","heightIdx","order","toastOrder","insertIdx","toastState","toastFunction","SonnerState","#activeToasts","basicToast","copyWithToast","done","tree","depth","d","dirs","styles","$.set_style","entry","fragment_4","iconify_icon_2","styles_3","onRowDrag","setExpanded","root_7","iconify_icon_3","node_7","iconify_icon_4","classes_2","openPath","styles_4","openFile","crumb","label","crumbFor","browse","Popover_Root","Popover_Trigger","Popover_Content","listingOf","browsing","root_12","node_11","iconify_icon_5","baseName","parentOf","rootName","button_3","iconify_icon_6","node_14","iconify_icon_7","api","prefs","showIgnored","expanded","treeEpoch","loadDir","epoch","reloadTree","rootListing","repo","readFor","EXPAND_ALL_DIRS","expandAll","level","collapseAll","toggleIgnored","wantedFile","wantedLine","restored","last","fileSeq","loadFile","path","fileReadFor","revealInTree","missing","ancestors","closeFile","mdSource","markdown","isMarkdown","rendered","tokens","shikiLanguage","CHUNK","chunks","codeEl","pickLine","copyText","copyPath","mentionOf","mentionPath","menuEntry","onListContextMenu","crumbs","explorerLabel","crumbsEl","formatSize","bytes","query","allFiles","picked","loadAll","results","fuzzyFilter","openResult","onQueryKey","root_40","div_7","iconify_icon_8","node_17","Input","div_8","node_16","div_9","div_10","div_11","button_4","classes_4","div_12","text_12","ContextMenu_Root","ContextMenu_Trigger","ContextMenu_Content","ContextMenu_Item","iconify_icon_9","fragment_18","ContextMenu_Item_1","iconify_icon_10","fragment_20","text_13","alternate_4","consequent_17","ContextMenu_Item_2","iconify_icon_11","fragment_21","ContextMenu_Separator","ContextMenu_Item_3","iconify_icon_12","fragment_22","ContextMenu_Item_4","iconify_icon_13","fragment_24","consequent_18","button_5","root_23","root_39","div_13","button_6","iconify_icon_14","div_14","node_36","node_37","iconify_icon_15","fragment_25","node_38","iconify_icon_16","$.bind_this","node_39","root_26","text_16","consequent_21","div_15","root_27","node_41","bind_get_1","node_42","consequent_22","button_7","node_40","iconify_icon_17","button_8","iconify_icon_18","node_43","wrapLabel","button_9","root_28","iconify_icon_19","classes_5","consequent_23","button_10","iconify_icon_20","button_11","iconify_icon_21","node_44","div_16","root_29","text_19","consequent_24","root_30","root_31","classes_7","div_17","root_32","img","div_18","root_33","$.html","renderMarkdown","root_34","div_19","root_38","start","div_20","root_37","div_21","root_36","button_12","node_46","node_47","root_35","styles_7","consequent_30","alternate_6","classes_9","styles_6","classes_8","styles_5","consequent_27","consequent_29","alternate_7","consequent_25","classes_6","consequent_31","classes_3","layoutGraph","commits","listed","c","waiting","free","width","commit","into","hash","lane","through","to","graph","subjectEl","subjectHtml","subject","history","all","layout","unpushed","branches","workerOn","branch","tip","worker","sessionStore","s","ROW","LANE","PAD","LANES","laneX","laneColor","railWidth","bend","fromTop","cx","edge","mid","filesError","filesSeq","loadFiles","shownFiles","fileText","bind_get","root_25","day","dayOf","clock","svg","$1","$2","path_1","node_8","path_2","d_1","circle","readRef","shortHash","formatAgo","GithubRefCards","node_15","fragment_2","h3","span_14","span_15","p_7","root_22","fragment_3","span_16","span_17","node_19","span_18","span_19","span_20","span_21","node_21","node_22","p_8","p_9","p_10","root_18","p_11","$.key","node_23","p_12","root_24","alternate_5","isLoopback","host","h","choiceUrl","choice","normalizeTyped","hasScheme","u","pointsHere","portOf","resolveEmbed","ctx","pageSecure","port","served","remote","card","where","machine","BROWSER_CHOICE","toPagePoint","clientX","clientY","frame","along","UNZOOMED","MAX_ZOOM","zoomView","view","from","factor","room","scale","cy","shift","dest","centre","offset","space","limit","modifiersOf","MOUSE_BUTTONS","buttonName","heldButton","buttons","keyMessage","command","msg","textDelta","prev","b","same","pickTab","staying","byId","filterTabs","tabs","words","hay","w","browserAnswers","openInBrowser","WebPaneStore","webPaneStore","BrowserStream","ReliableWebSocket","#closedReason","tabId","failed","icon","heading","retry","fragment","POLL_MS","MULTI_CLICK_MS","MULTI_CLICK_PX","LINE_PX","infoSeq","loadInfo","followed","timer","lookingFor","lookedFor","want","currentId","pickerOpen","hostOf","labelOf","stream","canvas","decodeSeq","drawnSeq","touches","pinch","pendingMove","clearTyped","onDestroy","reload","lastPress","stage","zoomed","fingers","flushMove","sendMove","track","touchMessage","onPointerDown","onPointerMove","now","onPointerUp","onWheel","here","onPaste","pressKey","keyCode","typing","typedLocal","typedRemote","typingEl","mirrorTyped","backspaces","insert","onTypingKey","sendEnter","Badge","li_1","canvas_1","$.event","form","infoError","devConfigured","fallback","browserView","browserUrl","trail","choose","goBack","typed","submitTyped","named","configured","embed","frameSrc","openUrl","check","result","verdict","blocked","reloads","copy","hostLabel","BrowserView","server","bind_set_3","fragment_6","code","fragment_7","fragment_9","code_1","iframe","REFRESH_MS","COMMENT_PAGE","RECENT_MAX","defaults","loadSessionGithub","parseRefParam","number","shownKey","refParam","openRef","recentKey","recent","k","shortcuts","list","own","fresh","answer","loadGithubItem","ready","peekGithubItem","olderShown","showBots","checksOpen","passingOpen","scroller","visual","githubRefVisual","pull","BROWSER_POLL_MS","browserUp","opening","showing","ask","up","openInRemote","pageUrl","githubUrl","folded","VERDICT","checks","groupChecks","checksTone","talk","readableComments","visibleComments","unread","md","mediaHref","capped","seen","toggleComment","ago","labelStyle","color","a_1","header","a_2","h2","l","span_22","span_23","span_24","span_25","span_26","a_3","span_27","text_23","span_28","text_24","$.clsx","text_25","describeChecks","article","visibleBody","section_1","span_29","text_26","text_27","node_24","span_30","text_28","node_25","a_4","text_29","$.action","$$node","text_30","text_31","a_5","text_32","consequent_26","node_27","consequent_28","PANES","ChangesPane","HistoryPane","FilesPane","WebPane","GithubPane","ProjectPane","PANE_KINDS","PANE_PARAMS","paneDef","kind","altShift","IS_MAC","paneKeys","def","MAXIMIZE_KEY","MAXIMIZE_KEYS","CLOSE_KEYS","panelKeyAction","NONE","release","chip","AttachmentsStore","localId","changes","attachmentsStore","DialogPrimitive_Root","DialogPrimitive_Portal","DialogPrimitive_Title","DialogPrimitive_Overlay","iconNode","Icon","showCloseButton","DialogPortal","Dialog_Overlay","DialogPrimitive_Content","DialogPrimitive_Close","XIcon","DialogPrimitive_Description","session","inputEl","killArmed","TOP_MARGIN_PX","KEYBOARD_RATIO","positionStyle","vv","sync","kill","onKeydown","Dialog_Root","Dialog_Content","Dialog_Header","Dialog_Title","Dialog_Description","Dialog_Footer","fuzzyMatch","wantPositions","needle","positions","score","ti","qi","ch","found","fuzzyScore","highlightRuns","runs","cut","scoreCommand","cmd","nameScore","descIdx","PANEL_PARAM","readPanel","params","kinds","readPaneParams","owned","panelQuery","paneParams","githubPaneHref","CollapsiblePrimitive_Content","CollapsiblePrimitive_Trigger","CollapsiblePrimitive_Root","sameShape","SidebarActionsStore","actions","sidebarActionsStore"],"ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,46,47,68],"sources":["../../../../../../src/lib/stores/preferences.svelte.ts","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+ec0a64a97e9eb16b/node_modules/svelte-toolbelt/dist/box/box.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/locale.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/get-directional-keys.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/roving-focus-group.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/mount-animation.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/events.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/arrays.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/collapsible.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/box-auto-reset.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/dom-typeahead.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/utils.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/focus.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/utilities/is-using-keyboard/is-using-keyboard.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/tabbable.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/menu.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/components/menu-item.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/components/menu-separator.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/popover/components/popover-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog-close.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/toggle/toggle.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/toggle/components/toggle.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-portal.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-content.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-item.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-separator.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-trigger.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu.svelte","../../../../../../src/lib/components/DiffBadge.svelte","../../../../../../src/lib/components/side-panel/ProjectPane.svelte","../../../../../../src/lib/components/ui/toggle/toggle.svelte","../../../../../../src/lib/side-panel/highlight.ts","../../../../../../src/lib/components/side-panel/DiffLines.svelte","../../../../../../src/lib/components/side-panel/ChangesPane.svelte","../../../../../../src/lib/components/ui/popover/popover-trigger.svelte","../../../../../../src/lib/side-panel/shiki.ts","../../../../../../src/lib/stores/filesPane.svelte.ts","../../../../../../../node_modules/.bun/svelte-sonner@1.2.2+ec0a64a97e9eb16b/node_modules/svelte-sonner/dist/internal/helpers.js","../../../../../../../node_modules/.bun/svelte-sonner@1.2.2+ec0a64a97e9eb16b/node_modules/svelte-sonner/dist/toast-state.svelte.js","../../../../../../src/lib/side-panel/clipboard.ts","../../../../../../src/lib/components/side-panel/FilesPane.svelte","../../../../../../../src/git-graph.ts","../../../../../../src/lib/components/side-panel/HistoryPane.svelte","../../../../../../../src/utils/loopback.ts","../../../../../../src/lib/side-panel/web.ts","../../../../../../src/lib/side-panel/browser.ts","../../../../../../src/lib/stores/webPane.svelte.ts","../../../../../../src/lib/stores/browserStream.svelte.ts","../../../../../../src/lib/components/side-panel/BrowserView.svelte","../../../../../../src/lib/components/side-panel/WebPane.svelte","../../../../../../src/lib/components/side-panel/GithubPane.svelte","../../../../../../src/lib/side-panel/panes.ts","../../../../../../src/lib/stores/attachments.svelte.ts","../../../../../../src/lib/components/ui/dialog/dialog.svelte","../../../../../../src/lib/components/ui/dialog/dialog-portal.svelte","../../../../../../src/lib/components/ui/dialog/dialog-title.svelte","../../../../../../src/lib/components/ui/dialog/dialog-footer.svelte","../../../../../../src/lib/components/ui/dialog/dialog-header.svelte","../../../../../../src/lib/components/ui/dialog/dialog-overlay.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+ec0a64a97e9eb16b/node_modules/@lucide/svelte/dist/icons/x.svelte","../../../../../../src/lib/components/ui/dialog/dialog-content.svelte","../../../../../../src/lib/components/ui/dialog/dialog-description.svelte","../../../../../../src/lib/components/RenameSessionDialog.svelte","../../../../../../../src/utils/fuzzy.ts","../../../../../../src/lib/side-panel/url.ts","../../../../../../src/lib/components/ui/collapsible/collapsible-content.svelte","../../../../../../src/lib/components/ui/collapsible/collapsible-trigger.svelte","../../../../../../src/lib/components/ui/collapsible/collapsible.svelte","../../../../../../src/lib/stores/sidebarActions.svelte.ts"],"sourcesContent":["import { createPersisted } from './persisted';\nimport type { NotificationMode } from '$lib/notifications';\n\ninterface Preferences {\n\tterminalTheming: boolean;\n\tkeepAwake: boolean;\n\t/** How this browser alerts when a session needs someone or finishes a turn. */\n\tnotificationMode: NotificationMode;\n\t/** A toast inside the page for the same events, while it has focus. */\n\tinAppToasts: boolean;\n\t/** The Files pane keeps its tree beside an open file, or puts it away. */\n\tfileExplorerOpen: boolean;\n\t/** Long lines of an open file fold at the pane's edge rather than scroll past it. */\n\tfileWordWrap: boolean;\n}\n\nconst persisted = createPersisted<Preferences>('claude-mux-preferences', {\n\tterminalTheming: true,\n\tkeepAwake: false,\n\tnotificationMode: 'off',\n\tinAppToasts: true,\n\tfileExplorerOpen: true,\n\tfileWordWrap: false\n});\n\nclass PreferencesStore {\n\tprivate prefs = $state<Preferences>(persisted.load());\n\n\tget terminalTheming(): boolean {\n\t\treturn this.prefs.terminalTheming;\n\t}\n\n\tset terminalTheming(value: boolean) {\n\t\tif (this.prefs.terminalTheming === value) return;\n\t\tthis.prefs.terminalTheming = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget keepAwake(): boolean {\n\t\treturn this.prefs.keepAwake;\n\t}\n\n\tset keepAwake(value: boolean) {\n\t\tif (this.prefs.keepAwake === value) return;\n\t\tthis.prefs.keepAwake = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget notificationMode(): NotificationMode {\n\t\treturn this.prefs.notificationMode;\n\t}\n\n\tset notificationMode(value: NotificationMode) {\n\t\tif (this.prefs.notificationMode === value) return;\n\t\tthis.prefs.notificationMode = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget inAppToasts(): boolean {\n\t\treturn this.prefs.inAppToasts;\n\t}\n\n\tset inAppToasts(value: boolean) {\n\t\tif (this.prefs.inAppToasts === value) return;\n\t\tthis.prefs.inAppToasts = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\ttoggle(key: keyof Preferences): void {\n\t\tif (typeof this.prefs[key] === 'boolean') {\n\t\t\t(this.prefs[key] as boolean) = !this.prefs[key];\n\t\t\tpersisted.save(this.prefs);\n\t\t}\n\t}\n\n\tget fileExplorerOpen(): boolean {\n\t\treturn this.prefs.fileExplorerOpen ?? true;\n\t}\n\n\tset fileExplorerOpen(value: boolean) {\n\t\tthis.prefs.fileExplorerOpen = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget fileWordWrap(): boolean {\n\t\treturn this.prefs.fileWordWrap ?? false;\n\t}\n\n\tset fileWordWrap(value: boolean) {\n\t\tthis.prefs.fileWordWrap = value;\n\t\tpersisted.save(this.prefs);\n\t}\n}\n\nexport const preferences = new PreferencesStore();\n","import { boxFrom, boxWith, boxFlatten, toReadonlyBox, isBox, isWritableBox, BoxSymbol, isWritableSymbol } from \"./box-extras.svelte.js\";\nexport function box(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nbox.from = boxFrom;\nbox.with = boxWith;\nbox.flatten = boxFlatten;\nbox.readonly = toReadonlyBox;\nbox.isBox = isBox;\nbox.isWritableBox = isWritableBox;\n","/**\n * Detects the text direction in the element.\n * @returns {Direction} The text direction ('ltr' for left-to-right or 'rtl' for right-to-left).\n */\nexport function getElemDirection(elem) {\n const style = window.getComputedStyle(elem);\n const direction = style.getPropertyValue(\"direction\");\n return direction;\n}\n","import { kbd } from \"./kbd.js\";\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SELECTION_KEYS = [kbd.SPACE, kbd.ENTER];\n/**\n * A utility function that returns the next key based on the direction and orientation.\n */\nexport function getNextKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_LEFT : kbd.ARROW_RIGHT,\n vertical: kbd.ARROW_DOWN,\n }[orientation];\n}\n/**\n * A utility function that returns the previous key based on the direction and orientation.\n */\nexport function getPrevKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_RIGHT : kbd.ARROW_LEFT,\n vertical: kbd.ARROW_UP,\n }[orientation];\n}\n/**\n * A utility function that returns the next and previous keys based on the direction\n * and orientation.\n */\nexport function getDirectionalKeys(dir = \"ltr\", orientation = \"horizontal\") {\n if (![\"ltr\", \"rtl\"].includes(dir))\n dir = \"ltr\";\n if (![\"horizontal\", \"vertical\"].includes(orientation))\n orientation = \"horizontal\";\n return {\n nextKey: getNextKey(dir, orientation),\n prevKey: getPrevKey(dir, orientation),\n };\n}\n","import { box } from \"svelte-toolbelt\";\nimport { getElemDirection } from \"./locale.js\";\nimport { getDirectionalKeys } from \"./get-directional-keys.js\";\nimport { kbd } from \"./kbd.js\";\nimport { BROWSER } from \"esm-env\";\nimport { isHTMLElement } from \"./is.js\";\nexport class RovingFocusGroup {\n #opts;\n #currentTabStopId = box(null);\n constructor(opts) {\n this.#opts = opts;\n }\n getCandidateNodes() {\n if (!BROWSER || !this.#opts.rootNode.current)\n return [];\n if (this.#opts.candidateSelector) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(this.#opts.candidateSelector));\n return this.#ownCandidates(this.#opts.rootNode.current, candidates);\n }\n else if (this.#opts.candidateAttr) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(`[${this.#opts.candidateAttr}]:not([data-disabled])`));\n return this.#ownCandidates(this.#opts.rootNode.current, candidates);\n }\n return [];\n }\n /**\n * Excludes candidates whose closest `[rootAttr]` ancestor is a nested root\n * rather than `rootNode` itself.\n */\n #ownCandidates(rootNode, candidates) {\n const rootAttr = this.#opts.rootAttr;\n if (!rootAttr)\n return candidates;\n const rootSelector = `[${rootAttr}]`;\n return candidates.filter((node) => node.closest(rootSelector) === rootNode);\n }\n focusFirstCandidate() {\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n items[0]?.focus();\n }\n handleKeydown(node, e, both = false) {\n const rootNode = this.#opts.rootNode.current;\n if (!rootNode || !node)\n return;\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n const currentIndex = items.indexOf(node);\n const dir = getElemDirection(rootNode);\n const { nextKey, prevKey } = getDirectionalKeys(dir, this.#opts.orientation.current);\n const loop = this.#opts.loop.current;\n const keyToIndex = {\n [nextKey]: currentIndex + 1,\n [prevKey]: currentIndex - 1,\n [kbd.HOME]: 0,\n [kbd.END]: items.length - 1,\n };\n if (both) {\n const altNextKey = nextKey === kbd.ARROW_DOWN ? kbd.ARROW_RIGHT : kbd.ARROW_DOWN;\n const altPrevKey = prevKey === kbd.ARROW_UP ? kbd.ARROW_LEFT : kbd.ARROW_UP;\n keyToIndex[altNextKey] = currentIndex + 1;\n keyToIndex[altPrevKey] = currentIndex - 1;\n }\n let itemIndex = keyToIndex[e.key];\n if (itemIndex === undefined)\n return;\n e.preventDefault();\n if (itemIndex < 0 && loop) {\n itemIndex = items.length - 1;\n }\n else if (itemIndex === items.length && loop) {\n itemIndex = 0;\n }\n const itemToFocus = items[itemIndex];\n if (!itemToFocus)\n return;\n itemToFocus.focus();\n this.#currentTabStopId.current = itemToFocus.id;\n this.#opts.onCandidateFocus?.(itemToFocus);\n return itemToFocus;\n }\n getTabIndex(node) {\n const items = this.getCandidateNodes();\n const anyActive = this.#currentTabStopId.current !== null;\n if (node && !anyActive && items[0] === node) {\n this.#currentTabStopId.current = node.id;\n return 0;\n }\n else if (node?.id === this.#currentTabStopId.current) {\n return 0;\n }\n return -1;\n }\n setCurrentTabStopId(id) {\n this.#currentTabStopId.current = id;\n }\n focusCurrentTabStop() {\n const currentTabStopId = this.#currentTabStopId.current;\n if (!currentTabStopId)\n return;\n const currentTabStop = this.#opts.rootNode.current?.querySelector(`#${currentTabStopId}`);\n if (!currentTabStop || !isHTMLElement(currentTabStop))\n return;\n currentTabStop.focus();\n }\n}\n","import { watch } from \"runed\";\nconst blockedAnimationStyle = { animationName: \"none\", transitionDuration: \"0s\" };\n/**\n * Keeps content that mounts open from playing its open animation/transition.\n *\n * The block is rendered through the content's `style` prop rather than set on the\n * node imperatively, since Svelte rewrites the `style` attribute whenever the\n * content's props change (e.g. after measuring its dimensions). It lifts on the\n * first open state change, so later opening and closing still animate.\n */\nexport class MountAnimationGuard {\n #prevented = $state(false);\n constructor(open) {\n this.#prevented = open();\n watch.pre(open, () => {\n this.#prevented = false;\n }, { lazy: true });\n }\n get style() {\n return this.#prevented ? blockedAnimationStyle : undefined;\n }\n}\n/**\n * Measures `node` at its full size with animations and transitions blocked, then\n * restores its inline styles.\n */\nexport function measureWithoutAnimation(node) {\n const { animationName, transitionDuration } = node.style;\n node.style.animationName = blockedAnimationStyle.animationName;\n node.style.transitionDuration = blockedAnimationStyle.transitionDuration;\n const rect = node.getBoundingClientRect();\n node.style.animationName = animationName;\n node.style.transitionDuration = transitionDuration;\n return rect;\n}\n","import { on } from \"svelte/events\";\n/**\n * Creates a typed event dispatcher and listener pair for custom events\n * @template T - The type of data that will be passed in the event detail\n * @param eventName - The name of the custom event\n * @param options - CustomEvent options (bubbles, cancelable, etc.)\n */\nexport class CustomEventDispatcher {\n eventName;\n options;\n constructor(eventName, options = { bubbles: true, cancelable: true }) {\n this.eventName = eventName;\n this.options = options;\n }\n createEvent(detail) {\n return new CustomEvent(this.eventName, {\n ...this.options,\n detail,\n });\n }\n dispatch(element, detail) {\n const event = this.createEvent(detail);\n element.dispatchEvent(event);\n return event;\n }\n listen(element, callback, options) {\n const handler = (event) => {\n callback(event);\n };\n return on(element, this.eventName, handler, options);\n }\n}\n","/**\n * Checks if two arrays are equal by comparing their values.\n */\nexport function arraysAreEqual(arr1, arr2) {\n if (arr1.length !== arr2.length)\n return false;\n return arr1.every((value, index) => isEqual(value, arr2[index]));\n}\n/**\n * A utility function that compares two values for equality.\n */\nfunction isEqual(a, b) {\n if (Number.isNaN(a) && Number.isNaN(b))\n return true;\n if (Array.isArray(a) && Array.isArray(b))\n return arraysAreEqual(a, b);\n if (typeof a === \"object\" && typeof b === \"object\")\n return isDeepEqual(a, b);\n return Object.is(a, b);\n}\n/**\n * A utility function that compares two values for deep equality.\n */\nfunction isDeepEqual(a, b) {\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null)\n return false;\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length)\n return false;\n for (const key of aKeys) {\n if (!bKeys.includes(key))\n return false;\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Splits an array into chunks of a given size.\n * @param arr The array to split.\n * @param size The size of each chunk.\n * @returns An array of arrays, where each sub-array has `size` elements from the original array.\n * @example ```ts\n * const arr = [1, 2, 3, 4, 5, 6, 7, 8];\n * const chunks = chunk(arr, 3);\n * // chunks = [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n */\nexport function chunk(arr, size) {\n if (size <= 0)\n return [];\n const result = [];\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n return result;\n}\n/**\n * Checks if the given index is valid for the given array.\n *\n * @param index - The index to check\n * @param arr - The array to check\n */\nexport function isValidIndex(index, arr) {\n return index >= 0 && index < arr.length;\n}\n/**\n * Returns the array element after the given index, or undefined for out-of-bounds or empty arrays.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the beginning of the array if the next index is out of bounds?\n */\n/**\n * Returns the array element after the given index, or undefined for out-of-bounds or empty arrays.\n * For single-element arrays, returns the element if the index is 0.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the beginning of the array if the next index is out of bounds?\n */\nexport function next(array, index, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n if (array.length === 1 && index === 0)\n return array[0];\n if (index === array.length - 1)\n return loop ? array[0] : undefined;\n return array[index + 1];\n}\n/**\n * Returns the array element prior to the given index, or undefined for out-of-bounds or empty arrays.\n * For single-element arrays, returns the element if the index is 0.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the end of the array if the previous index is out of bounds?\n */\nexport function prev(array, index, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n if (array.length === 1 && index === 0)\n return array[0];\n if (index === 0)\n return loop ? array[array.length - 1] : undefined;\n return array[index - 1];\n}\n/**\n * Returns the element some number after the given index. If the target index is out of bounds:\n * - If looping is disabled, the first or last element will be returned.\n * - If looping is enabled, it will wrap around the array.\n * Returns undefined for empty arrays or out-of-bounds initial indices.\n * @param array the array.\n * @param index the index of the current element.\n * @param increment the number of elements to move forward (can be negative).\n * @param loop loop around the array if the target index is out of bounds?\n */\nexport function forward(array, index, increment, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n let targetIndex = index + increment;\n if (loop) {\n // Ensure positive modulus\n targetIndex = ((targetIndex % array.length) + array.length) % array.length;\n }\n else {\n // Clamp to array bounds when not looping\n targetIndex = Math.max(0, Math.min(targetIndex, array.length - 1));\n }\n return array[targetIndex];\n}\n/**\n * Returns the element some number before the given index. If the target index is out of bounds:\n * - If looping is disabled, the first or last element will be returned.\n * - If looping is enabled, it will wrap around the array.\n * Returns undefined for empty arrays or out-of-bounds initial indices.\n * @param array the array.\n * @param index the index of the current element.\n * @param decrement the number of elements to move backward (can be negative).\n * @param loop loop around the array if the target index is out of bounds?\n */\nexport function backward(array, index, decrement, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n let targetIndex = index - decrement;\n if (loop) {\n // Ensure positive modulus\n targetIndex = ((targetIndex % array.length) + array.length) % array.length;\n }\n else {\n // Clamp to array bounds when not looping\n targetIndex = Math.max(0, Math.min(targetIndex, array.length - 1));\n }\n return array[targetIndex];\n}\n/**\n * Finds the next matching item from a list of values based on a search string.\n *\n * This function handles several special cases in typeahead behavior:\n *\n * 1. Space handling: When a search string ends with a space, it handles it specially:\n * - If there's only one match for the text before the space, it ignores the space\n * - If there are multiple matches and the current match already starts with the search prefix\n * followed by a space, it keeps the current match (doesn't change selection on space)\n * - Only after typing characters beyond the space will it move to a more specific match\n *\n * 2. Repeated character handling: If a search consists of repeated characters (e.g., \"aaa\"),\n * it treats it as a single character for matching purposes\n *\n * 3. Cycling behavior: The function wraps around the values array starting from the current match\n * to find the next appropriate match, creating a cycling selection behavior\n *\n * @param values - Array of string values to search through (e.g., the text content of menu items)\n * @param search - The current search string typed by the user\n * @param currentMatch - The currently selected/matched item, if any\n * @returns The next matching value that should be selected, or undefined if no match is found\n */\nexport function getNextMatch(values, search, currentMatch) {\n const lowerSearch = search.toLowerCase();\n if (lowerSearch.endsWith(\" \")) {\n const searchWithoutSpace = lowerSearch.slice(0, -1);\n const matchesWithoutSpace = values.filter((value) => value.toLowerCase().startsWith(searchWithoutSpace));\n /**\n * If there's only one match for the prefix without space, we don't\n * watch to match with space.\n */\n if (matchesWithoutSpace.length <= 1) {\n return getNextMatch(values, searchWithoutSpace, currentMatch);\n }\n const currentMatchLowercase = currentMatch?.toLowerCase();\n /**\n * If the current match already starts with the search prefix and has a space afterward,\n * and the user has only typed up to that space, keep the current match until they\n * disambiguate.\n */\n if (currentMatchLowercase &&\n currentMatchLowercase.startsWith(searchWithoutSpace) &&\n currentMatchLowercase.charAt(searchWithoutSpace.length) === \" \" &&\n search.trim() === searchWithoutSpace) {\n return currentMatch;\n }\n /**\n * With multiple matches, find items that match the full search string with space\n */\n const spacedMatches = values.filter((value) => value.toLowerCase().startsWith(lowerSearch));\n /**\n * If we found matches with the space, use the first one that's not the current match\n */\n if (spacedMatches.length > 0) {\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedMatches = wrapArray(spacedMatches, Math.max(currentMatchIndex, 0));\n // return the first match that is not the current one.\n const nextMatch = wrappedMatches.find((match) => match !== currentMatch);\n // fallback to current if no other is found.\n return nextMatch || currentMatch;\n }\n }\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const normalizedLowerSearch = normalizedSearch.toLowerCase();\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch)\n wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find((value) => value?.toLowerCase().startsWith(normalizedLowerSearch));\n return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nexport function wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n","import { afterTick, attachRef, boxWith, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { on } from \"svelte/events\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { MountAnimationGuard, measureWithoutAnimation, } from \"../../internal/mount-animation.svelte.js\";\nconst collapsibleAttrs = createBitsAttrs({\n component: \"collapsible\",\n parts: [\"root\", \"content\", \"trigger\"],\n});\nconst CollapsibleRootContext = new Context(\"Collapsible.Root\");\nexport class CollapsibleRootState {\n static create(opts) {\n return CollapsibleRootContext.set(new CollapsibleRootState(opts));\n }\n opts;\n attachment;\n contentNode = $state(null);\n contentPresence;\n contentId = $state(undefined);\n constructor(opts) {\n this.opts = opts;\n this.toggleOpen = this.toggleOpen.bind(this);\n this.attachment = attachRef(this.opts.ref);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n }\n toggleOpen() {\n this.opts.open.current = !this.opts.open.current;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-state\": getDataOpenClosed(this.opts.open.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n [collapsibleAttrs.root]: \"\",\n ...this.attachment,\n }));\n}\nexport class CollapsibleContentState {\n static create(opts) {\n return new CollapsibleContentState(opts, CollapsibleRootContext.get());\n }\n opts;\n root;\n attachment;\n present = $derived.by(() => {\n if (this.opts.hiddenUntilFound.current)\n return this.root.opts.open.current;\n return this.opts.forceMount.current || this.root.opts.open.current;\n });\n #mountAnimationGuard;\n #width = $state(0);\n #height = $state(0);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.#mountAnimationGuard = new MountAnimationGuard(() => this.root.opts.open.current);\n this.root.contentId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.contentNode = v));\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.contentId = id;\n });\n watch.pre([() => this.opts.ref.current, () => this.opts.hiddenUntilFound.current], ([node, hiddenUntilFound]) => {\n if (!node || !hiddenUntilFound)\n return;\n const handleBeforeMatch = () => {\n if (this.root.opts.open.current)\n return;\n // we need to defer opening until after browser completes search highlighting\n // otherwise the browser will immediately open the collapsible\n // and the search highlighting will not be visible\n requestAnimationFrame(() => {\n this.root.opts.open.current = true;\n });\n };\n return on(node, \"beforematch\", handleBeforeMatch);\n });\n watch([() => this.opts.ref.current, () => this.present], ([node]) => {\n if (!node)\n return;\n let active = true;\n afterTick(() => {\n // Cleanup can run before this tick; do not read destroyed or superseded state.\n if (!active)\n return;\n if (!this.opts.ref.current)\n return;\n const rect = measureWithoutAnimation(node);\n this.#height = rect.height;\n this.#width = rect.width;\n });\n return () => {\n active = false;\n };\n });\n }\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({\n open: this.root.opts.open.current,\n }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n style: {\n \"--bits-collapsible-content-height\": this.#height\n ? `${this.#height}px`\n : undefined,\n \"--bits-collapsible-content-width\": this.#width\n ? `${this.#width}px`\n : undefined,\n ...this.#mountAnimationGuard.style,\n },\n hidden: this.opts.hiddenUntilFound.current && !this.root.opts.open.current\n ? \"until-found\"\n : undefined,\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n \"data-disabled\": boolToEmptyStrOrUndef(this.root.opts.disabled.current),\n [collapsibleAttrs.content]: \"\",\n ...(this.opts.hiddenUntilFound.current && !this.shouldRender\n ? {}\n : {\n hidden: this.opts.hiddenUntilFound.current\n ? !this.shouldRender\n : this.opts.forceMount.current\n ? undefined\n : !this.shouldRender,\n }),\n ...this.attachment,\n }));\n}\nexport class CollapsibleTriggerState {\n static create(opts) {\n return new CollapsibleTriggerState(opts, CollapsibleRootContext.get());\n }\n opts;\n root;\n attachment;\n #isDisabled = $derived.by(() => this.opts.disabled.current || this.root.opts.disabled.current);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.#isDisabled)\n return;\n if (e.button !== 0)\n return e.preventDefault();\n this.root.toggleOpen();\n }\n onkeydown(e) {\n if (this.#isDisabled)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.toggleOpen();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n type: \"button\",\n disabled: this.#isDisabled,\n \"aria-controls\": this.root.contentId,\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.#isDisabled),\n [collapsibleAttrs.trigger]: \"\",\n //\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CollapsibleRootProps } from \"../types.js\";\n\timport { CollapsibleRootState } from \"../collapsible.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\topen = $bindable(false),\n\t\tdisabled = false,\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\t...restProps\n\t}: CollapsibleRootProps = $props();\n\n\tconst rootState = CollapsibleRootState.create({\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, rootState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { CollapsibleContentState } from \"../collapsible.svelte.js\";\n\timport type { CollapsibleContentProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\thiddenUntilFound = false,\n\t\tchildren,\n\t\tid = createId(uid),\n\t\t...restProps\n\t}: CollapsibleContentProps = $props();\n\n\tconst contentState = CollapsibleContentState.create({\n\t\tid: boxWith(() => id),\n\t\tforceMount: boxWith(() => forceMount),\n\t\thiddenUntilFound: boxWith(() => hiddenUntilFound),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if child}\n\t{@render child({\n\t\t...contentState.snippetProps,\n\t\tprops: mergedProps,\n\t})}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CollapsibleTriggerProps } from \"../types.js\";\n\timport { CollapsibleTriggerState } from \"../collapsible.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: CollapsibleTriggerProps = $props();\n\n\tconst triggerState = CollapsibleTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => disabled),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","import { boxWith } from \"svelte-toolbelt\";\nimport { noop } from \"./noop.js\";\nconst defaultOptions = {\n afterMs: 10000,\n onChange: noop,\n};\n/**\n * Creates a box which will be reset to the default value after some time.\n *\n * @param defaultValue The value which will be set.\n * @param afterMs A zero-or-greater delay in milliseconds.\n */\nexport function boxAutoReset(defaultValue, options) {\n const { afterMs, onChange, getWindow } = { ...defaultOptions, ...options };\n let timeout = null;\n let value = $state(defaultValue);\n function resetAfter() {\n return getWindow().setTimeout(() => {\n value = defaultValue;\n onChange?.(defaultValue);\n }, afterMs);\n }\n $effect(() => {\n return () => {\n if (timeout)\n getWindow().clearTimeout(timeout);\n };\n });\n return boxWith(() => value, (v) => {\n value = v;\n onChange?.(v);\n if (timeout)\n getWindow().clearTimeout(timeout);\n timeout = resetAfter();\n });\n}\n","import { getNextMatch } from \"./arrays.js\";\nimport { boxAutoReset } from \"./box-auto-reset.svelte.js\";\nexport class DOMTypeahead {\n #opts;\n #search;\n #onMatch = $derived.by(() => {\n if (this.#opts.onMatch)\n return this.#opts.onMatch;\n return (node) => node.focus();\n });\n #getCurrentItem = $derived.by(() => {\n if (this.#opts.getCurrentItem)\n return this.#opts.getCurrentItem;\n return this.#opts.getActiveElement;\n });\n constructor(opts) {\n this.#opts = opts;\n this.#search = boxAutoReset(\"\", {\n afterMs: 1000,\n getWindow: opts.getWindow,\n });\n this.handleTypeaheadSearch = this.handleTypeaheadSearch.bind(this);\n this.resetTypeahead = this.resetTypeahead.bind(this);\n }\n handleTypeaheadSearch(key, candidates) {\n if (!candidates.length)\n return;\n this.#search.current = this.#search.current + key;\n const currentItem = this.#getCurrentItem();\n const currentMatch = candidates.find((item) => item === currentItem)?.textContent?.trim() ?? \"\";\n const values = candidates.map((item) => item.textContent?.trim() ?? \"\");\n const nextMatch = getNextMatch(values, this.#search.current, currentMatch);\n const newItem = candidates.find((item) => item.textContent?.trim() === nextMatch);\n if (newItem)\n this.#onMatch(newItem);\n return newItem;\n }\n resetTypeahead() {\n this.#search.current = \"\";\n }\n get search() {\n return this.#search.current;\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { untrack } from \"svelte\";\n\timport { FloatingAnchorState } from \"../floating-root.svelte.js\";\n\timport type { AnchorProps } from \"./index.js\";\n\timport type { Measurable } from \"../../../../internal/floating-svelte/types.js\";\n\n\tlet { id, children, virtualEl, ref, tooltip = false }: AnchorProps = $props();\n\n\tFloatingAnchorState.create(\n\t\t{\n\t\t\tid: boxWith(() => id),\n\t\t\tvirtualEl: boxWith(() => virtualEl as unknown as Measurable | null),\n\t\t\tref: untrack(() => ref),\n\t\t},\n\t\tuntrack(() => tooltip)\n\t);\n</script>\n\n{@render children?.()}\n","import { kbd } from \"../../internal/kbd.js\";\nexport const SELECTION_KEYS = [kbd.ENTER, kbd.SPACE];\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, kbd.ARROW_RIGHT],\n rtl: [...SELECTION_KEYS, kbd.ARROW_LEFT],\n};\nexport const SUB_CLOSE_KEYS = {\n ltr: [kbd.ARROW_LEFT],\n rtl: [kbd.ARROW_RIGHT],\n};\nexport function isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nexport function getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nexport function isMouseEvent(event) {\n return event.pointerType === \"mouse\";\n}\n","import { getDocument, getWindow } from \"svelte-toolbelt\";\nimport { isBrowser, isElementHidden, isSelectableInput } from \"./is.js\";\n/**\n * Handles `initialFocus` prop behavior for the\n * Calendar & RangeCalendar components.\n */\nexport function handleCalendarInitialFocus(calendar) {\n if (!isBrowser)\n return;\n const selectedDay = calendar.querySelector(\"[data-selected]\");\n if (selectedDay)\n return focusWithoutScroll(selectedDay);\n const today = calendar.querySelector(\"[data-today]\");\n if (today)\n return focusWithoutScroll(today);\n const firstDay = calendar.querySelector(\"[data-calendar-date]\");\n if (firstDay)\n return focusWithoutScroll(firstDay);\n}\n/**\n * A utility function that focuses an element without scrolling.\n */\nexport function focusWithoutScroll(element) {\n const doc = getDocument(element);\n const win = getWindow(element);\n const scrollPosition = {\n x: win.pageXOffset || doc.documentElement.scrollLeft,\n y: win.pageYOffset || doc.documentElement.scrollTop,\n };\n element.focus();\n win.scrollTo(scrollPosition.x, scrollPosition.y);\n}\n/**\n * A utility function that focuses an element.\n */\nexport function focus(element, { select = false } = {}) {\n if (!element || !element.focus)\n return;\n const doc = getDocument(element);\n if (doc.activeElement === element)\n return;\n const previouslyFocusedElement = doc.activeElement;\n // prevent scroll on focus\n element.focus({ preventScroll: true });\n // only elect if its not the same element, it supports selection, and we need to select it\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select) {\n element.select();\n }\n}\n/**\n * Attempts to focus the first element in a list of candidates.\n * Stops when focus is successful.\n */\nexport function focusFirst(candidates, { select = false } = {}, getActiveElement) {\n const previouslyFocusedElement = getActiveElement();\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (getActiveElement() !== previouslyFocusedElement)\n return true;\n }\n}\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nexport function findVisible(elements, container) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isElementHidden(element, container))\n return element;\n }\n}\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nexport function getTabbableCandidates(container) {\n const nodes = [];\n const doc = getDocument(container);\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n // oxlint-disable-next-line no-explicit-any\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput)\n return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode())\n nodes.push(walker.currentNode);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n/**\n * A utility function that returns the first and last elements within a container that are\n * visible and focusable.\n */\nexport function getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n","import { executeCallbacks } from \"svelte-toolbelt\";\nimport { on } from \"svelte/events\";\n// Using global state to avoid multiple listeners.\nlet isUsingKeyboard = $state(false);\n/**\n * Detects whether the user is currently using the keyboard\n * or not by listening to keyboard and pointer events. Uses shared global\n * state to avoid listener duplication.\n */\nexport class IsUsingKeyboard {\n static _refs = 0; // Reference counting to avoid multiple listeners.\n static _cleanup;\n constructor() {\n $effect(() => {\n if (IsUsingKeyboard._refs === 0) {\n IsUsingKeyboard._cleanup = $effect.root(() => {\n const callbacksToDispose = [];\n const handlePointer = (_) => {\n isUsingKeyboard = false;\n };\n const handleKeydown = (_) => {\n isUsingKeyboard = true;\n };\n callbacksToDispose.push(on(document, \"pointerdown\", handlePointer, {\n capture: true,\n }), on(document, \"keydown\", handleKeydown, {\n capture: true,\n }));\n /**\n * `pointermove` fires constantly, so we only keep it attached while we're\n * actually in keyboard mode and have something to switch off. Once it has\n * flipped `isUsingKeyboard` back to `false`, the listener is removed again\n * and mouse movement costs nothing until the next keypress.\n */\n $effect(() => {\n if (!isUsingKeyboard)\n return;\n return on(document, \"pointermove\", handlePointer, {\n capture: true,\n });\n });\n // Don't forget to spread and call twice.\n return executeCallbacks(...callbacksToDispose);\n });\n }\n IsUsingKeyboard._refs++;\n return () => {\n IsUsingKeyboard._refs--;\n if (IsUsingKeyboard._refs === 0) {\n isUsingKeyboard = false;\n IsUsingKeyboard._cleanup?.();\n }\n };\n });\n }\n get current() {\n return isUsingKeyboard;\n }\n set current(value) {\n isUsingKeyboard = value;\n }\n}\n","import { focusable, isFocusable, isTabbable, tabbable } from \"tabbable\";\nimport { getDocument } from \"svelte-toolbelt\";\nfunction getTabbableOptions() {\n return {\n getShadowRoot: true,\n displayCheck: \n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === \"function\" &&\n ResizeObserver.toString().includes(\"[native code]\")\n ? \"full\"\n : \"none\",\n };\n}\n/**\n * Gets all tabbable elements in the body and finds the next/previous tabbable element\n * from the `currentNode` based on the `direction` provided.\n * @param currentNode - the node we want to get the next/previous tabbable from\n */\nexport function getTabbableFrom(currentNode, direction) {\n if (!isTabbable(currentNode, getTabbableOptions())) {\n return getTabbableFromFocusable(currentNode, direction);\n }\n const doc = getDocument(currentNode);\n const allTabbable = tabbable(doc.body, getTabbableOptions());\n if (direction === \"prev\")\n allTabbable.reverse();\n const activeIndex = allTabbable.indexOf(currentNode);\n if (activeIndex === -1)\n return doc.body;\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nexport function getTabbableFromFocusable(currentNode, direction) {\n const doc = getDocument(currentNode);\n if (!isFocusable(currentNode, getTabbableOptions()))\n return doc.body;\n // find all focusable nodes, since some elements may be focusable but not tabbable\n // such as context menu triggers\n const allFocusable = focusable(doc.body, getTabbableOptions());\n // find index of current node among focusable siblings\n if (direction === \"prev\")\n allFocusable.reverse();\n const activeIndex = allFocusable.indexOf(currentNode);\n if (activeIndex === -1)\n return doc.body;\n const nextFocusableElements = allFocusable.slice(activeIndex + 1);\n // find the next focusable node that is also tabbable\n return nextFocusableElements.find((node) => isTabbable(node, getTabbableOptions())) ?? doc.body;\n}\n","import { afterTick, mergeProps, onDestroyEffect, attachRef, DOMContext, getDocument, getWindow, simpleBox, boxWith, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { FIRST_LAST_KEYS, LAST_KEYS, SELECTION_KEYS, SUB_OPEN_KEYS, getCheckedState, isMouseEvent, } from \"./utils.js\";\nimport { focusFirst } from \"../../internal/focus.js\";\nimport { CustomEventDispatcher } from \"../../internal/events.js\";\nimport { isDisabledElement, isElement, isElementOrSVGElement, isHTMLElement, } from \"../../internal/is.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { createBitsAttrs, getAriaChecked, boolToStr, getDataOpenClosed, boolToEmptyStrOrUndef, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { IsUsingKeyboard } from \"../utilities/is-using-keyboard/is-using-keyboard.svelte.js\";\nimport { getTabbableFrom } from \"../../internal/tabbable.js\";\nimport { isTabbable } from \"tabbable\";\nimport { DOMTypeahead } from \"../../internal/dom-typeahead.svelte.js\";\nimport { RovingFocusGroup } from \"../../internal/roving-focus-group.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { arraysAreEqual } from \"../../internal/arrays.js\";\nimport { CONTEXT_MENU_TRIGGER_ATTR } from \"./context-menu-attributes.js\";\nconst MenuRootContext = new Context(\"Menu.Root\");\nconst MenuMenuContext = new Context(\"Menu.Root | Menu.Sub\");\nconst MenuContentContext = new Context(\"Menu.Content\");\nconst MenuGroupContext = new Context(\"Menu.Group | Menu.RadioGroup\");\nconst MenuRadioGroupContext = new Context(\"Menu.RadioGroup\");\nexport const MenuCheckboxGroupContext = new Context(\"Menu.CheckboxGroup\");\nexport const MenuOpenEvent = new CustomEventDispatcher(\"bitsmenuopen\", {\n bubbles: false,\n cancelable: true,\n});\nexport const menuAttrs = createBitsAttrs({\n component: \"menu\",\n parts: [\n \"trigger\",\n \"content\",\n \"sub-trigger\",\n \"item\",\n \"group\",\n \"group-heading\",\n \"checkbox-group\",\n \"checkbox-item\",\n \"radio-group\",\n \"radio-item\",\n \"separator\",\n \"sub-content\",\n \"arrow\",\n ],\n});\n/*\ninterface MenuIntentDebugSnapshot {\n active: boolean;\n target: IntentTarget | null;\n exitPoint: Point | null;\n pointerPoint: Point | null;\n corridor: Polygon | null;\n intentPolygon: Polygon | null;\n}\n\nclass MenuIntentDebugOverlay {\n readonly #enabled: () => boolean;\n readonly #getDocument: () => Document | null;\n #root: HTMLDivElement | null = null;\n #corridorPolygon: SVGPolygonElement | null = null;\n #intentPolygon: SVGPolygonElement | null = null;\n #exitPoint: SVGCircleElement | null = null;\n #pointerPoint: SVGCircleElement | null = null;\n\n constructor(opts: { enabled: () => boolean; getDocument: () => Document | null }) {\n this.#enabled = opts.enabled;\n this.#getDocument = opts.getDocument;\n }\n\n update(state: MenuIntentDebugSnapshot) {\n if (!this.#enabled()) {\n this.#detach();\n return;\n }\n this.#ensureRoot();\n if (!this.#root) return;\n\n if (!state.active || !state.corridor || !state.intentPolygon || !state.exitPoint) {\n this.#root.style.display = \"none\";\n return;\n }\n\n const color = state.target === \"trigger\" ? \"16 185 129\" : \"59 130 246\";\n const strokeColor = `rgb(${color})`;\n const fillColor = `rgb(${color} / 0.18)`;\n const corridorFill = `rgb(${color} / 0.1)`;\n\n this.#root.style.display = \"block\";\n this.#setPolygon(this.#corridorPolygon, state.corridor, corridorFill, strokeColor, 1.5);\n this.#setPolygon(this.#intentPolygon, state.intentPolygon, fillColor, strokeColor, 2);\n this.#setPoint(this.#exitPoint, state.exitPoint, strokeColor, 5);\n this.#setPoint(\n this.#pointerPoint,\n state.pointerPoint,\n \"rgb(15 23 42 / 0.9)\",\n 4,\n \"rgb(255 255 255 / 0.95)\"\n );\n }\n\n destroy() {\n this.#detach();\n }\n\n #setPolygon(\n node: SVGPolygonElement | null,\n points: Polygon | null,\n fill: string,\n stroke: string,\n strokeWidth: number\n ) {\n if (!node || !points || points.length === 0) return;\n node.setAttribute(\"points\", polygonToSvgPoints(points));\n node.setAttribute(\"fill\", fill);\n node.setAttribute(\"stroke\", stroke);\n node.setAttribute(\"stroke-width\", `${strokeWidth}`);\n node.setAttribute(\"stroke-dasharray\", \"6 4\");\n }\n\n #setPoint(\n node: SVGCircleElement | null,\n point: Point | null,\n fill: string,\n radius: number,\n stroke = \"transparent\"\n ) {\n if (!node || !point) return;\n node.setAttribute(\"cx\", `${point.x}`);\n node.setAttribute(\"cy\", `${point.y}`);\n node.setAttribute(\"r\", `${radius}`);\n node.setAttribute(\"fill\", fill);\n node.setAttribute(\"stroke\", stroke);\n node.setAttribute(\"stroke-width\", \"1.5\");\n }\n\n #ensureRoot() {\n if (this.#root) return;\n const doc = this.#getDocument();\n if (!doc?.body) return;\n\n const root = doc.createElement(\"div\");\n root.setAttribute(\"aria-hidden\", \"true\");\n root.style.position = \"fixed\";\n root.style.inset = \"0\";\n root.style.pointerEvents = \"none\";\n root.style.zIndex = \"2147483647\";\n root.style.display = \"none\";\n\n const svg = doc.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.style.overflow = \"visible\";\n\n const corridorPolygon = doc.createElementNS(SVG_NS, \"polygon\");\n const intentPolygon = doc.createElementNS(SVG_NS, \"polygon\");\n const exitPoint = doc.createElementNS(SVG_NS, \"circle\");\n const pointerPoint = doc.createElementNS(SVG_NS, \"circle\");\n\n svg.append(corridorPolygon, intentPolygon, exitPoint, pointerPoint);\n root.append(svg);\n doc.body.append(root);\n\n this.#root = root;\n this.#corridorPolygon = corridorPolygon;\n this.#intentPolygon = intentPolygon;\n this.#exitPoint = exitPoint;\n this.#pointerPoint = pointerPoint;\n }\n\n #detach() {\n this.#root?.remove();\n this.#root = null;\n this.#corridorPolygon = null;\n this.#intentPolygon = null;\n this.#exitPoint = null;\n this.#pointerPoint = null;\n }\n}\n*/\nclass MenuSubmenuIntent {\n #opts;\n // readonly #debugOverlay: MenuIntentDebugOverlay;\n #cleanupDocMove = null;\n #fallbackTimer = null;\n #active = false;\n #target = null;\n #apex = null;\n #pointerPoint = null;\n // #corridor: Polygon | null = null;\n // #intentPolygon: Polygon | null = null;\n #launchPoint = null;\n constructor(opts) {\n this.#opts = opts;\n // this.#debugOverlay = new MenuIntentDebugOverlay({\n // \tenabled: () => this.#opts.debugMode(),\n // \tgetDocument: () => getDocument(this.#opts.triggerNode() ?? this.#opts.contentNode()),\n // });\n watch([opts.triggerNode, opts.contentNode, opts.enabled], ([triggerNode, contentNode, enabled]) => {\n this.#reset();\n if (!triggerNode || !contentNode || !enabled)\n return;\n const onTriggerMove = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#launchPoint = { x: e.clientX, y: e.clientY };\n if (!this.#active)\n this.#preview(e, \"content\");\n };\n const onTriggerLeave = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#engage(e, \"content\");\n };\n const onContentMove = (e) => {\n if (!isMouseEvent(e))\n return;\n if (!this.#active)\n this.#preview(e, \"trigger\");\n };\n const onContentLeave = (e) => {\n if (!isMouseEvent(e))\n return;\n if (isElement(e.relatedTarget)) {\n const selector = this.#opts.subContentSelector();\n const matchedSubContent = e.relatedTarget.closest(selector);\n if (matchedSubContent &&\n matchedSubContent !== contentNode &&\n matchedSubContent.id) {\n const isChild = !!contentNode.querySelector(`[aria-controls=\"${matchedSubContent.id}\"]`);\n if (isChild) {\n return;\n }\n }\n }\n this.#engage(e, \"trigger\");\n };\n const onTriggerEnter = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#disengage();\n };\n const onContentEnter = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#disengage();\n };\n triggerNode.addEventListener(\"pointermove\", onTriggerMove);\n triggerNode.addEventListener(\"pointerleave\", onTriggerLeave);\n triggerNode.addEventListener(\"pointerenter\", onTriggerEnter);\n contentNode.addEventListener(\"pointermove\", onContentMove);\n contentNode.addEventListener(\"pointerleave\", onContentLeave);\n contentNode.addEventListener(\"pointerenter\", onContentEnter);\n return () => {\n triggerNode.removeEventListener(\"pointermove\", onTriggerMove);\n triggerNode.removeEventListener(\"pointerleave\", onTriggerLeave);\n triggerNode.removeEventListener(\"pointerenter\", onTriggerEnter);\n contentNode.removeEventListener(\"pointermove\", onContentMove);\n contentNode.removeEventListener(\"pointerleave\", onContentLeave);\n contentNode.removeEventListener(\"pointerenter\", onContentEnter);\n this.#reset();\n };\n });\n onDestroyEffect(() => {\n this.#reset();\n // this.#debugOverlay.destroy();\n });\n }\n #parentTargetRect() {\n const parent = this.#opts.parentContentNode();\n if (parent)\n return parent.getBoundingClientRect();\n return this.#opts.triggerNode()?.getBoundingClientRect() ?? null;\n }\n #computePolygons(pointerPt, target) {\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode)\n return null;\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n const side = getSide(triggerRect, contentRect);\n let apex;\n let targetRect;\n let sourceRect;\n if (target === \"content\") {\n apex = this.#active ? (this.#apex ?? pointerPt) : pointerPt;\n targetRect = contentRect;\n }\n else {\n apex = this.#launchPoint ?? pointerPt;\n targetRect = this.#parentTargetRect() ?? triggerRect;\n sourceRect = contentRect;\n }\n this.#apex = apex;\n return {\n corridor: getCorridorPolygon(triggerRect, contentRect, side),\n intent: getIntentPolygon(apex, targetRect, side, target, sourceRect),\n targetRect,\n side,\n };\n }\n #isInSafeZone(pt, corridor, intent) {\n return isPointInPolygon(pt, corridor) || isPointInPolygon(pt, intent);\n }\n #preview(e, target) {\n const pt = { x: e.clientX, y: e.clientY };\n const geo = this.#computePolygons(pt, target);\n if (!geo)\n return;\n this.#target = target;\n this.#pointerPoint = pt;\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n // this.#syncDebug();\n }\n #engage(e, target) {\n if (!this.#opts.enabled())\n return;\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode)\n return;\n const related = e.relatedTarget;\n if (isElement(related)) {\n if (target === \"content\" && contentNode.contains(related))\n return;\n if (target === \"trigger\" && triggerNode.contains(related))\n return;\n }\n const pt = { x: e.clientX, y: e.clientY };\n const geo = this.#computePolygons(pt, target);\n if (!geo)\n return;\n if (!isInsideRect(pt, geo.targetRect) &&\n !this.#isInSafeZone(pt, geo.corridor, geo.intent)) {\n this.#clearVisuals();\n return;\n }\n this.#active = true;\n this.#target = target;\n this.#pointerPoint = pt;\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n this.#opts.setIsPointerInTransit(true);\n this.#attachDocMove();\n this.#startFallback();\n // this.#syncDebug();\n }\n #disengageTimer = null;\n #disengage() {\n if (!this.#active)\n return;\n const wasReturning = this.#target === \"trigger\";\n this.#detachDocMove();\n this.#clearFallback();\n this.#active = false;\n this.#clearVisuals();\n if (wasReturning) {\n this.#clearDisengageTimer();\n this.#disengageTimer = setTimeout(() => {\n this.#disengageTimer = null;\n this.#opts.setIsPointerInTransit(false);\n }, 100);\n }\n else {\n this.#opts.setIsPointerInTransit(false);\n }\n }\n #clearDisengageTimer() {\n if (this.#disengageTimer === null)\n return;\n clearTimeout(this.#disengageTimer);\n this.#disengageTimer = null;\n }\n #intentExit() {\n const pointerPoint = this.#pointerPoint;\n this.#detachDocMove();\n this.#clearFallback();\n this.#clearDisengageTimer();\n this.#active = false;\n this.#opts.setIsPointerInTransit(false);\n this.#clearVisuals();\n this.#opts.onIntentExit(pointerPoint);\n }\n #reset() {\n this.#detachDocMove();\n this.#clearFallback();\n this.#clearDisengageTimer();\n if (this.#active)\n this.#opts.setIsPointerInTransit(false);\n this.#active = false;\n this.#target = null;\n this.#apex = null;\n this.#pointerPoint = null;\n // this.#corridor = null;\n // this.#intentPolygon = null;\n this.#launchPoint = null;\n // this.#syncDebug();\n }\n #isPointerInDescendantSubContent(pt) {\n const contentNode = this.#opts.contentNode();\n if (!contentNode)\n return false;\n const doc = contentNode.ownerDocument;\n const el = doc.elementFromPoint(pt.x, pt.y);\n if (!el)\n return false;\n const selector = this.#opts.subContentSelector();\n const subContent = el.closest(selector);\n if (!subContent || subContent === contentNode)\n return false;\n if (subContent.id)\n return !!contentNode.querySelector(`[aria-controls=\"${subContent.id}\"]`);\n return false;\n }\n #onDocMove = (e) => {\n if (!this.#active || !this.#target)\n return;\n if (!isMouseEvent(e))\n return;\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode) {\n this.#intentExit();\n return;\n }\n this.#clearFallback();\n const pt = { x: e.clientX, y: e.clientY };\n this.#pointerPoint = pt;\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n if (this.#target === \"content\" && isInsideRect(pt, contentRect)) {\n this.#disengage();\n return;\n }\n if (this.#target === \"trigger\" && isInsideInsetRect(pt, triggerRect, 4)) {\n this.#disengage();\n return;\n }\n if (this.#isPointerInDescendantSubContent(pt)) {\n this.#startFallback();\n return;\n }\n const geo = this.#computePolygons(pt, this.#target);\n if (!geo) {\n this.#intentExit();\n return;\n }\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n // this.#syncDebug();\n if (this.#isInSafeZone(pt, geo.corridor, geo.intent)) {\n this.#startFallback();\n return;\n }\n this.#intentExit();\n };\n #attachDocMove() {\n if (this.#cleanupDocMove)\n return;\n const doc = getDocument(this.#opts.triggerNode() ?? this.#opts.contentNode());\n if (!doc)\n return;\n doc.addEventListener(\"pointermove\", this.#onDocMove, true);\n this.#cleanupDocMove = () => {\n doc.removeEventListener(\"pointermove\", this.#onDocMove, true);\n this.#cleanupDocMove = null;\n };\n }\n #detachDocMove() {\n this.#cleanupDocMove?.();\n }\n #startFallback() {\n this.#clearFallback();\n this.#fallbackTimer = setTimeout(() => {\n this.#fallbackTimer = null;\n if (this.#active)\n this.#intentExit();\n }, 500);\n }\n #clearFallback() {\n if (this.#fallbackTimer === null)\n return;\n clearTimeout(this.#fallbackTimer);\n this.#fallbackTimer = null;\n }\n #clearVisuals() {\n this.#target = null;\n this.#apex = null;\n this.#pointerPoint = null;\n // this.#corridor = null;\n // this.#intentPolygon = null;\n // this.#syncDebug();\n }\n}\n/*\nfunction polygonToSvgPoints(points: Polygon): string {\n return points.map((point) => `${point.x},${point.y}`).join(\" \");\n}\n*/\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * (y - yi)) / (yj - yi) + xi);\n if (intersect)\n inside = !inside;\n }\n return inside;\n}\nfunction isInsideRect(point, rect) {\n return (point.x >= rect.left &&\n point.x <= rect.right &&\n point.y >= rect.top &&\n point.y <= rect.bottom);\n}\nfunction isInsideInsetRect(point, rect, inset) {\n return (point.x >= rect.left + inset &&\n point.x <= rect.right - inset &&\n point.y >= rect.top + inset &&\n point.y <= rect.bottom - inset);\n}\nfunction getSide(triggerRect, contentRect) {\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n const contentCenterX = contentRect.left + contentRect.width / 2;\n const contentCenterY = contentRect.top + contentRect.height / 2;\n const deltaX = contentCenterX - triggerCenterX;\n const deltaY = contentCenterY - triggerCenterY;\n if (Math.abs(deltaX) > Math.abs(deltaY)) {\n return deltaX > 0 ? \"right\" : \"left\";\n }\n return deltaY > 0 ? \"bottom\" : \"top\";\n}\nfunction getCorridorPolygon(triggerRect, contentRect, side) {\n const buffer = 2;\n switch (side) {\n case \"top\":\n return [\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: triggerRect.top },\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: contentRect.bottom },\n {\n x: Math.max(triggerRect.right, contentRect.right) + buffer,\n y: contentRect.bottom,\n },\n { x: Math.max(triggerRect.right, contentRect.right) + buffer, y: triggerRect.top },\n ];\n case \"bottom\":\n return [\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: triggerRect.bottom },\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: contentRect.top },\n { x: Math.max(triggerRect.right, contentRect.right) + buffer, y: contentRect.top },\n {\n x: Math.max(triggerRect.right, contentRect.right) + buffer,\n y: triggerRect.bottom,\n },\n ];\n case \"left\":\n return [\n { x: triggerRect.left, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n { x: contentRect.right, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n {\n x: contentRect.right,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n {\n x: triggerRect.left,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n ];\n case \"right\":\n return [\n { x: triggerRect.right, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n { x: contentRect.left, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n {\n x: contentRect.left,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n {\n x: triggerRect.right,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n ];\n }\n}\nfunction getIntentPolygon(exitPoint, targetRect, side, target, sourceRect) {\n const edgeBuffer = 8;\n const effectiveSide = target === \"trigger\" ? flipSide(side) : side;\n const top = sourceRect\n ? Math.min(targetRect.top, sourceRect.top) - edgeBuffer\n : targetRect.top - edgeBuffer;\n const bottom = sourceRect\n ? Math.max(targetRect.bottom, sourceRect.bottom) + edgeBuffer\n : targetRect.bottom + edgeBuffer;\n const left = sourceRect\n ? Math.min(targetRect.left, sourceRect.left) - edgeBuffer\n : targetRect.left - edgeBuffer;\n const right = sourceRect\n ? Math.max(targetRect.right, sourceRect.right) + edgeBuffer\n : targetRect.right + edgeBuffer;\n switch (effectiveSide) {\n case \"right\":\n return [exitPoint, { x: targetRect.left, y: top }, { x: targetRect.left, y: bottom }];\n case \"left\":\n return [exitPoint, { x: targetRect.right, y: top }, { x: targetRect.right, y: bottom }];\n case \"bottom\":\n return [exitPoint, { x: left, y: targetRect.top }, { x: right, y: targetRect.top }];\n case \"top\":\n return [\n exitPoint,\n { x: left, y: targetRect.bottom },\n { x: right, y: targetRect.bottom },\n ];\n }\n}\nfunction flipSide(side) {\n switch (side) {\n case \"top\":\n return \"bottom\";\n case \"bottom\":\n return \"top\";\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n }\n}\nexport class MenuRootState {\n static create(opts) {\n const root = new MenuRootState(opts);\n return MenuRootContext.set(root);\n }\n opts;\n isUsingKeyboard = new IsUsingKeyboard();\n ignoreCloseAutoFocus = $state(false);\n isPointerInTransit = $state(false);\n constructor(opts) {\n this.opts = opts;\n }\n getBitsAttr = (part) => {\n return menuAttrs.getAttr(part, this.opts.variant.current);\n };\n}\nexport class MenuMenuState {\n static create(opts, root) {\n return MenuMenuContext.set(new MenuMenuState(opts, root, null));\n }\n opts;\n root;\n parentMenu;\n // the content replaces this box when it mounts; a plain field would leave every\n // derived that read the empty box (a trigger rendered first) pointing at it forever\n contentId = $state.raw(boxWith(() => \"\"));\n contentNode = $state(null);\n contentPresence;\n triggerNode = $state(null);\n constructor(opts, root, parentMenu) {\n this.opts = opts;\n this.root = root;\n this.parentMenu = parentMenu;\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n shouldSkipExitAnimation: () => {\n if (this.root.opts.variant.current !== \"menubar\" || this.parentMenu !== null) {\n return false;\n }\n return this.root.opts.shouldSkipExitAnimation?.() ?? false;\n },\n });\n if (parentMenu) {\n watch(() => parentMenu.opts.open.current, () => {\n if (parentMenu.opts.open.current)\n return;\n this.opts.open.current = false;\n });\n }\n }\n toggleOpen() {\n this.opts.open.current = !this.opts.open.current;\n }\n onOpen() {\n this.opts.open.current = true;\n }\n onClose() {\n this.opts.open.current = false;\n }\n}\nexport class MenuContentState {\n static create(opts) {\n return MenuContentContext.set(new MenuContentState(opts, MenuMenuContext.get()));\n }\n opts;\n parentMenu;\n rovingFocusGroup;\n domContext;\n attachment;\n search = $state(\"\");\n #timer = 0;\n #handleTypeaheadSearch;\n mounted = $state(false);\n /**\n * The item a press started on, and where. The content can scroll under a still\n * pointer before the release, which then lands on a neighbouring item.\n */\n pressedItem = null;\n #isSub;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.domContext = new DOMContext(opts.ref);\n this.attachment = attachRef(this.opts.ref, (v) => {\n if (this.parentMenu.contentNode !== v) {\n this.parentMenu.contentNode = v;\n }\n });\n parentMenu.contentId = opts.id;\n this.#isSub = opts.isSub ?? false;\n this.onkeydown = this.onkeydown.bind(this);\n this.onblur = this.onblur.bind(this);\n this.onfocus = this.onfocus.bind(this);\n this.handleInteractOutside = this.handleInteractOutside.bind(this);\n new MenuSubmenuIntent({\n contentNode: () => this.parentMenu.contentNode,\n triggerNode: () => this.parentMenu.triggerNode,\n parentContentNode: () => this.parentMenu.parentMenu?.contentNode ?? null,\n subContentSelector: () => `[${this.parentMenu.root.getBitsAttr(\"sub-content\")}]`,\n // debugMode: () => this.parentMenu.root.opts.debugMode.current,\n enabled: () => this.parentMenu.opts.open.current &&\n Boolean(this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(\"sub-trigger\"))),\n onIntentExit: (pointerPoint) => {\n this.parentMenu.opts.open.current = false;\n this.#dispatchPointerMoveToHoveredSubTrigger(pointerPoint);\n },\n setIsPointerInTransit: (value) => {\n this.parentMenu.root.isPointerInTransit = value;\n },\n });\n this.#handleTypeaheadSearch = new DOMTypeahead({\n getActiveElement: () => this.domContext.getActiveElement(),\n getWindow: () => this.domContext.getWindow(),\n }).handleTypeaheadSearch;\n this.rovingFocusGroup = new RovingFocusGroup({\n rootNode: boxWith(() => this.parentMenu.contentNode),\n candidateAttr: this.parentMenu.root.getBitsAttr(\"item\"),\n loop: this.opts.loop,\n orientation: boxWith(() => \"vertical\"),\n });\n watch(() => this.parentMenu.contentNode, (contentNode) => {\n if (!contentNode)\n return;\n const handler = () => {\n afterTick(() => {\n if (!this.parentMenu.root.isUsingKeyboard.current)\n return;\n this.rovingFocusGroup.focusFirstCandidate();\n });\n };\n return MenuOpenEvent.listen(contentNode, handler);\n });\n $effect(() => {\n if (!this.parentMenu.opts.open.current) {\n this.domContext.getWindow().clearTimeout(this.#timer);\n this.clearPressedItem();\n }\n });\n }\n #getCandidateNodes() {\n const node = this.parentMenu.contentNode;\n if (!node)\n return [];\n const candidates = Array.from(node.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(\"item\")}]:not([data-disabled])`));\n return candidates;\n }\n #isPointerMovingToSubmenu() {\n return this.parentMenu.root.isPointerInTransit;\n }\n #dispatchPointerMoveToHoveredSubTrigger(pointerPoint) {\n if (!pointerPoint)\n return;\n const parentContentNode = this.parentMenu.parentMenu?.contentNode;\n if (!parentContentNode)\n return;\n const hoveredNode = this.domContext\n .getDocument()\n .elementFromPoint(pointerPoint.x, pointerPoint.y);\n if (!isElement(hoveredNode))\n return;\n const hoveredSubTrigger = hoveredNode.closest(`[${this.parentMenu.root.getBitsAttr(\"sub-trigger\")}]`);\n if (!hoveredSubTrigger || !parentContentNode.contains(hoveredSubTrigger))\n return;\n if (hoveredSubTrigger === this.parentMenu.triggerNode)\n return;\n hoveredSubTrigger.dispatchEvent(new PointerEvent(\"pointermove\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\",\n clientX: pointerPoint.x,\n clientY: pointerPoint.y,\n }));\n }\n onCloseAutoFocus = (e) => {\n this.opts.onCloseAutoFocus.current?.(e);\n if (e.defaultPrevented || this.#isSub)\n return;\n if (this.parentMenu.root.ignoreCloseAutoFocus) {\n e.preventDefault();\n return;\n }\n if (this.parentMenu.triggerNode && isTabbable(this.parentMenu.triggerNode)) {\n e.preventDefault();\n this.parentMenu.triggerNode.focus();\n }\n };\n handleTabKeyDown(e) {\n /**\n * We locate the root `menu`'s trigger by going up the tree until\n * we find a menu that has no parent. This will allow us to focus the next\n * tabbable element before/after the root trigger.\n */\n let rootMenu = this.parentMenu;\n while (rootMenu.parentMenu !== null) {\n rootMenu = rootMenu.parentMenu;\n }\n if (!rootMenu.triggerNode)\n return;\n e.preventDefault();\n const nodeToFocus = getTabbableFrom(rootMenu.triggerNode, e.shiftKey ? \"prev\" : \"next\");\n if (nodeToFocus) {\n /**\n * We set a flag to ignore the `onCloseAutoFocus` event handler\n * as well as the fallbacks inside the focus scope to prevent\n * race conditions causing focus to fall back to the body even\n * though we're trying to focus the next tabbable element.\n */\n this.parentMenu.root.ignoreCloseAutoFocus = true;\n rootMenu.onClose();\n afterTick(() => {\n nodeToFocus.focus();\n afterTick(() => {\n this.parentMenu.root.ignoreCloseAutoFocus = false;\n });\n });\n }\n else {\n this.domContext.getDocument().body.focus();\n }\n }\n onkeydown(e) {\n if (e.defaultPrevented)\n return;\n if (e.key === kbd.TAB) {\n this.handleTabKeyDown(e);\n return;\n }\n const target = e.target;\n const currentTarget = e.currentTarget;\n if (!isHTMLElement(target) || !isHTMLElement(currentTarget))\n return;\n const isKeydownInside = target.closest(`[${this.parentMenu.root.getBitsAttr(\"content\")}]`)?.id ===\n this.parentMenu.contentId.current;\n const isModifierKey = e.ctrlKey || e.altKey || e.metaKey;\n const isCharacterKey = e.key.length === 1;\n const kbdFocusedEl = this.rovingFocusGroup.handleKeydown(target, e);\n if (kbdFocusedEl)\n return;\n // prevent space from being considered with typeahead\n if (e.code === \"Space\")\n return;\n const candidateNodes = this.#getCandidateNodes();\n if (isKeydownInside) {\n if (!isModifierKey && isCharacterKey) {\n this.#handleTypeaheadSearch(e.key, candidateNodes);\n }\n }\n // focus first/last based on key pressed\n if (e.target?.id !== this.parentMenu.contentId.current)\n return;\n if (!FIRST_LAST_KEYS.includes(e.key))\n return;\n e.preventDefault();\n if (LAST_KEYS.includes(e.key)) {\n candidateNodes.reverse();\n }\n focusFirst(candidateNodes, { select: false }, () => this.domContext.getActiveElement());\n }\n onblur(e) {\n if (!isElement(e.currentTarget))\n return;\n if (!isElement(e.target))\n return;\n // clear search buffer when leaving the menu\n if (!e.currentTarget.contains?.(e.target)) {\n this.domContext.getWindow().clearTimeout(this.#timer);\n this.search = \"\";\n }\n }\n onfocus(_) {\n if (!this.parentMenu.root.isUsingKeyboard.current)\n return;\n afterTick(() => this.rovingFocusGroup.focusFirstCandidate());\n }\n onItemEnter() {\n return this.#isPointerMovingToSubmenu();\n }\n onItemLeave(e) {\n if (e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(\"sub-trigger\")))\n return;\n if (this.#isPointerMovingToSubmenu() || this.parentMenu.root.isUsingKeyboard.current)\n return;\n const contentNode = this.parentMenu.contentNode;\n contentNode?.focus({ preventScroll: true });\n this.rovingFocusGroup.setCurrentTabStopId(\"\");\n }\n onTriggerLeave() {\n if (this.#isPointerMovingToSubmenu())\n return true;\n return false;\n }\n handleInteractOutside(e) {\n if (!isElementOrSVGElement(e.target))\n return;\n const triggerId = this.parentMenu.triggerNode?.id;\n if (e.target.id === triggerId) {\n e.preventDefault();\n return;\n }\n if (e.target.closest(`#${triggerId}`)) {\n e.preventDefault();\n return;\n }\n /**\n * when the menu closes due to an outside pointer interaction (for example,\n * clicking another dropdown trigger), avoid focusing this menu's trigger\n * to prevent stealing focus from the new interaction target.\n */\n this.parentMenu.root.ignoreCloseAutoFocus = true;\n afterTick(() => {\n this.parentMenu.root.ignoreCloseAutoFocus = false;\n });\n }\n clearPressedItem = () => {\n this.pressedItem = null;\n };\n get shouldRender() {\n return this.parentMenu.contentPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({ open: this.parentMenu.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n [this.parentMenu.root.getBitsAttr(\"content\")]: \"\",\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n ...getDataTransitionAttrs(this.parentMenu.contentPresence.transitionStatus),\n onkeydown: this.onkeydown,\n onblur: this.onblur,\n onfocus: this.onfocus,\n // every press starts fresh, so a press that ended off an item isn't reused\n onpointerdowncapture: this.clearPressedItem,\n dir: this.parentMenu.root.opts.dir.current,\n style: {\n pointerEvents: \"auto\",\n contain: \"layout style\",\n },\n ...this.attachment,\n }));\n popperProps = {\n onCloseAutoFocus: (e) => this.onCloseAutoFocus(e),\n };\n}\nclass MenuItemSharedState {\n opts;\n content;\n attachment;\n #isFocused = $state(false);\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.attachment = attachRef(this.opts.ref);\n this.onpointermove = this.onpointermove.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n this.onfocus = this.onfocus.bind(this);\n this.onblur = this.onblur.bind(this);\n }\n onpointermove(e) {\n if (e.defaultPrevented)\n return;\n if (!isMouseEvent(e))\n return;\n if (this.opts.disabled.current) {\n this.content.onItemLeave(e);\n }\n else {\n const defaultPrevented = this.content.onItemEnter();\n if (defaultPrevented)\n return;\n const item = e.currentTarget;\n if (!isHTMLElement(item))\n return;\n item.focus({ preventScroll: true });\n }\n }\n onpointerleave(e) {\n if (e.defaultPrevented)\n return;\n if (!isMouseEvent(e))\n return;\n this.content.onItemLeave(e);\n }\n onfocus(e) {\n afterTick(() => {\n if (e.defaultPrevented || this.opts.disabled.current)\n return;\n this.#isFocused = true;\n });\n }\n onblur(e) {\n afterTick(() => {\n if (e.defaultPrevented)\n return;\n this.#isFocused = false;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n tabindex: -1,\n role: \"menuitem\",\n \"aria-disabled\": boolToStr(this.opts.disabled.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-highlighted\": this.#isFocused ? \"\" : undefined,\n [this.content.parentMenu.root.getBitsAttr(\"item\")]: \"\",\n //\n onpointermove: this.onpointermove,\n onpointerleave: this.onpointerleave,\n onfocus: this.onfocus,\n onblur: this.onblur,\n ...this.attachment,\n }));\n}\nexport class MenuItemState {\n static create(opts) {\n const item = new MenuItemSharedState(opts, MenuContentContext.get());\n return new MenuItemState(opts, item);\n }\n opts;\n item;\n root;\n constructor(opts, item) {\n this.opts = opts;\n this.item = item;\n this.root = item.content.parentMenu.root;\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onpointerup = this.onpointerup.bind(this);\n }\n #handleSelect() {\n if (this.item.opts.disabled.current)\n return;\n const selectEvent = new CustomEvent(\"menuitemselect\", { bubbles: true, cancelable: true });\n this.opts.onSelect.current(selectEvent);\n if (selectEvent.defaultPrevented) {\n this.item.content.parentMenu.root.isUsingKeyboard.current = false;\n return;\n }\n if (this.opts.closeOnSelect.current) {\n this.item.content.parentMenu.root.opts.onClose();\n }\n }\n onkeydown(e) {\n const isTypingAhead = this.item.content.search !== \"\";\n if (this.item.opts.disabled.current || (isTypingAhead && e.key === kbd.SPACE))\n return;\n if (SELECTION_KEYS.includes(e.key)) {\n if (!isHTMLElement(e.currentTarget))\n return;\n e.currentTarget.click();\n /**\n * We prevent default browser behavior for selection keys as they should trigger\n * a selection only:\n * - prevents space from scrolling the page.\n * - if keydown causes focus to move, prevents keydown from firing on the new target.\n */\n e.preventDefault();\n }\n }\n onclick(_) {\n if (this.item.opts.disabled.current)\n return;\n this.#handleSelect();\n }\n onpointerup(e) {\n const content = this.item.content;\n const press = content.pressedItem;\n content.pressedItem = null;\n if (e.defaultPrevented)\n return;\n // pressed here: the native click selects\n if (press?.item === this)\n return;\n // released on another item without the pointer moving: the content moved under it\n const target = press && Math.hypot(e.clientX - press.x, e.clientY - press.y) < 4\n ? press.item.item.opts.ref.current\n : e.currentTarget;\n if (!isHTMLElement(target))\n return;\n target.click();\n }\n onpointerdown(e) {\n this.item.content.pressedItem = { item: this, x: e.clientX, y: e.clientY };\n }\n props = $derived.by(() => mergeProps(this.item.props, {\n onclick: this.onclick,\n onpointerdown: this.onpointerdown,\n onpointerup: this.onpointerup,\n onkeydown: this.onkeydown,\n }));\n}\nexport class MenuSubTriggerState {\n static create(opts) {\n const content = MenuContentContext.get();\n const item = new MenuItemSharedState(opts, content);\n const submenu = MenuMenuContext.get();\n return new MenuSubTriggerState(opts, item, content, submenu);\n }\n opts;\n item;\n content;\n submenu;\n attachment;\n #openTimer = null;\n constructor(opts, item, content, submenu) {\n this.opts = opts;\n this.item = item;\n this.content = content;\n this.submenu = submenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.submenu.triggerNode = v));\n this.onpointerleave = this.onpointerleave.bind(this);\n this.onpointermove = this.onpointermove.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n onDestroyEffect(() => {\n this.#clearOpenTimer();\n });\n }\n #clearOpenTimer() {\n if (this.#openTimer === null)\n return;\n this.content.domContext.getWindow().clearTimeout(this.#openTimer);\n this.#openTimer = null;\n }\n onpointermove(e) {\n if (!isMouseEvent(e))\n return;\n if (this.submenu.root.isPointerInTransit) {\n if (this.#openTimer !== null)\n this.#clearOpenTimer();\n return;\n }\n if (!this.item.opts.disabled.current &&\n !this.submenu.opts.open.current &&\n !this.#openTimer) {\n const openDelay = this.opts.openDelay.current;\n if (openDelay <= 0) {\n this.submenu.onOpen();\n return;\n }\n this.#openTimer = this.content.domContext.setTimeout(() => {\n if (this.submenu.root.isPointerInTransit) {\n this.#clearOpenTimer();\n return;\n }\n this.submenu.onOpen();\n this.#clearOpenTimer();\n }, openDelay);\n }\n }\n onpointerleave(e) {\n if (!isMouseEvent(e))\n return;\n this.#clearOpenTimer();\n }\n onkeydown(e) {\n const isTypingAhead = this.content.search !== \"\";\n if (this.item.opts.disabled.current || (isTypingAhead && e.key === kbd.SPACE))\n return;\n if (SUB_OPEN_KEYS[this.submenu.root.opts.dir.current].includes(e.key)) {\n e.currentTarget.click();\n e.preventDefault();\n }\n }\n onclick(e) {\n if (this.item.opts.disabled.current)\n return;\n /**\n * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n * and we rely heavily on `onFocusOutside` for submenus to close when switching\n * between separate submenus.\n */\n if (!isHTMLElement(e.currentTarget))\n return;\n e.currentTarget.focus();\n const selectEvent = new CustomEvent(\"menusubtriggerselect\", {\n bubbles: true,\n cancelable: true,\n });\n this.opts.onSelect.current(selectEvent);\n if (!this.submenu.opts.open.current) {\n this.submenu.onOpen();\n afterTick(() => {\n const contentNode = this.submenu.contentNode;\n if (!contentNode)\n return;\n MenuOpenEvent.dispatch(contentNode);\n });\n }\n }\n props = $derived.by(() => mergeProps({\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": boolToStr(this.submenu.opts.open.current),\n \"data-state\": getDataOpenClosed(this.submenu.opts.open.current),\n \"aria-controls\": this.submenu.opts.open.current\n ? this.submenu.contentId.current\n : undefined,\n [this.submenu.root.getBitsAttr(\"sub-trigger\")]: \"\",\n onclick: this.onclick,\n onpointermove: this.onpointermove,\n onpointerleave: this.onpointerleave,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }, this.item.props));\n}\nexport class MenuCheckboxItemState {\n static create(opts, checkboxGroup) {\n const item = new MenuItemState(opts, new MenuItemSharedState(opts, MenuContentContext.get()));\n return new MenuCheckboxItemState(opts, item, checkboxGroup);\n }\n opts;\n item;\n group;\n constructor(opts, item, group = null) {\n this.opts = opts;\n this.item = item;\n this.group = group;\n // Watch for value changes in the group if we're part of one\n if (this.group) {\n watch(() => this.group.opts.value.current, (groupValues) => {\n this.opts.checked.current = groupValues.includes(this.opts.value.current);\n });\n // Watch for checked state changes and sync with group\n watch(() => this.opts.checked.current, (checked) => {\n if (checked) {\n this.group.addValue(this.opts.value.current);\n }\n else {\n this.group.removeValue(this.opts.value.current);\n }\n });\n }\n }\n toggleChecked() {\n if (this.opts.indeterminate.current) {\n this.opts.indeterminate.current = false;\n this.opts.checked.current = true;\n }\n else {\n this.opts.checked.current = !this.opts.checked.current;\n }\n }\n snippetProps = $derived.by(() => ({\n checked: this.opts.checked.current,\n indeterminate: this.opts.indeterminate.current,\n }));\n props = $derived.by(() => ({\n ...this.item.props,\n role: \"menuitemcheckbox\",\n \"aria-checked\": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),\n \"data-state\": getCheckedState(this.opts.checked.current),\n [this.item.root.getBitsAttr(\"checkbox-item\")]: \"\",\n }));\n}\nexport class MenuGroupState {\n static create(opts) {\n return MenuGroupContext.set(new MenuGroupState(opts, MenuRootContext.get()));\n }\n opts;\n root;\n attachment;\n groupHeadingId = $state(undefined);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n [this.root.getBitsAttr(\"group\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuGroupHeadingState {\n static create(opts) {\n // Try to get checkbox group first, then radio group, then regular group\n const checkboxGroup = MenuCheckboxGroupContext.getOr(null);\n if (checkboxGroup)\n return new MenuGroupHeadingState(opts, checkboxGroup);\n const radioGroup = MenuRadioGroupContext.getOr(null);\n if (radioGroup)\n return new MenuGroupHeadingState(opts, radioGroup);\n return new MenuGroupHeadingState(opts, MenuGroupContext.get());\n }\n opts;\n group;\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.attachment = attachRef(this.opts.ref, (v) => (this.group.groupHeadingId = v?.id));\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.group.root.getBitsAttr(\"group-heading\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuSeparatorState {\n static create(opts) {\n return new MenuSeparatorState(opts, MenuRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"separator\",\n [this.root.getBitsAttr(\"separator\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuArrowState {\n static create() {\n return new MenuArrowState(MenuRootContext.get());\n }\n root;\n constructor(root) {\n this.root = root;\n }\n props = $derived.by(() => ({\n [this.root.getBitsAttr(\"arrow\")]: \"\",\n }));\n}\nexport class MenuRadioGroupState {\n static create(opts) {\n return MenuGroupContext.set(MenuRadioGroupContext.set(new MenuRadioGroupState(opts, MenuContentContext.get())));\n }\n opts;\n content;\n attachment;\n groupHeadingId = $state(null);\n root;\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.root = content.parentMenu.root;\n this.attachment = attachRef(this.opts.ref);\n }\n setValue(v) {\n this.opts.value.current = v;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"radio-group\")]: \"\",\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n ...this.attachment,\n }));\n}\nexport class MenuRadioItemState {\n static create(opts) {\n const radioGroup = MenuRadioGroupContext.get();\n const sharedItem = new MenuItemSharedState(opts, radioGroup.content);\n const item = new MenuItemState(opts, sharedItem);\n return new MenuRadioItemState(opts, item, radioGroup);\n }\n opts;\n item;\n group;\n attachment;\n isChecked = $derived.by(() => this.group.opts.value.current === this.opts.value.current);\n constructor(opts, item, group) {\n this.opts = opts;\n this.item = item;\n this.group = group;\n this.attachment = attachRef(this.opts.ref);\n }\n selectValue() {\n this.group.setValue(this.opts.value.current);\n }\n props = $derived.by(() => ({\n [this.group.root.getBitsAttr(\"radio-item\")]: \"\",\n ...this.item.props,\n role: \"menuitemradio\",\n \"aria-checked\": getAriaChecked(this.isChecked, false),\n \"data-state\": getCheckedState(this.isChecked),\n ...this.attachment,\n }));\n}\nexport class DropdownMenuTriggerState {\n static create(opts) {\n return new DropdownMenuTriggerState(opts, MenuMenuContext.get());\n }\n opts;\n parentMenu;\n attachment;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.parentMenu.triggerNode = v));\n }\n onclick = (e) => {\n /**\n * MacOS VoiceOver sends a click in Safari/Firefox bypassing the keydown event\n * when V0+Space is pressed. Since we already handle the keydown event and the\n * pointerdown events separately, we ignore it if the detail is not 0.\n */\n if (this.opts.disabled.current || e.detail !== 0)\n return;\n this.parentMenu.toggleOpen();\n e.preventDefault();\n };\n onpointerdown = (e) => {\n if (this.opts.disabled.current || isDisabledElement(this.opts.ref.current))\n return;\n if (e.pointerType === \"touch\")\n return e.preventDefault();\n if (e.button === 0 && e.ctrlKey === false) {\n this.parentMenu.toggleOpen();\n // prevent trigger focusing when opening to allow\n // the content to be given focus without competition\n if (!this.parentMenu.opts.open.current)\n e.preventDefault();\n }\n };\n onpointerup = (e) => {\n if (this.opts.disabled.current || isDisabledElement(this.opts.ref.current))\n return;\n if (e.pointerType === \"touch\") {\n e.preventDefault();\n this.parentMenu.toggleOpen();\n }\n };\n onkeydown = (e) => {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n this.parentMenu.toggleOpen();\n e.preventDefault();\n return;\n }\n if (e.key === kbd.ARROW_DOWN) {\n this.parentMenu.onOpen();\n e.preventDefault();\n }\n };\n #ariaControls = $derived.by(() => {\n if (this.parentMenu.opts.open.current && this.parentMenu.contentId.current)\n return this.parentMenu.contentId.current;\n return undefined;\n });\n props = $derived.by(() => ({\n id: this.opts.id.current,\n disabled: this.opts.disabled.current,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": boolToStr(this.parentMenu.opts.open.current),\n \"aria-controls\": this.#ariaControls,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n [this.parentMenu.root.getBitsAttr(\"trigger\")]: \"\",\n //\n onclick: this.onclick,\n onpointerdown: this.onpointerdown,\n onpointerup: this.onpointerup,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\nexport class ContextMenuTriggerState {\n static create(opts) {\n return new ContextMenuTriggerState(opts, MenuMenuContext.get());\n }\n opts;\n parentMenu;\n attachment;\n #point = $state({ x: 0, y: 0 });\n virtualElement = simpleBox({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...this.#point }),\n });\n #longPressTimer = null;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.parentMenu.triggerNode = v));\n this.oncontextmenu = this.oncontextmenu.bind(this);\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onpointermove = this.onpointermove.bind(this);\n this.onpointercancel = this.onpointercancel.bind(this);\n this.onpointerup = this.onpointerup.bind(this);\n watch(() => this.#point, (point) => {\n this.virtualElement.current = {\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...point }),\n };\n });\n watch(() => this.opts.disabled.current, (isDisabled) => {\n if (isDisabled) {\n this.#clearLongPressTimer();\n }\n });\n onDestroyEffect(() => this.#clearLongPressTimer());\n }\n #clearLongPressTimer() {\n if (this.#longPressTimer === null)\n return;\n getWindow(this.opts.ref.current).clearTimeout(this.#longPressTimer);\n }\n #handleOpen(e) {\n this.#point = { x: e.clientX, y: e.clientY };\n this.parentMenu.onOpen();\n }\n oncontextmenu(e) {\n if (e.defaultPrevented || this.opts.disabled.current)\n return;\n this.#clearLongPressTimer();\n this.#handleOpen(e);\n e.preventDefault();\n this.parentMenu.contentNode?.focus();\n }\n onpointerdown(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n this.#longPressTimer = getWindow(this.opts.ref.current).setTimeout(() => this.#handleOpen(e), 700);\n }\n onpointermove(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n onpointercancel(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n onpointerup(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n disabled: this.opts.disabled.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n [CONTEXT_MENU_TRIGGER_ATTR]: \"\",\n tabindex: -1,\n onpointerdown: this.onpointerdown,\n onpointermove: this.onpointermove,\n onpointercancel: this.onpointercancel,\n onpointerup: this.onpointerup,\n oncontextmenu: this.oncontextmenu,\n ...this.attachment,\n }));\n}\nexport class MenuCheckboxGroupState {\n static create(opts) {\n return MenuCheckboxGroupContext.set(new MenuCheckboxGroupState(opts, MenuContentContext.get()));\n }\n opts;\n content;\n root;\n attachment;\n groupHeadingId = $state(null);\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.root = content.parentMenu.root;\n this.attachment = attachRef(this.opts.ref);\n }\n addValue(checkboxValue) {\n if (!checkboxValue)\n return;\n if (!this.opts.value.current.includes(checkboxValue)) {\n const newValue = [...$state.snapshot(this.opts.value.current), checkboxValue];\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n }\n removeValue(checkboxValue) {\n if (!checkboxValue)\n return;\n const index = this.opts.value.current.indexOf(checkboxValue);\n if (index === -1)\n return;\n const newValue = this.opts.value.current.filter((v) => v !== checkboxValue);\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"checkbox-group\")]: \"\",\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n ...this.attachment,\n }));\n}\nexport class MenuSubmenuState {\n static create(opts) {\n const menu = MenuMenuContext.get();\n return MenuMenuContext.set(new MenuMenuState(opts, menu.root, menu));\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { ContextMenuRootProps } from \"../types.js\";\n\timport FloatingLayer from \"../../utilities/floating-layer/components/floating-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { MenuMenuState, MenuRootState } from \"../../menu/menu.svelte.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tdir = \"ltr\",\n\t\t// debugMode = false,\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: ContextMenuRootProps = $props();\n\n\tconst root = MenuRootState.create({\n\t\tvariant: boxWith(() => \"context-menu\" as const),\n\t\tdir: boxWith(() => dir),\n\t\t// debugMode: boxWith(() => debugMode),\n\t\tonClose: () => {\n\t\t\topen = false;\n\t\t\tonOpenChange?.(false);\n\t\t},\n\t});\n\n\tMenuMenuState.create(\n\t\t{\n\t\t\topen: boxWith(\n\t\t\t\t() => open,\n\t\t\t\t(v) => {\n\t\t\t\t\topen = v;\n\t\t\t\t\tonOpenChange(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t\t},\n\t\troot\n\t);\n</script>\n\n<FloatingLayer>\n\t{@render children?.()}\n</FloatingLayer>\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { MenuItemProps } from \"../types.js\";\n\timport { MenuItemState } from \"../menu.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tdisabled = false,\n\t\tonSelect = noop,\n\t\tcloseOnSelect = true,\n\t\t...restProps\n\t}: MenuItemProps = $props();\n\n\tconst itemState = MenuItemState.create({\n\t\tid: boxWith(() => id),\n\t\tdisabled: boxWith(() => disabled),\n\t\tonSelect: boxWith(() => onSelect),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tcloseOnSelect: boxWith(() => closeOnSelect),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, itemState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ContextMenuContentProps } from \"../types.js\";\n\timport { MenuContentState } from \"../../menu/menu.svelte.js\";\n\timport { CONTEXT_MENU_TRIGGER_ATTR } from \"../../menu/context-menu-attributes.js\";\n\timport { useId } from \"../../../internal/use-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport PopperLayer from \"../../utilities/popper-layer/popper-layer.svelte\";\n\timport { getFloatingContentCSSVars } from \"../../../internal/floating-svelte/floating-utils.svelte.js\";\n\timport PopperLayerForceMount from \"../../utilities/popper-layer/popper-layer-force-mount.svelte\";\n\n\tlet {\n\t\tid = useId(),\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tloop = true,\n\t\tonInteractOutside = noop,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tpreventScroll = true,\n\t\tside = \"right\",\n\t\tsideOffset = 2,\n\t\talign = \"start\",\n\t\t// we need to explicitly pass this prop to the PopperLayer to override\n\t\t// the default menu behavior of handling outside interactions on the trigger\n\t\tonEscapeKeydown = noop,\n\t\tforceMount = false,\n\t\ttrapFocus = false,\n\t\tstyle,\n\t\t...restProps\n\t}: ContextMenuContentProps = $props();\n\n\tconst contentState = MenuContentState.create({\n\t\tid: boxWith(() => id),\n\t\tloop: boxWith(() => loop),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonCloseAutoFocus: boxWith(() => onCloseAutoFocus),\n\t});\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(restProps, contentState.props, {\n\t\t\tside,\n\t\t\tsideOffset,\n\t\t\talign,\n\t\t\tonOpenAutoFocus,\n\t\t\tisValidEvent,\n\t\t\ttrapFocus,\n\t\t\tloop,\n\t\t\tid,\n\t\t\tref: contentState.opts.ref,\n\t\t\tpreventScroll,\n\t\t\tonInteractOutside: handleInteractOutside,\n\t\t\tonEscapeKeydown: handleEscapeKeydown,\n\t\t\tshouldRender: contentState.shouldRender,\n\t\t})\n\t);\n\n\tfunction handleInteractOutside(e: PointerEvent) {\n\t\tonInteractOutside(e);\n\t\tif (e.defaultPrevented) return;\n\n\t\t// don't close if the interaction is with a submenu content or items\n\t\tif (e.target && e.target instanceof Element) {\n\t\t\tconst subContentSelector = `[${contentState.parentMenu.root.getBitsAttr(\"sub-content\")}]`;\n\t\t\tif (e.target.closest(subContentSelector)) return;\n\t\t}\n\t\tcontentState.parentMenu.onClose();\n\t}\n\n\tfunction handleEscapeKeydown(e: KeyboardEvent) {\n\t\tonEscapeKeydown(e);\n\t\tif (e.defaultPrevented) return;\n\t\tcontentState.parentMenu.onClose();\n\t}\n\n\tfunction isValidEvent(e: PointerEvent) {\n\t\tif (\"button\" in e && e.button === 2) {\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tif (!target) return false;\n\t\t\tconst isAnotherContextTrigger =\n\t\t\t\ttarget.closest(`[${CONTEXT_MENU_TRIGGER_ATTR}]`) !==\n\t\t\t\tcontentState.parentMenu.triggerNode;\n\t\t\treturn isAnotherContextTrigger;\n\t\t}\n\t\treturn false;\n\t}\n</script>\n\n{#if forceMount}\n\t<PopperLayerForceMount\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tenabled={contentState.parentMenu.opts.open.current}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"context-menu\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayerForceMount>\n{:else if !forceMount}\n\t<PopperLayer\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\topen={contentState.parentMenu.opts.open.current}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"context-menu\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayer>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ContextMenuTriggerProps } from \"../types.js\";\n\timport { ContextMenuTriggerState } from \"../../menu/menu.svelte.js\";\n\timport { useId } from \"../../../internal/use-id.js\";\n\timport { FloatingLayer } from \"../../utilities/floating-layer/index.js\";\n\n\tlet {\n\t\tid = useId(),\n\t\tref = $bindable(null),\n\t\tchild,\n\t\tchildren,\n\t\tdisabled = false,\n\t\t...restProps\n\t}: ContextMenuTriggerProps = $props();\n\n\tconst triggerState = ContextMenuTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tdisabled: boxWith(() => disabled),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(\n\t\t\trestProps,\n\t\t\ttriggerState.props,\n\t\t\t{ style: { pointerEvents: \"auto\" } },\n\t\t\t{\n\t\t\t\tstyle: restProps.style,\n\t\t\t\ttabindex: restProps.tabindex,\n\t\t\t}\n\t\t)\n\t);\n</script>\n\n<FloatingLayer.Anchor {id} virtualEl={triggerState.virtualElement} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<div {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</div>\n\t{/if}\n</FloatingLayer.Anchor>\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { MenuSeparatorProps } from \"../types.js\";\n\timport { MenuSeparatorState } from \"../menu.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tchild,\n\t\tchildren,\n\t\t...restProps\n\t}: MenuSeparatorProps = $props();\n\n\tconst separatorState = MenuSeparatorState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, separatorState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverTriggerProps } from \"../types.js\";\n\timport { PopoverTriggerState } from \"../popover.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport FloatingLayerAnchor from \"../../utilities/floating-layer/components/floating-layer-anchor.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\ttype = \"button\",\n\t\tdisabled = false,\n\t\topenOnHover = false,\n\t\topenDelay = 700,\n\t\tcloseDelay = 300,\n\t\t...restProps\n\t}: PopoverTriggerProps = $props();\n\n\tconst triggerState = PopoverTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t\topenOnHover: boxWith(() => openOnHover),\n\t\topenDelay: boxWith(() => openDelay),\n\t\tcloseDelay: boxWith(() => closeDelay),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props, { type }));\n</script>\n\n<FloatingLayerAnchor {id} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<button {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</button>\n\t{/if}\n</FloatingLayerAnchor>\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { DialogRootState } from \"../dialog.svelte.js\";\n\timport type { DialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: DialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogCloseState } from \"../dialog.svelte.js\";\n\timport type { DialogCloseProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: DialogCloseProps = $props();\n\n\tconst closeState = DialogCloseState.create({\n\t\tvariant: boxWith(() => \"close\"),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, closeState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogContentState } from \"../dialog.svelte.js\";\n\timport type { DialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: DialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","import { attachRef } from \"svelte-toolbelt\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, boolToTrueOrUndef, } from \"../../internal/attrs.js\";\nexport const toggleAttrs = createBitsAttrs({\n component: \"toggle\",\n parts: [\"root\"],\n});\nexport class ToggleRootState {\n static create(opts) {\n return new ToggleRootState(opts);\n }\n opts;\n attachment;\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n }\n onclick(_) {\n if (this.opts.disabled.current)\n return;\n this.opts.pressed.current = !this.opts.pressed.current;\n }\n snippetProps = $derived.by(() => ({\n pressed: this.opts.pressed.current,\n }));\n props = $derived.by(() => ({\n [toggleAttrs.root]: \"\",\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"aria-pressed\": boolToStr(this.opts.pressed.current),\n \"data-state\": getToggleDataState(this.opts.pressed.current),\n disabled: boolToTrueOrUndef(this.opts.disabled.current),\n onclick: this.onclick,\n ...this.attachment,\n }));\n}\nexport function getToggleDataState(condition) {\n return condition ? \"on\" : \"off\";\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ToggleRootProps } from \"../types.js\";\n\timport { ToggleRootState } from \"../toggle.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tpressed = $bindable(false),\n\t\tonPressedChange = noop,\n\t\tdisabled = false,\n\t\ttype = \"button\",\n\t\tchildren,\n\t\tchild,\n\t\t...restProps\n\t}: ToggleRootProps = $props();\n\n\tconst toggleState = ToggleRootState.create({\n\t\tpressed: boxWith(\n\t\t\t() => pressed,\n\t\t\t(v) => {\n\t\t\t\tpressed = v;\n\t\t\t\tonPressedChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled ?? false),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, toggleState.props, { type }));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps, ...toggleState.snippetProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(toggleState.snippetProps)}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: ContextMenuPrimitive.PortalProps = $props();\n</script>\n\n<ContextMenuPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\timport type { WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport ContextMenuPortal from \"./context-menu-portal.svelte\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tportalProps,\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.ContentProps & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof ContextMenuPortal>>;\n\t} = $props();\n</script>\n\n<ContextMenuPortal {...portalProps}>\n\t<ContextMenuPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"context-menu-content\"\n\t\tclass={cn(\n\t\t\t\"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-lg p-1 shadow-md ring-1 duration-100 z-(--z-floating) max-h-(--bits-context-menu-content-available-height) origin-(--bits-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</ContextMenuPortal>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tinset,\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: ContextMenuPrimitive.ItemProps & {\n\t\tinset?: boolean;\n\t\tvariant?: \"default\" | \"destructive\";\n\t} = $props();\n</script>\n\n<ContextMenuPrimitive.Item\n\tbind:ref\n\tdata-slot=\"context-menu-item\"\n\tdata-inset={inset}\n\tdata-variant={variant}\n\tclass={cn(\n\t\t\"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.SeparatorProps = $props();\n</script>\n\n<ContextMenuPrimitive.Separator\n\tbind:ref\n\tdata-slot=\"context-menu-separator\"\n\tclass={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.TriggerProps = $props();\n</script>\n\n<ContextMenuPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"context-menu-trigger\"\n\tclass={cn(\"select-none\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: ContextMenuPrimitive.RootProps = $props();\n</script>\n\n<ContextMenuPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\t/**\n\t * \"+42 −10\": the lines a session has added and removed, for the trailing\n\t * meta slot of its sidebar row. Muted and small, so the state indicator\n\t * stays the loudest thing on the row; nothing at all when both are zero.\n\t */\n\timport type { ChangesInfo } from '$shared/types/ws-messages.js';\n\n\tlet { changes }: { changes: ChangesInfo | null | undefined } = $props();\n</script>\n\n{#if changes && (changes.additions > 0 || changes.deletions > 0)}\n\t<span\n\t\tclass=\"diff\"\n\t\ttitle=\"{changes.files} {changes.files === 1 ? 'file' : 'files'} changed ({changes.source === 'git' ? 'git' : 'this session'})\"\n\t>\n\t\t<span class=\"add\">+{changes.additions}</span>\n\t\t<span class=\"del\">−{changes.deletions}</span>\n\t</span>\n{/if}\n\n<style>\n\t.diff {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\twhite-space: nowrap;\n\t\tfont-variant-numeric: tabular-nums;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * The project the session works in: the repo root (else the cwd), the\n\t * branch, and the URLs named in the repo's `.claude-mux.json`. The\n\t * simplest pane there is, shipped with the panel so the container has\n\t * something to hold before the Changes, Files and Web panes arrive.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport type { ProjectInfo } from '$shared/server/project.js';\n\n\tlet { session, base, setActions, active }: PaneBodyProps = $props();\n\n\tlet info = $state<ProjectInfo | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet loading = $state(false);\n\n\t/** Bumped by each load, so an answer that arrives after a newer request is dropped. */\n\tlet seq = 0;\n\n\tasync function load(id: string) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/project`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tif (mine === seq) info = body as ProjectInfo;\n\t\t} catch (err) {\n\t\t\tif (mine === seq) error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === seq) loading = false;\n\t\t}\n\t}\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t// Read when first shown, and again whenever the session moves to another directory.\n\tconst cwd = $derived(session?.cwd ?? null);\n\t$effect(() => {\n\t\tif (sessionId && cwd && active) void load(sessionId);\n\t});\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loading,\n\t\t\t\trun: () => sessionId && void load(sessionId)\n\t\t\t}\n\t\t]);\n\t});\n\n\tconst urls = $derived(Object.entries(info?.config?.urls ?? {}));\n</script>\n\n<div class=\"project\">\n\t{#if error}\n\t\t<p class=\"err\">{error}</p>\n\t{:else if !info}\n\t\t<p class=\"dim\">Loading…</p>\n\t{:else}\n\t\t<dl>\n\t\t\t<dt>{info.repo ? 'Repository' : 'Directory'}</dt>\n\t\t\t<dd class=\"mono\" title={info.root}>{info.root}</dd>\n\t\t\t<dt>Branch</dt>\n\t\t\t<dd class=\"mono\">\n\t\t\t\t{#if info.branch}{info.branch}{:else if info.repo}<span class=\"dim\">detached HEAD</span>{:else}<span\n\t\t\t\t\t\tclass=\"dim\">not a git repository</span\n\t\t\t\t\t>{/if}\n\t\t\t</dd>\n\t\t\t<dt>URLs</dt>\n\t\t\t<dd>\n\t\t\t\t{#if urls.length > 0}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each urls as [name, url] (name)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<span class=\"name\">{name}</span>\n\t\t\t\t\t\t\t\t<a class=\"mono\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">{url}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t{:else if info.configError}\n\t\t\t\t\t<span class=\"err\">.claude-mux.json: {info.configError}</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span class=\"dim\">\n\t\t\t\t\t\tNone. Commit a <code>.claude-mux.json</code> at the root to name them:\n\t\t\t\t\t</span>\n\t\t\t\t\t<pre>{`{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`}</pre>\n\t\t\t\t{/if}\n\t\t\t</dd>\n\t\t</dl>\n\t{/if}\n</div>\n\n<style>\n\t.project {\n\t\tpadding: 16px 18px;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tdl {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: max-content 1fr;\n\t\tgap: 10px 16px;\n\t\tmargin: 0;\n\t}\n\tdt {\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tpadding-top: 2px;\n\t}\n\tdd {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.mono,\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: grid;\n\t\tgap: 6px;\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t\tmin-width: 0;\n\t}\n\t.name {\n\t\tcolor: #a8a29e;\n\t\tmin-width: 3.5em;\n\t}\n\ta {\n\t\tcolor: #93c5fd;\n\t\ttext-decoration: none;\n\t\toverflow-wrap: anywhere;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n\tpre {\n\t\tmargin: 8px 0 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\" module>\n\timport { type VariantProps, tv } from \"tailwind-variants\";\n\n\texport const toggleVariants = tv({\n\t\tbase: \"hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline: \"border-input hover:bg-muted border bg-transparent\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\tsm: \"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\txs: \"h-6 min-w-6 rounded-md px-1.5 text-[11px] [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tlg: \"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t});\n\n\texport type ToggleVariant = VariantProps<typeof toggleVariants>[\"variant\"];\n\texport type ToggleSize = VariantProps<typeof toggleVariants>[\"size\"];\n\texport type ToggleVariants = VariantProps<typeof toggleVariants>;\n</script>\n\n<script lang=\"ts\">\n\timport { Toggle as TogglePrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tpressed = $bindable(false),\n\t\tclass: className,\n\t\tsize = \"default\",\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: TogglePrimitive.RootProps & {\n\t\tvariant?: ToggleVariant;\n\t\tsize?: ToggleSize;\n\t} = $props();\n</script>\n\n<TogglePrimitive.Root\n\tbind:ref\n\tbind:pressed\n\tdata-slot=\"toggle\"\n\tclass={cn(toggleVariants({ variant, size }), className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Changes pane's diff, loaded the first time a diff\n * is drawn so the session page does not carry highlight.js until then.\n *\n * Lines are coloured one at a time: a diff shows fragments, so a construct\n * that opens above the hunk (a block comment, a template string) is never\n * seen whole anyway, and per line keeps a bad guess from spilling further.\n */\nimport type { HLJSApi, LanguageFn } from 'highlight.js';\n\nlet loading: Promise<HLJSApi> | null = null;\n\nconst LOADERS: Record<string, () => Promise<{ default: LanguageFn }>> = {\n\ttypescript: () => import('highlight.js/lib/languages/typescript'),\n\tjavascript: () => import('highlight.js/lib/languages/javascript'),\n\txml: () => import('highlight.js/lib/languages/xml'),\n\tcss: () => import('highlight.js/lib/languages/css'),\n\tscss: () => import('highlight.js/lib/languages/scss'),\n\tjson: () => import('highlight.js/lib/languages/json'),\n\tmarkdown: () => import('highlight.js/lib/languages/markdown'),\n\tpython: () => import('highlight.js/lib/languages/python'),\n\tbash: () => import('highlight.js/lib/languages/bash'),\n\tyaml: () => import('highlight.js/lib/languages/yaml'),\n\tini: () => import('highlight.js/lib/languages/ini'),\n\trust: () => import('highlight.js/lib/languages/rust'),\n\tgo: () => import('highlight.js/lib/languages/go'),\n\tsql: () => import('highlight.js/lib/languages/sql'),\n\tjava: () => import('highlight.js/lib/languages/java'),\n\tkotlin: () => import('highlight.js/lib/languages/kotlin'),\n\tc: () => import('highlight.js/lib/languages/c'),\n\tcpp: () => import('highlight.js/lib/languages/cpp'),\n\truby: () => import('highlight.js/lib/languages/ruby'),\n\tphp: () => import('highlight.js/lib/languages/php'),\n\tswift: () => import('highlight.js/lib/languages/swift'),\n\tlua: () => import('highlight.js/lib/languages/lua'),\n\tdockerfile: () => import('highlight.js/lib/languages/dockerfile'),\n\tmakefile: () => import('highlight.js/lib/languages/makefile')\n};\n\nconst core = () => (loading ??= import('highlight.js/lib/core').then((m) => m.default));\n\n/**\n * Each line as escaped HTML with highlight.js's token spans, or null when the\n * language is unknown (the caller then draws the text as is).\n */\nexport async function highlightLines(lines: string[], language: string | null): Promise<string[] | null> {\n\tif (!language || !LOADERS[language]) return null;\n\tconst load = LOADERS[language];\n\tconst hljs = await core();\n\tif (!hljs.getLanguage(language)) hljs.registerLanguage(language, (await load()).default);\n\treturn lines.map((line) => hljs.highlight(line, { language, ignoreIllegals: true }).value);\n}\n","<script lang=\"ts\">\n\t/**\n\t * A file's hunks drawn as a unified diff: line numbers on both sides, a row\n\t * for each stretch of unchanged lines the diff leaves out, and the code\n\t * coloured once highlight.js has loaded. Given a way to read the file\n\t * (`loadText`), a left-out stretch can be opened a few lines at a time from\n\t * either end, or all at once. The Changes pane and the History pane both\n\t * read a diff through it.\n\t */\n\timport { untrack } from 'svelte';\n\timport { diffRows, languageFor, type DiffRow, type Hunk } from '$lib/side-panel/changes';\n\timport { highlightLines } from '$lib/side-panel/highlight';\n\n\tlet {\n\t\thunks,\n\t\tfile,\n\t\tloadText\n\t}: {\n\t\thunks: Hunk[];\n\t\tfile: string;\n\t\t/** The file's new side, whole, or null when it cannot be read as text. */\n\t\tloadText?: () => Promise<string | null>;\n\t} = $props();\n\n\ttype Gap = Extract<DiffRow, { type: 'gap' }>;\n\t/** A stretch still hidden, with what is left of it and which ends can be opened further. */\n\ttype Hidden = { type: 'hidden'; gap: Gap; left: number | null; first: boolean; last: boolean };\n\ttype Shown = Exclude<DiffRow, Gap> | Hidden;\n\n\t/** Lines shown per press on one end of a hidden stretch. */\n\tconst STEP = 20;\n\n\t/** The file's lines once someone has asked for hidden ones; false when it could not be read. */\n\tlet text = $state<string[] | false | null>(null);\n\tlet reading = $state(false);\n\t/** Lines opened at the top and the bottom of each hidden stretch, keyed by where it starts. */\n\tlet opened = $state<Record<number, { top: number; bottom: number }>>({});\n\n\tconst canOpen = $derived(loadText !== undefined && text !== false);\n\tconst base = $derived(diffRows(hunks, { tail: loadText !== undefined }));\n\n\tconst rows = $derived.by((): Shown[] => {\n\t\tconst out: Shown[] = [];\n\t\tconst gaps = base.filter((r): r is Gap => r.type === 'gap');\n\t\tfor (const row of base) {\n\t\t\tif (row.type !== 'gap') {\n\t\t\t\tout.push(row);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst lines = text || null;\n\t\t\tconst count = row.count ?? (lines ? Math.max(0, lines.length - row.from + 1) : null);\n\t\t\tconst open = opened[row.from] ?? { top: 0, bottom: 0 };\n\t\t\tconst top = count === null ? open.top : Math.min(open.top, count);\n\t\t\tconst bottom = count === null ? 0 : Math.min(open.bottom, count - top);\n\t\t\tconst line = (n: number): Shown => ({\n\t\t\t\ttype: 'context',\n\t\t\t\told: row.old + (n - row.from),\n\t\t\t\tnew: n,\n\t\t\t\ttext: lines?.[n - 1] ?? ''\n\t\t\t});\n\t\t\tfor (let i = 0; i < top; i++) out.push(line(row.from + i));\n\t\t\tconst left = count === null ? null : count - top - bottom;\n\t\t\t// The rest of a file that turns out to end where the diff does needs no row.\n\t\t\tif (left === null ? canOpen : left > 0) {\n\t\t\t\tout.push({ type: 'hidden', gap: row, left, first: row === gaps[0] && row.from === 1, last: row.count === null });\n\t\t\t}\n\t\t\tif (count !== null) for (let i = bottom; i > 0; i--) out.push(line(row.from + count - i));\n\t\t}\n\t\treturn out;\n\t});\n\n\tasync function open(gap: Gap, end: 'top' | 'bottom' | 'all') {\n\t\tif (text === null && loadText && !reading) {\n\t\t\treading = true;\n\t\t\ttry {\n\t\t\t\tconst read = await loadText();\n\t\t\t\ttext = read === null ? false : read.replace(/\\n$/, '').split('\\n');\n\t\t\t} catch {\n\t\t\t\ttext = false;\n\t\t\t} finally {\n\t\t\t\treading = false;\n\t\t\t}\n\t\t}\n\t\tif (!text) return;\n\t\tconst was = opened[gap.from] ?? { top: 0, bottom: 0 };\n\t\topened[gap.from] =\n\t\t\tend === 'all' ? { top: Infinity, bottom: 0 } : { ...was, [end]: was[end] + STEP };\n\t}\n\n\t// Another file is another set of hidden lines.\n\t$effect(() => {\n\t\tvoid file;\n\t\tuntrack(() => {\n\t\t\ttext = null;\n\t\t\topened = {};\n\t\t});\n\t});\n\n\tconst SIGN = { add: '+', del: '−', context: ' ' } as const;\n\n\t/** Rows past this many are drawn plain: colouring them costs more than it gives. */\n\tconst PAINT_LIMIT = 4000;\n\t/** Highlighted HTML per row index, filled in once highlight.js has loaded. */\n\tlet painted = $state<(string | null)[] | null>(null);\n\t$effect(() => {\n\t\tpainted = null;\n\t\tif (rows.length === 0 || rows.length > PAINT_LIMIT) return;\n\t\tconst lines = rows.map((r) => ('text' in r ? r.text : ''));\n\t\tconst language = untrack(() => languageFor(file));\n\t\tlet stale = false;\n\t\tvoid highlightLines(lines, language).then((html) => {\n\t\t\tif (!stale && html) painted = html;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n</script>\n\n<div class=\"lines\">\n\t{#each rows as row, i (i)}\n\t\t{#if row.type === 'hunk'}\n\t\t\t<div class=\"hunk\">{row.header}</div>\n\t\t{:else if row.type === 'hidden'}\n\t\t\t{@const some = row.left === null || row.left > STEP}\n\t\t\t<div class=\"gap\">\n\t\t\t\t{#if canOpen && some && !row.first}\n\t\t\t\t\t<button type=\"button\" title=\"Show {STEP} more lines below\" aria-label=\"Show {STEP} more lines below\" onclick={() => void open(row.gap, 'top')}>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-expand-down\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t{#if canOpen}\n\t\t\t\t\t<button type=\"button\" class=\"all\" title=\"Show all of these lines\" onclick={() => void open(row.gap, 'all')}>\n\t\t\t\t\t\t{#if row.left === null}\n\t\t\t\t\t\t\t{reading ? 'Reading…' : 'the rest of the file'}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{row.left} unchanged {row.left === 1 ? 'line' : 'lines'}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{:else}\n\t\t\t\t\t<span>⋯ {row.left} unchanged {row.left === 1 ? 'line' : 'lines'} ⋯</span>\n\t\t\t\t{/if}\n\t\t\t\t{#if canOpen && some && !row.last}\n\t\t\t\t\t<button type=\"button\" title=\"Show {STEP} more lines above\" aria-label=\"Show {STEP} more lines above\" onclick={() => void open(row.gap, 'bottom')}>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-expand-up\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<div class=\"ln {row.type}\">\n\t\t\t\t<span class=\"no\">{row.old ?? ''}</span><span class=\"no\">{row.new ?? ''}</span><span class=\"sign\"\n\t\t\t\t\t>{SIGN[row.type]}</span\n\t\t\t\t><!-- eslint-disable-next-line svelte/no-at-html-tags -- highlight.js escapes the text it colours --><span\n\t\t\t\t\tclass=\"code\">{#if painted?.[i] != null}{@html painted[i]}{:else}{row.text}{/if}</span\n\t\t\t\t>\n\t\t\t</div>\n\t\t{/if}\n\t{/each}\n</div>\n\n<style>\n\t.lines {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 16px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.hunk {\n\t\tpadding: 2px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #161616;\n\t\twhite-space: pre;\n\t}\n\t.gap {\n\t\tposition: sticky;\n\t\tleft: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 4px;\n\t\tmin-height: 26px;\n\t\tpadding: 0 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #141414;\n\t}\n\t.gap button {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\theight: 24px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 5px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.gap button:hover {\n\t\tbackground: #232323;\n\t\tcolor: #f5f5f4;\n\t}\n\t.gap button:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t.gap iconify-icon {\n\t\tfont-size: 14px;\n\t}\n\t@media (pointer: coarse) {\n\t\t.gap {\n\t\t\tmin-height: 38px;\n\t\t}\n\t\t.gap button {\n\t\t\theight: 34px;\n\t\t\tpadding: 0 12px;\n\t\t}\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcolor: #a8a29e;\n\t}\n\t.ln.add {\n\t\tbackground: #0f2417;\n\t\tcolor: #bbf7d0;\n\t}\n\t.ln.del {\n\t\tbackground: #2a1215;\n\t\tcolor: #fecaca;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: 4ch;\n\t\tpadding-right: 1ch;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tuser-select: none;\n\t}\n\t.sign {\n\t\tflex: none;\n\t\twidth: 2ch;\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t}\n\t.ln.add .sign {\n\t\tcolor: #4ade80;\n\t}\n\t.ln.del .sign {\n\t\tcolor: #f87171;\n\t}\n\t.code {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* highlight.js tokens, muted so the add/del backgrounds still lead. */\n\t.code :global(.hljs-keyword),\n\t.code :global(.hljs-built_in),\n\t.code :global(.hljs-literal),\n\t.code :global(.hljs-selector-tag) {\n\t\tcolor: #c4b5fd;\n\t}\n\t.code :global(.hljs-string),\n\t.code :global(.hljs-regexp),\n\t.code :global(.hljs-attr),\n\t.code :global(.hljs-selector-attr) {\n\t\tcolor: #fcd34d;\n\t}\n\t.code :global(.hljs-number),\n\t.code :global(.hljs-symbol) {\n\t\tcolor: #fdba74;\n\t}\n\t.code :global(.hljs-comment),\n\t.code :global(.hljs-meta) {\n\t\tcolor: #78716c;\n\t\tfont-style: italic;\n\t}\n\t.code :global(.hljs-title),\n\t.code :global(.hljs-function),\n\t.code :global(.hljs-section) {\n\t\tcolor: #93c5fd;\n\t}\n\t.code :global(.hljs-type),\n\t.code :global(.hljs-class),\n\t.code :global(.hljs-name),\n\t.code :global(.hljs-selector-class) {\n\t\tcolor: #5eead4;\n\t}\n\t.code :global(.hljs-variable),\n\t.code :global(.hljs-template-variable),\n\t.code :global(.hljs-property) {\n\t\tcolor: #f9a8d4;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * What the session changed, from one of two sources: Current (git's\n\t * working tree, which catches edits made through Bash) or Session (the\n\t * edits in the session's own log, which reach files outside the repo and\n\t * know which turn made each). A file list on the left, the selected\n\t * file's diff on the right; narrower than the two fit, one at a time.\n\t *\n\t * The URL holds the file (`file`), the Session turn (`turn`, its number in\n\t * the session) and the source (`source`), so a link can open any of it.\n\t * While shown, the pane re-reads whenever the session's hooks report in.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tdisplayPath,\n\t\tisGenerated,\n\t\tstatusLetter,\n\t\tsumCounts,\n\t\ttype Diff,\n\t\ttype Listing,\n\t\ttype Source\n\t} from '$lib/side-panel/changes';\n\timport DiffLines from './DiffLines.svelte';\n\n\tlet { session, base, params, setParams, setActions, openPane, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t/** Git when the session sits in a repo, else its log; a `source` param overrides. */\n\tconst inRepo = $derived(!!session?.git_root || session?.changes?.source === 'git');\n\t/** Set once git answered that the session is not in a work tree. */\n\tlet gitMissing = $state(false);\n\tconst wanted = $derived<Source>(\n\t\tparams.source === 'session' || params.source === 'git' ? params.source : inRepo ? 'git' : 'session'\n\t);\n\tconst source = $derived<Source>(gitMissing && wanted === 'git' ? 'session' : wanted);\n\n\tlet listing = $state<Listing | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loadingList = $state(false);\n\t/** Bumped by each listing read, so the diff is read again with it. */\n\tlet listStamp = $state(0);\n\tlet listSeq = 0;\n\t/** A reload asked for while one was in flight: run once more when it lands. */\n\tlet again: { id: string; src: Source } | null = null;\n\n\tasync function loadList(id: string, src: Source) {\n\t\tif (loadingList) {\n\t\t\tagain = { id, src };\n\t\t\treturn;\n\t\t}\n\t\tconst mine = ++listSeq;\n\t\tloadingList = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/changes?source=${src}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (res.status === 404 && src === 'git') {\n\t\t\t\tgitMissing = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tlisting = body as Listing;\n\t\t\tlistStamp++;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loadingList = false;\n\t\t\tconst next = again;\n\t\t\tagain = null;\n\t\t\tif (next) void loadList(next.id, next.src);\n\t\t}\n\t}\n\n\t/**\n\t * Re-read whenever a hook reports in or the broadcast count moves — what\n\t * makes git re-read the repo, too. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(\n\t\t`${session?.last_update ?? 0}:${session?.changes?.additions ?? 0}:${session?.changes?.deletions ?? 0}:${session?.changes?.files ?? 0}`\n\t);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tconst id = sessionId;\n\t\tconst src = source;\n\t\t// Untracked: `loadList` reads its own `loadingList`, and an effect that\n\t\t// depended on that ran again the moment each read finished. The list was\n\t\t// then read without pause, every read asked for the diff afresh, and each\n\t\t// diff was thrown away as stale before it could be drawn.\n\t\tif (id && active) untrack(() => void loadList(id, src));\n\t});\n\n\t// A listing for the other source is no answer for this one.\n\tconst current = $derived(listing?.source === source ? listing : null);\n\tconst turns = $derived(current?.turns ?? []);\n\tconst turn = $derived(\n\t\tsource === 'session' && params.turn !== undefined\n\t\t\t? (turns.find((t) => String(t.n) === params.turn) ?? null)\n\t\t\t: null\n\t);\n\tconst files = $derived(turn ? turn.files : (current?.files ?? []));\n\tconst root = $derived(current?.root ?? session?.git_root ?? session?.cwd ?? null);\n\tconst totals = $derived(turn ? sumCounts(files) : (current?.totals ?? sumCounts(files)));\n\t/** Newest first, each with its own totals. */\n\tconst chips = $derived(turns.map((t) => ({ ...t, ...sumCounts(t.files) })).reverse());\n\n\tlet showGenerated = $state(false);\n\tconst split = $derived.by(() => {\n\t\tconst generated: typeof files = [];\n\t\tconst kept: typeof files = [];\n\t\t// Relative to the root, so a repo that sits under a `build/` is not all generated.\n\t\tfor (const f of files) (isGenerated(displayPath(f.file, root)) ? generated : kept).push(f);\n\t\treturn { generated, kept };\n\t});\n\tconst shown = $derived(showGenerated ? files : split.kept);\n\n\t/** The file the URL names, else the first one listed, so a wide pane never sits empty. */\n\tconst selected = $derived(\n\t\tfiles.find((f) => f.file === params.file) ?? (params.file ? null : (shown[0] ?? null))\n\t);\n\n\tfunction pick(file: string) {\n\t\tsetParams({ file });\n\t}\n\n\tfunction setSource(next: Source) {\n\t\tif (next === source) return;\n\t\tsetParams({ source: next, turn: null, file: null });\n\t}\n\n\tfunction setTurn(n: number | null) {\n\t\tsetParams({ turn: n === null ? null : String(n), file: null });\n\t}\n\n\tconst NO_PROMPT = 'Before the first prompt';\n\n\t/** Scroll the transcript to the prompt that opened a turn; the page does the scrolling. */\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── the selected file's diff ─────────────────────────────────────────\n\n\tlet diff = $state<Diff | null>(null);\n\tlet diffError = $state<{ file: string; message: string } | null>(null);\n\tlet diffSeq = 0;\n\t/** The answer `diff` was parsed from, to tell a new one from the same again. */\n\tlet diffText: string | null = null;\n\n\tasync function loadDiff(id: string, src: Source, file: string, turnId: string | null | undefined) {\n\t\tconst mine = ++diffSeq;\n\t\tconst q = new URLSearchParams({ source: src, file });\n\t\t// An empty turn is the one before the first prompt; no turn at all is every turn.\n\t\tif (turnId !== undefined) q.set('turn', turnId ?? '');\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/changes/diff?${q}`);\n\t\t\tconst text = await res.text();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error((JSON.parse(text) as { error?: string }).error ?? `HTTP ${res.status}`);\n\t\t\t// The diff is asked for again with every hook; an answer that says\n\t\t\t// the same thing is not even parsed, and the rows and their colouring stay.\n\t\t\tif (text !== diffText) {\n\t\t\t\tdiffText = text;\n\t\t\t\tdiff = JSON.parse(text) as Diff;\n\t\t\t}\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) {\n\t\t\t\tdiffText = null;\n\t\t\t\tdiff = null;\n\t\t\t\tdiffError = { file, message: err instanceof Error ? err.message : String(err) };\n\t\t\t}\n\t\t}\n\t}\n\n\t/** What the diff depends on: the file, the turn, and each fresh read of the list. */\n\tconst diffKey = $derived(\n\t\tselected ? `${source}\\0${selected.file}\\0${turn ? `t${turn.n}` : ''}\\0${listStamp}` : null\n\t);\n\t$effect(() => {\n\t\tif (!diffKey || !sessionId || !active) return;\n\t\t// Only the key decides: a reloaded list hands back new objects for the same file.\n\t\tconst id = sessionId;\n\t\tuntrack(() => void loadDiff(id, source, selected!.file, turn ? turn.id : undefined));\n\t});\n\n\t/**\n\t * The file as it is on disk, for the lines the git diff leaves out: its new\n\t * side is the working tree. The session source's hunks are from the log,\n\t * whose new side may no longer be what is on disk, so it offers none.\n\t */\n\tasync function workingText(file: string): Promise<string | null> {\n\t\tif (!sessionId) return null;\n\t\tconst res = await fetch(`${sessionApiAt(base, sessionId)}/files/read?${new URLSearchParams({ path: file })}`);\n\t\tif (!res.ok) return null;\n\t\tconst read = (await res.json()) as { kind: string; text?: string };\n\t\treturn read.kind === 'text' ? (read.text ?? null) : null;\n\t}\n\n\tconst shownDiff = $derived(diff && diff.file === selected?.file ? diff : null);\n\tconst shownError = $derived(diffError?.file === selected?.file ? diffError!.message : null);\n\tconst hunkCount = $derived(shownDiff?.hunks.length ?? 0);\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loadingList,\n\t\t\t\trun: () => sessionId && void loadList(sessionId, source)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the files, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (shown.length === 0) return;\n\t\tconst at = selected ? shown.findIndex((f) => f.file === selected.file) : -1;\n\t\tconst next = e.key === 'j' ? Math.min(at + 1, shown.length - 1) : Math.max(at - 1, 0);\n\t\te.preventDefault();\n\t\tpick(shown[next].file);\n\t\tdocument\n\t\t\t.querySelector(`[data-change-file=\"${CSS.escape(shown[next].file)}\"]`)\n\t\t\t?.scrollIntoView({ block: 'nearest' });\n\t}\n\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"changes\" class:picked={!!params.file}>\n\t<div class=\"bar\">\n\t\t<span class=\"title\">\n\t\t\t{#if current}\n\t\t\t\t{files.length} {files.length === 1 ? 'file' : 'files'} changed\n\t\t\t\t{#if totals.additions || totals.deletions}\n\t\t\t\t\t<span class=\"mono\"><span class=\"add\">+{totals.additions}</span> <span class=\"del\">−{totals.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\tChanges\n\t\t\t{/if}\n\t\t</span>\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Source\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'git', (on) => on && setSource('git')}\n\t\t\t\tdisabled={gitMissing}\n\t\t\t\ttitle={gitMissing ? 'Not a git repository' : 'What git sees in the working tree now'}>Current · git</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'session', (on) => on && setSource('session')}\n\t\t\t\ttitle=\"The edits this session's tools made\">Session</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if source === 'session' && turns.length > 0}\n\t\t<div class=\"turns\" role=\"group\" aria-label=\"Turn\">\n\t\t\t<Toggle\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"chip\"\n\t\t\t\tbind:pressed={() => !turn, (on) => on && setTurn(null)}>All turns</Toggle\n\t\t\t>\n\t\t\t{#each chips as t (t.n)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={t.prompt || NO_PROMPT}\n\t\t\t\t\tbind:pressed={() => turn?.n === t.n, (on) => on && setTurn(t.n)}\n\t\t\t\t>\n\t\t\t\t\t{t.n === 0 ? 'Start' : `Turn ${t.n}`}\n\t\t\t\t\t{#if t.additions}<span class=\"add\">+{t.additions}</span>{/if}\n\t\t\t\t\t{#if t.deletions}<span class=\"del\">−{t.deletions}</span>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t\t{#if turn}\n\t\t\t<div class=\"turn-note\">\n\t\t\t\t<span class=\"prompt\" title={turn.prompt}>{turn.prompt || NO_PROMPT}</span>\n\t\t\t\t{#if turn.id}\n\t\t\t\t\t{@const id = turn.id}\n\t\t\t\t\t<Button variant=\"link\" size=\"sm\" class=\"link\" onclick={() => revealTurn(id)}>Show in transcript</Button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t{/if}\n\n\t{#if listError && !current}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !current}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if files.length === 0}\n\t\t<p class=\"msg\">\n\t\t\t{source === 'git' ? 'The working tree is clean.' : 'This session has not edited any files yet.'}\n\t\t</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Changed files\">\n\t\t\t\t{#each shown as f (f.file)}\n\t\t\t\t\t{@const letter = statusLetter(f)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\tclass:on={selected?.file === f.file}\n\t\t\t\t\t\tclass:untracked={f.untracked}\n\t\t\t\t\t\taria-current={selected?.file === f.file ? 'true' : undefined}\n\t\t\t\t\t\tdata-change-file={f.file}\n\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\tonclick={() => pick(f.file)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"st st-{letter === '?' ? 'u' : letter.toLowerCase()}\">{letter}</span>\n\t\t\t\t\t\t<!-- rtl puts the ellipsis on the left; bdi keeps the path itself left to right. -->\n\t\t\t\t\t\t<span class=\"path\"><bdi>{displayPath(f.file, root)}</bdi></span>\n\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{#if f.additions}<span class=\"add\">+{f.additions}</span>{/if}\n\t\t\t\t\t\t\t{#if f.deletions}<span class=\"del\">−{f.deletions}</span>{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if split.generated.length > 0}\n\t\t\t\t\t<Button variant=\"ghost\" size=\"sm\" class=\"more\" onclick={() => (showGenerated = !showGenerated)}>\n\t\t\t\t\t\t{showGenerated ? 'Hide generated' : `+ ${split.generated.length} generated (show)`}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t<section class=\"diff\" aria-label=\"Diff\">\n\t\t\t\t{#if selected}\n\t\t\t\t\t<div class=\"diff-head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to files\" onclick={() => setParams({ file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<span class=\"path\" title={selected.file}>{displayPath(selected.file, root)}</span>\n\t\t\t\t\t\t<span class=\"sp\"></span>\n\t\t\t\t\t\t{#if hunkCount}<span class=\"dim\">{hunkCount} {hunkCount === 1 ? 'hunk' : 'hunks'}</span>{/if}\n\t\t\t\t\t\t{#if selected.kind !== 'deleted'}\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"tofiles\"\n\t\t\t\t\t\t\t\ttitle=\"Open this file in the Files pane\"\n\t\t\t\t\t\t\t\taria-label=\"Open in Files\"\n\t\t\t\t\t\t\t\tonclick={() => openPane('files', { file: selected.file, line: null })}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree-outline\"></iconify-icon>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if shownError}\n\t\t\t\t\t\t<p class=\"msg err\">{shownError}</p>\n\t\t\t\t\t{:else if shownDiff?.binary}\n\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t{:else if shownDiff && shownDiff.hunks.length > 0}\n\t\t\t\t\t\t<DiffLines\n\t\t\t\t\t\t\thunks={shownDiff.hunks}\n\t\t\t\t\t\t\tfile={selected.file}\n\t\t\t\t\t\t\tloadText={source === 'git' && selected.kind !== 'deleted' ? () => workingText(selected.file) : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t{:else if diff}\n\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">That file has no change here.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n\t<div class=\"foot\"><kbd>j</kbd>/<kbd>k</kbd> next / previous file</div>\n</div>\n\n<style>\n\t.changes {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.mono,\n\tnav,\n\t.diff,\n\t.turns {\n\t\tfont-family: var(--font-mono);\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.title {\n\t\tfont-size: 13.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\tdisplay: inline-flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t}\n\t.title .mono {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.turns {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.turns :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 28px;\n\t\tpadding: 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turns :global(.chip:hover) {\n\t\tcolor: #f5f5f4;\n\t}\n\t.turns :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.turn-note {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t\tflex: none;\n\t}\n\t.prompt,\n\t.file .path,\n\t.diff-head .path {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.prompt {\n\t\tflex: 1;\n\t}\n\t.turn-note :global(.link) {\n\t\tflex: none;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 4px 0;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turn-note :global(.link:hover) {\n\t\ttext-decoration: underline;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\twidth: 250px;\n\t\tflex: none;\n\t\toverflow-y: auto;\n\t\tborder-right: 1px solid #222;\n\t\tpadding: 8px 6px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tfont-size: 12px;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-height: 32px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.file:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.file.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.file.untracked {\n\t\tcolor: #78716c;\n\t}\n\t.file .path {\n\t\tflex: 1;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.st {\n\t\twidth: 10px;\n\t\tflex: none;\n\t}\n\t.st-m,\n\t.st-r {\n\t\tcolor: #fbbf24;\n\t}\n\t.st-a {\n\t\tcolor: #4ade80;\n\t}\n\t.st-d {\n\t\tcolor: #f87171;\n\t}\n\t.st-u {\n\t\tcolor: #78716c;\n\t}\n\tnav :global(.more) {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: left;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\tnav :global(.more:hover) {\n\t\tcolor: #d6d3d1;\n\t}\n\t.add {\n\t\tcolor: #4ade80;\n\t}\n\t.del {\n\t\tcolor: #f87171;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 12px;\n\t}\n\t.diff-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.tofiles {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.tofiles:hover {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: -8px 0 -8px -12px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.foot {\n\t\tflex: none;\n\t\tpadding: 8px 14px;\n\t\tborder-top: 1px solid #222;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\tkbd {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tpadding: 0 4px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1f1f1f;\n\t\tcolor: #a8a29e;\n\t}\n\n\t/* Too narrow for both: the list, or the picked file's diff with a way back. */\n\t@container (max-width: 38rem) {\n\t\tnav {\n\t\t\twidth: auto;\n\t\t\tflex: 1;\n\t\t\tborder-right: 0;\n\t\t}\n\t\t.diff {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked .diff {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.foot {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* A finger needs room. */\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","<script lang=\"ts\">\n\timport { cn } from \"$lib/utils.js\";\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: PopoverPrimitive.TriggerProps = $props();\n</script>\n\n<PopoverPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"popover-trigger\"\n\tclass={cn(\"\", className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Files pane, loaded the first time a file is shown\n * so the session page does not carry Shiki until the pane is opened. The\n * fine-grained build: Shiki's core, its JavaScript regex engine (no WASM),\n * one theme, and a grammar only when a file of that language is opened.\n * Anything else is drawn plain.\n */\nimport type { HighlighterCore, LanguageRegistration, ThemedToken } from 'shiki/core';\n\ntype Grammar = () => Promise<{ default: LanguageRegistration[] }>;\n\nconst GRAMMARS: Record<string, Grammar> = {\n\ttypescript: () => import('shiki/langs/typescript.mjs'),\n\ttsx: () => import('shiki/langs/tsx.mjs'),\n\tjavascript: () => import('shiki/langs/javascript.mjs'),\n\tjsx: () => import('shiki/langs/jsx.mjs'),\n\tsvelte: () => import('shiki/langs/svelte.mjs'),\n\thtml: () => import('shiki/langs/html.mjs'),\n\txml: () => import('shiki/langs/xml.mjs'),\n\tcss: () => import('shiki/langs/css.mjs'),\n\tscss: () => import('shiki/langs/scss.mjs'),\n\tjson: () => import('shiki/langs/json.mjs'),\n\tjsonc: () => import('shiki/langs/jsonc.mjs'),\n\tmarkdown: () => import('shiki/langs/markdown.mjs'),\n\tpython: () => import('shiki/langs/python.mjs'),\n\tshellscript: () => import('shiki/langs/shellscript.mjs'),\n\tyaml: () => import('shiki/langs/yaml.mjs'),\n\ttoml: () => import('shiki/langs/toml.mjs'),\n\trust: () => import('shiki/langs/rust.mjs'),\n\tgo: () => import('shiki/langs/go.mjs'),\n\tsql: () => import('shiki/langs/sql.mjs'),\n\tdiff: () => import('shiki/langs/diff.mjs'),\n\tdocker: () => import('shiki/langs/docker.mjs'),\n\tmake: () => import('shiki/langs/make.mjs')\n};\n\nconst THEME = 'github-dark-default';\n\n/** Text longer than this is drawn plain: tokenizing it would stall the page. */\nconst HIGHLIGHT_LIMIT_CHARS = 400_000;\n\nlet core: Promise<HighlighterCore> | null = null;\n\nfunction highlighter(): Promise<HighlighterCore> {\n\treturn (core ??= (async () => {\n\t\tconst [{ createHighlighterCore }, { createJavaScriptRegexEngine }, theme] = await Promise.all([\n\t\t\timport('shiki/core'),\n\t\t\timport('shiki/engine/javascript'),\n\t\t\timport('shiki/themes/github-dark-default.mjs')\n\t\t]);\n\t\treturn createHighlighterCore({ themes: [theme.default], langs: [], engine: createJavaScriptRegexEngine() });\n\t})());\n}\n\n/**\n * Each line's tokens with their colours, or null when the language is not one\n * this loads or the text is too long (the caller then draws it plain).\n */\nexport async function highlightFile(text: string, language: string | null): Promise<ThemedToken[][] | null> {\n\tif (!language || !GRAMMARS[language] || text.length > HIGHLIGHT_LIMIT_CHARS) return null;\n\tconst shiki = await highlighter();\n\tif (!shiki.getLoadedLanguages().includes(language)) await shiki.loadLanguage((await GRAMMARS[language]()).default);\n\treturn shiki.codeToTokens(text, { lang: language, theme: THEME }).tokens;\n}\n","import { createPersisted } from './persisted';\n\n/** What the Files pane keeps per session between visits; the URL holds the open file. */\nexport interface FilesPrefs {\n\t/** Directories open in the tree, relative to the project root. */\n\texpanded?: string[];\n\t/** The file last open, which the pane reopens when the URL names none. */\n\tfile?: string;\n\t/** List the entries git ignores. */\n\tshowIgnored?: boolean;\n}\n\nconst persisted = createPersisted<Record<string, FilesPrefs>>('claude-mux-files-pane', {});\n\n/** The Files pane's per-session preferences, keyed by session id: a pane target is reused by later sessions. */\nclass FilesPaneStore {\n\tprivate state = $state<Record<string, FilesPrefs>>(persisted.load());\n\n\tget(id: string | null): FilesPrefs {\n\t\treturn (id && this.state[id]) || {};\n\t}\n\n\tupdate(id: string | null, patch: FilesPrefs): void {\n\t\tif (!id) return;\n\t\tthis.state[id] = { ...this.state[id], ...patch };\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const filesPaneStore = new FilesPaneStore();\n","export function cn(...classes) {\n return classes.filter(Boolean).join(' ');\n}\nexport const isBrowser = typeof document !== 'undefined';\n","import { isBrowser } from './internal/helpers.js';\nimport { sonnerContext } from './internal/ctx.js';\nimport { untrack } from 'svelte';\nlet toastsCounter = 0;\n// A toast keeps the id it was given, otherwise it gets the next one from the counter.\n// `custom` needs the same id `create` would pick, as it hands it to the component.\nfunction getToastId(data) {\n return typeof data?.id === 'number' || (typeof data?.id === 'string' && data.id.length > 0)\n ? data.id\n : toastsCounter++;\n}\nclass ToastState {\n toasts = $state([]);\n heights = $state([]);\n // Removals whose exit animation is running but whose entry hasn't been removed yet\n #pendingRemovals = new Map();\n #findToastIdx = (id) => {\n const idx = this.toasts.findIndex((toast) => toast.id === id);\n if (idx === -1)\n return null;\n return idx;\n };\n #findHeightIdx = (toastId) => this.heights.findIndex((height) => height.toastId === toastId);\n addToast = (data) => {\n if (!isBrowser)\n return;\n this.toasts.unshift(data);\n };\n updateToast = ({ id, data, type, message }) => {\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n const toastToUpdate = this.toasts[toastIdx];\n this.toasts[toastIdx] = {\n ...toastToUpdate,\n ...data,\n id,\n title: message,\n type,\n // A dismissal that hasn't been processed yet gets cancelled: the toast is\n // still on screen, so this is an update of it rather than a new toast.\n dismiss: false,\n delete: false,\n updated: true\n };\n };\n // Flags a toast that was dismissed from inside the Toast component (close button,\n // swipe, action/cancel click, auto-close) so `create` treats an id reuse as a new\n // toast instead of merging the old props into it.\n markDismissed = (id) => {\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n const toast = this.toasts[toastIdx];\n if (!toast)\n return;\n if (!toast.dismiss || !toast.delete) {\n this.toasts[toastIdx] = { ...toast, dismiss: true, delete: true };\n }\n };\n scheduleRemoval = (id, delay) => {\n this.cancelRemoval(id);\n this.#pendingRemovals.set(id, setTimeout(() => {\n this.#pendingRemovals.delete(id);\n this.remove(id);\n }, delay));\n };\n cancelRemoval = (id) => {\n const timeout = this.#pendingRemovals.get(id);\n if (timeout !== undefined) {\n clearTimeout(timeout);\n this.#pendingRemovals.delete(id);\n }\n };\n create = (data) => {\n const { message, ...rest } = data;\n const id = getToastId(data);\n // Support deprecated `dismissable` as a fallback for backwards compatibility\n const dismissible = data.dismissible !== undefined\n ? data.dismissible\n : data.dismissable !== undefined\n ? data.dismissable\n : true;\n const type = data.type === undefined ? 'default' : data.type;\n untrack(() => {\n // A removal that hasn't run yet gets cancelled: this create() supersedes it,\n // otherwise the old toast's unmount timeout would remove the new one.\n this.cancelRemoval(id);\n const alreadyExists = this.toasts.find((toast) => toast.id === id);\n if (alreadyExists?.dismiss || alreadyExists?.delete) {\n // The previous toast with this id was dismissed, so this is a brand new\n // toast. Drop the old one instead of merging into it, otherwise its\n // props (e.g. `action`) leak into the new one. `updated` makes the still\n // mounted component reset its auto-close timer: when the recreate happens\n // in the same tick as the dismissal, the keyed each reuses the component\n // before it ever processed the dismissal, so the old timer would\n // otherwise keep running.\n this.remove(id);\n this.addToast({\n ...rest,\n id,\n title: message,\n dismissible,\n type,\n updated: true\n });\n }\n else if (alreadyExists) {\n this.updateToast({ id, data, type, message, dismissible });\n }\n else {\n this.addToast({ ...rest, id, title: message, dismissible, type });\n }\n });\n return id;\n };\n dismiss = (id) => {\n untrack(() => {\n if (id === undefined) {\n // we're dismissing all the active toasts\n this.toasts = this.toasts.map((toast) => toast.dismiss ? toast : { ...toast, dismiss: true });\n return;\n }\n // we're dismissing a specific toast\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n if (this.toasts[toastIdx]) {\n this.toasts[toastIdx] = { ...this.toasts[toastIdx], dismiss: true };\n }\n });\n return id;\n };\n remove = (id) => {\n if (id === undefined) {\n // remove all toasts\n this.toasts = [];\n return;\n }\n // remove a specific toast\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n this.toasts.splice(toastIdx, 1);\n return id;\n };\n message = (message, data) => {\n return this.create({ ...data, type: 'default', message });\n };\n error = (message, data) => {\n return this.create({ ...data, type: 'error', message });\n };\n success = (message, data) => {\n return this.create({ ...data, type: 'success', message });\n };\n info = (message, data) => {\n return this.create({ ...data, type: 'info', message });\n };\n warning = (message, data) => {\n return this.create({ ...data, type: 'warning', message });\n };\n loading = (message, data) => {\n return this.create({ ...data, type: 'loading', message });\n };\n promise = (promise, data) => {\n if (!data) {\n // Nothing to show\n return;\n }\n let id = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: typeof data.loading === 'string' ? data.loading : data.loading()\n });\n }\n const p = promise instanceof Promise ? promise : promise();\n let shouldDismiss = id !== undefined;\n p.then((response) => {\n if (typeof response === 'object' &&\n response &&\n 'ok' in response &&\n typeof response.ok === 'boolean' &&\n !response.ok) {\n shouldDismiss = false;\n const message = constructPromiseErrorMessage(response);\n this.create({ id, type: 'error', message });\n }\n else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? data.success(response) : data.success;\n this.create({ id, type: 'success', message });\n }\n })\n .catch((error) => {\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? data.error(error) : data.error;\n this.create({ id, type: 'error', message });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n data.finally?.();\n });\n return id;\n };\n custom = (component, data) => {\n const id = getToastId(data);\n this.create({ component, ...data, id });\n return id;\n };\n removeHeight = (id) => {\n this.heights = this.heights.filter((height) => height.toastId !== id);\n };\n setHeight = (data) => {\n // untrack: setHeight runs inside a $effect; a tracked read of this.heights\n // would re-trigger it on the write below (effect_update_depth_exceeded).\n untrack(() => {\n const heightIdx = this.#findHeightIdx(data.toastId);\n if (heightIdx !== -1) {\n this.heights[heightIdx] = data;\n return;\n }\n // The offset math and --front-toast-height assume heights share the\n // newest-first order of `toasts`, so insert at the matching position.\n // With batched mounts (several toasts created in one tick, or created\n // before the Toaster mounted) the components mount newest-first and a\n // plain unshift would reverse them.\n const order = new Map(this.toasts.map((toast, idx) => [toast.id, idx]));\n const toastOrder = order.get(data.toastId) ?? -1;\n const insertIdx = this.heights.findIndex((height) => (order.get(height.toastId) ?? Infinity) > toastOrder);\n if (insertIdx === -1) {\n this.heights.push(data);\n }\n else {\n this.heights.splice(insertIdx, 0, data);\n }\n });\n };\n reset = () => {\n this.toasts = [];\n this.heights = [];\n this.#pendingRemovals.forEach((timeout) => clearTimeout(timeout));\n this.#pendingRemovals.clear();\n };\n}\nfunction constructPromiseErrorMessage(response) {\n if (response && typeof response === 'object' && 'status' in response) {\n return `HTTP error! Status: ${response.status}`;\n }\n return `Error! ${response}`;\n}\nexport const toastState = new ToastState();\nfunction toastFunction(message, data) {\n return toastState.message(message, data);\n}\nexport class SonnerState {\n /**\n * A derived state of the toasts that are not dismissed.\n */\n #activeToasts = $derived(toastState.toasts.filter((toast) => !toast.dismiss));\n get toasts() {\n return this.#activeToasts;\n }\n}\n/**\n * A hook to get a reference to the sonner toast state.\n *\n * Returns a class instance a getter for the `toasts` array.\n *\n * @example\n * ```svelte\n * <script lang=\"ts\">\n * import { useSonner } from 'svelte-sonner';\n *\n * const sonner = useSonner();\n *\n * // Reactive access to the toasts\n * $effect(() => console.log(sonner.toasts))\n * </script>\n * ```\n */\nexport function useSonner() {\n return sonnerContext.get();\n}\nconst basicToast = toastFunction;\nexport const toast = Object.assign(basicToast, {\n success: toastState.success,\n info: toastState.info,\n warning: toastState.warning,\n error: toastState.error,\n custom: toastState.custom,\n message: toastState.message,\n promise: toastState.promise,\n dismiss: toastState.dismiss,\n loading: toastState.loading,\n getActiveToasts: () => {\n return toastState.toasts.filter((toast) => !toast.dismiss);\n }\n});\n","import { toast } from 'svelte-sonner';\n\n/** Copy `text` and say so, or say that it could not be copied. */\nexport async function copyWithToast(text: string, done = 'Copied'): Promise<void> {\n\ttry {\n\t\tawait navigator.clipboard.writeText(text);\n\t\ttoast.success(done, { description: text });\n\t} catch {\n\t\ttoast.error('Could not copy');\n\t}\n}\n","<script lang=\"ts\">\n\t/**\n\t * The session's project, read-only. With no file open the tree takes the\n\t * whole pane; once one is, the file has the pane and the tree narrows to a\n\t * column on its far side, which a button in the file's header puts away\n\t * and brings back. On a narrow pane the two take turns instead. The\n\t * arrangement and its measures follow t3code's FilePreviewPanel\n\t * (https://github.com/pingdotgg/t3code, MIT, © T3 Tools Inc.).\n\t *\n\t * The URL holds the file (`file`, relative to the project root) and the\n\t * line to show (`line`). Which directories are open, the last file, and\n\t * whether ignored entries are listed persist per session. Shiki loads the\n\t * first time a file is drawn.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { ThemedToken } from 'shiki/core';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport * as ContextMenu from '$lib/components/ui/context-menu';\n\timport * as Popover from '$lib/components/ui/popover';\n\timport { Input } from '$lib/components/ui/input';\n\timport {\n\t\tancestors,\n\t\tbaseName,\n\t\tfuzzyFilter,\n\t\tisMarkdown,\n\t\tparentOf,\n\t\tshikiLanguage,\n\t\ttype DirListing,\n\t\ttype FileEntry,\n\t\ttype FileRead\n\t} from '$lib/side-panel/files';\n\timport { displayPath } from '$lib/side-panel/changes';\n\timport { highlightFile } from '$lib/side-panel/shiki';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { filesPaneStore } from '$lib/stores/filesPane.svelte';\n\timport { preferences } from '$lib/stores/preferences.svelte';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\n\tlet { session, base, params, setParams, setActions, mention, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `${sessionApiAt(base, sessionId)}/files` : null);\n\tconst prefs = $derived(filesPaneStore.get(sessionId));\n\tconst showIgnored = $derived(prefs.showIgnored === true);\n\t// Only paths inside the root belong here; an older build could save others.\n\tconst expanded = $derived(new Set((prefs.expanded ?? []).filter((d) => d && !d.startsWith('/'))));\n\n\t// ── the tree ─────────────────────────────────────────────────────────\n\n\ttype DirState = DirListing | { error: string } | 'loading';\n\tlet dirs = $state<Record<string, DirState>>({});\n\t/** Bumped by a reload or the ignored toggle, so answers for the old tree are dropped. */\n\tlet treeEpoch = 0;\n\n\tasync function loadDir(dir: string) {\n\t\tif (!api) return;\n\t\tconst epoch = treeEpoch;\n\t\tdirs[dir] = 'loading';\n\t\tconst q = new URLSearchParams({ dir });\n\t\tif (showIgnored) q.set('ignored', '1');\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/tree?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (epoch !== treeEpoch) return;\n\t\t\tdirs[dir] = res.ok ? (body as DirListing) : { error: body.error ?? `HTTP ${res.status}` };\n\t\t} catch (err) {\n\t\t\tif (epoch === treeEpoch) dirs[dir] = { error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tfunction reloadTree() {\n\t\ttreeEpoch++;\n\t\tdirs = {};\n\t\tvoid loadDir('');\n\t\tfor (const dir of expanded) void loadDir(dir);\n\t}\n\n\t/** A directory's entries, once they have been read. */\n\tfunction listingOf(dir: string): DirListing | null {\n\t\tconst d = dirs[dir];\n\t\treturn d && d !== 'loading' && 'entries' in d ? d : null;\n\t}\n\tconst rootListing = $derived(listingOf(''));\n\tconst root = $derived(rootListing?.root ?? null);\n\tconst repo = $derived(rootListing?.repo ?? false);\n\n\t/** What the tree was last read for; showing the pane again reuses it, Reload reads it afresh. */\n\tlet readFor: string | null = null;\n\t$effect(() => {\n\t\tconst key = `${api}\\0${showIgnored}`;\n\t\tif (!active || !api || key === readFor) return;\n\t\treadFor = key;\n\t\tuntrack(reloadTree);\n\t});\n\n\tfunction setExpanded(dir: string, open: boolean) {\n\t\tconst next = new Set(expanded);\n\t\tif (open) next.add(dir);\n\t\telse next.delete(dir);\n\t\tfilesPaneStore.update(sessionId, { expanded: [...next] });\n\t\tif (open && !dirs[dir]) void loadDir(dir);\n\t}\n\n\t/** Enough to open any project worth reading as a tree, and a stop for one that is not. */\n\tconst EXPAND_ALL_DIRS = 400;\n\n\t/**\n\t * Open every directory, a level at a time. Ignored directories and links\n\t * stay shut: `node_modules` is nobody's idea of \"everything\", and a link\n\t * can lead back up the tree.\n\t */\n\tasync function expandAll() {\n\t\tconst open: string[] = [];\n\t\tlet level = [''];\n\t\twhile (level.length > 0 && open.length < EXPAND_ALL_DIRS) {\n\t\t\tconst next: string[] = [];\n\t\t\t// All at once: the browser already holds a host to a few requests at a time.\n\t\t\tawait Promise.all(level.filter((dir) => !listingOf(dir)).map(loadDir));\n\t\t\tfor (const dir of level) {\n\t\t\t\tfor (const entry of listingOf(dir)?.entries ?? []) {\n\t\t\t\t\tif (entry.type === 'dir' && !entry.ignored && !entry.link) next.push(entry.path);\n\t\t\t\t}\n\t\t\t}\n\t\t\topen.push(...next);\n\t\t\tlevel = next;\n\t\t}\n\t\tfilesPaneStore.update(sessionId, { expanded: open.slice(0, EXPAND_ALL_DIRS) });\n\t}\n\n\tfunction collapseAll() {\n\t\tfilesPaneStore.update(sessionId, { expanded: [] });\n\t}\n\n\tfunction toggleIgnored() {\n\t\tfilesPaneStore.update(sessionId, { showIgnored: !showIgnored });\n\t}\n\n\t// ── the open file ────────────────────────────────────────────────────\n\n\t/** The file the URL names, made relative when it is an absolute path inside the root. */\n\tconst wantedFile = $derived(params.file ? displayPath(params.file, root) : null);\n\tconst wantedLine = $derived.by(() => {\n\t\tconst n = Number(params.line);\n\t\treturn Number.isInteger(n) && n > 0 ? n : null;\n\t});\n\n\t// No file in the URL: reopen the one last open here.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => prefs.file);\n\t\tif (!params.file && last) setParams({ file: last });\n\t});\n\n\ttype Shown = { path: string; read: FileRead } | { path: string; error: string; binary?: boolean };\n\tlet shown = $state<Shown | null>(null);\n\tlet fileSeq = 0;\n\n\tasync function loadFile(path: string) {\n\t\tif (!api) return;\n\t\tconst mine = ++fileSeq;\n\t\ttry {\n\t\t\t// The URL's file may come from a message, which seldom spells it from the root.\n\t\t\tconst res = await fetch(`${api}/read?${new URLSearchParams({ path, locate: '1' })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== fileSeq) return;\n\t\t\tif (!res.ok) {\n\t\t\t\tshown = { path, error: body.error ?? `HTTP ${res.status}`, binary: body.binary === true };\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst read = body as FileRead;\n\t\t\tshown = { path, read };\n\t\t\t// An absolute or roundabout spelling settles on the path inside the root.\n\t\t\tif (read.path !== path) {\n\t\t\t\tfileReadFor = `${read.path}\\0${params.line ?? ''}`;\n\t\t\t\tsetParams({ file: read.path });\n\t\t\t}\n\t\t\trevealInTree(read.path);\n\t\t\tfilesPaneStore.update(sessionId, { file: read.path });\n\t\t} catch (err) {\n\t\t\tif (mine === fileSeq) shown = { path, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\t/**\n\t * What the file was last read for: its path and the line asked. A link\n\t * that names the open file again (after Claude edited it, say) reads it\n\t * afresh rather than scrolling stale text; showing the pane again does not.\n\t */\n\tlet fileReadFor: string | null = null;\n\t$effect(() => {\n\t\tconst path = wantedFile;\n\t\tif (!path || !active) return;\n\t\tconst key = `${path}\\0${params.line ?? ''}`;\n\t\tif (key === fileReadFor) return;\n\t\tfileReadFor = key;\n\t\tuntrack(() => void loadFile(path));\n\t});\n\n\t/** Open the directories that hold `path` (inside the root), so the tree shows where it is. */\n\tfunction revealInTree(path: string) {\n\t\tconst missing = ancestors(path).filter((d) => !expanded.has(d));\n\t\tif (missing.length === 0) return;\n\t\tfilesPaneStore.update(sessionId, { expanded: [...expanded, ...missing] });\n\t\tfor (const d of missing) if (!dirs[d]) void loadDir(d);\n\t}\n\n\tconst current = $derived(\n\t\tshown && wantedFile && (shown.path === wantedFile || ('read' in shown && shown.read.path === wantedFile))\n\t\t\t? shown\n\t\t\t: null\n\t);\n\tconst read = $derived(current && 'read' in current ? current.read : null);\n\tconst openPath = $derived(read?.path ?? wantedFile);\n\n\tfunction openFile(path: string, line?: number) {\n\t\tsetParams({ file: path, line: line ? String(line) : null }, { push: true });\n\t}\n\n\tfunction closeFile() {\n\t\tfilesPaneStore.update(sessionId, { file: undefined });\n\t\tsetParams({ file: null, line: null });\n\t}\n\n\t/** Markdown opens rendered; this flips the open file to its source. */\n\tlet mdSource = $state(false);\n\tconst markdown = $derived(read?.kind === 'text' && isMarkdown(read.path));\n\tconst rendered = $derived(markdown && !mdSource && wantedLine === null);\n\n\tconst lines = $derived(read?.kind === 'text' ? read.text.replace(/\\n$/, '').split('\\n') : []);\n\tlet tokens = $state<ThemedToken[][] | null>(null);\n\t$effect(() => {\n\t\ttokens = null;\n\t\tif (read?.kind !== 'text' || rendered) return;\n\t\tconst { text, path } = read;\n\t\tlet stale = false;\n\t\tvoid highlightFile(text, shikiLanguage(path)).then((t) => {\n\t\t\tif (!stale) tokens = t;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t/** Lines are drawn in blocks the browser may skip laying out while off screen. */\n\tconst CHUNK = 200;\n\tconst chunks = $derived(\n\t\tArray.from({ length: Math.ceil(lines.length / CHUNK) }, (_, i) => i * CHUNK)\n\t);\n\n\tlet codeEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\tconst line = wantedLine;\n\t\tif (!line || !codeEl || lines.length === 0) return;\n\t\tvoid tokens;\n\t\trequestAnimationFrame(() =>\n\t\t\tcodeEl?.querySelector(`[data-line=\"${line}\"]`)?.scrollIntoView({ block: 'center' })\n\t\t);\n\t});\n\n\tfunction pickLine(n: number) {\n\t\tsetParams({ line: wantedLine === n ? null : String(n) });\n\t}\n\n\tconst copyText = (text: string) => copyWithToast(text, 'Path copied');\n\n\tfunction copyPath() {\n\t\tif (openPath) void copyText(wantedLine ? `${openPath}:${wantedLine}` : openPath);\n\t}\n\n\t/**\n\t * How Claude Code is told about a path. It reads an `@path` from the\n\t * session's cwd, which may sit below the root this pane lists from: the\n\t * path is made relative to the cwd, or left absolute when the cwd is not\n\t * inside the root.\n\t */\n\tfunction mentionOf(path: string): string | null {\n\t\tif (!root) return null;\n\t\tconst cwd = session?.cwd ?? root;\n\t\treturn `@${cwd === root ? path : displayPath(`${root}/${path}`, cwd)}`;\n\t}\n\n\tfunction mentionPath(path: string | null) {\n\t\tconst text = path && mentionOf(path);\n\t\tif (text) mention(text);\n\t}\n\n\t// ── a row's own menu, and dragging it to the composer ────────────────\n\n\t/** The row the context menu was opened on; one menu serves the whole tree. */\n\tlet menuEntry = $state<{ path: string; dir: boolean } | null>(null);\n\n\t/** Right-clicking the list between rows is the browser's business, not ours. */\n\tfunction onListContextMenu(e: MouseEvent) {\n\t\tconst row = (e.target as Element | null)?.closest<HTMLElement>('[data-path]');\n\t\tconst path = row?.dataset.path;\n\t\tif (!path) return e.stopPropagation();\n\t\tmenuEntry = { path, dir: row.dataset.type === 'dir' };\n\t}\n\n\t/** Dropped on the composer, a row becomes a mention of it; anywhere else, its path. */\n\tfunction onRowDrag(e: DragEvent, path: string) {\n\t\tif (!e.dataTransfer) return;\n\t\te.dataTransfer.setData('text/plain', `${mentionOf(path) ?? path} `);\n\t\te.dataTransfer.effectAllowed = 'copy';\n\t}\n\n\t// ── the breadcrumb, which finds its way around without the tree ──────\n\n\t/** The crumb whose menu is open, and the directory that menu is showing. */\n\tlet crumbFor = $state<string | null>(null);\n\tlet browsing = $state('');\n\n\tfunction browse(dir: string) {\n\t\tbrowsing = dir;\n\t\tif (!dirs[dir]) void loadDir(dir);\n\t}\n\n\tconst crumbs = $derived(openPath ? ancestors(openPath) : []);\n\tconst rootName = $derived((root && baseName(root)) || 'root');\n\tconst explorerLabel = $derived(preferences.fileExplorerOpen ? 'Hide file explorer' : 'Show file explorer');\n\n\t/** The file's own name is what was asked for, so the row of crumbs rests on it. */\n\tlet crumbsEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\t// Everything that changes how wide the row or its box is.\n\t\tvoid [openPath, rootName, read, markdown, preferences.fileExplorerOpen];\n\t\tconst el = crumbsEl;\n\t\t// After the frame: the crumbs for the new path are not laid out yet.\n\t\tif (el) requestAnimationFrame(() => (el.scrollLeft = el.scrollWidth));\n\t});\n\n\tfunction formatSize(bytes: number): string {\n\t\tif (bytes < 1024) return `${bytes} B`;\n\t\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\t\treturn `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n\t}\n\n\t// ── quick open ───────────────────────────────────────────────────────\n\n\tlet query = $state('');\n\tlet allFiles = $state<string[] | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet listing = false;\n\tlet picked = $state(0);\n\n\tasync function loadAll() {\n\t\tif (allFiles || listing || !api) return;\n\t\tlisting = true;\n\t\tlistError = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/list`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tallFiles = (body as { files: string[] }).files;\n\t\t} catch (err) {\n\t\t\tlistError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tlisting = false;\n\t\t}\n\t}\n\n\tconst results = $derived(query.trim() && allFiles ? fuzzyFilter(query, allFiles) : []);\n\t$effect(() => {\n\t\tvoid results;\n\t\tpicked = 0;\n\t});\n\n\tfunction openResult(path: string) {\n\t\tquery = '';\n\t\topenFile(path);\n\t}\n\n\tfunction onQueryKey(e: KeyboardEvent) {\n\t\tif (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n\t\t\te.preventDefault();\n\t\t\tconst n = results.length;\n\t\t\tif (n) picked = (picked + (e.key === 'ArrowDown' ? 1 : n - 1)) % n;\n\t\t\tdocument.querySelector(`[data-result=\"${picked}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t\t} else if (e.key === 'Enter' && results[picked]) {\n\t\t\te.preventDefault();\n\t\t\topenResult(results[picked]);\n\t\t} else if (e.key === 'Escape' && query) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tquery = '';\n\t\t}\n\t}\n\n\t// ── header actions ───────────────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t...(repo\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: showIgnored ? 'mdi:eye-outline' : 'mdi:eye-off-outline',\n\t\t\t\t\t\t\tlabel: showIgnored ? 'Hide ignored files' : 'Show ignored files',\n\t\t\t\t\t\t\tpressed: showIgnored,\n\t\t\t\t\t\t\trun: toggleIgnored\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\texpanded.size > 0\n\t\t\t\t? { icon: 'mdi:unfold-less-horizontal', label: 'Collapse all folders', run: collapseAll }\n\t\t\t\t: { icon: 'mdi:unfold-more-horizontal', label: 'Expand all folders', run: () => void expandAll() },\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId,\n\t\t\t\trun: () => {\n\t\t\t\t\tallFiles = null;\n\t\t\t\t\tif (query.trim()) void loadAll();\n\t\t\t\t\treloadTree();\n\t\t\t\t\tif (wantedFile) void loadFile(wantedFile);\n\t\t\t\t}\n\t\t\t}\n\t\t]);\n\t});\n</script>\n\n{#snippet tree(dir: string, depth: number)}\n\t{@const d = dirs[dir]}\n\t{#if d === 'loading' || d === undefined}\n\t\t<div class=\"note\" style:--depth={depth}>Loading…</div>\n\t{:else if 'error' in d}\n\t\t<div class=\"note err\" style:--depth={depth}>{d.error}</div>\n\t{:else}\n\t\t{#each d.entries as entry (entry.path)}\n\t\t\t{@render node(entry, depth)}\n\t\t{/each}\n\t\t{#if d.entries.length === 0}\n\t\t\t<div class=\"note\" style:--depth={depth}>{d.hidden ? `${d.hidden} ignored` : 'Empty'}</div>\n\t\t{/if}\n\t{/if}\n{/snippet}\n\n{#snippet node(entry: FileEntry, depth: number)}\n\t{#if entry.type === 'dir'}\n\t\t{@const open = expanded.has(entry.path)}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item dir\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tstyle:--depth={depth}\n\t\t\taria-expanded={open}\n\t\t\ttitle={entry.path}\n\t\t\tdata-path={entry.path}\n\t\t\tdata-type=\"dir\"\n\t\t\tdraggable=\"true\"\n\t\t\tondragstart={(e) => onRowDrag(e, entry.path)}\n\t\t\tonclick={() => setExpanded(entry.path, !open)}\n\t\t>\n\t\t\t<iconify-icon class=\"chev\" class:open icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t<iconify-icon class=\"ico\" icon={open ? 'mdi:folder-open-outline' : 'mdi:folder-outline'}></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t\t{#if open}{@render tree(entry.path, depth + 1)}{/if}\n\t{:else}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item file\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tclass:on={openPath === entry.path}\n\t\t\taria-current={openPath === entry.path ? 'true' : undefined}\n\t\t\tstyle:--depth={depth}\n\t\t\ttitle={entry.path}\n\t\t\tdata-path={entry.path}\n\t\t\tdata-type=\"file\"\n\t\t\tdraggable=\"true\"\n\t\t\tondragstart={(e) => onRowDrag(e, entry.path)}\n\t\t\tonclick={() => openFile(entry.path)}\n\t\t>\n\t\t\t<span class=\"chev\"></span>\n\t\t\t<iconify-icon class=\"ico\" icon=\"mdi:file-outline\"></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t{/if}\n{/snippet}\n\n<!-- A folder in the breadcrumb opens onto what it holds, and from there onto any folder below it. -->\n{#snippet crumb(dir: string, label: string)}\n\t<Popover.Root\n\t\tbind:open={() => crumbFor === dir, (open) => {\n\t\t\tcrumbFor = open ? dir : null;\n\t\t\tif (open) browse(dir);\n\t\t}}\n\t>\n\t\t<Popover.Trigger class=\"shrink-0 cursor-pointer rounded px-1 py-0.5 font-mono text-xs text-stone-400 hover:bg-[#1f1f1f] hover:text-stone-100\">\n\t\t\t{label}\n\t\t</Popover.Trigger>\n\t\t<Popover.Content align=\"start\" class=\"w-64 max-w-[80vw] border-[#333] bg-[#1a1a1a] p-1\">\n\t\t\t{@const listing = listingOf(browsing)}\n\t\t\t<div class=\"flex max-h-72 flex-col overflow-y-auto font-mono text-xs\">\n\t\t\t\t{#if browsing !== dir}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"flex min-h-8 items-center gap-1.5 rounded px-2 text-left text-stone-400 hover:bg-[#262626]\"\n\t\t\t\t\t\tonclick={() => browse(parentOf(browsing))}\n\t\t\t\t\t>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\tBack to {baseName(parentOf(browsing)) || rootName}\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t{#if !listing}\n\t\t\t\t\t<div class=\"px-2 py-1.5 text-stone-500\">\n\t\t\t\t\t\t{dirs[browsing] && dirs[browsing] !== 'loading' ? 'Could not read this folder' : 'Loading…'}\n\t\t\t\t\t</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each listing.entries as entry (entry.path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"flex min-h-8 items-center gap-1.5 rounded px-2 text-left text-stone-200 hover:bg-[#262626] {entry.path ===\n\t\t\t\t\t\t\topenPath\n\t\t\t\t\t\t\t\t? 'bg-[#262626]'\n\t\t\t\t\t\t\t\t: ''} {entry.ignored ? 'text-stone-500' : ''}\"\n\t\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\t\tif (entry.type === 'dir') return browse(entry.path);\n\t\t\t\t\t\t\t\tcrumbFor = null;\n\t\t\t\t\t\t\t\topenFile(entry.path);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<iconify-icon icon={entry.type === 'dir' ? 'mdi:folder-outline' : 'mdi:file-outline'}></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 truncate\">{entry.name}</span>\n\t\t\t\t\t\t\t{#if entry.type === 'dir'}<iconify-icon icon=\"mdi:chevron-right\"></iconify-icon>{/if}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t\t{#if listing.entries.length === 0}\n\t\t\t\t\t\t<div class=\"px-2 py-1.5 text-stone-500\">Empty</div>\n\t\t\t\t\t{/if}\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</Popover.Content>\n\t</Popover.Root>\n{/snippet}\n\n<div class=\"files\" class:picked={!!wantedFile} class:tree-off={!preferences.fileExplorerOpen}>\n\t<nav aria-label=\"Project files\">\n\t\t{#if repo}\n\t\t\t<div class=\"search\">\n\t\t\t\t<iconify-icon icon=\"mdi:magnify\"></iconify-icon>\n\t\t\t\t<Input\n\t\t\t\t\tbind:value={query}\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder=\"Go to file…\"\n\t\t\t\t\taria-label=\"Go to file\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tspellcheck={false}\n\t\t\t\t\tonfocus={loadAll}\n\t\t\t\t\tonkeydown={onQueryKey}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t{/if}\n\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\n\t\t<div class=\"list\" oncontextmenucapture={onListContextMenu}>\n\t\t\t{#if query.trim()}\n\t\t\t\t{#if listError}\n\t\t\t\t\t<div class=\"note err\">{listError}</div>\n\t\t\t\t{:else if !allFiles}\n\t\t\t\t\t<div class=\"note\">Loading…</div>\n\t\t\t\t{:else if results.length === 0}\n\t\t\t\t\t<div class=\"note\">No file matches.</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each results as path, i (path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"item result\"\n\t\t\t\t\t\t\tclass:on={i === picked}\n\t\t\t\t\t\t\tdata-result={i}\n\t\t\t\t\t\t\ttitle={path}\n\t\t\t\t\t\t\tonclick={() => openResult(path)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"name\">{baseName(path)}</span>\n\t\t\t\t\t\t\t<span class=\"dirname\"><bdi>{parentOf(path)}</bdi></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t{#if root}\n\t\t\t\t\t<div class=\"root\" title={root}>{rootName}</div>\n\t\t\t\t{/if}\n\t\t\t\t<ContextMenu.Root>\n\t\t\t\t\t<ContextMenu.Trigger>{@render tree('', 0)}</ContextMenu.Trigger>\n\t\t\t\t\t<ContextMenu.Content class=\"min-w-44\">\n\t\t\t\t\t\t{#if menuEntry}\n\t\t\t\t\t\t\t{@const entry = menuEntry}\n\t\t\t\t\t\t\t{#if !entry.dir}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => openFile(entry.path)}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-eye-outline\"></iconify-icon>\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => setExpanded(entry.path, !expanded.has(entry.path))}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon={expanded.has(entry.path) ? 'mdi:folder-outline' : 'mdi:folder-open-outline'}\n\t\t\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t\t\t{expanded.has(entry.path) ? 'Collapse' : 'Expand'}\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => mentionPath(entry.path)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t\t\t\t\tAdd to chat\n\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t<ContextMenu.Separator />\n\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => void copyText(entry.path)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t\tCopy path\n\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{#if root}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => void copyText(`${root}/${entry.path}`)}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t\t\tCopy absolute path\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</ContextMenu.Content>\n\t\t\t\t</ContextMenu.Root>\n\t\t\t\t{#if rootListing && !showIgnored && rootListing.hidden > 0}\n\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={toggleIgnored}>\n\t\t\t\t\t\t+ {rootListing.hidden} ignored at the top level (show)\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t{/if}\n\t\t</div>\n\t</nav>\n\n\t{#if wantedFile}\n\t\t<section class=\"viewer\" aria-label=\"File\">\n\t\t\t<div class=\"vhead\">\n\t\t\t\t<button type=\"button\" class=\"icon back\" aria-label=\"Back to files\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<div class=\"crumbs\" bind:this={crumbsEl} title={openPath}>\n\t\t\t\t\t{@render crumb('', rootName)}\n\t\t\t\t\t{#each crumbs as dir (dir)}\n\t\t\t\t\t\t<iconify-icon class=\"sep\" icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t\t\t\t{@render crumb(dir, baseName(dir))}\n\t\t\t\t\t{/each}\n\t\t\t\t\t<iconify-icon class=\"sep\" icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t\t\t<span class=\"leaf\">{openPath ? baseName(openPath) : ''}</span>\n\t\t\t\t</div>\n\t\t\t\t{#if read}<span class=\"dim size\">{formatSize(read.size)}</span>{/if}\n\t\t\t\t{#if markdown}\n\t\t\t\t\t<div class=\"seg\" role=\"group\" aria-label=\"Markdown view\">\n\t\t\t\t\t\t<Toggle\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tbind:pressed={() => rendered, (on) => {\n\t\t\t\t\t\t\t\tif (on) {\n\t\t\t\t\t\t\t\t\tmdSource = false;\n\t\t\t\t\t\t\t\t\tsetParams({ line: null });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}>Preview</Toggle\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<Toggle size=\"sm\" bind:pressed={() => !rendered, (on) => on && (mdSource = true)}>Source</Toggle>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t\t<button type=\"button\" class=\"icon\" title=\"Copy path\" aria-label=\"Copy path\" onclick={copyPath}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\ttitle=\"Mention in composer\"\n\t\t\t\t\taria-label=\"Mention in composer\"\n\t\t\t\t\tonclick={() => mentionPath(openPath)}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t{#if read?.kind === 'text' && !rendered}\n\t\t\t\t\t{@const wrapLabel = preferences.fileWordWrap ? 'Let long lines scroll' : 'Wrap long lines'}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\t\tclass:on={preferences.fileWordWrap}\n\t\t\t\t\t\taria-pressed={preferences.fileWordWrap}\n\t\t\t\t\t\ttitle={wrapLabel}\n\t\t\t\t\t\taria-label={wrapLabel}\n\t\t\t\t\t\tonclick={() => (preferences.fileWordWrap = !preferences.fileWordWrap)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:wrap\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon wide-only\"\n\t\t\t\t\tclass:on={preferences.fileExplorerOpen}\n\t\t\t\t\taria-pressed={preferences.fileExplorerOpen}\n\t\t\t\t\ttitle={explorerLabel}\n\t\t\t\t\taria-label={explorerLabel}\n\t\t\t\t\tonclick={() => (preferences.fileExplorerOpen = !preferences.fileExplorerOpen)}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"icon wide-only\" title=\"Close file\" aria-label=\"Close file\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:close\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if read?.kind === 'text' && read.truncated}\n\t\t\t\t<div class=\"banner\">Truncated at 1 MB: showing the first {formatSize(read.shown)} of {formatSize(read.size)}.</div>\n\t\t\t{/if}\n\t\t\t{#if !current}\n\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t{:else if 'error' in current}\n\t\t\t\t<p class=\"msg\" class:err={!current.binary}>\n\t\t\t\t\t{current.binary ? 'Binary file; not shown.' : current.error}\n\t\t\t\t</p>\n\t\t\t{:else if read?.kind === 'image'}\n\t\t\t\t<div class=\"image\">\n\t\t\t\t\t<img src=\"{api}/read?{new URLSearchParams({ path: read.path, raw: '1' })}\" alt={read.path} />\n\t\t\t\t</div>\n\t\t\t{:else if rendered && read?.kind === 'text'}\n\t\t\t\t<!-- eslint-disable-next-line svelte/no-at-html-tags -- markdown output with raw HTML escaped -->\n\t\t\t\t<div class=\"md markdown\">{@html renderMarkdown(read.text)}</div>\n\t\t\t{:else if lines.length === 0}\n\t\t\t\t<p class=\"msg\">Empty file.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"code\" class:wrap={preferences.fileWordWrap} bind:this={codeEl} style:--gutter=\"{String(lines.length).length + 1}ch\">\n\t\t\t\t\t{#each chunks as start (start)}\n\t\t\t\t\t\t<div class=\"chunk\" style:--rows={Math.min(CHUNK, lines.length - start)}>\n\t\t\t\t\t\t\t{#each lines.slice(start, start + CHUNK) as text, j (j)}\n\t\t\t\t\t\t\t\t{@const n = start + j + 1}\n\t\t\t\t\t\t\t\t<div class=\"ln\" class:hl={wantedLine === n} data-line={n}>\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"no\" tabindex=\"-1\" onclick={() => pickLine(n)}>{n}</button>\n\t\t\t\t\t\t\t\t\t<span class=\"src\"\n\t\t\t\t\t\t\t\t\t\t>{#if tokens?.[n - 1]}{#each tokens[n - 1] as t, k (k)}<span style:color={t.color}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>{t.content}</span\n\t\t\t\t\t\t\t\t\t\t\t\t>{/each}{:else}{text}{/if}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</section>\n\t{/if}\n</div>\n\n<style>\n\t.files {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t/* Beside an open file the tree sits past it, on the pane's far edge. */\n\t.picked nav {\n\t\torder: 1;\n\t\tflex: none;\n\t\twidth: min(22rem, 46%);\n\t\tmin-width: 16rem;\n\t\tborder-left: 1px solid #222;\n\t}\n\t.picked.tree-off nav {\n\t\tdisplay: none;\n\t}\n\t.search {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tcolor: #78716c;\n\t\tflex: none;\n\t}\n\t.search :global(input) {\n\t\theight: 32px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #1a1a1a;\n\t\tborder-color: #2a2a2a;\n\t}\n\t.list {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 6px 16px;\n\t}\n\t.root {\n\t\tpadding: 4px 8px 6px;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.item {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\twidth: 100%;\n\t\tmin-height: 28px;\n\t\tpadding: 0 8px 0 calc(4px + var(--depth, 0) * 14px);\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.item:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.item.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.item.ignored {\n\t\tcolor: #6b6560;\n\t}\n\t.chev {\n\t\tflex: none;\n\t\twidth: 14px;\n\t\tcolor: #78716c;\n\t\ttransition: transform 0.12s;\n\t}\n\t.chev.open {\n\t\ttransform: rotate(90deg);\n\t}\n\t.ico {\n\t\tflex: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 14px;\n\t}\n\t.dir .ico {\n\t\tcolor: #93c5fd;\n\t}\n\t.ignored .ico {\n\t\tcolor: inherit;\n\t\topacity: 0.6;\n\t}\n\t.link {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 12px;\n\t}\n\t.name {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.result {\n\t\tgap: 10px;\n\t\tpadding-left: 8px;\n\t}\n\t.result .name {\n\t\tflex: none;\n\t\tmax-width: 60%;\n\t}\n\t.dirname {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tcolor: #78716c;\n\t}\n\t.note {\n\t\tpadding: 5px 8px 5px calc(26px + var(--depth, 0) * 14px);\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.more {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t\ttext-align: left;\n\t}\n\t.more:hover {\n\t\tcolor: #d6d3d1;\n\t}\n\t.viewer {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.vhead {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-height: 44px;\n\t\tpadding: 6px 8px 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t/* The way to the file, scrolled to its end: the name is what was asked for. */\n\t.crumbs {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\toverflow-x: auto;\n\t\tscrollbar-width: none;\n\t\twhite-space: nowrap;\n\t}\n\t.crumbs::-webkit-scrollbar {\n\t\tdisplay: none;\n\t}\n\t.crumbs .sep {\n\t\tflex: none;\n\t\tfont-size: 13px;\n\t\tcolor: #57534e;\n\t}\n\t.leaf {\n\t\tflex: none;\n\t\tpadding: 0 4px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tcolor: #e7e5e4;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.size {\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.icon {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.icon:hover,\n\t.icon.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tmargin-left: -8px;\n\t}\n\t.seg {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 2px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 26px;\n\t\tfont-size: 12px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.banner {\n\t\tflex: none;\n\t\tpadding: 6px 14px;\n\t\tbackground: #2a2110;\n\t\tcolor: #fcd34d;\n\t\tfont-size: 12px;\n\t\tborder-bottom: 1px solid #3a2e14;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.msg.err {\n\t\tcolor: #f87171;\n\t}\n\t.image {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px;\n\t\tbackground:\n\t\t\trepeating-conic-gradient(#161616 0 25%, #1c1c1c 0 50%) 0 0 / 16px 16px;\n\t}\n\t.image img {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tdisplay: block;\n\t\tmargin: 0 auto;\n\t}\n\t.md {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px 20px 32px;\n\t\tfont-size: 14px;\n\t\tline-height: 1.6;\n\t}\n\t/* A document, not a reply: its headings stand out more than the transcript's. */\n\t.md :global(h1) {\n\t\tfont-size: 1.45em;\n\t\tmargin-top: 4px;\n\t}\n\t.md :global(h2) {\n\t\tfont-size: 1.2em;\n\t\tmargin-top: 20px;\n\t}\n\t.md :global(h3) {\n\t\tfont-size: 1.05em;\n\t}\n\t.code {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 24px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.chunk {\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-size: auto calc(var(--rows) * 1.65em);\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\tcolor: #c9d1d9;\n\t}\n\t.ln.hl {\n\t\tbackground: #2a2a1a;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: calc(var(--gutter) + 1ch);\n\t\tpadding: 0 1.5ch 0 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t}\n\t.no:hover,\n\t.hl .no {\n\t\tcolor: #d6d3d1;\n\t}\n\t.src {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* Folded at the pane's edge: a block is then as wide as the pane, not as its longest line. */\n\t.wrap .chunk {\n\t\twidth: auto;\n\t}\n\t.wrap .src {\n\t\tmin-width: 0;\n\t\twhite-space: pre-wrap;\n\t\toverflow-wrap: anywhere;\n\t}\n\n\t/* Too narrow for both: the tree, or the open file with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.wide-only {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.item,\n\t\t.more {\n\t\t\tmin-height: 40px;\n\t\t}\n\t\t.icon {\n\t\t\twidth: 40px;\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","/**\n * Lanes for a commit graph.\n *\n * Commits arrive newest first, each naming its parents. A lane is a column a\n * line of history runs down; a commit sits in the lane that was waiting for\n * it, its first parent carries that lane on, and any other parent opens a lane\n * of its own (or joins the one already waiting for it). Lanes never shift\n * sideways, so a branch is a straight line from its tip to where it forks.\n */\n\nexport interface GraphInput {\n hash: string;\n parents: string[];\n}\n\nexport interface GraphRow {\n /** The column the commit's dot sits in. */\n lane: number;\n /** Lanes with a line arriving from above that end at this commit. */\n into: number[];\n /** Lanes with a line that passes this row without touching the commit. */\n through: number[];\n /** Lanes a line leaves this commit toward, one per parent that is listed further down. */\n out: number[];\n}\n\nexport interface Graph {\n rows: GraphRow[];\n /** The most lanes any row uses, for sizing the column the graph is drawn in. */\n width: number;\n}\n\nexport function layoutGraph(commits: readonly GraphInput[]): Graph {\n const listed = new Set(commits.map((c) => c.hash));\n /** What each lane is waiting for next, or null when it is free. */\n const waiting: (string | null)[] = [];\n const free = () => {\n const at = waiting.indexOf(null);\n return at === -1 ? waiting.length : at;\n };\n const rows: GraphRow[] = [];\n let width = 0;\n\n for (const commit of commits) {\n const into: number[] = [];\n waiting.forEach((hash, lane) => {\n if (hash === commit.hash) into.push(lane);\n });\n const lane = into[0] ?? free();\n const through: number[] = [];\n waiting.forEach((hash, i) => {\n if (hash !== null && hash !== commit.hash) through.push(i);\n });\n // Every lane that was waiting for this commit ends here; its own carries on below.\n for (const i of into) waiting[i] = null;\n waiting[lane] = null;\n\n const out: number[] = [];\n // A parent outside the listing (history cut short) draws no line: nothing is there to reach.\n const parents = commit.parents.filter((p) => listed.has(p));\n parents.forEach((parent, n) => {\n // The first parent carries this lane on, even when another lane already\n // waits for the same commit: the two meet there, and neither bends early.\n let to = n === 0 ? lane : waiting.indexOf(parent);\n if (to === -1) to = free();\n waiting[to] = parent;\n if (!out.includes(to)) out.push(to);\n });\n\n while (waiting.length > 0 && waiting[waiting.length - 1] === null) waiting.pop();\n width = Math.max(width, lane + 1, ...through.map((i) => i + 1), ...out.map((i) => i + 1));\n rows.push({ lane, into, through, out });\n }\n return { rows, width };\n}\n","<script lang=\"ts\">\n\t/**\n\t * The repo's commits, read-only: the list on one side, the picked commit's\n\t * files and their diffs on the other, and on a narrow pane the two take\n\t * turns. \"List\" follows the checked-out branch, filed by day; \"Graph\" adds\n\t * every worktree's branch and the upstream, each in a lane of its own, and\n\t * names a lane's tip after the worker running there.\n\t *\n\t * What no other git client can say is said here: which commits this\n\t * session made (and the turn that made them), and which have not left the\n\t * machine yet.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { layoutGraph, type GraphRow } from '$shared/git-graph.js';\n\timport { dayOf, readRef, shortHash, type Commit, type CommitFile, type History } from '$lib/side-panel/history';\n\timport { statusLetter, type Diff } from '$lib/side-panel/changes';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\timport { sessionStore } from '$lib/stores/sessions.svelte';\n\timport { clock } from '$lib/stores/clock.svelte';\n\timport { formatAgo } from '$lib/format';\n\timport DiffLines from './DiffLines.svelte';\n\timport GithubRefCards from '$lib/components/GithubRefCards.svelte';\n\timport { renderMarkdown } from '$lib/markdown';\n\n\tlet { session, base, params, setParams, setActions, mention, openPane, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `${sessionApiAt(base, sessionId)}/history` : null);\n\tconst graph = $derived(params.view === 'graph');\n\n\t// ── the commits ──────────────────────────────────────────────────────\n\n\tlet subjectEl = $state<HTMLElement | null>(null);\n\n\t/** A subject as text, but with each `#n` marked to resolve in the session's repo. */\n\tfunction subjectHtml(subject: string): string {\n\t\tconst html = renderMarkdown(subject.replace(/[\\\\`*_[\\]<>]/g, '\\\\$&'), { github: { bare: true } }).trim();\n\t\treturn html.replace(/^<p>([\\s\\S]*)<\\/p>$/, '$1');\n\t}\n\n\tlet history = $state<History | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loading = $state(false);\n\tlet listSeq = 0;\n\n\tasync function loadList(url: string, all: boolean) {\n\t\tconst mine = ++listSeq;\n\t\tloading = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}?scope=${all ? 'all' : 'branch'}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\thistory = body as History;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loading = false;\n\t\t}\n\t}\n\n\t/**\n\t * Commits change when a turn ends or the working tree's count moves (a\n\t * commit empties it), not with every hook, so that is when the log is read\n\t * again. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(`${session?.turn_completed_at ?? 0}:${session?.changes?.files ?? 0}`);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tconst url = api;\n\t\tconst all = graph;\n\t\tif (url && active) untrack(() => void loadList(url, all));\n\t});\n\n\tconst commits = $derived(history?.commits ?? []);\n\tconst layout = $derived(layoutGraph(commits));\n\tconst unpushed = $derived(commits.filter((c) => !c.pushed).length);\n\tconst branches = $derived(new Set((history?.tips ?? []).flatMap((t) => (t.branch ? [t.branch] : []))));\n\n\t/** The worker whose worktree has `branch` checked out, named as the sidebar names it. */\n\tfunction workerOn(branch: string): string | null {\n\t\tconst tip = history?.tips.find((t) => t.branch === branch);\n\t\tconst worker = tip && sessionStore.sessions.find((s) => s.git_root === tip.path && s.maestro_issue != null);\n\t\tif (!worker) return null;\n\t\treturn worker.issue ? `#${worker.maestro_issue} ${worker.issue.title}` : `#${worker.maestro_issue}`;\n\t}\n\n\t// ── drawing a row of the graph ───────────────────────────────────────\n\n\tconst ROW = 44;\n\tconst LANE = 14;\n\tconst PAD = 11;\n\tconst LANES = ['#a8a29e', '#a78bfa', '#2dd4bf', '#7dd3fc', '#fbbf24', '#f9a8d4'];\n\tconst laneX = (lane: number) => PAD + lane * LANE;\n\tconst laneColor = (lane: number) => LANES[lane % LANES.length];\n\tconst railWidth = $derived(PAD * 2 + Math.max(0, layout.width - 1) * LANE);\n\n\t/** A line from a lane at one edge of the row to the commit's dot, bending only if the lanes differ. */\n\tfunction bend(lane: number, row: GraphRow, fromTop: boolean): string {\n\t\tconst x = laneX(lane);\n\t\tconst cx = laneX(row.lane);\n\t\tconst edge = fromTop ? 0 : ROW;\n\t\tconst mid = ROW / 2;\n\t\treturn x === cx\n\t\t\t? `M${x} ${edge} L${cx} ${mid}`\n\t\t\t: `M${x} ${edge} C${x} ${(edge + mid) / 2} ${cx} ${(edge + mid) / 2} ${cx} ${mid}`;\n\t}\n\n\t// ── the picked commit ────────────────────────────────────────────────\n\n\tconst picked = $derived(commits.find((c) => c.hash === params.commit) ?? null);\n\n\tlet files = $state<{ hash: string; files: CommitFile[] } | null>(null);\n\tlet filesError = $state<string | null>(null);\n\tlet filesSeq = 0;\n\tasync function loadFiles(url: string, hash: string) {\n\t\tconst mine = ++filesSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}/commit?hash=${hash}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== filesSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tfiles = body as { hash: string; files: CommitFile[] };\n\t\t\tfilesError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === filesSeq) filesError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\t$effect(() => {\n\t\tconst url = api;\n\t\tconst hash = params.commit;\n\t\tif (url && hash && active) untrack(() => void loadFiles(url, hash));\n\t});\n\tconst shownFiles = $derived(files && files.hash === params.commit ? files.files : null);\n\n\tlet diff = $state<{ hash: string; diff: Diff } | null>(null);\n\tlet diffError = $state<string | null>(null);\n\tlet diffSeq = 0;\n\tasync function loadDiff(url: string, hash: string, file: string) {\n\t\tconst mine = ++diffSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}/diff?${new URLSearchParams({ hash, file })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tdiff = { hash, diff: body as Diff };\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) diffError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\t$effect(() => {\n\t\tconst url = api;\n\t\tconst hash = params.commit;\n\t\tconst file = params.file;\n\t\tif (url && hash && file && active) untrack(() => void loadDiff(url, hash, file));\n\t});\n\tconst shownDiff = $derived(\n\t\tdiff && diff.hash === params.commit && diff.diff.file === params.file ? diff.diff : null\n\t);\n\n\t/** The file as the picked commit left it, for the lines its diff leaves out. */\n\tasync function fileText(hash: string, file: string): Promise<string | null> {\n\t\tif (!api) return null;\n\t\tconst res = await fetch(`${api}/file?${new URLSearchParams({ hash, file })}`);\n\t\treturn res.ok ? ((await res.json()) as { text: string }).text : null;\n\t}\n\n\tfunction pick(hash: string) {\n\t\tsetParams({ commit: hash, file: null }, { push: true });\n\t}\n\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !api || loading,\n\t\t\t\trun: () => api && void loadList(api, graph)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the commits, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (commits.length === 0) return;\n\t\tconst at = picked ? commits.indexOf(picked) : -1;\n\t\tconst next = commits[e.key === 'j' ? Math.min(at + 1, commits.length - 1) : Math.max(at - 1, 0)];\n\t\te.preventDefault();\n\t\tsetParams({ commit: next.hash, file: null });\n\t\tdocument.querySelector(`[data-commit=\"${next.hash}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t}\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"history\" class:picked={!!params.commit}>\n\t<div class=\"bar\">\n\t\t<span class=\"branch\">\n\t\t\t<iconify-icon icon=\"mdi:source-branch\"></iconify-icon>\n\t\t\t{history?.branch ?? (history ? 'detached HEAD' : 'History')}\n\t\t</span>\n\t\t{#if unpushed > 0}\n\t\t\t<span class=\"chip local\" title=\"Commits no remote branch has yet\">{unpushed} to push</span>\n\t\t{/if}\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"How the commits are shown\">\n\t\t\t<Toggle size=\"sm\" bind:pressed={() => !graph, (on) => on && setParams({ view: null })}\n\t\t\t\ttitle=\"The checked-out branch, by day\">List</Toggle\n\t\t\t>\n\t\t\t<Toggle size=\"sm\" bind:pressed={() => graph, (on) => on && setParams({ view: 'graph' })}\n\t\t\t\ttitle=\"Every worktree's branch and the upstream, a lane each\">Graph</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if listError}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !history}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if commits.length === 0}\n\t\t<p class=\"msg\">No commits yet.</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Commits\">\n\t\t\t\t{#each commits as commit, i (commit.hash)}\n\t\t\t\t\t{@const row = layout.rows[i]}\n\t\t\t\t\t{@const day = dayOf(commit.at, clock.now)}\n\t\t\t\t\t{#if !graph && (i === 0 || day !== dayOf(commits[i - 1].at, clock.now))}\n\t\t\t\t\t\t<div class=\"day\" style:padding-left=\"{railWidth + 6}px\">{day}</div>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"commit\"\n\t\t\t\t\t\tclass:on={commit.hash === params.commit}\n\t\t\t\t\t\taria-current={commit.hash === params.commit ? 'true' : undefined}\n\t\t\t\t\t\tdata-commit={commit.hash}\n\t\t\t\t\t\tonclick={() => pick(commit.hash)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg class=\"rail\" width={railWidth} height={ROW} viewBox=\"0 0 {railWidth} {ROW}\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t{#each row.through as lane (lane)}\n\t\t\t\t\t\t\t\t<path d=\"M{laneX(lane)} 0 L{laneX(lane)} {ROW}\" stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#each row.into as lane (lane)}\n\t\t\t\t\t\t\t\t<path d={bend(lane, row, true)} stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#each row.out as lane (lane)}\n\t\t\t\t\t\t\t\t<path d={bend(lane, row, false)} stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#if commit.refs.some((r) => r.startsWith('tag: '))}\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tclass=\"dot tag\"\n\t\t\t\t\t\t\t\t\tx={laneX(row.lane) - 4}\n\t\t\t\t\t\t\t\t\ty={ROW / 2 - 4}\n\t\t\t\t\t\t\t\t\twidth=\"8\"\n\t\t\t\t\t\t\t\t\theight=\"8\"\n\t\t\t\t\t\t\t\t\ttransform=\"rotate(45 {laneX(row.lane)} {ROW / 2})\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\t\tclass=\"dot\"\n\t\t\t\t\t\t\t\t\tclass:mine={commit.mine}\n\t\t\t\t\t\t\t\t\tcx={laneX(row.lane)}\n\t\t\t\t\t\t\t\t\tcy={ROW / 2}\n\t\t\t\t\t\t\t\t\tr=\"4\"\n\t\t\t\t\t\t\t\t\tstroke={commit.mine ? undefined : laneColor(row.lane)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span class=\"what\">\n\t\t\t\t\t\t\t<span class=\"subject\">{commit.subject}</span>\n\t\t\t\t\t\t\t<span class=\"meta\">\n\t\t\t\t\t\t\t\t<span>{shortHash(commit.hash)}</span>\n\t\t\t\t\t\t\t\t<span>{formatAgo(commit.at, clock.now)}</span>\n\t\t\t\t\t\t\t\t{#each commit.refs as ref (ref)}\n\t\t\t\t\t\t\t\t\t{@const r = readRef(ref, branches)}\n\t\t\t\t\t\t\t\t\t{@const worker = r.kind === 'branch' ? workerOn(r.name) : null}\n\t\t\t\t\t\t\t\t\t<span class=\"chip {worker ? 'worker' : r.kind}\" title={worker ? `${r.name}, where this worker runs` : ref}\n\t\t\t\t\t\t\t\t\t\t>{worker ?? r.name}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t\t{#if commit.mine}<span class=\"chip mine\" title=\"Made by this session\">this session</span>{/if}\n\t\t\t\t\t\t\t\t{#if !commit.pushed}<span class=\"chip local\" title=\"No remote branch has this commit yet\">local</span>{/if}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{#if commit.additions || commit.deletions}\n\t\t\t\t\t\t\t<span class=\"nums\"><span class=\"add\">+{commit.additions}</span> <span class=\"del\">−{commit.deletions}</span></span>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if history.truncated}\n\t\t\t\t\t<p class=\"more\">Older commits are not listed.</p>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t{#if subjectEl && sessionId}\n\t\t\t\t<GithubRefCards root={subjectEl} session={sessionId} {base} onOpen={(ref) => openPane('github', { ref })} />\n\t\t\t{/if}\n\t\t\t<section class=\"detail\" aria-label=\"Commit\">\n\t\t\t\t{#if picked}\n\t\t\t\t\t<div class=\"head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to commits\" onclick={() => setParams({ commit: null, file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<div class=\"title\">\n\t\t\t\t\t\t\t<!-- A `(#116)` in the subject is a chip that opens the GitHub pane. -->\n\t\t\t\t\t\t\t<h3 bind:this={subjectEl}>{@html subjectHtml(picked.subject)}</h3>\n\t\t\t\t\t\t\t<p class=\"who\">\n\t\t\t\t\t\t\t\t<span>{shortHash(picked.hash)}</span>\n\t\t\t\t\t\t\t\t<span>{picked.author}</span>\n\t\t\t\t\t\t\t\t<span>{new Date(picked.at).toLocaleString()}</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"acts\">\n\t\t\t\t\t\t<button type=\"button\" class=\"act\" onclick={() => mention(shortHash(picked.hash))}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon> Add to chat\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button type=\"button\" class=\"act\" onclick={() => void copyWithToast(picked.hash, 'Hash copied')}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon> Copy hash\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{#if picked.turn}\n\t\t\t\t\t\t\t{@const turn = picked.turn}\n\t\t\t\t\t\t\t<button type=\"button\" class=\"act\" title=\"Show the turn of the conversation that made this commit\" onclick={() => revealTurn(turn)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:message-arrow-left-outline\"></iconify-icon> Go to turn\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if filesError}\n\t\t\t\t\t\t<p class=\"msg err\">{filesError}</p>\n\t\t\t\t\t{:else if !shownFiles}\n\t\t\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t\t\t{:else if shownFiles.length === 0}\n\t\t\t\t\t\t<p class=\"msg\">This commit changed no files.</p>\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<div class=\"files\">\n\t\t\t\t\t\t\t{#each shownFiles as f (f.file)}\n\t\t\t\t\t\t\t\t{@const open = f.file === params.file}\n\t\t\t\t\t\t\t\t<!-- The way to the Files pane rides on the file's own row, so it costs the diff no height. -->\n\t\t\t\t\t\t\t\t<div class=\"filerow\" class:on={open}>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\t\t\t\t\tonclick={() => setParams({ file: open ? null : f.file })}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"st {f.kind}\">{statusLetter(f)}</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"path\"><bdi>{f.file}</bdi></span>\n\t\t\t\t\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"nums\"><span class=\"add\">+{f.additions}</span> <span class=\"del\">−{f.deletions}</span></span>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t{#if f.kind !== 'deleted'}\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"tofiles\"\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Open in Files, as the file is on disk now\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Open {f.file} in Files\"\n\t\t\t\t\t\t\t\t\t\t\tonclick={() => openPane('files', { file: f.file, line: null })}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree-outline\"></iconify-icon>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{#if open}\n\t\t\t\t\t\t\t\t\t<div class=\"diff\">\n\t\t\t\t\t\t\t\t\t\t{#if diffError}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg err\">{diffError}</p>\n\t\t\t\t\t\t\t\t\t\t{:else if !shownDiff}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t\t\t\t\t\t\t\t{:else if shownDiff.binary}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t\t\t\t\t\t{:else if shownDiff.hunks.length === 0}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t{#key `${picked.hash}\\0${f.file}`}\n\t\t\t\t\t\t\t\t\t\t\t\t<DiffLines\n\t\t\t\t\t\t\t\t\t\t\t\t\thunks={shownDiff.hunks}\n\t\t\t\t\t\t\t\t\t\t\t\t\tfile={f.file}\n\t\t\t\t\t\t\t\t\t\t\t\t\tloadText={f.kind === 'deleted' ? undefined : () => fileText(picked.hash, f.file)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{/key}\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">Pick a commit to see what it changed.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n</div>\n\n<style>\n\t.history {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.branch {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow-y: auto;\n\t\tpadding: 4px 0 12px;\n\t}\n\t.picked nav {\n\t\tflex: none;\n\t\twidth: min(24rem, 46%);\n\t\tborder-right: 1px solid #222;\n\t}\n\t.day {\n\t\tpadding: 10px 12px 2px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t.commit {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\theight: 44px;\n\t\tpadding: 0 12px 0 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.commit:hover {\n\t\tbackground: #171717;\n\t}\n\t.commit.on {\n\t\tbackground: #1f1f1f;\n\t}\n\t.commit:focus-visible,\n\t.file:focus-visible,\n\t.act:focus-visible,\n\t.tofiles:focus-visible,\n\t.back:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t.rail {\n\t\tflex: none;\n\t}\n\t.rail path {\n\t\tfill: none;\n\t\tstroke-width: 2;\n\t}\n\t.dot {\n\t\tfill: #111111;\n\t\tstroke-width: 2;\n\t}\n\t.dot.mine {\n\t\tfill: #2dd4bf;\n\t\tstroke: #2dd4bf;\n\t}\n\t.dot.tag {\n\t\tstroke: #fbbf24;\n\t}\n\t.what {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t}\n\t.subject {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #e7e5e4;\n\t}\n\t.meta {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t.chip {\n\t\tflex: none;\n\t\tmax-width: 16rem;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tpadding: 0 5px;\n\t\tborder: 1px solid #3a3532;\n\t\tborder-radius: 4px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tline-height: 1.5;\n\t\tcolor: #a8a29e;\n\t}\n\t.chip.tag {\n\t\tcolor: #fbbf24;\n\t\tborder-color: #6b5312;\n\t}\n\t.chip.remote {\n\t\tcolor: #7dd3fc;\n\t\tborder-color: #1e4a5f;\n\t}\n\t.chip.mine {\n\t\tcolor: #2dd4bf;\n\t\tborder-color: #14524a;\n\t}\n\t.chip.worker {\n\t\tcolor: #a78bfa;\n\t\tborder-color: #4a3c7a;\n\t}\n\t.chip.local {\n\t\tcolor: #fdba74;\n\t\tborder-color: #6b3d12;\n\t}\n\t.nums {\n\t\tflex: none;\n\t\tpadding-left: 10px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\twhite-space: nowrap;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n\t.more {\n\t\tmargin: 0;\n\t\tpadding: 10px 14px;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\n\t.detail {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: none;\n\t\tflex-direction: column;\n\t\toverflow-y: auto;\n\t}\n\t.picked .detail {\n\t\tdisplay: flex;\n\t}\n\t.head {\n\t\tdisplay: flex;\n\t\talign-items: flex-start;\n\t\tgap: 4px;\n\t\tpadding: 12px 14px 0;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 40px;\n\t\theight: 40px;\n\t\tmargin: -8px 0 0 -10px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.title {\n\t\tmin-width: 0;\n\t}\n\th3 {\n\t\tmargin: 0;\n\t\tfont-size: 14.5px;\n\t\tfont-weight: 600;\n\t\tline-height: 1.35;\n\t\tcolor: #f5f5f4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.who {\n\t\tmargin: 4px 0 0;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 2px 10px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t\tcolor: #a8a29e;\n\t}\n\t.acts {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tpadding: 10px 14px 12px;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\t.act {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 30px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tborder-radius: 7px;\n\t\tbackground: #1a1a1a;\n\t\tcolor: #e7e5e4;\n\t\tfont: inherit;\n\t\tfont-size: 12px;\n\t\tcursor: pointer;\n\t}\n\t.act:hover {\n\t\tbackground: #232323;\n\t}\n\t.files {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.filerow {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t\tborder-bottom: 1px solid #1c1c1c;\n\t}\n\t.filerow:hover {\n\t\tbackground: #171717;\n\t}\n\t.filerow.on {\n\t\tbackground: #1f1f1f;\n\t}\n\t.filerow.on .file {\n\t\tcolor: #f5f5f4;\n\t}\n\t.tofiles {\n\t\tflex: none;\n\t\twidth: 36px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #78716c;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t\t/* Out of the way until the row is the one in hand; always there where nothing hovers. */\n\t\topacity: 0;\n\t}\n\t.filerow:hover .tofiles,\n\t.filerow.on .tofiles,\n\t.tofiles:focus-visible {\n\t\topacity: 1;\n\t}\n\t.tofiles:hover {\n\t\tcolor: #f5f5f4;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tmin-height: 34px;\n\t\tpadding: 0 4px 0 14px;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.st {\n\t\tflex: none;\n\t\twidth: 1ch;\n\t\tfont-weight: 600;\n\t\tcolor: #fbbf24;\n\t}\n\t.st.added {\n\t\tcolor: #4ade80;\n\t}\n\t.st.deleted {\n\t\tcolor: #f87171;\n\t}\n\t.path {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: 70vh;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\n\t/* Too narrow for both: the commits, or the picked one with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t\t.act {\n\t\t\theight: 38px;\n\t\t}\n\t\t.file {\n\t\t\tmin-height: 42px;\n\t\t}\n\t\t.tofiles {\n\t\t\twidth: 44px;\n\t\t\topacity: 1;\n\t\t}\n\t}\n</style>\n","/** A hostname or bound address that only this machine can reach. */\nexport function isLoopback(host: string): boolean {\n\tconst h = host.replace(/^\\[|\\]$/g, '').toLowerCase();\n\treturn h === 'localhost' || h.endsWith('.localhost') || h === '::1' || /^(::ffff:)?127\\./.test(h);\n}\n","/**\n * The Web pane's logic, apart from the component: which URL a choice names,\n * and how a URL can be shown from the device the page is open on.\n *\n * claude-mux is usually reached over HTTPS through tailscale serve, so an\n * `http://` page cannot be framed (mixed content), and a `localhost` URL means\n * the phone itself when opened on the phone. A dev server on this machine is\n * therefore framed through its tailscale serve HTTPS mapping when it has one,\n * and otherwise offered in a new tab with the command that would map it.\n *\n * A session on another machine reads `localhost` as that machine, which the\n * device reaches by the machine's own tailnet name, never by the page's.\n */\nimport { isLoopback } from '$shared/utils/loopback.js';\nimport type { DevServer, WebInfo } from '$shared/server/web-preview.js';\n\nexport type { DevServer, FrameCheck, WebInfo } from '$shared/server/web-preview.js';\n\n/** The named choices; anything else in `?url=` is a URL typed by hand. */\nexport type WebChoice = 'prod' | 'dev';\n\n/**\n * The URL a choice names. `dev` falls back to the first dev server found\n * running in the project when `.claude-mux.json` names none.\n */\nexport function choiceUrl(choice: string, info: Pick<WebInfo, 'urls' | 'detected'> | null): string | null {\n\tif (choice === 'prod') return info?.urls.prod ?? null;\n\tif (choice === 'dev') return info?.urls.dev ?? info?.detected[0]?.url ?? null;\n\treturn choice;\n}\n\n/** A URL typed into the bar, given a scheme when it has none. Null when it will not parse. */\nexport function normalizeTyped(text: string): string | null {\n\tconst t = text.trim();\n\tif (!t) return null;\n\tconst hasScheme = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(t);\n\ttry {\n\t\tlet u = new URL(hasScheme ? t : `http://${t}`);\n\t\t// Without a scheme, only this machine is assumed to speak plain HTTP.\n\t\tif (!hasScheme && !pointsHere(u)) u = new URL(`https://${t}`);\n\t\treturn u.protocol === 'http:' || u.protocol === 'https:' ? u.href : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** A URL that points at the machine claude-mux runs on. */\nfunction pointsHere(u: URL): boolean {\n\treturn isLoopback(u.hostname) || u.hostname === '0.0.0.0';\n}\n\nfunction portOf(u: URL): number {\n\treturn Number(u.port || (u.protocol === 'https:' ? 443 : 80));\n}\n\nexport type Embed =\n\t| {\n\t\t\tkind: 'frame';\n\t\t\tsrc: string;\n\t }\n\t| {\n\t\t\tkind: 'card';\n\t\t\t/** Why it cannot be framed from here. */\n\t\t\treason: string;\n\t\t\t/** The URL that opens it in a tab of its own. */\n\t\t\topen: string;\n\t\t\t/** The command that would make it embeddable. */\n\t\t\tcommand?: string;\n\t };\n\nexport interface EmbedContext {\n\t/** Where this page is open: `location`. */\n\tpage: { protocol: string; hostname: string };\n\t/**\n\t * The host name of the session's machine when it is not the one that\n\t * served the page; null or absent for the page's own machine.\n\t */\n\tmachine?: string | null;\n\tserves: WebInfo['serves'];\n\tdetected: DevServer[];\n}\n\n/** How `target` can be shown in the pane from the page in `ctx`. */\nexport function resolveEmbed(target: string, ctx: EmbedContext): Embed {\n\tconst u = new URL(target);\n\tconst pageSecure = ctx.page.protocol === 'https:';\n\tif (!pointsHere(u)) {\n\t\tif (pageSecure && u.protocol === 'http:') {\n\t\t\treturn {\n\t\t\t\tkind: 'card',\n\t\t\t\treason: 'This page is served over HTTPS, and browsers will not frame a plain-HTTP page inside it.',\n\t\t\t\topen: u.href\n\t\t\t};\n\t\t}\n\t\treturn { kind: 'frame', src: u.href };\n\t}\n\n\tconst port = portOf(u);\n\tconst served = ctx.serves[port];\n\tif (served) {\n\t\treturn { kind: 'frame', src: `${served}${u.pathname}${u.search}${u.hash}` };\n\t}\n\t// Opened on the machine itself, localhost is the same machine, and browsers treat it as secure.\n\tif (!ctx.machine && isLoopback(ctx.page.hostname)) {\n\t\treturn { kind: 'frame', src: u.href.replace('//0.0.0.0', '//localhost') };\n\t}\n\n\t// Whatever name the device reached claude-mux by reaches this machine's other ports too;\n\t// another machine's ports are reached by that machine's name.\n\tconst remote = new URL(u.href);\n\tremote.hostname = ctx.machine || ctx.page.hostname;\n\tconst card = { kind: 'card' as const, open: remote.href, command: `tailscale serve --bg --https=${port} http://localhost:${port}` };\n\t// The command maps a port of the machine it runs on, so another machine's card says where.\n\tconst where = ctx.machine ? ` Run it on ${ctx.machine.split('.')[0]}.` : '';\n\tconst machine = ctx.machine ? ctx.machine.split('.')[0] : 'this machine';\n\tif (ctx.detected.find((d) => d.port === port)?.loopbackOnly) {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `The server on port ${port} listens on 127.0.0.1 only, so nothing off ${machine} reaches it. Map it with tailscale serve, or restart it bound to 0.0.0.0.${where}`\n\t\t};\n\t}\n\tif (pageSecure && remote.protocol === 'http:') {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `Port ${port} has no tailscale serve HTTPS mapping on ${machine}, and this page, served over HTTPS, cannot frame plain HTTP.${where}`\n\t\t};\n\t}\n\treturn { kind: 'frame', src: remote.href };\n}\n","/**\n * The Web pane's Browser source, apart from the component: turning what\n * happens on the canvas into the messages the stream takes (see\n * `toCdpInput()` in `src/server/browser-view.ts`), and picking the tab to show.\n */\nimport type { BrowserInfo, BrowserTab } from '$shared/server/browser-view.js';\n\nexport type { BrowserInfo, BrowserWsMessage } from '$shared/server/browser-view.js';\n\n/** The `?url=` value that names the remote browser rather than a site. */\nexport const BROWSER_CHOICE = 'browser';\n\n/** The size, in CSS pixels, of the remote viewport a frame shows. */\nexport interface FrameSize {\n\twidth: number;\n\theight: number;\n}\n\n/** The box the frame is drawn in, as `getBoundingClientRect()` has it. */\nexport interface Box {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * A point on this screen as a point in the remote page, in its CSS pixels.\n * The canvas is the frame scaled to fit, so the mapping is one ratio; a point\n * dragged past the edge is held to it.\n */\nexport function toPagePoint(clientX: number, clientY: number, box: Box, frame: FrameSize): { x: number; y: number } {\n\tconst along = (at: number, start: number, size: number, remote: number) =>\n\t\tsize > 0 ? Math.round(Math.min(Math.max((at - start) / size, 0), 1) * remote) : 0;\n\treturn {\n\t\tx: along(clientX, box.left, box.width, frame.width),\n\t\ty: along(clientY, box.top, box.height, frame.height)\n\t};\n}\n\n/** How the canvas is magnified on this side: a scale about its centre, then a shift in screen pixels. */\nexport interface View {\n\tscale: number;\n\tx: number;\n\ty: number;\n}\n\nexport const UNZOOMED: View = { scale: 1, x: 0, y: 0 };\nconst MAX_ZOOM = 8;\n\n/**\n * `view` after a zoom by `factor` that carries what was under `from` to `to`\n * (both screen points): a pinch whose midpoint moved, or a wheel zoom about\n * the pointer when the two are the same. `box` is where the canvas lies\n * unzoomed, and `room` the size of the space it may fill, which it is centred\n * in. The canvas never shrinks below its fit, and once it is larger than the\n * room on an axis it never leaves a gap at that axis's edges.\n */\nexport function zoomView(\n\tview: View,\n\tfrom: { x: number; y: number },\n\tto: { x: number; y: number },\n\tfactor: number,\n\tbox: Box,\n\troom: { width: number; height: number } = box\n): View {\n\tconst scale = Math.min(Math.max(view.scale * factor, 1), MAX_ZOOM);\n\tconst cx = box.left + box.width / 2;\n\tconst cy = box.top + box.height / 2;\n\tconst shift = (at: number, dest: number, centre: number, offset: number, size: number, space: number) => {\n\t\tconst limit = Math.max(0, (scale * size - space) / 2);\n\t\t// The point of the canvas under `at`, measured from its centre before any zoom.\n\t\tconst on = (at - centre - offset) / view.scale;\n\t\treturn Math.min(Math.max(dest - centre - scale * on, -limit), limit);\n\t};\n\treturn {\n\t\tscale,\n\t\tx: shift(from.x, to.x, cx, view.x, box.width, room.width),\n\t\ty: shift(from.y, to.y, cy, view.y, box.height, room.height)\n\t};\n}\n\ninterface Modified {\n\taltKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n}\n\n/** CDP's modifier bit field: Alt 1, Ctrl 2, Meta 4, Shift 8. */\nexport function modifiersOf(e: Modified): number {\n\treturn (e.altKey ? 1 : 0) | (e.ctrlKey ? 2 : 0) | (e.metaKey ? 4 : 0) | (e.shiftKey ? 8 : 0);\n}\n\nconst MOUSE_BUTTONS = ['left', 'middle', 'right', 'back', 'forward'] as const;\n\n/** The name CDP gives `MouseEvent.button`. */\nexport function buttonName(button: number): string {\n\treturn MOUSE_BUTTONS[button] ?? 'none';\n}\n\n/** The button a move is dragging with, from `MouseEvent.buttons`. */\nexport function heldButton(buttons: number): string {\n\treturn buttons & 1 ? 'left' : buttons & 2 ? 'right' : buttons & 4 ? 'middle' : 'none';\n}\n\ninterface KeyLike extends Modified {\n\tkey: string;\n\tcode: string;\n\tkeyCode: number;\n}\n\ninterface KeyMessage {\n\ttype: 'key';\n\tevent: 'down' | 'up';\n\tkey: string;\n\tcode: string;\n\tkeyCode: number;\n\ttext?: string;\n\tmodifiers: number;\n}\n\n/**\n * The message for a key going down or up, or null for one the remote page\n * should not get: the side panel's own Alt+Shift shortcuts, and paste, whose\n * text arrives by the paste event from this machine's clipboard instead of\n * the remote one's.\n */\nexport function keyMessage(e: KeyLike, event: 'down' | 'up'): KeyMessage | null {\n\tif (e.altKey && e.shiftKey) return null;\n\tconst command = e.ctrlKey || e.metaKey;\n\tif (command && e.key.toLowerCase() === 'v') return null;\n\tconst msg: KeyMessage = { type: 'key', event, key: e.key, code: e.code, keyCode: e.keyCode, modifiers: modifiersOf(e) };\n\t// A key that types carries its text; without it the page sees the key and no character.\n\tif (event === 'down' && !command) {\n\t\tif (e.key === 'Enter') msg.text = '\\r';\n\t\telse if ([...e.key].length === 1) msg.text = e.key;\n\t}\n\treturn msg;\n}\n\n/**\n * What to do remotely so that text which read `prev` reads `next`: how many\n * characters to delete off the end, then what to type. The phone keyboard's\n * field is mirrored this way, because autocorrect and composition rewrite\n * what is already there rather than only appending.\n */\nexport function textDelta(prev: string, next: string): { backspaces: number; insert: string } {\n\tconst a = [...prev];\n\tconst b = [...next];\n\tlet same = 0;\n\twhile (same < a.length && same < b.length && a[same] === b[same]) same++;\n\treturn { backspaces: a.length - same, insert: b.slice(same).join('') };\n}\n\n/**\n * The tab to show: the one the URL names while it is open, else the one\n * already showing (`staying`), else the one the session last opened or\n * selected, else the browser's first. The session's tab is found by its URL,\n * which stops matching as soon as the page goes anywhere, so without\n * `staying` a click on a link would hand the view, and the person's next\n * keystrokes, to some other tab.\n */\nexport function pickTab(\n\tinfo: Pick<BrowserInfo, 'tabs' | 'preferred'> | null,\n\twanted: string | undefined,\n\tstaying: string | null = null\n): BrowserTab | null {\n\tif (!info) return null;\n\tconst byId = (id: string | null | undefined) => (id ? info.tabs.find((t) => t.id === id) : undefined);\n\treturn byId(wanted) ?? byId(staying) ?? byId(info.preferred) ?? info.tabs[0] ?? null;\n}\n\n/** The tabs whose title or URL contains every word of `query`. */\nexport function filterTabs(tabs: BrowserTab[], query: string): BrowserTab[] {\n\tconst words = query.toLowerCase().split(/\\s+/).filter(Boolean);\n\tif (words.length === 0) return tabs;\n\treturn tabs.filter((t) => {\n\t\tconst hay = `${t.title} ${t.url}`.toLowerCase();\n\t\treturn words.every((w) => hay.includes(w));\n\t});\n}\n\n/** Whether the remote browser on `base`'s machine answers, so a page can be opened in it. */\nexport async function browserAnswers(base: string): Promise<boolean> {\n\ttry {\n\t\tconst res = await fetch(`${base}/api/browser/tabs`);\n\t\tif (!res.ok) return false;\n\t\tconst info = (await res.json()) as BrowserInfo;\n\t\treturn !!info.name && !info.error;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Show a GitHub page in the remote browser, in a background tab of its own\n * (the same one again for a page opened before), and answer that tab's id.\n */\nexport async function openInBrowser(base: string, url: string): Promise<{ tab: string } | { error: string }> {\n\ttry {\n\t\tconst res = await fetch(`${base}/api/browser/open`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tbody: JSON.stringify({ url })\n\t\t});\n\t\tconst body = (await res.json().catch(() => null)) as { tab?: unknown; error?: unknown } | null;\n\t\tif (res.ok && typeof body?.tab === 'string') return { tab: body.tab };\n\t\treturn { error: typeof body?.error === 'string' ? body.error : `HTTP ${res.status}` };\n\t} catch (err) {\n\t\treturn { error: `Could not reach claude-mux: ${err}` };\n\t}\n}\n","import { createPersisted } from './persisted';\n\nconst persisted = createPersisted<Record<string, string>>('claude-mux-web-pane', {});\n\n/**\n * The URL the Web pane last showed, per session id: `prod`, `dev`, or a URL\n * typed by hand. The pane reopens it when the page's URL names none.\n */\nclass WebPaneStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\n\tget(id: string | null): string | null {\n\t\treturn (id && this.state[id]) || null;\n\t}\n\n\tset(id: string | null, url: string): void {\n\t\tif (!id || this.state[id] === url) return;\n\t\tthis.state[id] = url;\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const webPaneStore = new WebPaneStore();\n","import { ReliableWebSocket } from './websocket-base.svelte';\nimport type { BrowserWsMessage } from '$lib/side-panel/browser';\n\ntype Frame = Extract<BrowserWsMessage, { type: 'frame' }>;\n\n/**\n * The Web pane's connection to one remote browser tab: frames come in, input\n * goes out. The server holds the tab's DevTools connection only while a\n * socket like this one is open, so closing it is what ends the screencast.\n */\nexport class BrowserStream extends ReliableWebSocket {\n\t/** Why the server ended the stream (the tab or the browser went away), until the next `open`. */\n\tclosedReason = $state<string | null>(null);\n\t/** Where the tab has navigated to since the stream opened. */\n\turl = $state<string | null>(null);\n\t/** Called with each frame; the canvas draws it. */\n\tonFrame: ((frame: Frame) => void) | null = null;\n\n\tprivate tabId: string | null = null;\n\t/** Where the tab's machine is reached: '' for the origin, `/fleet/<id>` through its relay. */\n\tprivate base = '';\n\n\t/**\n\t * Show `tabId` of the browser the machine at `base` drives. Opening the\n\t * tab already open does nothing unless `again`.\n\t */\n\topen(tabId: string, base: string, again = false): void {\n\t\tif (this.tabId === tabId && this.base === base && !again && this.closedReason === null) return;\n\t\tthis.doDisconnect();\n\t\tthis.tabId = tabId;\n\t\tthis.base = base;\n\t\tthis.closedReason = null;\n\t\tthis.url = null;\n\t\tthis.resetReceived();\n\t\tthis.doConnect();\n\t}\n\n\tclose(): void {\n\t\tthis.tabId = null;\n\t\tthis.doDisconnect();\n\t}\n\n\t/** Send one input message; it is dropped when the socket is not up. */\n\tinput(msg: object): void {\n\t\tthis.send(JSON.stringify(msg));\n\t}\n\n\tprotected getWsUrl(): string {\n\t\tconst protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';\n\t\treturn `${protocol}//${window.location.host}${this.base}/api/browser/${encodeURIComponent(this.tabId!)}/stream`;\n\t}\n\n\tprotected getLogPrefix(): string {\n\t\treturn '[browser]';\n\t}\n\n\tprotected shouldReconnect(): boolean {\n\t\treturn this.tabId !== null && this.closedReason === null;\n\t}\n\n\tprotected handleMessage(event: MessageEvent): void {\n\t\tlet msg: BrowserWsMessage;\n\t\ttry {\n\t\t\tmsg = JSON.parse(event.data);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tif (msg.type === 'frame') this.onFrame?.(msg);\n\t\telse if (msg.type === 'nav') this.url = msg.url;\n\t\telse if (msg.type === 'closed') this.closedReason = msg.reason;\n\t}\n}\n","<script lang=\"ts\">\n\t/**\n\t * The Web pane's Browser source: one tab of the remote browser a session\n\t * drives, live, and open to the pointer, the keyboard and touch. Frames\n\t * arrive over the stream and are drawn on a canvas scaled to the pane;\n\t * what happens on the canvas goes back as input for the page. A desktop\n\t * page is small on a phone, so two fingers (or Ctrl+wheel) magnify and\n\t * move the picture on this side, and one finger is the page's.\n\t *\n\t * The tab shown is the one the session last opened or selected until the\n\t * person picks another. The stream is open only while the pane is showing,\n\t * because the server holds the tab's DevTools connection for exactly as\n\t * long.\n\t */\n\timport { onDestroy, untrack } from 'svelte';\n\timport * as Popover from '$lib/components/ui/popover';\n\timport { Badge } from '$lib/components/ui/badge';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport {\n\t\tbuttonName,\n\t\tfilterTabs,\n\t\theldButton,\n\t\tkeyMessage,\n\t\tmodifiersOf,\n\t\tpickTab,\n\t\ttextDelta,\n\t\ttoPagePoint,\n\t\tUNZOOMED,\n\t\tzoomView,\n\t\ttype BrowserInfo,\n\t\ttype FrameSize,\n\t\ttype View\n\t} from '$lib/side-panel/browser';\n\timport { BrowserStream } from '$lib/stores/browserStream.svelte';\n\n\tinterface Props {\n\t\tsessionId: string | null;\n\t\t/**\n\t\t * Where the session's machine is reached: '' for the origin, `/fleet/<id>`\n\t\t * for another, whose own page the relay makes this one.\n\t\t */\n\t\tbase: string;\n\t\t/** The pane is the one showing. */\n\t\tactive: boolean;\n\t\t/** The tab the URL pins, if any. */\n\t\ttab: string | undefined;\n\t\t/** Pin a tab, or with null go back to following the session. */\n\t\tonPick: (id: string | null) => void;\n\t\t/** The URL of the tab being shown, for the pane's bar. */\n\t\tonUrl: (url: string | null) => void;\n\t}\n\n\tlet { sessionId, base, active, tab, onPick, onUrl }: Props = $props();\n\n\t/** How often the tab list is read while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\t/** Two presses this close in time and place are a double click. */\n\tconst MULTI_CLICK_MS = 500;\n\tconst MULTI_CLICK_PX = 6;\n\t/** What one wheel notch scrolls when the wheel reports lines rather than pixels. */\n\tconst LINE_PX = 40;\n\n\t// ── the tabs ─────────────────────────────────────────────────────────\n\n\tlet info = $state<BrowserInfo | null>(null);\n\tlet loading = $state(false);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo() {\n\t\tconst mine = ++infoSeq;\n\t\tloading = true;\n\t\ttry {\n\t\t\tconst q = sessionId ? `?session=${encodeURIComponent(sessionId)}` : '';\n\t\t\tconst res = await fetch(`${base}/api/browser/tabs${q}`);\n\t\t\tconst body = (await res.json()) as BrowserInfo;\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(`HTTP ${res.status}`);\n\t\t\t// The session opened or selected another tab: the view goes with it.\n\t\t\tif (body.preferred && body.preferred !== followed) {\n\t\t\t\tfollowed = body.preferred;\n\t\t\t\tstaying = null;\n\t\t\t}\n\t\t\tinfo = body;\n\t\t} catch (err) {\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tinfo = { name: info?.name ?? 'the browser', error: `Could not ask claude-mux for the tabs: ${err}`, tabs: [], preferred: null };\n\t\t} finally {\n\t\t\tif (mine === infoSeq) loading = false;\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tvoid sessionId;\n\t\tif (!active) return;\n\t\tuntrack(() => void loadInfo());\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo();\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t/**\n\t * A pinned tab the list has not seen yet (one opened for the GitHub pane a\n\t * moment ago) is looked for once more before anything else is shown, so the\n\t * view never streams some other logged-in tab in its place.\n\t */\n\tlet lookingFor = $state<string | null>(null);\n\tlet lookedFor: string | null = null;\n\t$effect(() => {\n\t\tconst want = tab;\n\t\tif (!active || !want || !info || want === lookedFor || info.tabs.some((t) => t.id === want)) return;\n\t\tlookedFor = want;\n\t\tlookingFor = want;\n\t\tuntrack(() => void loadInfo().finally(() => (lookingFor = null)));\n\t});\n\n\t/** The tab on show, kept while it stays open however its URL changes. */\n\tlet staying = $state<string | null>(null);\n\t/** The session's tab as last reported, to tell when the session moves to another. */\n\tlet followed: string | null = null;\n\tconst current = $derived(lookingFor && lookingFor === tab ? null : pickTab(info, tab, staying));\n\tconst currentId = $derived(current?.id ?? null);\n\t$effect(() => {\n\t\tif (currentId) staying = currentId;\n\t});\n\n\tlet pickerOpen = $state(false);\n\tlet query = $state('');\n\tconst shown = $derived(filterTabs(info?.tabs ?? [], query));\n\n\tfunction pick(id: string) {\n\t\t// The session's own tab is followed rather than pinned, so the view moves on when the session does.\n\t\tonPick(id === info?.preferred ? null : id);\n\t\tstaying = id;\n\t\tpickerOpen = false;\n\t\tquery = '';\n\t}\n\n\tfunction hostOf(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host || url;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n\n\tconst labelOf = (t: { title: string; url: string }) => t.title || hostOf(t.url) || 'Untitled';\n\n\t// ── the stream ───────────────────────────────────────────────────────\n\n\tconst stream = new BrowserStream();\n\tlet canvas = $state<HTMLCanvasElement | null>(null);\n\t/** The remote viewport the canvas is showing, once a frame has been drawn. */\n\tlet frame = $state<FrameSize | null>(null);\n\tlet decodeSeq = 0;\n\tlet drawnSeq = 0;\n\n\tstream.onFrame = (f) => {\n\t\tconst seq = ++decodeSeq;\n\t\tconst img = new Image();\n\t\timg.onload = () => {\n\t\t\t// Frames decode on their own time; an older one must not paint over a newer.\n\t\t\tif (seq < drawnSeq || !canvas) return;\n\t\t\tdrawnSeq = seq;\n\t\t\tif (canvas.width !== img.naturalWidth || canvas.height !== img.naturalHeight) {\n\t\t\t\tcanvas.width = img.naturalWidth;\n\t\t\t\tcanvas.height = img.naturalHeight;\n\t\t\t}\n\t\t\tcanvas.getContext('2d')?.drawImage(img, 0, 0);\n\t\t\tif (frame?.width !== f.width || frame?.height !== f.height) frame = { width: f.width, height: f.height };\n\t\t};\n\t\timg.src = `data:image/jpeg;base64,${f.data}`;\n\t};\n\n\t$effect(() => {\n\t\tconst id = currentId;\n\t\tconst at = base;\n\t\tif (active && id) {\n\t\t\tuntrack(() => stream.open(id, at));\n\t\t} else {\n\t\t\tuntrack(() => {\n\t\t\t\tstream.close();\n\t\t\t\tframe = null;\n\t\t\t});\n\t\t}\n\t});\n\n\t// Another tab starts from an empty canvas, not from the last tab's picture.\n\t$effect(() => {\n\t\tvoid currentId;\n\t\tuntrack(() => {\n\t\t\tframe = null;\n\t\t\t// Frames of the last tab still decoding must not paint over this one.\n\t\t\tdrawnSeq = decodeSeq + 1;\n\t\t\tview = UNZOOMED;\n\t\t\ttouches.clear();\n\t\t\tpinch = null;\n\t\t\tpendingMove = null;\n\t\t\tclearTyped();\n\t\t});\n\t});\n\n\t// The canvas goes when the stream ends, and its frame with it.\n\t$effect(() => {\n\t\tif (stream.closedReason !== null) frame = null;\n\t});\n\n\tonDestroy(() => stream.close());\n\n\t$effect(() => {\n\t\tonUrl(stream.url ?? current?.url ?? null);\n\t});\n\n\t/** Reload the remote tab, or reconnect when the stream has ended. */\n\texport function reload() {\n\t\tif (!currentId || stream.closedReason !== null || info?.error) return retry();\n\t\tstream.input({ type: 'reload' });\n\t}\n\n\tfunction retry() {\n\t\tvoid loadInfo().then(() => {\n\t\t\tif (active && currentId) stream.open(currentId, base, true);\n\t\t});\n\t}\n\n\t// ── pointer, wheel and touch ─────────────────────────────────────────\n\n\tfunction at(e: { clientX: number; clientY: number }) {\n\t\treturn canvas && frame ? toPagePoint(e.clientX, e.clientY, canvas.getBoundingClientRect(), frame) : null;\n\t}\n\n\tlet lastPress = { at: 0, x: 0, y: 0, count: 0, button: 0 };\n\t/** The fingers down, by pointer id: where each is in the page, and on this screen. */\n\tconst touches = new Map<number, { x: number; y: number; sx: number; sy: number }>();\n\n\t/** How the picture is magnified on this side. The page itself is never zoomed. */\n\tlet view = $state<View>(UNZOOMED);\n\tlet stage = $state<HTMLDivElement | null>(null);\n\t/** A two-finger gesture in progress: the view and the fingers as it began. */\n\tlet pinch: { view: View; mid: { x: number; y: number }; span: number } | null = null;\n\n\t/** `view` zoomed by `factor` so that what was under `from` lands on `to`, or as it was while nothing is drawn. */\n\tfunction zoomed(from: View, a: { x: number; y: number }, b: { x: number; y: number }, factor: number): View {\n\t\tif (!canvas || !stage) return from;\n\t\tconst room = stage.getBoundingClientRect();\n\t\tconst width = canvas.offsetWidth;\n\t\tconst height = canvas.offsetHeight;\n\t\t// With no zoom the canvas sits centred in the stage at its laid-out size.\n\t\tconst box = { left: room.left + (room.width - width) / 2, top: room.top + (room.height - height) / 2, width, height };\n\t\treturn zoomView(from, a, b, factor, box, room);\n\t}\n\n\tfunction fingers() {\n\t\tconst [a, b] = [...touches.values()];\n\t\treturn { mid: { x: (a.sx + b.sx) / 2, y: (a.sy + b.sy) / 2 }, span: Math.hypot(a.sx - b.sx, a.sy - b.sy) || 1 };\n\t}\n\t/** A move waiting for the next animation frame, so a fast pointer sends one message per paint. */\n\tlet pendingMove: Record<string, unknown> | null = null;\n\n\tfunction flushMove() {\n\t\tif (pendingMove) stream.input(pendingMove);\n\t\tpendingMove = null;\n\t}\n\n\tfunction sendMove(msg: Record<string, unknown>) {\n\t\tif (!pendingMove) requestAnimationFrame(flushMove);\n\t\tpendingMove = msg;\n\t}\n\n\t/** Put a finger where it now is, in the page and on this screen. */\n\tfunction track(e: PointerEvent, p: { x: number; y: number }) {\n\t\ttouches.set(e.pointerId, { ...p, sx: e.clientX, sy: e.clientY });\n\t}\n\n\tfunction press(event: 'down' | 'up', e: PointerEvent, p: { x: number; y: number }) {\n\t\tstream.input({\n\t\t\ttype: 'mouse',\n\t\t\tevent,\n\t\t\t...p,\n\t\t\t// A cancelled pointer no longer says which button it was.\n\t\t\tbutton: buttonName(e.type === 'pointercancel' ? lastPress.button : e.button),\n\t\t\tbuttons: e.buttons,\n\t\t\tclickCount: lastPress.count,\n\t\t\tmodifiers: modifiersOf(e)\n\t\t});\n\t}\n\n\tfunction touchMessage(event: 'start' | 'move' | 'end' | 'cancel') {\n\t\treturn { type: 'touch', event, points: [...touches].map(([id, p]) => ({ id, x: p.x, y: p.y })) };\n\t}\n\n\tfunction onPointerDown(e: PointerEvent) {\n\t\tconst p = at(e);\n\t\tif (!p) return;\n\t\tcanvas?.focus({ preventScroll: true });\n\t\ttry {\n\t\t\tcanvas?.setPointerCapture(e.pointerId);\n\t\t} catch {\n\t\t\t// a pointer that is already gone; the press still counts\n\t\t}\n\t\tflushMove();\n\t\tif (e.pointerType === 'touch') {\n\t\t\t// A second finger makes it a gesture on the picture, so the page's touch is called off.\n\t\t\tif (touches.size === 1 && !pinch) stream.input({ type: 'touch', event: 'cancel', points: [] });\n\t\t\ttrack(e, p);\n\t\t\tif (touches.size === 1 && !pinch) stream.input(touchMessage('start'));\n\t\t\telse if (touches.size === 2) pinch = { view, ...fingers() };\n\t\t\treturn;\n\t\t}\n\t\te.preventDefault();\n\t\tconst again =\n\t\t\te.timeStamp - lastPress.at < MULTI_CLICK_MS &&\n\t\t\tMath.abs(e.clientX - lastPress.x) < MULTI_CLICK_PX &&\n\t\t\tMath.abs(e.clientY - lastPress.y) < MULTI_CLICK_PX;\n\t\tlastPress = { at: e.timeStamp, x: e.clientX, y: e.clientY, count: again ? (lastPress.count % 3) + 1 : 1, button: e.button };\n\t\tpress('down', e, p);\n\t}\n\n\tfunction onPointerMove(e: PointerEvent) {\n\t\tconst p = at(e);\n\t\tif (!p) return;\n\t\tif (e.pointerType === 'touch') {\n\t\t\tif (!touches.has(e.pointerId)) return;\n\t\t\ttrack(e, p);\n\t\t\tif (!pinch) return sendMove(touchMessage('move'));\n\t\t\tif (touches.size === 2) {\n\t\t\t\tconst now = fingers();\n\t\t\t\tview = zoomed(pinch.view, pinch.mid, now.mid, now.span / pinch.span);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsendMove({ type: 'mouse', event: 'move', ...p, button: heldButton(e.buttons), buttons: e.buttons, modifiers: modifiersOf(e) });\n\t}\n\n\tfunction onPointerUp(e: PointerEvent) {\n\t\tflushMove();\n\t\tif (e.pointerType === 'touch') {\n\t\t\tif (!touches.delete(e.pointerId)) return;\n\t\t\tif (pinch) {\n\t\t\t\t// The gesture lasts until every finger is up; the one left behind does not become a touch.\n\t\t\t\tif (touches.size === 0) pinch = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstream.input(touchMessage(e.type === 'pointercancel' ? 'cancel' : 'end'));\n\t\t\treturn;\n\t\t}\n\t\t// A cancelled press is still let go of, or the page is left holding the button.\n\t\tconst p = at(e);\n\t\tif (p) press('up', e, p);\n\t}\n\n\t// A wheel listener has to be non-passive to keep the pane itself from scrolling.\n\t$effect(() => {\n\t\tconst el = canvas;\n\t\tif (!el) return;\n\t\tconst onWheel = (e: WheelEvent) => {\n\t\t\tconst p = at(e);\n\t\t\tif (!p) return;\n\t\t\te.preventDefault();\n\t\t\t// Ctrl+wheel is also what a trackpad pinch sends. It magnifies the picture; the page's own zoom is left alone.\n\t\t\tif (e.ctrlKey) {\n\t\t\t\tconst here = { x: e.clientX, y: e.clientY };\n\t\t\t\tview = zoomed(view, here, here, Math.exp(-e.deltaY * 0.01));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst scale = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? LINE_PX : 1;\n\t\t\tstream.input({ type: 'wheel', ...p, deltaX: e.deltaX * scale, deltaY: e.deltaY * scale, modifiers: modifiersOf(e) });\n\t\t};\n\t\tel.addEventListener('wheel', onWheel, { passive: false });\n\t\treturn () => el.removeEventListener('wheel', onWheel);\n\t});\n\n\t// ── keys ─────────────────────────────────────────────────────────────\n\n\tfunction onKey(e: KeyboardEvent) {\n\t\tconst msg = keyMessage(e, e.type === 'keyup' ? 'up' : 'down');\n\t\tif (!msg) return;\n\t\te.preventDefault();\n\t\tstream.input(msg);\n\t}\n\n\tfunction onPaste(e: ClipboardEvent) {\n\t\tconst text = e.clipboardData?.getData('text/plain');\n\t\tif (!text) return;\n\t\te.preventDefault();\n\t\tstream.input({ type: 'text', text });\n\t}\n\n\tfunction pressKey(key: string, keyCode: number) {\n\t\tconst e = { key, code: key, keyCode, altKey: false, ctrlKey: false, metaKey: false, shiftKey: false };\n\t\tfor (const event of ['down', 'up'] as const) {\n\t\t\tconst msg = keyMessage(e, event);\n\t\t\tif (msg) stream.input(msg);\n\t\t}\n\t}\n\n\t/**\n\t * A phone has no keys to forward until a text field has focus, so this\n\t * field stands in: whatever is typed into it is typed into the page, and\n\t * what it holds is only an echo of that.\n\t */\n\tlet typing = $state(false);\n\tlet typedLocal = $state('');\n\tlet typedRemote = '';\n\tlet typingEl = $state<HTMLInputElement | null>(null);\n\n\tfunction mirrorTyped() {\n\t\tconst { backspaces, insert } = textDelta(typedRemote, typedLocal);\n\t\tfor (let i = 0; i < backspaces; i++) pressKey('Backspace', 8);\n\t\tif (insert) stream.input({ type: 'text', text: insert });\n\t\ttypedRemote = typedLocal;\n\t}\n\n\tfunction onTypingKey(e: KeyboardEvent) {\n\t\tif (e.isComposing) return;\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tsendEnter();\n\t\t} else if (e.key === 'Backspace' && typedLocal === '') {\n\t\t\tpressKey('Backspace', 8);\n\t\t} else if (e.key === 'Tab') {\n\t\t\te.preventDefault();\n\t\t\tpressKey('Tab', 9);\n\t\t\tclearTyped();\n\t\t}\n\t}\n\n\tfunction clearTyped() {\n\t\ttypedLocal = typedRemote = '';\n\t}\n\n\tfunction sendEnter() {\n\t\tpressKey('Enter', 13);\n\t\tclearTyped();\n\t\ttypingEl?.focus();\n\t}\n\n\t$effect(() => {\n\t\tif (typing) typingEl?.focus();\n\t});\n</script>\n\n{#snippet failed(icon: string, heading: string, text: string)}\n\t<div class=\"empty\">\n\t\t<iconify-icon {icon}></iconify-icon>\n\t\t<h3>{heading}</h3>\n\t\t<p>{text}</p>\n\t\t<Button size=\"sm\" onclick={retry} disabled={loading}>\n\t\t\t<iconify-icon icon=\"mdi:refresh\"></iconify-icon> Try again\n\t\t</Button>\n\t</div>\n{/snippet}\n\n<div class=\"browser\">\n\t{#if info?.name && !info.error && info.tabs.length > 0}\n\t\t<div class=\"strip\">\n\t\t\t<Popover.Root bind:open={pickerOpen}>\n\t\t\t\t<Popover.Trigger class=\"tab-trigger\" aria-label=\"Choose a tab\">\n\t\t\t\t\t<span class=\"live\" class:on={stream.connected && frame !== null}></span>\n\t\t\t\t\t<span class=\"title\">{current ? labelOf(current) : 'Untitled'}</span>\n\t\t\t\t\t<span class=\"count\">{info.tabs.length} tabs</span>\n\t\t\t\t\t<iconify-icon icon=\"mdi:chevron-down\"></iconify-icon>\n\t\t\t\t</Popover.Trigger>\n\t\t\t\t<Popover.Content class=\"tab-picker\" align=\"start\" sideOffset={4}>\n\t\t\t\t\t<Input bind:value={query} class=\"filter\" type=\"search\" placeholder=\"Find a tab…\" aria-label=\"Find a tab\" autocomplete=\"off\" />\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each shown as t (t.id)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<button type=\"button\" class:current={t.id === currentId} onclick={() => pick(t.id)}>\n\t\t\t\t\t\t\t\t\t<span class=\"row1\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"t\">{labelOf(t)}</span>\n\t\t\t\t\t\t\t\t\t\t{#if t.id === info.preferred}<Badge variant=\"secondary\" title=\"The tab this session last opened or selected\">Session</Badge>{/if}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"u\">{t.url}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<li class=\"none\">No tab matches “{query}”.</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t</Popover.Content>\n\t\t\t</Popover.Root>\n\t\t\t<Toggle class=\"kbd\" size=\"sm\" variant=\"outline\" bind:pressed={typing} title=\"Type into the page\" aria-label=\"Type into the page\">\n\t\t\t\t<iconify-icon icon=\"mdi:keyboard-outline\"></iconify-icon>\n\t\t\t</Toggle>\n\t\t</div>\n\t{/if}\n\n\t<div class=\"stage\" bind:this={stage}>\n\t\t{#if !info}\n\t\t\t<p class=\"msg dim\">Looking for the browser's tabs…</p>\n\t\t{:else if !info.name}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:monitor-off\"></iconify-icon>\n\t\t\t\t<h3>No remote browser set up</h3>\n\t\t\t\t<p>\n\t\t\t\t\tThis shows the browser a session drives through an MCP server started with\n\t\t\t\t\t<code>--browserUrl</code>. None is listed in <code>~/.claude.json</code>.\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t{:else if info.error}\n\t\t\t{@render failed('mdi:lan-disconnect', \"Can't reach the browser\", info.error)}\n\t\t{:else if !current}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:tab-unselected\"></iconify-icon>\n\t\t\t\t<h3>No tabs open</h3>\n\t\t\t\t<p>The browser behind {info.name} is running with no page to show.</p>\n\t\t\t</div>\n\t\t{:else if stream.closedReason}\n\t\t\t{@render failed('mdi:tab-remove', 'The view ended', stream.closedReason)}\n\t\t{:else}\n\t\t\t{#if !frame}<p class=\"msg dim waiting\">Connecting to {hostOf(current.url)}…</p>{/if}\n\t\t\t<canvas\n\t\t\t\tbind:this={canvas}\n\t\t\t\tclass:blank={!frame}\n\t\t\t\tstyle:--ratio={frame ? frame.width / frame.height : 1.6}\n\t\t\t\tstyle:transform={view.scale === 1 ? null : `translate(${view.x}px, ${view.y}px) scale(${view.scale})`}\n\t\t\t\ttabindex=\"0\"\n\t\t\t\taria-label={`Live view of ${current.title || current.url}`}\n\t\t\t\tonpointerdown={onPointerDown}\n\t\t\t\tonpointermove={onPointerMove}\n\t\t\t\tonpointerup={onPointerUp}\n\t\t\t\tonpointercancel={onPointerUp}\n\t\t\t\toncontextmenu={(e) => e.preventDefault()}\n\t\t\t\tonkeydown={onKey}\n\t\t\t\tonkeyup={onKey}\n\t\t\t\tonpaste={onPaste}\n\t\t\t></canvas>\n\t\t{/if}\n\t</div>\n\n\t{#if typing && current && !info?.error}\n\t\t<form\n\t\t\tclass=\"typing\"\n\t\t\tonsubmit={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tsendEnter();\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tbind:ref={typingEl}\n\t\t\t\tbind:value={typedLocal}\n\t\t\t\toninput={mirrorTyped}\n\t\t\t\tonkeydown={onTypingKey}\n\t\t\t\tclass=\"field\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tplaceholder=\"Tap a field in the page, then type here\"\n\t\t\t\taria-label=\"Type into the page\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tautocapitalize=\"off\"\n\t\t\t\tautocorrect=\"off\"\n\t\t\t\tspellcheck={false}\n\t\t\t\tenterkeyhint=\"enter\"\n\t\t\t/>\n\t\t\t<Button type=\"submit\" size=\"sm\" variant=\"secondary\" title=\"Press Enter in the page\">\n\t\t\t\t<iconify-icon icon=\"mdi:keyboard-return\"></iconify-icon> Enter\n\t\t\t</Button>\n\t\t</form>\n\t{/if}\n</div>\n\n<style>\n\t.browser {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.strip {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.strip :global(.tab-trigger) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\theight: 28px;\n\t\tpadding: 0 8px 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tcolor: #e7e5e4;\n\t\tfont-size: 12px;\n\t\ttext-align: left;\n\t}\n\t.strip :global(.tab-trigger:hover) {\n\t\tborder-color: #3f3f46;\n\t}\n\t.strip :global(.tab-trigger:focus-visible) {\n\t\toutline: 2px solid #a8a29e;\n\t\toutline-offset: 1px;\n\t}\n\t.live {\n\t\tflex: none;\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #57534e;\n\t}\n\t.live.on {\n\t\tbackground: #34d399;\n\t}\n\t.title {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.count {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t}\n\t.strip :global(.kbd) {\n\t\tflex: none;\n\t\theight: 28px;\n\t\tborder-color: #2a2a2a;\n\t\tcolor: #a8a29e;\n\t\tdisplay: none;\n\t}\n\t.strip :global(.kbd[data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t/* Only a device with no keys of its own needs the field. */\n\t@media (pointer: coarse) {\n\t\t.strip :global(.kbd) {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t}\n\t:global(.tab-picker) {\n\t\twidth: min(420px, calc(100vw - 24px));\n\t\tpadding: 8px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\t:global(.tab-picker .filter) {\n\t\theight: 32px;\n\t\tfont-size: 13px;\n\t}\n\t:global(.tab-picker) ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tmax-height: min(50vh, 380px);\n\t\toverflow-y: auto;\n\t}\n\t:global(.tab-picker) button {\n\t\twidth: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tpadding: 6px 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t:global(.tab-picker) button:hover,\n\t:global(.tab-picker) button:focus-visible {\n\t\tbackground: #232326;\n\t\toutline: none;\n\t}\n\t:global(.tab-picker) button.current {\n\t\tbackground: #2a2a2e;\n\t}\n\t:global(.tab-picker) .row1 {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-width: 0;\n\t}\n\t:global(.tab-picker) .t {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-size: 13px;\n\t\tcolor: #f5f5f4;\n\t}\n\t:global(.tab-picker) .u {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t:global(.tab-picker) .none {\n\t\tpadding: 10px 8px;\n\t\tcolor: #78716c;\n\t\tfont-size: 12.5px;\n\t}\n\t.stage {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tcontainer-type: size;\n\t\tbackground: #0c0c0c;\n\t\toverflow: hidden;\n\t}\n\tcanvas {\n\t\t/* The frame, as large as the pane allows at its own shape. */\n\t\twidth: min(100cqw, calc(100cqh * var(--ratio)));\n\t\taspect-ratio: var(--ratio);\n\t\theight: auto;\n\t\tbackground: #fff;\n\t\ttouch-action: none;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\toutline: none;\n\t\tcursor: default;\n\t}\n\tcanvas.blank {\n\t\tvisibility: hidden;\n\t}\n\tcanvas:focus-visible {\n\t\tbox-shadow: inset 0 0 0 2px #a8a29e;\n\t}\n\t.waiting {\n\t\tposition: absolute;\n\t\tinset: 0 auto auto 0;\n\t}\n\t.typing {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-top: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.typing :global(.field) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 36px;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\talign-self: flex-start;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t\toverflow-wrap: anywhere;\n\t}\n\tcode {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * The project's site in a frame: the prod or dev URL `.claude-mux.json`\n\t * names, a dev server found running inside the project, or a URL typed into\n\t * the bar. The URL holds the choice (`?url=prod|dev|<url>`), and the last\n\t * one persists per session.\n\t *\n\t * A URL on this machine is framed through its tailscale serve mapping when\n\t * it has one, so the phone reaches it too; one that cannot be framed from\n\t * here (mixed content, X-Frame-Options, CSP frame-ancestors) gets a card\n\t * that opens it in a tab of its own instead of a blank frame. Discovery is\n\t * polled only while the pane is showing.\n\t *\n\t * One more source is not a site at all: `?url=browser` shows a tab of the\n\t * remote browser a session drives (`BrowserView.svelte`), `?tab=` naming it.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tchoiceUrl,\n\t\tnormalizeTyped,\n\t\tresolveEmbed,\n\t\ttype FrameCheck,\n\t\ttype WebChoice,\n\t\ttype WebInfo\n\t} from '$lib/side-panel/web';\n\timport { BROWSER_CHOICE } from '$lib/side-panel/browser';\n\timport { webPaneStore } from '$lib/stores/webPane.svelte';\n\timport BrowserView from './BrowserView.svelte';\n\n\tlet { session, base, machineHost, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\t/** How often discovery runs while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\tconst CONFIG_SAMPLE = `{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`;\n\n\tconst sessionId = $derived(session?.id ?? null);\n\n\t// ── discovery ────────────────────────────────────────────────────────\n\n\tlet info = $state<WebInfo | null>(null);\n\tlet infoError = $state<string | null>(null);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo(id: string) {\n\t\tconst mine = ++infoSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/web`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tinfo = body as WebInfo;\n\t\t\tinfoError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === infoSeq) infoError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tuntrack(() => void loadInfo(id));\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo(id);\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t// ── the choice ───────────────────────────────────────────────────────\n\n\tconst devConfigured = $derived(!!info?.urls.dev);\n\t/** What to show when neither the URL nor this browser names anything. */\n\tconst fallback = $derived<WebChoice | null>(\n\t\tdevConfigured || info?.detected.length ? 'dev' : info?.urls.prod ? 'prod' : null\n\t);\n\tconst choice = $derived(params.url ?? fallback);\n\t/** The remote browser is showing, not a site. */\n\tconst browsing = $derived(choice === BROWSER_CHOICE);\n\tconst target = $derived(choice && !browsing ? choiceUrl(choice, info) : null);\n\tlet browserView = $state<ReturnType<typeof BrowserView> | null>(null);\n\t/** The URL of the remote tab on show, which the bar displays and \"Open in new tab\" opens. */\n\tlet browserUrl = $state<string | null>(null);\n\n\t// No URL in the address: put the one last shown here back.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored || !sessionId) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => webPaneStore.get(sessionId));\n\t\tif (!params.url && last) setParams({ url: last });\n\t});\n\n\t$effect(() => {\n\t\tif (params.url) webPaneStore.set(sessionId, params.url);\n\t});\n\n\t/**\n\t * The choices shown before this one, newest last, for Back. A frame on\n\t * another origin keeps its own history out of reach, so Back steps\n\t * through what was picked here rather than through the page's links.\n\t */\n\tlet trail = $state<string[]>([]);\n\n\tfunction choose(next: string) {\n\t\tif (next === choice) return;\n\t\tif (choice) trail = [...trail, choice];\n\t\tsetParams({ url: next, tab: null });\n\t}\n\n\tfunction goBack() {\n\t\tconst prev = trail.at(-1);\n\t\tif (!prev) return;\n\t\ttrail = trail.slice(0, -1);\n\t\tsetParams({ url: prev, tab: null });\n\t}\n\n\t// ── the bar ──────────────────────────────────────────────────────────\n\n\tlet typed = $state('');\n\t$effect(() => {\n\t\ttyped = (browsing ? browserUrl : target) ?? '';\n\t});\n\n\tfunction submitTyped(e: SubmitEvent) {\n\t\te.preventDefault();\n\t\t// The bar only reads a remote tab's address: typing there must not send someone's tab elsewhere.\n\t\tif (browsing) return;\n\t\tconst url = normalizeTyped(typed);\n\t\tif (!url) {\n\t\t\ttoast.error('Not an http(s) URL', { description: typed });\n\t\t\treturn;\n\t\t}\n\t\tconst named = (['prod', 'dev'] as const).find((c) => {\n\t\t\tconst configured = choiceUrl(c, info);\n\t\t\treturn configured !== null && normalizeTyped(configured) === url;\n\t\t});\n\t\tchoose(named ?? url);\n\t}\n\n\t// ── what is drawn ────────────────────────────────────────────────────\n\n\tconst embed = $derived.by(() => {\n\t\tif (!target || !info) return null;\n\t\ttry {\n\t\t\treturn resolveEmbed(target, { page: location, machine: machineHost, serves: info.serves, detected: info.detected });\n\t\t} catch {\n\t\t\treturn 'invalid' as const;\n\t\t}\n\t});\n\tconst frameSrc = $derived(embed !== 'invalid' && embed?.kind === 'frame' ? embed.src : null);\n\tconst openUrl = $derived(\n\t\tbrowsing ? browserUrl : embed === 'invalid' ? null : embed ? (embed.kind === 'frame' ? embed.src : embed.open) : target\n\t);\n\n\t/** The frame check for the frame's URL; until it lands the frame is not drawn. */\n\tlet check = $state<{ src: string; result: FrameCheck } | null>(null);\n\t$effect(() => {\n\t\tconst src = frameSrc;\n\t\tif (!src) return;\n\t\tlet stale = false;\n\t\tconst q = new URLSearchParams({ url: src, origin: location.origin });\n\t\tfetch(`${base}/api/web/frame?${q}`)\n\t\t\t.then((res) => res.json() as Promise<FrameCheck>)\n\t\t\t.catch((err): FrameCheck => ({ embeddable: null, reason: String(err) }))\n\t\t\t.then((result) => {\n\t\t\t\tif (!stale) check = { src, result };\n\t\t\t});\n\t\treturn () => (stale = true);\n\t});\n\tconst verdict = $derived(check && check.src === frameSrc ? check.result : null);\n\t/** Why the target is shown as a card rather than framed, or null to frame it. */\n\tconst blocked = $derived.by((): { reason: string; open: string; command?: string } | null => {\n\t\tif (embed === 'invalid') return null;\n\t\tif (embed?.kind === 'card') return embed;\n\t\tif (embed && verdict?.embeddable === false) {\n\t\t\treturn { reason: `The site forbids framing. ${verdict.reason}`, open: embed.src };\n\t\t}\n\t\treturn null;\n\t});\n\n\tlet reloads = $state(0);\n\n\tfunction reload() {\n\t\tif (browsing) browserView?.reload();\n\t\tif (frameSrc) reloads++;\n\t\tif (sessionId) void loadInfo(sessionId);\n\t}\n\n\tconst copy = (text: string) => copyWithToast(text);\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:arrow-left', label: 'Back', disabled: trail.length === 0, run: goBack },\n\t\t\t{ icon: 'mdi:refresh', label: 'Reload', disabled: !sessionId, run: reload },\n\t\t\t{\n\t\t\t\ticon: 'mdi:open-in-new',\n\t\t\t\tlabel: 'Open in new tab',\n\t\t\t\tdisabled: !openUrl,\n\t\t\t\trun: () => openUrl && window.open(openUrl, '_blank', 'noopener,noreferrer')\n\t\t\t}\n\t\t]);\n\t});\n\n\tfunction hostLabel(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n</script>\n\n<div class=\"web\">\n\t<form class=\"bar\" onsubmit={submitTyped}>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Site\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!info?.urls.prod}\n\t\t\t\ttitle={info?.urls.prod ?? 'No prod URL in .claude-mux.json'}\n\t\t\t\tbind:pressed={() => choice === 'prod', (on) => on && choose('prod')}>Prod</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!devConfigured && !info?.detected.length}\n\t\t\t\ttitle={info?.urls.dev ?? (info?.detected.length ? 'A dev server found running in the project' : 'No dev server found')}\n\t\t\t\tbind:pressed={() =>\n\t\t\t\t\tchoice === 'dev' || (!devConfigured && !!info?.detected.some((d) => d.url === choice)),\n\t\t\t\t(on) => on && choose('dev')}>Dev</Toggle\n\t\t\t>\n\t\t\t{#if info?.browser}\n\t\t\t\t<Toggle\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttitle={`The browser sessions drive through ${info.browser}, live`}\n\t\t\t\t\tbind:pressed={() => browsing, (on) => on && choose(BROWSER_CHOICE)}>Browser</Toggle\n\t\t\t\t>\n\t\t\t{/if}\n\t\t</div>\n\t\t<Input\n\t\t\tbind:value={typed}\n\t\t\tclass=\"url\"\n\t\t\ttype=\"text\"\n\t\t\tinputmode=\"url\"\n\t\t\tplaceholder=\"Type a URL…\"\n\t\t\taria-label=\"URL\"\n\t\t\treadonly={browsing}\n\t\t\tautocomplete=\"off\"\n\t\t\tspellcheck={false}\n\t\t/>\n\t</form>\n\n\t{#if browsing}\n\t\t<BrowserView\n\t\t\tbind:this={browserView}\n\t\t\t{sessionId}\n\t\t\t{base}\n\t\t\t{active}\n\t\t\ttab={params.tab}\n\t\t\tonPick={(id) => setParams({ tab: id })}\n\t\t\tonUrl={(url) => (browserUrl = url)}\n\t\t/>\n\t{:else}\n\t\t{#if info && !devConfigured && info.detected.length > 0}\n\t\t\t<div class=\"detected\">\n\t\t\t\t<span class=\"label\">Detected dev servers</span>\n\t\t\t\t{#each info.detected as server, i (server.port)}\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\t\ttitle={`${server.process} (pid ${server.pid}) · ${server.url}`}\n\t\t\t\t\t\tbind:pressed={() => target === server.url, (on) => on && choose(i === 0 ? 'dev' : server.url)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"dot\"></span>:{server.port}\n\t\t\t\t\t\t<span class=\"proc\">{server.process}</span>\n\t\t\t\t\t\t{#if server.loopbackOnly}<iconify-icon icon=\"mdi:lock-outline\" title=\"127.0.0.1 only\"></iconify-icon>{/if}\n\t\t\t\t\t</Toggle>\n\t\t\t\t{/each}\n\t\t\t</div>\n\t\t{/if}\n\n\t\t<div class=\"view\">\n\t\t\t{#if infoError && !info}\n\t\t\t\t<p class=\"msg err\">{infoError}</p>\n\t\t\t{:else if !info && !params.url}\n\t\t\t\t<p class=\"msg dim\">Looking for the project's URLs…</p>\n\t\t\t{:else if !target}\n\t\t\t\t<div class=\"empty\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:web-off\"></iconify-icon>\n\t\t\t\t\t{#if choice === 'prod'}\n\t\t\t\t\t\t<h3>No prod URL</h3>\n\t\t\t\t\t\t<p>Name one as <code>urls.prod</code> in <code>.claude-mux.json</code> at the repo root.</p>\n\t\t\t\t\t{:else if choice === 'dev'}\n\t\t\t\t\t\t<h3>No dev server running</h3>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\tNothing inside <code>{info?.root}</code> is serving HTML. Start the dev server, or name one as\n\t\t\t\t\t\t\t<code>urls.dev</code> in <code>.claude-mux.json</code>.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<h3>Nothing to show yet</h3>\n\t\t\t\t\t\t<p>Type a URL above, start a dev server in the project, or commit a <code>.claude-mux.json</code>:</p>\n\t\t\t\t\t\t<pre>{CONFIG_SAMPLE}</pre>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if info?.configError}<p class=\"err\">.claude-mux.json: {info.configError}</p>{/if}\n\t\t\t\t</div>\n\t\t\t{:else if embed === 'invalid'}\n\t\t\t\t<p class=\"msg err\">Not a URL: {target}</p>\n\t\t\t{:else if !embed}\n\t\t\t\t<p class=\"msg dim\">Resolving {target}…</p>\n\t\t\t{:else if blocked}\n\t\t\t\t{@const command = blocked.command}\n\t\t\t\t<div class=\"empty card\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:application-brackets-outline\"></iconify-icon>\n\t\t\t\t\t<h3>Can't show {hostLabel(blocked.open)} here</h3>\n\t\t\t\t\t<p>{blocked.reason}</p>\n\t\t\t\t\t<Button href={blocked.open} target=\"_blank\" rel=\"noopener noreferrer\" size=\"sm\">\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:open-in-new\"></iconify-icon> Open in new tab\n\t\t\t\t\t</Button>\n\t\t\t\t\t{#if command}\n\t\t\t\t\t\t<p class=\"dim\">To show it here, map the port over HTTPS on this machine:</p>\n\t\t\t\t\t\t<div class=\"cmd\">\n\t\t\t\t\t\t\t<code>{command}</code>\n\t\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-sm\" title=\"Copy command\" aria-label=\"Copy command\" onclick={() => copy(command)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t{:else if frameSrc && !verdict}\n\t\t\t\t<p class=\"msg dim\">Checking {hostLabel(frameSrc)}…</p>\n\t\t\t{:else if frameSrc}\n\t\t\t\t{#key `${frameSrc}\\0${reloads}`}\n\t\t\t\t\t<iframe src={frameSrc} title=\"Web preview\" allow=\"clipboard-read; clipboard-write; fullscreen\"></iframe>\n\t\t\t\t{/key}\n\t\t\t{/if}\n\t\t</div>\n\t{/if}\n</div>\n\n<style>\n\t.web {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmin-width: 0;\n\t\tcolor: #d6d3d1;\n\t\tfont-size: 13px;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tflex: none;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 28px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.bar :global(.url) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 34px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.detected {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.label {\n\t\tcolor: #78716c;\n\t\tfont-size: 10.5px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\twhite-space: nowrap;\n\t\tmargin-right: 2px;\n\t}\n\t.detected :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 26px;\n\t\tpadding: 0 9px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.detected :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.dot {\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #34d399;\n\t}\n\t.proc {\n\t\tcolor: #78716c;\n\t}\n\t.view {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\tiframe {\n\t\tflex: 1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: 0;\n\t\tbackground: #fff;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t}\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tpre {\n\t\tmargin: 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t\ttext-align: left;\n\t}\n\t.cmd {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmax-width: 100%;\n\t\tpadding: 6px 6px 6px 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\ttext-align: left;\n\t}\n\t.cmd code {\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * A pull request or issue drawn from GitHub's data, read-only, so a link to\n\t * one opens beside the session (github.com refuses to be framed). The\n\t * header says where it stands; for a pull request the reviews and checks\n\t * follow; then the body and the conversation, newest first.\n\t *\n\t * `?ref=owner/name#n` names what shows. With none, the pane shows the pull\n\t * request of the session's branch, else the issue the session works on as a\n\t * worker. The row of refs above the header holds both, and the last few\n\t * opened here, to go back with a click.\n\t *\n\t * The pane only reads. To comment, review or merge, \"Open in Browser\"\n\t * shows the real page in the Web pane's Browser source, in a background\n\t * tab of the remote browser that is already signed in; it is offered only\n\t * while that browser answers.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { clock } from '$lib/stores/clock.svelte';\n\timport { formatAgo } from '$lib/format';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { githubRefVisual } from '$shared/github-ref.js';\n\timport {\n\t\tdescribeChecks,\n\t\tgroupChecks,\n\t\tparseRefParam,\n\t\treadableComments,\n\t\trefParam,\n\t\tvisibleBody,\n\t\ttype GithubComment,\n\t\ttype ReviewVerdict\n\t} from '$shared/github-item.js';\n\timport {\n\t\tloadGithubItem,\n\t\tloadSessionGithub,\n\t\tmediaHref,\n\t\tpeekGithubItem,\n\t\ttype GithubItemResult,\n\t\ttype SessionGithub\n\t} from '$lib/github-items';\n\timport { BROWSER_CHOICE, browserAnswers, openInBrowser } from '$lib/side-panel/browser';\n\timport GithubRefCards from '$lib/components/GithubRefCards.svelte';\n\n\tlet { session, target, base, params, setParams, setActions, openPane, active }: PaneBodyProps = $props();\n\n\t/** How often an item on screen is read again; the server's cache and ETag make most of these free. */\n\tconst REFRESH_MS = 60_000;\n\tconst COMMENT_PAGE = 10;\n\tconst RECENT_MAX = 6;\n\n\t// ── what shows ───────────────────────────────────────────────────────\n\n\tlet defaults = $state<SessionGithub | null>(null);\n\tconst sessionId = $derived(session?.id ?? null);\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tconst api = sessionApiAt(base, id);\n\t\tuntrack(() => {\n\t\t\tif (defaults) return;\n\t\t\tvoid loadSessionGithub(api).then((d) => {\n\t\t\t\tif (sessionId === id) defaults = d;\n\t\t\t});\n\t\t});\n\t});\n\n\tconst picked = $derived(parseRefParam(params.ref));\n\tconst fallback = $derived.by(() => {\n\t\tif (!defaults?.repo) return null;\n\t\tconst number = defaults.pull ?? defaults.issue;\n\t\treturn number ? { repo: defaults.repo, number } : null;\n\t});\n\tconst shown = $derived(picked ?? fallback);\n\tconst shownKey = $derived(shown ? refParam(shown.repo, shown.number) : null);\n\n\tfunction openRef(ref: string) {\n\t\tif (ref !== params.ref) setParams({ ref }, { push: true });\n\t}\n\n\t// ── recently opened, per session, kept in this browser ───────────────\n\n\tconst recentKey = $derived(`gh-pane-recent:${base}|${target}`);\n\tlet recent = $state<string[]>([]);\n\t$effect(() => {\n\t\tconst k = recentKey;\n\t\ttry {\n\t\t\tconst kept = JSON.parse(localStorage.getItem(k) ?? '[]');\n\t\t\trecent = Array.isArray(kept) ? kept.filter((r) => typeof r === 'string' && parseRefParam(r)) : [];\n\t\t} catch {\n\t\t\trecent = [];\n\t\t}\n\t});\n\t$effect(() => {\n\t\tconst ref = shownKey;\n\t\tif (!ref) return;\n\t\tuntrack(() => {\n\t\t\tif (recent[0] === ref) return;\n\t\t\trecent = [ref, ...recent.filter((r) => r !== ref)].slice(0, RECENT_MAX);\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(recentKey, JSON.stringify(recent));\n\t\t\t} catch {\n\t\t\t\t// Storage may be off; the list then lasts as long as the page.\n\t\t\t}\n\t\t});\n\t});\n\n\t/** The shortcuts above the header: the session's own two, then what was opened here. */\n\tconst shortcuts = $derived.by(() => {\n\t\tconst list: { ref: string; label: string; icon: string; hint: string }[] = [];\n\t\tconst repo = defaults?.repo;\n\t\tif (repo && defaults?.pull) {\n\t\t\tlist.push({ ref: refParam(repo, defaults.pull), label: `#${defaults.pull}`, icon: 'mdi:source-branch', hint: \"This branch's pull request\" });\n\t\t}\n\t\tif (repo && defaults?.issue) {\n\t\t\tlist.push({ ref: refParam(repo, defaults.issue), label: `#${defaults.issue}`, icon: 'mdi:account-hard-hat-outline', hint: 'The issue this worker owns' });\n\t\t}\n\t\tfor (const ref of recent) {\n\t\t\tif (list.some((s) => s.ref === ref)) continue;\n\t\t\tconst p = parseRefParam(ref)!;\n\t\t\tconst own = p.repo.toLowerCase() === repo?.toLowerCase();\n\t\t\tlist.push({ ref, label: own ? `#${p.number}` : ref, icon: 'mdi:history', hint: `Opened lately: ${ref}` });\n\t\t}\n\t\treturn list;\n\t});\n\n\t// ── the read ─────────────────────────────────────────────────────────\n\n\tlet result = $state<GithubItemResult | null>(null);\n\tlet loading = $state(false);\n\tlet seq = 0;\n\n\tasync function load(repo: string, number: number, fresh = false) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\tconst answer = await loadGithubItem(base, repo, number, fresh);\n\t\tif (mine !== seq) return;\n\t\t// A failed refresh keeps what is on screen.\n\t\tif (answer.item || !result?.item || refParam(result.item.repo, result.item.number) !== refParam(repo, number)) {\n\t\t\tresult = answer;\n\t\t}\n\t\tloading = false;\n\t}\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want) return;\n\t\tuntrack(() => {\n\t\t\tconst ready = peekGithubItem(base, want.repo, want.number);\n\t\t\tresult = ready;\n\t\t\tolderShown = 0;\n\t\t\tshowBots = false;\n\t\t\tchecksOpen = false;\n\t\t\tpassingOpen = false;\n\t\t\texpanded = new Set();\n\t\t\tscroller?.scrollTo({ top: 0 });\n\t\t\tvoid load(want.repo, want.number);\n\t\t});\n\t});\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want || !active) return;\n\t\tconst id = setInterval(() => void load(want.repo, want.number), REFRESH_MS);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tconst item = $derived(result?.item ?? null);\n\tconst visual = $derived(item && githubRefVisual(item));\n\tconst pull = $derived(item?.pull ?? null);\n\n\t// ── the real page, in the remote browser ─────────────────────────────\n\n\t/** How often the pane asks whether the remote browser answers, while showing. */\n\tconst BROWSER_POLL_MS = 30_000;\n\tlet browserUp = $state(false);\n\tlet opening = $state(false);\n\n\tconst showing = $derived(!!shown);\n\t$effect(() => {\n\t\tconst at = base;\n\t\tbrowserUp = false;\n\t\tif (!active || !showing) return;\n\t\tconst ask = () => void browserAnswers(at).then((up) => base === at && (browserUp = up));\n\t\task();\n\t\tconst id = setInterval(() => document.visibilityState === 'visible' && ask(), BROWSER_POLL_MS);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tasync function openInRemote(url: string) {\n\t\tconst from = { base, ref: shownKey };\n\t\topening = true;\n\t\tconst opened = await openInBrowser(base, url);\n\t\topening = false;\n\t\t// The person moved on while the browser answered: leave the panel where they took it.\n\t\tif (!active || base !== from.base || shownKey !== from.ref) return;\n\t\tif ('tab' in opened) openPane('web', { url: BROWSER_CHOICE, tab: opened.tab });\n\t\telse toast.error('Could not open it in the browser', { description: opened.error });\n\t}\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want) {\n\t\t\tsetActions([]);\n\t\t\treturn;\n\t\t}\n\t\tconst pageUrl = item?.url ?? githubUrl(want.repo, want.number);\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:refresh', label: 'Read again', run: () => void load(want.repo, want.number, true), disabled: loading },\n\t\t\t...(browserUp\n\t\t\t\t? [{ icon: 'mdi:monitor-share', label: 'Open in Browser', run: () => void openInRemote(pageUrl), disabled: opening }]\n\t\t\t\t: []),\n\t\t\t{ icon: 'mdi:open-in-new', label: 'Open on GitHub', run: () => window.open(pageUrl, '_blank', 'noopener') }\n\t\t]);\n\t});\n\n\tfunction githubUrl(repo: string, number: number): string {\n\t\t// GitHub sends an issue URL on to the pull request when the number is one.\n\t\treturn `https://github.com/${repo}/issues/${number}`;\n\t}\n\n\t// ── the header folds as the body scrolls ─────────────────────────────\n\n\tlet scroller = $state<HTMLElement | null>(null);\n\tlet folded = $state(false);\n\n\t// ── reviews and checks ───────────────────────────────────────────────\n\n\tconst VERDICT: Record<Exclude<ReviewVerdict, 'dismissed'>, { icon: string; word: string; tone: string }> = {\n\t\tapproved: { icon: 'mdi:check-circle', word: 'Approved', tone: 'good' },\n\t\tchanges_requested: { icon: 'mdi:file-document-edit-outline', word: 'Changes requested', tone: 'bad' },\n\t\tcommented: { icon: 'mdi:comment-outline', word: 'Commented', tone: 'quiet' }\n\t};\n\n\tlet checksOpen = $state(false);\n\tlet passingOpen = $state(false);\n\tconst checks = $derived(pull ? groupChecks(pull.checks) : null);\n\tconst checksTone = $derived(!checks ? 'quiet' : checks.failing.length ? 'bad' : checks.running.length ? 'busy' : 'good');\n\n\t// ── the conversation ─────────────────────────────────────────────────\n\n\tlet olderShown = $state(0);\n\tlet showBots = $state(false);\n\tlet expanded = $state(new Set<string>());\n\tconst talk = $derived(item?.comments ? readableComments(item.comments) : null);\n\t/** Newest first. */\n\tconst listed = $derived.by(() => {\n\t\tif (!talk) return [];\n\t\tconst all = showBots ? [...talk.people, ...talk.bots].sort((a, b) => (a.at ?? 0) - (b.at ?? 0)) : talk.people;\n\t\treturn [...all].reverse();\n\t});\n\tconst visibleComments = $derived(listed.slice(0, COMMENT_PAGE + olderShown));\n\tconst unread = $derived(item ? Math.max(0, item.comments_total - (item.comments?.length ?? 0)) : 0);\n\n\tfunction md(text: string): string {\n\t\treturn renderMarkdown(text, { github: { bare: true }, githubBody: { media: mediaHref(base) } });\n\t}\n\n\t/** Marks a comment whose body runs past the cap, so it can offer the rest. */\n\tfunction capped(node: HTMLElement) {\n\t\tconst check = () => node.classList.toggle('long', node.scrollHeight > node.clientHeight + 24);\n\t\tconst seen = new ResizeObserver(check);\n\t\tseen.observe(node);\n\t\tcheck();\n\t\treturn { destroy: () => seen.disconnect() };\n\t}\n\n\tfunction toggleComment(c: GithubComment) {\n\t\tconst next = new Set(expanded);\n\t\tif (next.has(c.id)) next.delete(c.id);\n\t\telse next.add(c.id);\n\t\texpanded = next;\n\t}\n\n\tfunction ago(at: number | null): string {\n\t\tif (!at) return '';\n\t\tconst a = formatAgo(at, clock.now);\n\t\treturn a === 'now' ? 'just now' : `${a} ago`;\n\t}\n\n\tfunction labelStyle(color: string): string {\n\t\tconst hex = /^[0-9a-f]{6}$/i.test(color) ? `#${color}` : '#78716c';\n\t\treturn `--label: ${hex}`;\n\t}\n</script>\n\n<div class=\"gh\">\n\t{#if shortcuts.length > 0}\n\t\t<nav class=\"refs\" aria-label=\"Pull requests and issues\">\n\t\t\t{#each shortcuts as s (s.ref)}\n\t\t\t\t<button type=\"button\" class=\"ref\" class:on={s.ref === shownKey} title={s.hint} onclick={() => openRef(s.ref)}>\n\t\t\t\t\t<iconify-icon icon={s.icon}></iconify-icon>\n\t\t\t\t\t<span>{s.label}</span>\n\t\t\t\t</button>\n\t\t\t{/each}\n\t\t</nav>\n\t{/if}\n\n\t{#if !shown}\n\t\t<div class=\"empty\">\n\t\t\t<iconify-icon icon=\"mdi:github\"></iconify-icon>\n\t\t\t{#if !defaults}\n\t\t\t\t<p>Looking for this session's pull request…</p>\n\t\t\t{:else if !defaults.repo}\n\t\t\t\t<p>This session is not in a GitHub repo.</p>\n\t\t\t{:else}\n\t\t\t\t<p>No pull request for this branch yet. Click a link to an issue or pull request in the conversation to open it here.</p>\n\t\t\t{/if}\n\t\t</div>\n\t{:else if !item}\n\t\t{#if result?.error}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:github\"></iconify-icon>\n\t\t\t\t{#if result.error === 'no-gh'}\n\t\t\t\t\t<p>The GitHub CLI is not signed in on this session's machine. Run <code>gh auth login</code> there to read it here.</p>\n\t\t\t\t{:else if result.error === 'not-found'}\n\t\t\t\t\t<p>GitHub has no {shown.repo}#{shown.number}, or this machine cannot see it.</p>\n\t\t\t\t{:else}\n\t\t\t\t\t<p>GitHub did not answer for {shown.repo}#{shown.number}.</p>\n\t\t\t\t{/if}\n\t\t\t\t<a class=\"out\" href={githubUrl(shown.repo, shown.number)} target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\tOpen on github.com <iconify-icon icon=\"mdi:open-in-new\"></iconify-icon>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<div class=\"ghost\" aria-busy=\"true\" aria-label=\"Loading\">\n\t\t\t\t<span style:width=\"40%\"></span>\n\t\t\t\t<span style:width=\"85%\"></span>\n\t\t\t\t<span style:width=\"60%\"></span>\n\t\t\t\t<span class=\"gap\" style:width=\"100%\"></span>\n\t\t\t\t<span style:width=\"92%\"></span>\n\t\t\t\t<span style:width=\"70%\"></span>\n\t\t\t</div>\n\t\t{/if}\n\t{:else if visual}\n\t\t<header class=\"head\" class:folded style:--state={visual.color}>\n\t\t\t<div class=\"line1\">\n\t\t\t\t<span class=\"state\">\n\t\t\t\t\t<iconify-icon icon={visual.icon}></iconify-icon>\n\t\t\t\t\t{visual.label}\n\t\t\t\t</span>\n\t\t\t\t<a class=\"num\" href={item.url} target=\"_blank\" rel=\"noopener\" title=\"Open on GitHub\">\n\t\t\t\t\t{item.repo.toLowerCase() === defaults?.repo?.toLowerCase() ? '' : item.repo}#{item.number}\n\t\t\t\t</a>\n\t\t\t\t{#if result?.stale}<span class=\"stale\" title=\"GitHub did not answer the last read; this is the one before\">not current</span>{/if}\n\t\t\t\t{#if folded && pull}\n\t\t\t\t\t<span class=\"mini\"><span class=\"add\">+{pull.additions}</span> <span class=\"del\">−{pull.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<h2 title={item.title}>{item.title}</h2>\n\t\t\t<div class=\"fold\">\n\t\t\t\t<div class=\"fold-in\">\n\t\t\t\t\t<p class=\"meta\">\n\t\t\t\t\t\t{#if item.author}<span class=\"who\">{item.author}</span>{/if}\n\t\t\t\t\t\t{#if item.updated_at}<span title={new Date(item.updated_at).toLocaleString()}>updated {ago(item.updated_at)}</span>{/if}\n\t\t\t\t\t</p>\n\t\t\t\t\t{#if pull}\n\t\t\t\t\t\t<p class=\"branch\">\n\t\t\t\t\t\t\t<span class=\"names\" title=\"{pull.base} ← {pull.head}\">\n\t\t\t\t\t\t\t\t<span class=\"b\">{pull.base}</span>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t\t\t<span class=\"b\">{pull.head}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"nums\">\n\t\t\t\t\t\t\t\t<span class=\"add\">+{pull.additions}</span>\n\t\t\t\t\t\t\t\t<span class=\"del\">−{pull.deletions}</span>\n\t\t\t\t\t\t\t\t<span>{pull.files} {pull.files === 1 ? 'file' : 'files'}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if item.labels.length}\n\t\t\t\t\t\t<p class=\"labels\">\n\t\t\t\t\t\t\t{#each item.labels as l (l.name)}\n\t\t\t\t\t\t\t\t<span class=\"label\" style={labelStyle(l.color)}>{l.name}</span>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</header>\n\n\t\t<div class=\"scroll\" bind:this={scroller} onscroll={(e) => (folded = e.currentTarget.scrollTop > 24)}>\n\t\t\t{#if pull && (pull.reviews.length || pull.requested.length || pull.checks.length)}\n\t\t\t\t<section class=\"facts\" aria-label=\"Reviews and checks\">\n\t\t\t\t\t{#each pull.reviews as r (r.author)}\n\t\t\t\t\t\t{@const v = VERDICT[r.verdict as keyof typeof VERDICT]}\n\t\t\t\t\t\t<div class=\"fact {v.tone}\" class:old={r.stale} title={r.stale ? 'Given before the latest commit' : undefined}>\n\t\t\t\t\t\t\t<iconify-icon icon={v.icon}></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"who\">{r.author}</span>\n\t\t\t\t\t\t\t<span class=\"word\">{v.word.toLowerCase()}</span>\n\t\t\t\t\t\t\t{#if r.at}<span class=\"when\">{ago(r.at)}</span>{/if}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t\t{#if pull.requested.length}\n\t\t\t\t\t\t<div class=\"fact quiet\">\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:account-clock-outline\"></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"word\">Waiting on {pull.requested.join(', ')}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if checks && pull.checks.length}\n\t\t\t\t\t\t<button type=\"button\" class=\"fact checks {checksTone}\" aria-expanded={checksOpen} onclick={() => (checksOpen = !checksOpen)}>\n\t\t\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\t\t\ticon={checksTone === 'bad' ? 'mdi:close-circle' : checksTone === 'busy' ? 'mdi:progress-clock' : 'mdi:check-circle'}\n\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"word\">{describeChecks(pull.checks)}</span>\n\t\t\t\t\t\t\t<iconify-icon class=\"chev\" icon={checksOpen ? 'mdi:chevron-up' : 'mdi:chevron-down'}></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{#if checksOpen}\n\t\t\t\t\t\t\t<ul class=\"checklist\">\n\t\t\t\t\t\t\t\t{#each [...checks.failing, ...checks.running, ...(passingOpen || (!checks.failing.length && !checks.running.length) ? checks.passing : [])] as c, i (`${c.name}:${i}`)}\n\t\t\t\t\t\t\t\t\t<li class={c.bucket}>\n\t\t\t\t\t\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\t\t\t\t\t\ticon={c.bucket === 'failing' ? 'mdi:close-circle' : c.bucket === 'running' ? 'mdi:progress-clock' : 'mdi:check-circle'}\n\t\t\t\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t\t\t\t{#if c.url}\n\t\t\t\t\t\t\t\t\t\t\t<a href={c.url} target=\"_blank\" rel=\"noopener\">{c.name}</a>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"name\">{c.name}</span>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t<span class=\"status\">{c.status}</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t{#if !passingOpen && checks.passing.length && (checks.failing.length || checks.running.length)}\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={() => (passingOpen = true)}>Show {checks.passing.length} passing</button>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t{/if}\n\t\t\t\t</section>\n\t\t\t{/if}\n\n\t\t\t<article class=\"body markdown\">\n\t\t\t\t{#if visibleBody(item.body)}\n\t\t\t\t\t{@html md(item.body)}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"none\">No description.</p>\n\t\t\t\t{/if}\n\t\t\t</article>\n\n\t\t\t<section class=\"talk\" aria-label=\"Comments\">\n\t\t\t\t<div class=\"talk-head\">\n\t\t\t\t\t<span>{item.comments_total} {item.comments_total === 1 ? 'comment' : 'comments'}</span>\n\t\t\t\t\t{#if talk?.bots.length}\n\t\t\t\t\t\t<button type=\"button\" class=\"more\" aria-pressed={showBots} onclick={() => (showBots = !showBots)}>\n\t\t\t\t\t\t\t{showBots ? `Hide ${talk.bots.length} from bots` : `${talk.bots.length} from bots hidden`}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t\t{#if item.comments === null}\n\t\t\t\t\t<p class=\"none\">The comments could not be read.</p>\n\t\t\t\t{/if}\n\t\t\t\t{#each visibleComments as c (c.id)}\n\t\t\t\t\t<div class=\"comment\" class:bot={c.bot}>\n\t\t\t\t\t\t<p class=\"c-head\">\n\t\t\t\t\t\t\t<span class=\"who\">{c.author}</span>\n\t\t\t\t\t\t\t{#if c.at}\n\t\t\t\t\t\t\t\t<a class=\"when\" href={c.url} target=\"_blank\" rel=\"noopener\" title={new Date(c.at).toLocaleString()}>{ago(c.at)}</a>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div class=\"c-body markdown\" class:open={expanded.has(c.id)} use:capped>\n\t\t\t\t\t\t\t{@html md(c.body)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button type=\"button\" class=\"more showmore\" onclick={() => toggleComment(c)}>\n\t\t\t\t\t\t\t{expanded.has(c.id) ? 'Show less' : 'Show more'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t{/each}\n\t\t\t\t{#if listed.length > visibleComments.length}\n\t\t\t\t\t<button type=\"button\" class=\"more older\" onclick={() => (olderShown += COMMENT_PAGE)}>\n\t\t\t\t\t\tShow older ({listed.length - visibleComments.length} more)\n\t\t\t\t\t</button>\n\t\t\t\t{:else if unread}\n\t\t\t\t\t<a class=\"more older\" href={item.url} target=\"_blank\" rel=\"noopener\">{unread} older on GitHub</a>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t\t{#if scroller}\n\t\t\t<GithubRefCards root={scroller} repo={item.repo} {base} onOpen={openRef} />\n\t\t{/if}\n\t{/if}\n</div>\n\n<style>\n\t.gh {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t\tmin-width: 0;\n\t}\n\t.refs {\n\t\tflex: none;\n\t\tdisplay: flex;\n\t\tgap: 4px;\n\t\tpadding: 6px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tscrollbar-width: none;\n\t}\n\t.ref {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\theight: 26px;\n\t\tmax-width: 16rem;\n\t\tpadding: 0 8px;\n\t\tborder: 1px solid transparent;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\t.ref span {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.ref:hover {\n\t\tcolor: #e7e5e4;\n\t\tbackground: #1a1a1a;\n\t}\n\t.ref.on {\n\t\tcolor: #f5f5f4;\n\t\tborder-color: #2a2a2a;\n\t\tbackground: #1f1f1f;\n\t}\n\t.empty {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 10px;\n\t\tpadding: 24px 18px;\n\t\tcolor: #a8a29e;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 22px;\n\t\tcolor: #57534e;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tmax-width: 34rem;\n\t}\n\t.empty code {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #292524;\n\t\tborder-radius: 4px;\n\t\tpadding: 1px 5px;\n\t}\n\t.out {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\tcolor: #93c5fd;\n\t}\n\t.ghost {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 9px;\n\t\tpadding: 18px;\n\t}\n\t.ghost span {\n\t\theight: 11px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1c1c1c;\n\t\tanimation: ghost 1.4s ease-in-out infinite;\n\t}\n\t.ghost .gap {\n\t\theight: 1px;\n\t\tmargin: 6px 0;\n\t}\n\t@keyframes ghost {\n\t\t50% {\n\t\t\topacity: 0.45;\n\t\t}\n\t}\n\n\t/* The header: its left rule and the state word carry the state's colour, nothing else does. */\n\t.head {\n\t\tflex: none;\n\t\tpadding: 10px 14px 10px 12px;\n\t\tborder-bottom: 1px solid #222;\n\t\tborder-left: 2px solid var(--state);\n\t}\n\t.line1 {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-width: 0;\n\t\tfont-size: 12px;\n\t}\n\t.state {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\tcolor: var(--state);\n\t\tfont-weight: 600;\n\t}\n\t.state iconify-icon {\n\t\tfont-size: 15px;\n\t}\n\t.num {\n\t\tfont-family: var(--font-mono);\n\t\tcolor: #a8a29e;\n\t\ttext-decoration: none;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.num:hover {\n\t\tcolor: #e7e5e4;\n\t\ttext-decoration: underline;\n\t}\n\t.stale {\n\t\tpadding: 0 5px;\n\t\tborder: 1px solid #3a3532;\n\t\tborder-radius: 4px;\n\t\tfont-size: 10.5px;\n\t\tcolor: #a8a29e;\n\t}\n\t.mini {\n\t\tmargin-left: auto;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t}\n\th2 {\n\t\tmargin: 4px 0 0;\n\t\tfont-size: 14.5px;\n\t\tfont-weight: 600;\n\t\tline-height: 1.35;\n\t\tcolor: #f5f5f4;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.fold {\n\t\tdisplay: grid;\n\t\tgrid-template-rows: 1fr;\n\t\ttransition: grid-template-rows 160ms ease;\n\t}\n\t.folded .fold {\n\t\tgrid-template-rows: 0fr;\n\t}\n\t.fold-in {\n\t\toverflow: hidden;\n\t\tmin-height: 0;\n\t}\n\t.meta,\n\t.branch,\n\t.labels {\n\t\tmargin: 6px 0 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 4px 10px;\n\t\tflex-wrap: wrap;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t}\n\t.who {\n\t\tcolor: #d6d3d1;\n\t\tfont-weight: 500;\n\t}\n\t.branch {\n\t\tflex-wrap: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.names {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t}\n\t.names iconify-icon {\n\t\tflex: none;\n\t\tcolor: #57534e;\n\t}\n\t.b {\n\t\tmin-width: 0;\n\t\tmax-width: 50%;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #d6d3d1;\n\t}\n\t.nums {\n\t\tflex: none;\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n\t.label {\n\t\tpadding: 0 7px;\n\t\tborder: 1px solid color-mix(in srgb, var(--label) 55%, #111);\n\t\tborder-radius: 999px;\n\t\tbackground: color-mix(in srgb, var(--label) 16%, #111);\n\t\tcolor: color-mix(in srgb, var(--label) 45%, #e7e5e4);\n\t\tfont-size: 11px;\n\t\tline-height: 1.6;\n\t}\n\n\t.scroll {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow-y: auto;\n\t\tpadding-bottom: 24px;\n\t}\n\t.facts {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 8px 0;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\t.fact {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 7px;\n\t\tmin-height: 28px;\n\t\tpadding: 0 14px;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tfont-size: 12.5px;\n\t\ttext-align: left;\n\t}\n\t.fact iconify-icon {\n\t\tflex: none;\n\t\tfont-size: 15px;\n\t}\n\t.fact.good iconify-icon {\n\t\tcolor: #34d399;\n\t}\n\t.fact.bad iconify-icon {\n\t\tcolor: #f87171;\n\t}\n\t.fact.busy iconify-icon {\n\t\tcolor: #a8a29e;\n\t}\n\t.fact.quiet iconify-icon {\n\t\tcolor: #78716c;\n\t}\n\t.fact.old {\n\t\topacity: 0.5;\n\t}\n\t.fact .when {\n\t\tmargin-left: auto;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\t.checks {\n\t\tcursor: pointer;\n\t}\n\t.checks:hover {\n\t\tbackground: #171717;\n\t}\n\t.checks .word {\n\t\tcolor: #d6d3d1;\n\t}\n\t.chev {\n\t\tmargin-left: auto;\n\t\tcolor: #78716c;\n\t}\n\t.checklist {\n\t\tmargin: 2px 0 4px;\n\t\tpadding: 0;\n\t\tlist-style: none;\n\t}\n\t.checklist li {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 7px;\n\t\tmin-height: 26px;\n\t\tpadding: 0 14px 0 34px;\n\t\tfont-size: 12px;\n\t}\n\t.checklist iconify-icon {\n\t\tflex: none;\n\t\tfont-size: 13px;\n\t}\n\t.checklist .failing iconify-icon {\n\t\tcolor: #f87171;\n\t}\n\t.checklist .running iconify-icon {\n\t\tcolor: #a8a29e;\n\t}\n\t.checklist .passing iconify-icon {\n\t\tcolor: #34d399;\n\t}\n\t.checklist a,\n\t.checklist .name {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #d6d3d1;\n\t\ttext-decoration: none;\n\t}\n\t.checklist a:hover {\n\t\ttext-decoration: underline;\n\t}\n\t.status {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 11.5px;\n\t}\n\t.more {\n\t\talign-self: flex-start;\n\t\tmargin: 2px 14px;\n\t\tpadding: 2px 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tfont-size: 12px;\n\t\tcursor: pointer;\n\t\ttext-decoration: none;\n\t}\n\t.more:hover {\n\t\ttext-decoration: underline;\n\t}\n\t.body {\n\t\tpadding: 14px;\n\t\tline-height: 1.55;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.none {\n\t\tmargin: 0;\n\t\tcolor: #78716c;\n\t}\n\t.talk {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tborder-top: 1px solid #222;\n\t}\n\t.talk-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px 4px;\n\t\tfont-size: 12px;\n\t\tcolor: #78716c;\n\t}\n\t.talk-head .more {\n\t\tmargin: 0;\n\t}\n\t.talk > .none {\n\t\tpadding: 6px 14px;\n\t}\n\t.comment {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #1c1c1c;\n\t\t/* Long bot reports off screen skip layout until scrolled to. */\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-block-size: auto 120px;\n\t}\n\t.comment.bot {\n\t\topacity: 0.8;\n\t}\n\t.c-head {\n\t\tmargin: 0 0 4px;\n\t\tdisplay: flex;\n\t\talign-items: baseline;\n\t\tgap: 8px;\n\t\tfont-size: 12px;\n\t}\n\t.c-head .when {\n\t\tcolor: #78716c;\n\t\ttext-decoration: none;\n\t}\n\t.c-head .when:hover {\n\t\tcolor: #a8a29e;\n\t\ttext-decoration: underline;\n\t}\n\t.c-body {\n\t\tmax-height: 240px;\n\t\toverflow: hidden;\n\t\tline-height: 1.55;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.c-body:global(.long):not(.open) {\n\t\tmask-image: linear-gradient(to bottom, #000 70%, transparent);\n\t}\n\t.c-body.open {\n\t\tmax-height: none;\n\t}\n\t.showmore {\n\t\tdisplay: none;\n\t\tmargin: 4px 0 0;\n\t}\n\t.c-body:global(.long) + .showmore,\n\t.c-body.open + .showmore {\n\t\tdisplay: inline;\n\t}\n\t.older {\n\t\tmargin: 10px 14px;\n\t}\n\n\t/* What a body holds beyond the transcript's markdown. */\n\t.gh :global(.markdown img) {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tborder-radius: 4px;\n\t}\n\t.gh :global(.markdown details) {\n\t\tmargin: 6px 0;\n\t\tpadding: 4px 10px;\n\t\tborder: 1px solid #262626;\n\t\tborder-radius: 6px;\n\t}\n\t.gh :global(.markdown summary) {\n\t\tcursor: pointer;\n\t\tcolor: #a8a29e;\n\t}\n\t.gh :global(.markdown details[open] > summary) {\n\t\tmargin-bottom: 6px;\n\t}\n\t.gh :global(.gh-alert) {\n\t\tmargin: 8px 0;\n\t\tpadding: 2px 0 2px 12px;\n\t\tborder-left: 3px solid var(--alert);\n\t}\n\t.gh :global(.gh-alert-title) {\n\t\tcolor: var(--alert);\n\t\tfont-weight: 600;\n\t\tmargin-bottom: 3px;\n\t}\n\t.gh :global(.gh-alert-note) {\n\t\t--alert: #60a5fa;\n\t}\n\t.gh :global(.gh-alert-tip) {\n\t\t--alert: #34d399;\n\t}\n\t.gh :global(.gh-alert-important) {\n\t\t--alert: #a78bfa;\n\t}\n\t.gh :global(.gh-alert-warning) {\n\t\t--alert: #fb923c;\n\t}\n\t.gh :global(.gh-alert-caution) {\n\t\t--alert: #f87171;\n\t}\n\t.ref:focus-visible,\n\t.fact:focus-visible,\n\t.more:focus-visible,\n\t.num:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t@media (pointer: coarse) {\n\t\t.ref {\n\t\t\theight: 34px;\n\t\t}\n\t\t.fact {\n\t\t\tmin-height: 36px;\n\t\t}\n\t\t.more {\n\t\t\tpadding: 8px 0;\n\t\t}\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.fold {\n\t\t\ttransition: none;\n\t\t}\n\t\t.ghost span {\n\t\t\tanimation: none;\n\t\t}\n\t}\n</style>\n","/**\n * The pane kinds the side panel can show. A pane registers here: its kind\n * (the `?panel=` value), icon, label, the key that toggles it, the URL params\n * it owns, its body component, and when it cannot apply. Its header actions\n * come from the body itself, through `setActions`, since they usually depend\n * on what the body is showing.\n */\nimport type { Component } from 'svelte';\nimport type { Session } from '$lib/stores/sessions.svelte';\nimport type { ChangesInfo } from '$shared/types/ws-messages.js';\nimport ProjectPane from '$lib/components/side-panel/ProjectPane.svelte';\nimport ChangesPane from '$lib/components/side-panel/ChangesPane.svelte';\nimport FilesPane from '$lib/components/side-panel/FilesPane.svelte';\nimport HistoryPane from '$lib/components/side-panel/HistoryPane.svelte';\nimport WebPane from '$lib/components/side-panel/WebPane.svelte';\nimport GithubPane from '$lib/components/side-panel/GithubPane.svelte';\nimport { IS_MAC } from '$lib/constants';\n\nexport interface PaneAction {\n\ticon: string;\n\tlabel: string;\n\trun: () => void;\n\t/** For an action that toggles, whether it is on. */\n\tpressed?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PaneBodyProps {\n\tsession: Session | null;\n\ttarget: string;\n\t/**\n\t * Where the session's machine's API is reached from this page: '' for the\n\t * origin's own, `/fleet/<id>` through the relay for another machine's.\n\t */\n\tbase: string;\n\t/**\n\t * The host name that reaches another machine's own ports (its dev servers),\n\t * or null for the origin's own session.\n\t */\n\tmachineHost: string | null;\n\t/** The params this pane owns, as the URL has them. */\n\tparams: Record<string, string>;\n\t/** Change this pane's params; a null value removes one. Replaces the history entry unless `push`. */\n\tsetParams: (own: Record<string, string | null>, opts?: { push?: boolean }) => void;\n\t/** The actions the panel header draws beside the pane's title. */\n\tsetActions: (actions: PaneAction[]) => void;\n\t/** The pane is the one showing; a hidden pane stays mounted but may idle. */\n\tactive: boolean;\n\t/** Put `text` into the session's composer, at the end of the draft. */\n\tmention: (text: string) => void;\n\t/** Show another pane, with the params it owns set to `own`. */\n\topenPane: (kind: string, own: Record<string, string | null>) => void;\n}\n\nexport interface PaneDef {\n\tkind: string;\n\tlabel: string;\n\ticon: string;\n\t/** The letter that, with Alt+Shift, toggles this pane. */\n\tkey: string;\n\t/** The query params this pane owns besides `panel`. */\n\tparams: readonly string[];\n\tbody: Component<PaneBodyProps>;\n\t/** Why the pane cannot apply to this session, or null when it can. */\n\tunavailable?: (session: Session | null) => string | null;\n\t/** Lines added and removed, drawn on the pane's toggle while non-zero. */\n\tcount?: (session: Session | null) => ChangesInfo | null;\n}\n\nexport const PANES: readonly PaneDef[] = [\n\t{\n\t\tkind: 'changes',\n\t\tlabel: 'Changes',\n\t\ticon: 'mdi:plus-minus-variant',\n\t\tkey: 'C',\n\t\tparams: ['file', 'turn', 'source'],\n\t\tbody: ChangesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session'),\n\t\tcount: (s) => s?.changes ?? null\n\t},\n\t{\n\t\tkind: 'history',\n\t\tlabel: 'History',\n\t\ticon: 'mdi:source-commit',\n\t\tkey: 'H',\n\t\tparams: ['commit', 'file', 'view'],\n\t\tbody: HistoryPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'files',\n\t\tlabel: 'Files',\n\t\ticon: 'mdi:file-tree-outline',\n\t\tkey: 'F',\n\t\tparams: ['file', 'line'],\n\t\tbody: FilesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'web',\n\t\tlabel: 'Web',\n\t\ticon: 'mdi:web',\n\t\tkey: 'W',\n\t\tparams: ['url', 'tab'],\n\t\tbody: WebPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'github',\n\t\tlabel: 'GitHub',\n\t\ticon: 'mdi:github',\n\t\tkey: 'G',\n\t\tparams: ['ref'],\n\t\tbody: GithubPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'project',\n\t\tlabel: 'Project',\n\t\ticon: 'mdi:folder-information-outline',\n\t\tkey: 'P',\n\t\tparams: [],\n\t\tbody: ProjectPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t}\n];\n\nexport const PANE_KINDS = PANES.map((p) => p.kind);\n/** Every param any pane owns, which switching panes clears. */\nexport const PANE_PARAMS = [...new Set(PANES.flatMap((p) => p.params))];\n\nexport function paneDef(kind: string | null): PaneDef | null {\n\treturn PANES.find((p) => p.kind === kind) ?? null;\n}\n\n/** How Alt+Shift+`letter` is written for this keyboard. */\nfunction altShift(letter: string): string {\n\treturn IS_MAC ? `⌥⇧${letter}` : `Alt Shift ${letter}`;\n}\n\n/** How the keys that toggle a pane are written for this keyboard. */\nexport function paneKeys(def: PaneDef): string {\n\treturn altShift(def.key);\n}\n/** Toggles maximize. */\nconst MAXIMIZE_KEY = 'M';\nexport const MAXIMIZE_KEYS = altShift(MAXIMIZE_KEY);\n/** Closes the panel, or reopens the pane last shown. */\nexport const CLOSE_KEYS = IS_MAC ? '⌘\\\\' : 'Ctrl \\\\';\n\n/** The pane an Alt+Shift+letter press names, or 'maximize'. */\nexport function panelKeyAction(e: KeyboardEvent): PaneDef | 'maximize' | 'toggle' | null {\n\tif ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.code === 'Backslash') return 'toggle';\n\tif (!e.altKey || !e.shiftKey || e.ctrlKey || e.metaKey) return null;\n\tif (e.code === `Key${MAXIMIZE_KEY}`) return 'maximize';\n\treturn PANES.find((p) => e.code === `Key${p.key}`) ?? null;\n}\n","// File attachments staged for the next send, kept per target the way drafts\n// are (see docs/adr/0001, 0002). In memory only: a chip holds the File and a\n// blob URL, neither of which survives a reload.\nexport type AttachmentStatus = 'uploading' | 'ready' | 'failed';\nexport interface Attachment {\n\tlocalId: string;\n\tfile: File;\n\tname: string;\n\tsize: number;\n\tmime: string;\n\tstatus: AttachmentStatus;\n\tpath?: string;\n\terror?: string;\n\tthumb?: string;\n\tabort?: AbortController;\n}\n\nconst NONE: Attachment[] = [];\n\nfunction release(chip: Attachment): void {\n\tchip.abort?.abort();\n\tif (chip.thumb) URL.revokeObjectURL(chip.thumb);\n}\n\nclass AttachmentsStore {\n\tprivate state = $state<Record<string, Attachment[]>>({});\n\n\tget(target: string | null): Attachment[] {\n\t\tif (!target) return NONE;\n\t\treturn this.state[target] ?? NONE;\n\t}\n\n\tcount(target: string | null): number {\n\t\treturn this.get(target).length;\n\t}\n\n\tadd(target: string | null, chip: Attachment): void {\n\t\tif (!target) return;\n\t\tthis.state[target] = [...this.get(target), chip];\n\t}\n\n\t/** Patch a chip in its own target's list; a no-op once it has been removed. */\n\tpatch(target: string, localId: string, changes: Partial<Attachment>): void {\n\t\tconst list = this.state[target];\n\t\tif (!list?.some((a) => a.localId === localId)) return;\n\t\tthis.state[target] = list.map((a) => (a.localId === localId ? { ...a, ...changes } : a));\n\t}\n\n\t/** Drop one chip, aborting its upload and revoking its blob URL. */\n\tremove(target: string | null, localId: string): Attachment | undefined {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tconst chip = list?.find((a) => a.localId === localId);\n\t\tif (!target || !list || !chip) return undefined;\n\t\trelease(chip);\n\t\tconst rest = list.filter((a) => a.localId !== localId);\n\t\tif (rest.length) this.state[target] = rest;\n\t\telse delete this.state[target];\n\t\treturn chip;\n\t}\n\n\tclear(target: string | null): void {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tif (!target || !list) return;\n\t\tlist.forEach(release);\n\t\tdelete this.state[target];\n\t}\n}\n\nexport const attachmentsStore = new AttachmentsStore();\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: DialogPrimitive.RootProps = $props();\n</script>\n\n<DialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: DialogPrimitive.PortalProps = $props();\n</script>\n\n<DialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.TitleProps = $props();\n</script>\n\n<DialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"dialog-title\"\n\tclass={cn(\"text-lg leading-none font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.OverlayProps = $props();\n</script>\n\n<DialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M18 6 6 18\" }], [\"path\", { \"d\": \"m6 6 12 12\" }]];\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"x\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport DialogPortal from \"./dialog-portal.svelte\";\n\timport XIcon from \"@lucide/svelte/icons/x\";\n\timport type { Snippet } from \"svelte\";\n\timport * as Dialog from \"./index.js\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\tchildren,\n\t\tshowCloseButton = true,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;\n\t\tchildren: Snippet;\n\t\tshowCloseButton?: boolean;\n\t} = $props();\n</script>\n\n<DialogPortal {...portalProps}>\n\t<Dialog.Overlay />\n\t<DialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t>\n\t\t{@render children?.()}\n\t\t{#if showCloseButton}\n\t\t\t<DialogPrimitive.Close\n\t\t\t\tclass=\"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t>\n\t\t\t\t<XIcon />\n\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t</DialogPrimitive.Close>\n\t\t{/if}\n\t</DialogPrimitive.Content>\n</DialogPortal>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.DescriptionProps = $props();\n</script>\n\n<DialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport * as Dialog from '$lib/components/ui/dialog';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { sessionStore, type Session } from '$lib/stores/sessions.svelte';\n\n\tinterface Props {\n\t\t/** The session to rename; `null` keeps the dialog closed. */\n\t\tsessionId: string | null;\n\t\tonClose: () => void;\n\t\t/** Another machine's sessions, and the relay path to it; this machine's by default. */\n\t\tsessions?: Session[];\n\t\tbase?: string;\n\t}\n\n\tlet { sessionId, onClose, sessions, base = '' }: Props = $props();\n\n\t// Looked up rather than passed in, so the dialog reads the live session\n\t// instead of a snapshot frozen at the moment the row was clicked.\n\tconst session = $derived.by(() => {\n\t\tif (!sessionId) return null;\n\t\tif (sessions) return sessions.find((s) => s.id === sessionId) ?? null;\n\t\treturn sessionStore.sessionById.get(sessionId) ?? null;\n\t});\n\n\tlet value = $state('');\n\tlet inputEl = $state<HTMLInputElement | null>(null);\n\t/**\n\t * The kill arms before it fires. On a phone this dialog is the long-press\n\t * menu — the only place a pane can be killed at all, since the row's kill\n\t * switch needs a hover to appear — so it sits next to a text field a thumb\n\t * is already aiming at, and one stray tap must not end a session.\n\t */\n\tlet killArmed = $state(false);\n\n\t// Seed the field once per opening. The name is read untracked so a rename\n\t// arriving back over the WebSocket cannot overwrite what is being typed.\n\t$effect(() => {\n\t\tif (sessionId) {\n\t\t\tvalue = untrack(() => session?.display_name ?? '');\n\t\t\tkillArmed = false;\n\t\t}\n\t});\n\n\tconst TOP_MARGIN_PX = 16;\n\t/** Below this share of the layout viewport, the shortfall is the keyboard. */\n\tconst KEYBOARD_RATIO = 0.75;\n\n\t/**\n\t * The dialog is `position: fixed`, which anchors it to the layout viewport —\n\t * on a phone the on-screen keyboard then covers it, and the focused field\n\t * sits behind the keys. Pinning it to the top of `visualViewport` instead\n\t * keeps it in sight as the keyboard opens and closes.\n\t *\n\t * Android resizes the layout viewport along with the keyboard, so the default\n\t * centring already lands above it and there is nothing to correct. iOS Safari\n\t * does not, and supports neither `env(keyboard-inset-height)` nor\n\t * `interactive-widget`, which is why this is done in script.\n\t */\n\tlet positionStyle = $state<string | undefined>(undefined);\n\n\t$effect(() => {\n\t\tconst vv = window.visualViewport;\n\t\tif (!sessionId || !vv) return;\n\t\t// Assigning the same string is a no-op in Svelte, so the per-frame `scroll`\n\t\t// events an opening keyboard produces cost nothing extra. Reading\n\t\t// `positionStyle` here to compare would make this effect depend on its own\n\t\t// output and re-subscribe the listeners on every change.\n\t\tconst sync = () => {\n\t\t\t// `translate` (not `transform`) is what centres the panel, so the vertical\n\t\t\t// half of it has to be cancelled here or the panel rides off the top.\n\t\t\tpositionStyle =\n\t\t\t\tvv.height < window.innerHeight * KEYBOARD_RATIO\n\t\t\t\t\t? `top: ${vv.offsetTop + TOP_MARGIN_PX}px; translate: -50% 0;`\n\t\t\t\t\t: undefined;\n\t\t};\n\t\tsync();\n\t\tvv.addEventListener('resize', sync);\n\t\tvv.addEventListener('scroll', sync);\n\t\treturn () => {\n\t\t\tvv.removeEventListener('resize', sync);\n\t\t\tvv.removeEventListener('scroll', sync);\n\t\t\tpositionStyle = undefined;\n\t\t};\n\t});\n\n\tasync function commit() {\n\t\tconst target = session;\n\t\tconst next = value.trim();\n\t\tonClose();\n\t\tif (!target || next === (target.display_name ?? '')) return;\n\t\ttry {\n\t\t\tawait fetch(`${base}/api/sessions/${encodeURIComponent(target.id)}/rename`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ name: next || null })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tasync function kill() {\n\t\tconst target = session;\n\t\tif (!target) return;\n\t\tif (!killArmed) {\n\t\t\tkillArmed = true;\n\t\t\treturn;\n\t\t}\n\t\tonClose();\n\t\ttry {\n\t\t\tawait fetch(`${base}/api/sessions/${encodeURIComponent(target.id)}/kill`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ pid: target.pid, tmux_target: target.tmux_target })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tfunction onKeydown(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tvoid commit();\n\t\t}\n\t}\n</script>\n\n<Dialog.Root open={session !== null} onOpenChange={(open) => { if (!open) onClose(); }}>\n\t<Dialog.Content\n\t\tclass=\"max-w-sm\"\n\t\tstyle={positionStyle}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\t// bits-ui focuses the panel itself; the point of this dialog is to type\n\t\t\t// straight away, so hand focus to the field instead.\n\t\t\te.preventDefault();\n\t\t\tinputEl?.focus();\n\t\t\tinputEl?.select();\n\t\t}}\n\t>\n\t\t<Dialog.Header>\n\t\t\t<Dialog.Title>Rename session</Dialog.Title>\n\t\t\t<Dialog.Description>\n\t\t\t\tAlso sent to the agent as <code>/rename</code>, once its pane is back at a prompt. Leave\n\t\t\t\tblank to fall back to the tmux target.\n\t\t\t</Dialog.Description>\n\t\t</Dialog.Header>\n\t\t<Input\n\t\t\tbind:ref={inputEl}\n\t\t\tbind:value\n\t\t\tonkeydown={onKeydown}\n\t\t\tclass=\"font-mono\"\n\t\t\ttype=\"text\"\n\t\t\tplaceholder={session?.tmux_target ?? session?.id ?? 'session name'}\n\t\t\taria-label=\"Session name\"\n\t\t\tautocomplete=\"off\"\n\t\t\tautocapitalize=\"off\"\n\t\t\tspellcheck=\"false\"\n\t\t\tenterkeyhint=\"done\"\n\t\t\tmaxlength={120}\n\t\t/>\n\t\t<Dialog.Footer>\n\t\t\t<Button\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tclass=\"min-h-11 text-destructive hover:text-destructive sm:mr-auto\"\n\t\t\t\tonclick={kill}\n\t\t\t>\n\t\t\t\t{killArmed ? 'Confirm kill' : 'Kill session'}\n\t\t\t</Button>\n\t\t\t<Button variant=\"ghost\" class=\"min-h-11\" onclick={onClose}>Cancel</Button>\n\t\t\t<Button class=\"min-h-11\" onclick={commit}>Rename</Button>\n\t\t</Dialog.Footer>\n\t</Dialog.Content>\n</Dialog.Root>\n","export interface FuzzyMatch {\n /** Higher is better. */\n score: number;\n /** Indices of the characters in `text` that the query matched. */\n positions: number[];\n}\n\n/**\n * Subsequence fuzzy match with the matched character positions.\n * Prefers: prefix match, matches at word boundaries, contiguous runs, shorter names.\n * Returns null when the query is not a subsequence of the text.\n * Pass `wantPositions: false` when only the score is used — it skips collecting them.\n */\nexport function fuzzyMatch(text: string, q: string, wantPositions = true): FuzzyMatch | null {\n if (!q) return { score: 0, positions: [] };\n const t = text.toLowerCase();\n const needle = q.toLowerCase();\n // Fast path: substring\n const idx = t.indexOf(needle);\n if (idx !== -1) {\n const positions = wantPositions\n ? Array.from({ length: needle.length }, (_, i) => idx + i)\n : [];\n return { score: 1000 - idx * 5 - t.length, positions };\n }\n const positions: number[] = [];\n let score = 0;\n let ti = 0;\n let prev = -2;\n for (let qi = 0; qi < needle.length; qi++) {\n const ch = needle[qi];\n const found = t.indexOf(ch, ti);\n if (found === -1) return null;\n score += found === prev + 1 ? 10 : 1;\n if (found === 0 || /[^a-z0-9]/.test(t[found - 1] ?? \"\")) score += 5;\n if (wantPositions) positions.push(found);\n prev = found;\n ti = found + 1;\n }\n return { score: score - t.length * 0.1, positions };\n}\n\n/** Score only — skips collecting match positions. Higher is better; null = no match. */\nexport function fuzzyScore(text: string, q: string): number | null {\n return fuzzyMatch(text, q, false)?.score ?? null;\n}\n\n/** Split `text` into alternating plain/matched runs for highlighting. */\nexport function highlightRuns(text: string, positions: number[]): { text: string; hit: boolean }[] {\n if (positions.length === 0) return [{ text, hit: false }];\n const runs: { text: string; hit: boolean }[] = [];\n let cut = 0;\n for (let i = 0; i < positions.length; ) {\n // positions is ascending, so a run of matched chars is one slice\n const from = positions[i];\n let to = from;\n while (i + 1 < positions.length && positions[i + 1] === to + 1) {\n to = positions[++i];\n }\n i++;\n if (from > cut) runs.push({ text: text.slice(cut, from), hit: false });\n runs.push({ text: text.slice(from, to + 1), hit: true });\n cut = to + 1;\n }\n if (cut < text.length) runs.push({ text: text.slice(cut), hit: false });\n return runs;\n}\n\n/**\n * Ranking shared by the web command list and spoken-command resolution: a\n * fuzzy match on the name (boosted so any name hit beats any description\n * hit), else a substring match on the description — substring only, because\n * a subsequence over long prose matches everything. Lives here rather than\n * beside the command scanner so the browser bundle never sees \"fs\".\n */\nexport function scoreCommand(\n cmd: { name: string; description: string },\n query: string\n): number | null {\n const nameScore = fuzzyScore(cmd.name, query);\n if (nameScore != null) return nameScore + 500;\n const descIdx = query ? cmd.description.toLowerCase().indexOf(query.toLowerCase()) : -1;\n return descIdx === -1 ? null : 100 - descIdx * 0.5;\n}\n","/**\n * The side panel's half of the session page's URL.\n *\n * `?panel=<kind>` names the pane showing, and each pane owns a few plain query\n * params of its own (Changes `file` and `turn`, Files `file` and `line`, Web\n * `url`). Two panes may own a param of the same name, so switching panes drops\n * every pane param before setting the new pane's; the page's own params\n * (`view`, `embed`, `with`) are never touched.\n */\n\nconst PANEL_PARAM = 'panel';\n\n/** Which pane the URL asks for, if it is one of `kinds`. */\nexport function readPanel<K extends string>(params: URLSearchParams, kinds: readonly K[]): K | null {\n\tconst kind = params.get(PANEL_PARAM);\n\treturn kind && (kinds as readonly string[]).includes(kind) ? (kind as K) : null;\n}\n\n/** The params a pane owns, read off the URL. */\nexport function readPaneParams(params: URLSearchParams, owned: readonly string[]): Record<string, string> {\n\tconst out: Record<string, string> = {};\n\tfor (const name of owned) {\n\t\tconst value = params.get(name);\n\t\tif (value !== null) out[name] = value;\n\t}\n\treturn out;\n}\n\n/**\n * The query after opening `kind` (or closing the panel, for null). `paneParams`\n * lists every param any pane owns; `own` sets this pane's, a null value\n * removing one. Opening the pane already showing keeps the params it has.\n */\nexport function panelQuery(\n\tparams: URLSearchParams,\n\tkind: string | null,\n\tpaneParams: readonly string[],\n\town: Record<string, string | null> = {}\n): URLSearchParams {\n\tconst next = new URLSearchParams(params);\n\tif (kind === null || next.get(PANEL_PARAM) !== kind) {\n\t\tfor (const name of paneParams) next.delete(name);\n\t}\n\tif (kind === null) {\n\t\tnext.delete(PANEL_PARAM);\n\t\treturn next;\n\t}\n\tnext.set(PANEL_PARAM, kind);\n\tfor (const [name, value] of Object.entries(own)) {\n\t\tif (value === null) next.delete(name);\n\t\telse next.set(name, value);\n\t}\n\treturn next;\n}\n\n/**\n * Where a pull request or issue (`owner/name#n`) opens beside the session on\n * screen: the page's own URL with the GitHub pane on it, or null when the\n * page is not a session's (then the link goes to github.com).\n */\nexport function githubPaneHref(url: URL, ref: string, paneParams: readonly string[]): string | null {\n\tif (!/^(?:\\/m\\/[^/]+)?\\/session\\/[^/]+\\/?$/.test(url.pathname)) return null;\n\treturn `${url.pathname}?${panelQuery(url.searchParams, 'github', paneParams, { ref })}`;\n}\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();\n</script>\n\n<CollapsiblePrimitive.Content bind:ref data-slot=\"collapsible-content\" {...restProps} />\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();\n</script>\n\n<CollapsiblePrimitive.Trigger bind:ref data-slot=\"collapsible-trigger\" {...restProps} />\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\topen = $bindable(false),\n\t\t...restProps\n\t}: CollapsiblePrimitive.RootProps = $props();\n</script>\n\n<CollapsiblePrimitive.Root bind:ref bind:open data-slot=\"collapsible\" {...restProps} />\n","export type ChordAction = {\n\tlabel: string;\n\ticon: string;\n\trun: () => void;\n\tdanger?: boolean;\n\t/** Drawn but not pickable; menus that cannot grey a row out may ignore it. */\n\tdisabled?: boolean;\n\tflashing?: boolean;\n\tvariant?: 'destructive' | 'secondary';\n};\n\nfunction sameShape(a: ChordAction[], b: ChordAction[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (\n\t\t\tx.label !== y.label ||\n\t\t\tx.icon !== y.icon ||\n\t\t\tx.danger !== y.danger ||\n\t\t\tx.variant !== y.variant ||\n\t\t\tx.flashing !== y.flashing\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass SidebarActionsStore {\n\tactions: ChordAction[] = $state([]);\n\n\tset(actions: ChordAction[]): void {\n\t\tif (sameShape(this.actions, actions)) return;\n\t\tthis.actions = actions;\n\t}\n\n\tclear(): void {\n\t\tif (this.actions.length === 0) return;\n\t\tthis.actions = [];\n\t}\n}\n\nexport const sidebarActionsStore = new SidebarActionsStore();\n"],"file":"VceCNUd7.js"}
1
+ {"version":3,"mappings":";ijDAgBA,MAAMA,GAAYC,GAA6B,yBAA0B,CACxE,gBAAiB,GACjB,UAAW,GACX,iBAAkB,MAClB,YAAa,GACb,iBAAkB,GAClB,aAAc,EACd,GAED,MAAMC,EAAiB,CACNC,GAAAC,EAAAC,GAAoBL,GAAU,MAAM,OAA5C,oCAAAM,EAAA,iBAER,IAAI,iBAA2B,CAC9B,OAAO,KAAK,MAAM,eACnB,CAEA,IAAI,gBAAgBA,EAAgB,CAC/B,KAAK,MAAM,kBAAoBA,IACnC,KAAK,MAAM,gBAAkBA,EAC7BN,GAAU,KAAK,KAAK,KAAK,EAC1B,CAEA,IAAI,WAAqB,CACxB,OAAO,KAAK,MAAM,SACnB,CAEA,IAAI,UAAUM,EAAgB,CACzB,KAAK,MAAM,YAAcA,IAC7B,KAAK,MAAM,UAAYA,EACvBN,GAAU,KAAK,KAAK,KAAK,EAC1B,CAEA,IAAI,kBAAqC,CACxC,OAAO,KAAK,MAAM,gBACnB,CAEA,IAAI,iBAAiBM,EAAyB,CACzC,KAAK,MAAM,mBAAqBA,IACpC,KAAK,MAAM,iBAAmBA,EAC9BN,GAAU,KAAK,KAAK,KAAK,EAC1B,CAEA,IAAI,aAAuB,CAC1B,OAAO,KAAK,MAAM,WACnB,CAEA,IAAI,YAAYM,EAAgB,CAC3B,KAAK,MAAM,cAAgBA,IAC/B,KAAK,MAAM,YAAcA,EACzBN,GAAU,KAAK,KAAK,KAAK,EAC1B,CAEA,OAAOO,EAA8B,CAChC,OAAO,KAAK,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aC,EAAE,SAEjB,MAAO,EAET,CACA,MAAO,EACR,CAEA,MAAMgjC,EAAoB,IACA9zC,KAAO,EAAE,OAAlC,wCAAAE,EAAA,iBAEA,IAAI6zC,EAA8B,CAC7BF,GAAU,KAAK,QAASE,CAAO,IACnC,KAAK,QAAUA,EAChB,CAEA,OAAc,CACT,KAAK,QAAQ,SAAW,IAC5B,KAAK,QAAU,GAChB,CACD,CAEO,MAAMC,GAAsB,IAAIF","names":["persisted","createPersisted","PreferencesStore","#prefs","$.state","$.proxy","value","key","preferences","box","initialValue","current","BoxSymbol","isWritableSymbol","$.get","v","$.set","boxFrom","boxWith","boxFlatten","toReadonlyBox","isBox","isWritableBox","getElemDirection","elem","getNextKey","dir","orientation","kbd.ARROW_LEFT","kbd.ARROW_RIGHT","kbd.ARROW_DOWN","getPrevKey","kbd.ARROW_UP","getDirectionalKeys","RovingFocusGroup","#opts","#currentTabStopId","opts","candidates","#ownCandidates","rootNode","rootAttr","rootSelector","node","items","e","both","currentIndex","nextKey","prevKey","loop","keyToIndex","kbd.HOME","kbd.END","altNextKey","altPrevKey","itemIndex","itemToFocus","anyActive","id","currentTabStopId","currentTabStop","isHTMLElement","blockedAnimationStyle","MountAnimationGuard","#prevented","open","watch","measureWithoutAnimation","animationName","transitionDuration","rect","CustomEventDispatcher","eventName","options","detail","element","event","callback","handler","on","getNextMatch","values","search","currentMatch","lowerSearch","searchWithoutSpace","currentMatchLowercase","spacedMatches","currentMatchIndex","wrapArray","match","normalizedSearch","char","normalizedLowerSearch","wrappedValues","nextMatch","array","startIndex","_","index","collapsibleAttrs","createBitsAttrs","CollapsibleRootContext","Context","CollapsibleRootState","attachRef","PresenceManager","#props","$.derived","getDataOpenClosed","boolToEmptyStrOrUndef","CollapsibleContentState","#present","#mountAnimationGuard","#width","#height","root","hiddenUntilFound","active","afterTick","#snippetProps","getDataTransitionAttrs","CollapsibleTriggerState","#isDisabled","kbd.SPACE","kbd.ENTER","boolToStr","uid","$.props_id","$.prop","$$props","createId","ref","disabled","onOpenChange","noop","onOpenChangeComplete","restProps","$.rest_props","rest_excludes","rootState","mergedProps","mergeProps","div","$.attribute_effect","forceMount","contentState","triggerState","button","defaultOptions","boxAutoReset","defaultValue","afterMs","onChange","getWindow","timeout","resetAfter","$.user_effect","DOMTypeahead","#search","#onMatch","#getCurrentItem","currentItem","item","newItem","tooltip","FloatingAnchorState","untrack","SELECTION_KEYS","FIRST_KEYS","kbd.PAGE_UP","LAST_KEYS","kbd.PAGE_DOWN","FIRST_LAST_KEYS","isMouseEvent","focus","select","doc","getDocument","previouslyFocusedElement","isSelectableInput","focusFirst","getActiveElement","candidate","isUsingKeyboard","IsUsingKeyboard","$.effect_root","callbacksToDispose","handlePointer","handleKeydown","executeCallbacks","getTabbableOptions","getTabbableFrom","currentNode","direction","isTabbable","getTabbableFromFocusable","allTabbable","tabbable","activeIndex","isFocusable","allFocusable","focusable","MenuRootContext","MenuMenuContext","MenuContentContext","MenuOpenEvent","menuAttrs","MenuSubmenuIntent","#cleanupDocMove","#fallbackTimer","#active","#target","#apex","#pointerPoint","#launchPoint","triggerNode","contentNode","enabled","#reset","onTriggerMove","#preview","onTriggerLeave","#engage","onContentMove","onContentLeave","isElement","selector","matchedSubContent","onTriggerEnter","#disengage","onContentEnter","onDestroyEffect","#parentTargetRect","parent","#computePolygons","pointerPt","target","triggerRect","contentRect","side","getSide","apex","targetRect","sourceRect","getCorridorPolygon","getIntentPolygon","#isInSafeZone","pt","corridor","intent","isPointInPolygon","related","geo","isInsideRect","#clearVisuals","#attachDocMove","#startFallback","#disengageTimer","wasReturning","#detachDocMove","#clearFallback","#clearDisengageTimer","#intentExit","pointerPoint","#isPointerInDescendantSubContent","el","subContent","#onDocMove","isInsideInsetRect","point","polygon","x","y","inside","j","xi","yi","xj","yj","inset","triggerCenterX","triggerCenterY","contentCenterX","contentCenterY","deltaX","deltaY","exitPoint","effectiveSide","flipSide","top","bottom","left","right","MenuRootState","part","MenuMenuState","#contentId","parentMenu","MenuContentState","#timer","#handleTypeaheadSearch","#isSub","DOMContext","#dispatchPointerMoveToHoveredSubTrigger","#getCandidateNodes","#isPointerMovingToSubmenu","parentContentNode","hoveredNode","hoveredSubTrigger","rootMenu","nodeToFocus","kbd.TAB","currentTarget","isKeydownInside","isModifierKey","isCharacterKey","candidateNodes","isElementOrSVGElement","triggerId","MenuItemSharedState","#isFocused","content","MenuItemState","#handleSelect","selectEvent","isTypingAhead","press","MenuSeparatorState","ContextMenuTriggerState","#point","simpleBox","#longPressTimer","isDisabled","#clearLongPressTimer","#handleOpen","CONTEXT_MENU_TRIGGER_ATTR","FloatingLayer","$$anchor","onSelect","closeOnSelect","itemState","useId","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","preventScroll","sideOffset","align","onEscapeKeydown","trapFocus","isValidEvent","handleInteractOutside","handleEscapeKeydown","subContentSelector","PopperLayerForceMount","$.spread_props","$$arg0","props","wrapperProps","finalProps","getFloatingContentCSSVars","$0","div_1","node_3","$.child","$.reset","PopperLayer","div_2","div_3","node_6","$.append","$$render","consequent_1","consequent_3","FloatingLayer_Anchor","separatorState","type","openOnHover","openDelay","closeDelay","PopoverTriggerState","FloatingLayerAnchor","DialogRootState","closeState","DialogCloseState","preventOverflowTextSelection","restoreScrollDelay","DialogContentState","FocusScope","focusScopeProps","EscapeLayer","DismissibleLayer","TextSelectionLayer","ScrollLock","consequent","node_4","$.sibling","consequent_2","toggleAttrs","ToggleRootState","getToggleDataState","boolToTrueOrUndef","condition","pressed","onPressedChange","toggleState","$.snippet","node_2","$.noop","ContextMenuPrimitive_Portal","ContextMenuPortal","cn","ContextMenuPrimitive_Content","$$value","variant","ContextMenuPrimitive_Item","ContextMenuPrimitive_Separator","ContextMenuPrimitive_Trigger","ContextMenuPrimitive_Root","span","span_1","text","$.only_child","span_2","text_1","$.set_attribute","$.set_text","info","error","loading","seq","load","mine","res","sessionApiAt","body","err","sessionId","cwd","urls","root_9","p","p_1","root_1","dl","root_8","dt","dd","dd_1","node_1","$.template_effect","text_3","root_2","root_3","alternate","dd_2","ul","root_5","name","url","$$item","$$array","li","root_4","text_4","a","span_3","root_6","text_6","pre","$.first_child","fragment_1","consequent_4","consequent_5","alternate_1","text_2","alternate_2","toggleVariants","tv","size","TogglePrimitive_Root","LOADERS","__vitePreload","core","m","highlightLines","lines","language","hljs","line","STEP","reading","opened","canOpen","base","diffRows","rows","out","gaps","r","row","count","n","i","gap","end","read","was","SIGN","PAINT_LIMIT","painted","languageFor","stale","html","$.index","some","iconify_icon","button_1","$.delegated","button_2","iconify_icon_1","$.set_custom_element_data","$.set_class","text_5","text_7","span_4","node_5","text_8","consequent_6","alternate_3","inRepo","gitMissing","wanted","source","listing","listError","loadingList","listStamp","listSeq","again","loadList","src","$.update","next","pulse","turns","turn","t","files","totals","sumCounts","chips","showGenerated","split","generated","kept","f","isGenerated","displayPath","shown","selected","pick","file","setSource","setTurn","NO_PROMPT","revealTurn","diff","diffError","diffSeq","diffText","loadDiff","turnId","q","diffKey","workingText","shownDiff","shownError","hunkCount","onKey","at","root_21","bind_set","Toggle","bind_set_1","bind_get_2","bind_set_2","$.each","bind_get_3","text_9","span_5","text_10","node_9","div_4","span_6","text_11","node_10","Button","p_2","root_10","text_14","div_5","root_20","nav","node_12","letter","statusLetter","root_13","span_7","text_15","span_8","bdi","node_13","span_9","root_11","span_10","text_17","consequent_11","span_11","text_18","consequent_12","consequent_10","classes_1","consequent_13","section","div_6","fragment_8","span_12","text_20","node_18","span_13","root_14","text_21","consequent_14","root_15","consequent_15","node_20","p_3","text_22","p_4","root_16","DiffLines","p_5","root_17","consequent_16","consequent_19","p_6","root_19","consequent_20","consequent_7","consequent_9","consequent_8","classes","PopoverPrimitive_Trigger","GRAMMARS","THEME","HIGHLIGHT_LIMIT_CHARS","highlighter","createHighlighterCore","createJavaScriptRegexEngine","theme","highlightFile","shiki","FilesPaneStore","#state","patch","filesPaneStore","isBrowser","toastsCounter","getToastId","data","ToastState","#pendingRemovals","#findToastIdx","idx","toast","#findHeightIdx","toastId","height","message","toastIdx","toastToUpdate","delay","rest","dismissible","alreadyExists","promise","shouldDismiss","response","constructPromiseErrorMessage","component","heightIdx","order","toastOrder","insertIdx","toastState","toastFunction","SonnerState","#activeToasts","basicToast","copyWithToast","done","tree","depth","d","dirs","styles","$.set_style","entry","fragment_4","iconify_icon_2","styles_3","onRowDrag","setExpanded","root_7","iconify_icon_3","node_7","iconify_icon_4","classes_2","openPath","styles_4","openFile","crumb","label","crumbFor","browse","Popover_Root","Popover_Trigger","Popover_Content","listingOf","browsing","root_12","node_11","iconify_icon_5","baseName","parentOf","rootName","button_3","iconify_icon_6","node_14","iconify_icon_7","api","prefs","showIgnored","expanded","treeEpoch","loadDir","epoch","reloadTree","rootListing","repo","readFor","EXPAND_ALL_DIRS","expandAll","level","collapseAll","toggleIgnored","wantedFile","wantedLine","restored","last","fileSeq","loadFile","path","fileReadFor","revealInTree","missing","ancestors","closeFile","mdSource","markdown","isMarkdown","rendered","tokens","shikiLanguage","CHUNK","chunks","codeEl","pickLine","copyText","copyPath","mentionOf","mentionPath","menuEntry","onListContextMenu","crumbs","explorerLabel","crumbsEl","formatSize","bytes","query","allFiles","picked","loadAll","results","fuzzyFilter","openResult","onQueryKey","root_40","div_7","iconify_icon_8","node_17","Input","div_8","node_16","div_9","div_10","div_11","button_4","classes_4","div_12","text_12","ContextMenu_Root","ContextMenu_Trigger","ContextMenu_Content","ContextMenu_Item","iconify_icon_9","fragment_18","ContextMenu_Item_1","iconify_icon_10","fragment_20","text_13","alternate_4","consequent_17","ContextMenu_Item_2","iconify_icon_11","fragment_21","ContextMenu_Separator","ContextMenu_Item_3","iconify_icon_12","fragment_22","ContextMenu_Item_4","iconify_icon_13","fragment_24","consequent_18","button_5","root_23","root_39","div_13","button_6","iconify_icon_14","div_14","node_36","node_37","iconify_icon_15","fragment_25","node_38","iconify_icon_16","$.bind_this","node_39","root_26","text_16","consequent_21","div_15","root_27","node_41","bind_get_1","node_42","consequent_22","button_7","node_40","iconify_icon_17","button_8","iconify_icon_18","node_43","wrapLabel","button_9","root_28","iconify_icon_19","classes_5","consequent_23","button_10","iconify_icon_20","button_11","iconify_icon_21","node_44","div_16","root_29","text_19","consequent_24","root_30","root_31","classes_7","div_17","root_32","img","div_18","root_33","$.html","renderMarkdown","root_34","div_19","root_38","start","div_20","root_37","div_21","root_36","button_12","node_46","node_47","root_35","styles_7","consequent_30","alternate_6","classes_9","styles_6","classes_8","styles_5","consequent_27","consequent_29","alternate_7","consequent_25","classes_6","consequent_31","classes_3","layoutGraph","commits","listed","c","waiting","free","width","commit","into","hash","lane","through","to","graph","subjectEl","subjectHtml","subject","history","all","layout","unpushed","branches","workerOn","branch","tip","worker","sessionStore","s","ROW","LANE","PAD","LANES","laneX","laneColor","railWidth","bend","fromTop","cx","edge","mid","filesError","filesSeq","loadFiles","shownFiles","fileText","bind_get","root_25","day","dayOf","clock","svg","$1","$2","path_1","node_8","path_2","d_1","circle","readRef","shortHash","formatAgo","GithubRefCards","node_15","fragment_2","h3","span_14","span_15","p_7","root_22","fragment_3","span_16","span_17","node_19","span_18","span_19","span_20","span_21","node_21","node_22","p_8","p_9","p_10","root_18","p_11","$.key","node_23","p_12","root_24","alternate_5","isLoopback","host","h","choiceUrl","choice","normalizeTyped","hasScheme","u","pointsHere","portOf","resolveEmbed","ctx","pageSecure","port","served","remote","card","where","machine","BROWSER_CHOICE","toPagePoint","clientX","clientY","frame","along","UNZOOMED","MAX_ZOOM","zoomView","view","from","factor","room","scale","cy","shift","dest","centre","offset","space","limit","modifiersOf","MOUSE_BUTTONS","buttonName","heldButton","buttons","keyMessage","command","msg","textDelta","prev","b","same","pickTab","staying","byId","filterTabs","tabs","words","hay","w","browserAnswers","openInBrowser","WebPaneStore","webPaneStore","BrowserStream","ReliableWebSocket","#closedReason","tabId","failed","icon","heading","retry","fragment","POLL_MS","MULTI_CLICK_MS","MULTI_CLICK_PX","LINE_PX","infoSeq","loadInfo","followed","timer","lookingFor","lookedFor","want","currentId","pickerOpen","hostOf","labelOf","stream","canvas","decodeSeq","drawnSeq","touches","pinch","pendingMove","clearTyped","onDestroy","reload","lastPress","stage","zoomed","fingers","flushMove","sendMove","track","touchMessage","onPointerDown","onPointerMove","now","onPointerUp","onWheel","here","onPaste","pressKey","keyCode","typing","typedLocal","typedRemote","typingEl","mirrorTyped","backspaces","insert","onTypingKey","sendEnter","Badge","li_1","canvas_1","$.event","form","infoError","devConfigured","fallback","browserView","browserUrl","trail","choose","goBack","typed","submitTyped","named","configured","embed","frameSrc","openUrl","check","result","verdict","blocked","reloads","copy","hostLabel","BrowserView","server","bind_set_3","fragment_6","code","fragment_7","fragment_9","code_1","iframe","REFRESH_MS","COMMENT_PAGE","RECENT_MAX","defaults","loadSessionGithub","parseRefParam","number","shownKey","refParam","openRef","recentKey","recent","k","shortcuts","list","own","fresh","answer","loadGithubItem","ready","peekGithubItem","olderShown","showBots","checksOpen","passingOpen","scroller","visual","githubRefVisual","pull","BROWSER_POLL_MS","browserUp","opening","showing","ask","up","openInRemote","pageUrl","githubUrl","folded","VERDICT","checks","groupChecks","checksTone","talk","readableComments","visibleComments","unread","md","mediaHref","capped","seen","toggleComment","ago","labelStyle","color","a_1","header","a_2","h2","l","span_22","span_23","span_24","span_25","span_26","a_3","span_27","text_23","span_28","text_24","$.clsx","text_25","describeChecks","article","visibleBody","section_1","span_29","text_26","text_27","node_24","span_30","text_28","node_25","a_4","text_29","$.action","$$node","text_30","text_31","a_5","text_32","consequent_26","node_27","consequent_28","PANES","ChangesPane","HistoryPane","FilesPane","WebPane","GithubPane","ProjectPane","PANE_KINDS","PANE_PARAMS","paneDef","kind","altShift","IS_MAC","paneKeys","def","MAXIMIZE_KEY","MAXIMIZE_KEYS","CLOSE_KEYS","panelKeyAction","NONE","release","chip","AttachmentsStore","localId","changes","attachmentsStore","DialogPrimitive_Root","DialogPrimitive_Portal","DialogPrimitive_Title","DialogPrimitive_Overlay","iconNode","Icon","showCloseButton","DialogPortal","Dialog_Overlay","DialogPrimitive_Content","DialogPrimitive_Close","XIcon","DialogPrimitive_Description","session","inputEl","killArmed","TOP_MARGIN_PX","KEYBOARD_RATIO","positionStyle","vv","sync","kill","onKeydown","Dialog_Root","Dialog_Content","Dialog_Header","Dialog_Title","Dialog_Description","Dialog_Footer","fuzzyMatch","wantPositions","needle","positions","score","ti","qi","ch","found","fuzzyScore","highlightRuns","runs","cut","scoreCommand","cmd","nameScore","descIdx","PANEL_PARAM","readPanel","params","kinds","readPaneParams","owned","panelQuery","paneParams","githubPaneHref","CollapsiblePrimitive_Content","CollapsiblePrimitive_Trigger","CollapsiblePrimitive_Root","sameShape","SidebarActionsStore","actions","sidebarActionsStore"],"ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,46,47,68],"sources":["../../../../../../src/lib/stores/preferences.svelte.ts","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+ec0a64a97e9eb16b/node_modules/svelte-toolbelt/dist/box/box.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/locale.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/get-directional-keys.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/roving-focus-group.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/mount-animation.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/events.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/arrays.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/collapsible.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/collapsible/components/collapsible-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/box-auto-reset.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/dom-typeahead.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/utils.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/focus.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/utilities/is-using-keyboard/is-using-keyboard.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/internal/tabbable.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/menu.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/components/menu-item.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/context-menu/components/context-menu-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/menu/components/menu-separator.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/popover/components/popover-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog-close.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/dialog/components/dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/toggle/toggle.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.20.2+2df16ea90105ef5c/node_modules/bits-ui/dist/bits/toggle/components/toggle.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-portal.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-content.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-item.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-separator.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu-trigger.svelte","../../../../../../src/lib/components/ui/context-menu/context-menu.svelte","../../../../../../src/lib/components/DiffBadge.svelte","../../../../../../src/lib/components/side-panel/ProjectPane.svelte","../../../../../../src/lib/components/ui/toggle/toggle.svelte","../../../../../../src/lib/side-panel/highlight.ts","../../../../../../src/lib/components/side-panel/DiffLines.svelte","../../../../../../src/lib/components/side-panel/ChangesPane.svelte","../../../../../../src/lib/components/ui/popover/popover-trigger.svelte","../../../../../../src/lib/side-panel/shiki.ts","../../../../../../src/lib/stores/filesPane.svelte.ts","../../../../../../../node_modules/.bun/svelte-sonner@1.2.2+ec0a64a97e9eb16b/node_modules/svelte-sonner/dist/internal/helpers.js","../../../../../../../node_modules/.bun/svelte-sonner@1.2.2+ec0a64a97e9eb16b/node_modules/svelte-sonner/dist/toast-state.svelte.js","../../../../../../src/lib/side-panel/clipboard.ts","../../../../../../src/lib/components/side-panel/FilesPane.svelte","../../../../../../../src/git-graph.ts","../../../../../../src/lib/components/side-panel/HistoryPane.svelte","../../../../../../../src/utils/loopback.ts","../../../../../../src/lib/side-panel/web.ts","../../../../../../src/lib/side-panel/browser.ts","../../../../../../src/lib/stores/webPane.svelte.ts","../../../../../../src/lib/stores/browserStream.svelte.ts","../../../../../../src/lib/components/side-panel/BrowserView.svelte","../../../../../../src/lib/components/side-panel/WebPane.svelte","../../../../../../src/lib/components/side-panel/GithubPane.svelte","../../../../../../src/lib/side-panel/panes.ts","../../../../../../src/lib/stores/attachments.svelte.ts","../../../../../../src/lib/components/ui/dialog/dialog.svelte","../../../../../../src/lib/components/ui/dialog/dialog-portal.svelte","../../../../../../src/lib/components/ui/dialog/dialog-title.svelte","../../../../../../src/lib/components/ui/dialog/dialog-footer.svelte","../../../../../../src/lib/components/ui/dialog/dialog-header.svelte","../../../../../../src/lib/components/ui/dialog/dialog-overlay.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+ec0a64a97e9eb16b/node_modules/@lucide/svelte/dist/icons/x.svelte","../../../../../../src/lib/components/ui/dialog/dialog-content.svelte","../../../../../../src/lib/components/ui/dialog/dialog-description.svelte","../../../../../../src/lib/components/RenameSessionDialog.svelte","../../../../../../../src/utils/fuzzy.ts","../../../../../../src/lib/side-panel/url.ts","../../../../../../src/lib/components/ui/collapsible/collapsible-content.svelte","../../../../../../src/lib/components/ui/collapsible/collapsible-trigger.svelte","../../../../../../src/lib/components/ui/collapsible/collapsible.svelte","../../../../../../src/lib/stores/sidebarActions.svelte.ts"],"sourcesContent":["import { createPersisted } from './persisted';\nimport type { NotificationMode } from '$lib/notifications';\n\ninterface Preferences {\n\tterminalTheming: boolean;\n\tkeepAwake: boolean;\n\t/** How this browser alerts when a session needs someone or finishes a turn. */\n\tnotificationMode: NotificationMode;\n\t/** A toast inside the page for the same events, while it has focus. */\n\tinAppToasts: boolean;\n\t/** The Files pane keeps its tree beside an open file, or puts it away. */\n\tfileExplorerOpen: boolean;\n\t/** Long lines of an open file fold at the pane's edge rather than scroll past it. */\n\tfileWordWrap: boolean;\n}\n\nconst persisted = createPersisted<Preferences>('claude-mux-preferences', {\n\tterminalTheming: true,\n\tkeepAwake: false,\n\tnotificationMode: 'off',\n\tinAppToasts: true,\n\tfileExplorerOpen: true,\n\tfileWordWrap: false\n});\n\nclass PreferencesStore {\n\tprivate prefs = $state<Preferences>(persisted.load());\n\n\tget terminalTheming(): boolean {\n\t\treturn this.prefs.terminalTheming;\n\t}\n\n\tset terminalTheming(value: boolean) {\n\t\tif (this.prefs.terminalTheming === value) return;\n\t\tthis.prefs.terminalTheming = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget keepAwake(): boolean {\n\t\treturn this.prefs.keepAwake;\n\t}\n\n\tset keepAwake(value: boolean) {\n\t\tif (this.prefs.keepAwake === value) return;\n\t\tthis.prefs.keepAwake = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget notificationMode(): NotificationMode {\n\t\treturn this.prefs.notificationMode;\n\t}\n\n\tset notificationMode(value: NotificationMode) {\n\t\tif (this.prefs.notificationMode === value) return;\n\t\tthis.prefs.notificationMode = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget inAppToasts(): boolean {\n\t\treturn this.prefs.inAppToasts;\n\t}\n\n\tset inAppToasts(value: boolean) {\n\t\tif (this.prefs.inAppToasts === value) return;\n\t\tthis.prefs.inAppToasts = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\ttoggle(key: keyof Preferences): void {\n\t\tif (typeof this.prefs[key] === 'boolean') {\n\t\t\t(this.prefs[key] as boolean) = !this.prefs[key];\n\t\t\tpersisted.save(this.prefs);\n\t\t}\n\t}\n\n\tget fileExplorerOpen(): boolean {\n\t\treturn this.prefs.fileExplorerOpen ?? true;\n\t}\n\n\tset fileExplorerOpen(value: boolean) {\n\t\tthis.prefs.fileExplorerOpen = value;\n\t\tpersisted.save(this.prefs);\n\t}\n\n\tget fileWordWrap(): boolean {\n\t\treturn this.prefs.fileWordWrap ?? false;\n\t}\n\n\tset fileWordWrap(value: boolean) {\n\t\tthis.prefs.fileWordWrap = value;\n\t\tpersisted.save(this.prefs);\n\t}\n}\n\nexport const preferences = new PreferencesStore();\n","import { boxFrom, boxWith, boxFlatten, toReadonlyBox, isBox, isWritableBox, BoxSymbol, isWritableSymbol } from \"./box-extras.svelte.js\";\nexport function box(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nbox.from = boxFrom;\nbox.with = boxWith;\nbox.flatten = boxFlatten;\nbox.readonly = toReadonlyBox;\nbox.isBox = isBox;\nbox.isWritableBox = isWritableBox;\n","/**\n * Detects the text direction in the element.\n * @returns {Direction} The text direction ('ltr' for left-to-right or 'rtl' for right-to-left).\n */\nexport function getElemDirection(elem) {\n const style = window.getComputedStyle(elem);\n const direction = style.getPropertyValue(\"direction\");\n return direction;\n}\n","import { kbd } from \"./kbd.js\";\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SELECTION_KEYS = [kbd.SPACE, kbd.ENTER];\n/**\n * A utility function that returns the next key based on the direction and orientation.\n */\nexport function getNextKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_LEFT : kbd.ARROW_RIGHT,\n vertical: kbd.ARROW_DOWN,\n }[orientation];\n}\n/**\n * A utility function that returns the previous key based on the direction and orientation.\n */\nexport function getPrevKey(dir = \"ltr\", orientation = \"horizontal\") {\n return {\n horizontal: dir === \"rtl\" ? kbd.ARROW_RIGHT : kbd.ARROW_LEFT,\n vertical: kbd.ARROW_UP,\n }[orientation];\n}\n/**\n * A utility function that returns the next and previous keys based on the direction\n * and orientation.\n */\nexport function getDirectionalKeys(dir = \"ltr\", orientation = \"horizontal\") {\n if (![\"ltr\", \"rtl\"].includes(dir))\n dir = \"ltr\";\n if (![\"horizontal\", \"vertical\"].includes(orientation))\n orientation = \"horizontal\";\n return {\n nextKey: getNextKey(dir, orientation),\n prevKey: getPrevKey(dir, orientation),\n };\n}\n","import { box } from \"svelte-toolbelt\";\nimport { getElemDirection } from \"./locale.js\";\nimport { getDirectionalKeys } from \"./get-directional-keys.js\";\nimport { kbd } from \"./kbd.js\";\nimport { BROWSER } from \"esm-env\";\nimport { isHTMLElement } from \"./is.js\";\nexport class RovingFocusGroup {\n #opts;\n #currentTabStopId = box(null);\n constructor(opts) {\n this.#opts = opts;\n }\n getCandidateNodes() {\n if (!BROWSER || !this.#opts.rootNode.current)\n return [];\n if (this.#opts.candidateSelector) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(this.#opts.candidateSelector));\n return this.#ownCandidates(this.#opts.rootNode.current, candidates);\n }\n else if (this.#opts.candidateAttr) {\n const candidates = Array.from(this.#opts.rootNode.current.querySelectorAll(`[${this.#opts.candidateAttr}]:not([data-disabled])`));\n return this.#ownCandidates(this.#opts.rootNode.current, candidates);\n }\n return [];\n }\n /**\n * Excludes candidates whose closest `[rootAttr]` ancestor is a nested root\n * rather than `rootNode` itself.\n */\n #ownCandidates(rootNode, candidates) {\n const rootAttr = this.#opts.rootAttr;\n if (!rootAttr)\n return candidates;\n const rootSelector = `[${rootAttr}]`;\n return candidates.filter((node) => node.closest(rootSelector) === rootNode);\n }\n focusFirstCandidate() {\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n items[0]?.focus();\n }\n handleKeydown(node, e, both = false) {\n const rootNode = this.#opts.rootNode.current;\n if (!rootNode || !node)\n return;\n const items = this.getCandidateNodes();\n if (!items.length)\n return;\n const currentIndex = items.indexOf(node);\n const dir = getElemDirection(rootNode);\n const { nextKey, prevKey } = getDirectionalKeys(dir, this.#opts.orientation.current);\n const loop = this.#opts.loop.current;\n const keyToIndex = {\n [nextKey]: currentIndex + 1,\n [prevKey]: currentIndex - 1,\n [kbd.HOME]: 0,\n [kbd.END]: items.length - 1,\n };\n if (both) {\n const altNextKey = nextKey === kbd.ARROW_DOWN ? kbd.ARROW_RIGHT : kbd.ARROW_DOWN;\n const altPrevKey = prevKey === kbd.ARROW_UP ? kbd.ARROW_LEFT : kbd.ARROW_UP;\n keyToIndex[altNextKey] = currentIndex + 1;\n keyToIndex[altPrevKey] = currentIndex - 1;\n }\n let itemIndex = keyToIndex[e.key];\n if (itemIndex === undefined)\n return;\n e.preventDefault();\n if (itemIndex < 0 && loop) {\n itemIndex = items.length - 1;\n }\n else if (itemIndex === items.length && loop) {\n itemIndex = 0;\n }\n const itemToFocus = items[itemIndex];\n if (!itemToFocus)\n return;\n itemToFocus.focus();\n this.#currentTabStopId.current = itemToFocus.id;\n this.#opts.onCandidateFocus?.(itemToFocus);\n return itemToFocus;\n }\n getTabIndex(node) {\n const items = this.getCandidateNodes();\n const anyActive = this.#currentTabStopId.current !== null;\n if (node && !anyActive && items[0] === node) {\n this.#currentTabStopId.current = node.id;\n return 0;\n }\n else if (node?.id === this.#currentTabStopId.current) {\n return 0;\n }\n return -1;\n }\n setCurrentTabStopId(id) {\n this.#currentTabStopId.current = id;\n }\n focusCurrentTabStop() {\n const currentTabStopId = this.#currentTabStopId.current;\n if (!currentTabStopId)\n return;\n const currentTabStop = this.#opts.rootNode.current?.querySelector(`#${currentTabStopId}`);\n if (!currentTabStop || !isHTMLElement(currentTabStop))\n return;\n currentTabStop.focus();\n }\n}\n","import { watch } from \"runed\";\nconst blockedAnimationStyle = { animationName: \"none\", transitionDuration: \"0s\" };\n/**\n * Keeps content that mounts open from playing its open animation/transition.\n *\n * The block is rendered through the content's `style` prop rather than set on the\n * node imperatively, since Svelte rewrites the `style` attribute whenever the\n * content's props change (e.g. after measuring its dimensions). It lifts on the\n * first open state change, so later opening and closing still animate.\n */\nexport class MountAnimationGuard {\n #prevented = $state(false);\n constructor(open) {\n this.#prevented = open();\n watch.pre(open, () => {\n this.#prevented = false;\n }, { lazy: true });\n }\n get style() {\n return this.#prevented ? blockedAnimationStyle : undefined;\n }\n}\n/**\n * Measures `node` at its full size with animations and transitions blocked, then\n * restores its inline styles.\n */\nexport function measureWithoutAnimation(node) {\n const { animationName, transitionDuration } = node.style;\n node.style.animationName = blockedAnimationStyle.animationName;\n node.style.transitionDuration = blockedAnimationStyle.transitionDuration;\n const rect = node.getBoundingClientRect();\n node.style.animationName = animationName;\n node.style.transitionDuration = transitionDuration;\n return rect;\n}\n","import { on } from \"svelte/events\";\n/**\n * Creates a typed event dispatcher and listener pair for custom events\n * @template T - The type of data that will be passed in the event detail\n * @param eventName - The name of the custom event\n * @param options - CustomEvent options (bubbles, cancelable, etc.)\n */\nexport class CustomEventDispatcher {\n eventName;\n options;\n constructor(eventName, options = { bubbles: true, cancelable: true }) {\n this.eventName = eventName;\n this.options = options;\n }\n createEvent(detail) {\n return new CustomEvent(this.eventName, {\n ...this.options,\n detail,\n });\n }\n dispatch(element, detail) {\n const event = this.createEvent(detail);\n element.dispatchEvent(event);\n return event;\n }\n listen(element, callback, options) {\n const handler = (event) => {\n callback(event);\n };\n return on(element, this.eventName, handler, options);\n }\n}\n","/**\n * Checks if two arrays are equal by comparing their values.\n */\nexport function arraysAreEqual(arr1, arr2) {\n if (arr1.length !== arr2.length)\n return false;\n return arr1.every((value, index) => isEqual(value, arr2[index]));\n}\n/**\n * A utility function that compares two values for equality.\n */\nfunction isEqual(a, b) {\n if (Number.isNaN(a) && Number.isNaN(b))\n return true;\n if (Array.isArray(a) && Array.isArray(b))\n return arraysAreEqual(a, b);\n if (typeof a === \"object\" && typeof b === \"object\")\n return isDeepEqual(a, b);\n return Object.is(a, b);\n}\n/**\n * A utility function that compares two values for deep equality.\n */\nfunction isDeepEqual(a, b) {\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null)\n return false;\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length)\n return false;\n for (const key of aKeys) {\n if (!bKeys.includes(key))\n return false;\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Splits an array into chunks of a given size.\n * @param arr The array to split.\n * @param size The size of each chunk.\n * @returns An array of arrays, where each sub-array has `size` elements from the original array.\n * @example ```ts\n * const arr = [1, 2, 3, 4, 5, 6, 7, 8];\n * const chunks = chunk(arr, 3);\n * // chunks = [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n */\nexport function chunk(arr, size) {\n if (size <= 0)\n return [];\n const result = [];\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n return result;\n}\n/**\n * Checks if the given index is valid for the given array.\n *\n * @param index - The index to check\n * @param arr - The array to check\n */\nexport function isValidIndex(index, arr) {\n return index >= 0 && index < arr.length;\n}\n/**\n * Returns the array element after the given index, or undefined for out-of-bounds or empty arrays.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the beginning of the array if the next index is out of bounds?\n */\n/**\n * Returns the array element after the given index, or undefined for out-of-bounds or empty arrays.\n * For single-element arrays, returns the element if the index is 0.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the beginning of the array if the next index is out of bounds?\n */\nexport function next(array, index, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n if (array.length === 1 && index === 0)\n return array[0];\n if (index === array.length - 1)\n return loop ? array[0] : undefined;\n return array[index + 1];\n}\n/**\n * Returns the array element prior to the given index, or undefined for out-of-bounds or empty arrays.\n * For single-element arrays, returns the element if the index is 0.\n * @param array the array.\n * @param index the index of the current element.\n * @param loop loop to the end of the array if the previous index is out of bounds?\n */\nexport function prev(array, index, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n if (array.length === 1 && index === 0)\n return array[0];\n if (index === 0)\n return loop ? array[array.length - 1] : undefined;\n return array[index - 1];\n}\n/**\n * Returns the element some number after the given index. If the target index is out of bounds:\n * - If looping is disabled, the first or last element will be returned.\n * - If looping is enabled, it will wrap around the array.\n * Returns undefined for empty arrays or out-of-bounds initial indices.\n * @param array the array.\n * @param index the index of the current element.\n * @param increment the number of elements to move forward (can be negative).\n * @param loop loop around the array if the target index is out of bounds?\n */\nexport function forward(array, index, increment, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n let targetIndex = index + increment;\n if (loop) {\n // Ensure positive modulus\n targetIndex = ((targetIndex % array.length) + array.length) % array.length;\n }\n else {\n // Clamp to array bounds when not looping\n targetIndex = Math.max(0, Math.min(targetIndex, array.length - 1));\n }\n return array[targetIndex];\n}\n/**\n * Returns the element some number before the given index. If the target index is out of bounds:\n * - If looping is disabled, the first or last element will be returned.\n * - If looping is enabled, it will wrap around the array.\n * Returns undefined for empty arrays or out-of-bounds initial indices.\n * @param array the array.\n * @param index the index of the current element.\n * @param decrement the number of elements to move backward (can be negative).\n * @param loop loop around the array if the target index is out of bounds?\n */\nexport function backward(array, index, decrement, loop = true) {\n if (array.length === 0 || index < 0 || index >= array.length)\n return;\n let targetIndex = index - decrement;\n if (loop) {\n // Ensure positive modulus\n targetIndex = ((targetIndex % array.length) + array.length) % array.length;\n }\n else {\n // Clamp to array bounds when not looping\n targetIndex = Math.max(0, Math.min(targetIndex, array.length - 1));\n }\n return array[targetIndex];\n}\n/**\n * Finds the next matching item from a list of values based on a search string.\n *\n * This function handles several special cases in typeahead behavior:\n *\n * 1. Space handling: When a search string ends with a space, it handles it specially:\n * - If there's only one match for the text before the space, it ignores the space\n * - If there are multiple matches and the current match already starts with the search prefix\n * followed by a space, it keeps the current match (doesn't change selection on space)\n * - Only after typing characters beyond the space will it move to a more specific match\n *\n * 2. Repeated character handling: If a search consists of repeated characters (e.g., \"aaa\"),\n * it treats it as a single character for matching purposes\n *\n * 3. Cycling behavior: The function wraps around the values array starting from the current match\n * to find the next appropriate match, creating a cycling selection behavior\n *\n * @param values - Array of string values to search through (e.g., the text content of menu items)\n * @param search - The current search string typed by the user\n * @param currentMatch - The currently selected/matched item, if any\n * @returns The next matching value that should be selected, or undefined if no match is found\n */\nexport function getNextMatch(values, search, currentMatch) {\n const lowerSearch = search.toLowerCase();\n if (lowerSearch.endsWith(\" \")) {\n const searchWithoutSpace = lowerSearch.slice(0, -1);\n const matchesWithoutSpace = values.filter((value) => value.toLowerCase().startsWith(searchWithoutSpace));\n /**\n * If there's only one match for the prefix without space, we don't\n * watch to match with space.\n */\n if (matchesWithoutSpace.length <= 1) {\n return getNextMatch(values, searchWithoutSpace, currentMatch);\n }\n const currentMatchLowercase = currentMatch?.toLowerCase();\n /**\n * If the current match already starts with the search prefix and has a space afterward,\n * and the user has only typed up to that space, keep the current match until they\n * disambiguate.\n */\n if (currentMatchLowercase &&\n currentMatchLowercase.startsWith(searchWithoutSpace) &&\n currentMatchLowercase.charAt(searchWithoutSpace.length) === \" \" &&\n search.trim() === searchWithoutSpace) {\n return currentMatch;\n }\n /**\n * With multiple matches, find items that match the full search string with space\n */\n const spacedMatches = values.filter((value) => value.toLowerCase().startsWith(lowerSearch));\n /**\n * If we found matches with the space, use the first one that's not the current match\n */\n if (spacedMatches.length > 0) {\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedMatches = wrapArray(spacedMatches, Math.max(currentMatchIndex, 0));\n // return the first match that is not the current one.\n const nextMatch = wrappedMatches.find((match) => match !== currentMatch);\n // fallback to current if no other is found.\n return nextMatch || currentMatch;\n }\n }\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const normalizedLowerSearch = normalizedSearch.toLowerCase();\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch)\n wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find((value) => value?.toLowerCase().startsWith(normalizedLowerSearch));\n return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nexport function wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n","import { afterTick, attachRef, boxWith, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { on } from \"svelte/events\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { MountAnimationGuard, measureWithoutAnimation, } from \"../../internal/mount-animation.svelte.js\";\nconst collapsibleAttrs = createBitsAttrs({\n component: \"collapsible\",\n parts: [\"root\", \"content\", \"trigger\"],\n});\nconst CollapsibleRootContext = new Context(\"Collapsible.Root\");\nexport class CollapsibleRootState {\n static create(opts) {\n return CollapsibleRootContext.set(new CollapsibleRootState(opts));\n }\n opts;\n attachment;\n contentNode = $state(null);\n contentPresence;\n contentId = $state(undefined);\n constructor(opts) {\n this.opts = opts;\n this.toggleOpen = this.toggleOpen.bind(this);\n this.attachment = attachRef(this.opts.ref);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n }\n toggleOpen() {\n this.opts.open.current = !this.opts.open.current;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-state\": getDataOpenClosed(this.opts.open.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n [collapsibleAttrs.root]: \"\",\n ...this.attachment,\n }));\n}\nexport class CollapsibleContentState {\n static create(opts) {\n return new CollapsibleContentState(opts, CollapsibleRootContext.get());\n }\n opts;\n root;\n attachment;\n present = $derived.by(() => {\n if (this.opts.hiddenUntilFound.current)\n return this.root.opts.open.current;\n return this.opts.forceMount.current || this.root.opts.open.current;\n });\n #mountAnimationGuard;\n #width = $state(0);\n #height = $state(0);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.#mountAnimationGuard = new MountAnimationGuard(() => this.root.opts.open.current);\n this.root.contentId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.contentNode = v));\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.contentId = id;\n });\n watch.pre([() => this.opts.ref.current, () => this.opts.hiddenUntilFound.current], ([node, hiddenUntilFound]) => {\n if (!node || !hiddenUntilFound)\n return;\n const handleBeforeMatch = () => {\n if (this.root.opts.open.current)\n return;\n // we need to defer opening until after browser completes search highlighting\n // otherwise the browser will immediately open the collapsible\n // and the search highlighting will not be visible\n requestAnimationFrame(() => {\n this.root.opts.open.current = true;\n });\n };\n return on(node, \"beforematch\", handleBeforeMatch);\n });\n watch([() => this.opts.ref.current, () => this.present], ([node]) => {\n if (!node)\n return;\n let active = true;\n afterTick(() => {\n // Cleanup can run before this tick; do not read destroyed or superseded state.\n if (!active)\n return;\n if (!this.opts.ref.current)\n return;\n const rect = measureWithoutAnimation(node);\n this.#height = rect.height;\n this.#width = rect.width;\n });\n return () => {\n active = false;\n };\n });\n }\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({\n open: this.root.opts.open.current,\n }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n style: {\n \"--bits-collapsible-content-height\": this.#height\n ? `${this.#height}px`\n : undefined,\n \"--bits-collapsible-content-width\": this.#width\n ? `${this.#width}px`\n : undefined,\n ...this.#mountAnimationGuard.style,\n },\n hidden: this.opts.hiddenUntilFound.current && !this.root.opts.open.current\n ? \"until-found\"\n : undefined,\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n \"data-disabled\": boolToEmptyStrOrUndef(this.root.opts.disabled.current),\n [collapsibleAttrs.content]: \"\",\n ...(this.opts.hiddenUntilFound.current && !this.shouldRender\n ? {}\n : {\n hidden: this.opts.hiddenUntilFound.current\n ? !this.shouldRender\n : this.opts.forceMount.current\n ? undefined\n : !this.shouldRender,\n }),\n ...this.attachment,\n }));\n}\nexport class CollapsibleTriggerState {\n static create(opts) {\n return new CollapsibleTriggerState(opts, CollapsibleRootContext.get());\n }\n opts;\n root;\n attachment;\n #isDisabled = $derived.by(() => this.opts.disabled.current || this.root.opts.disabled.current);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.#isDisabled)\n return;\n if (e.button !== 0)\n return e.preventDefault();\n this.root.toggleOpen();\n }\n onkeydown(e) {\n if (this.#isDisabled)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.toggleOpen();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n type: \"button\",\n disabled: this.#isDisabled,\n \"aria-controls\": this.root.contentId,\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.#isDisabled),\n [collapsibleAttrs.trigger]: \"\",\n //\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CollapsibleRootProps } from \"../types.js\";\n\timport { CollapsibleRootState } from \"../collapsible.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\topen = $bindable(false),\n\t\tdisabled = false,\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\t...restProps\n\t}: CollapsibleRootProps = $props();\n\n\tconst rootState = CollapsibleRootState.create({\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, rootState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { CollapsibleContentState } from \"../collapsible.svelte.js\";\n\timport type { CollapsibleContentProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\thiddenUntilFound = false,\n\t\tchildren,\n\t\tid = createId(uid),\n\t\t...restProps\n\t}: CollapsibleContentProps = $props();\n\n\tconst contentState = CollapsibleContentState.create({\n\t\tid: boxWith(() => id),\n\t\tforceMount: boxWith(() => forceMount),\n\t\thiddenUntilFound: boxWith(() => hiddenUntilFound),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if child}\n\t{@render child({\n\t\t...contentState.snippetProps,\n\t\tprops: mergedProps,\n\t})}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CollapsibleTriggerProps } from \"../types.js\";\n\timport { CollapsibleTriggerState } from \"../collapsible.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: CollapsibleTriggerProps = $props();\n\n\tconst triggerState = CollapsibleTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => disabled),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","import { boxWith } from \"svelte-toolbelt\";\nimport { noop } from \"./noop.js\";\nconst defaultOptions = {\n afterMs: 10000,\n onChange: noop,\n};\n/**\n * Creates a box which will be reset to the default value after some time.\n *\n * @param defaultValue The value which will be set.\n * @param afterMs A zero-or-greater delay in milliseconds.\n */\nexport function boxAutoReset(defaultValue, options) {\n const { afterMs, onChange, getWindow } = { ...defaultOptions, ...options };\n let timeout = null;\n let value = $state(defaultValue);\n function resetAfter() {\n return getWindow().setTimeout(() => {\n value = defaultValue;\n onChange?.(defaultValue);\n }, afterMs);\n }\n $effect(() => {\n return () => {\n if (timeout)\n getWindow().clearTimeout(timeout);\n };\n });\n return boxWith(() => value, (v) => {\n value = v;\n onChange?.(v);\n if (timeout)\n getWindow().clearTimeout(timeout);\n timeout = resetAfter();\n });\n}\n","import { getNextMatch } from \"./arrays.js\";\nimport { boxAutoReset } from \"./box-auto-reset.svelte.js\";\nexport class DOMTypeahead {\n #opts;\n #search;\n #onMatch = $derived.by(() => {\n if (this.#opts.onMatch)\n return this.#opts.onMatch;\n return (node) => node.focus();\n });\n #getCurrentItem = $derived.by(() => {\n if (this.#opts.getCurrentItem)\n return this.#opts.getCurrentItem;\n return this.#opts.getActiveElement;\n });\n constructor(opts) {\n this.#opts = opts;\n this.#search = boxAutoReset(\"\", {\n afterMs: 1000,\n getWindow: opts.getWindow,\n });\n this.handleTypeaheadSearch = this.handleTypeaheadSearch.bind(this);\n this.resetTypeahead = this.resetTypeahead.bind(this);\n }\n handleTypeaheadSearch(key, candidates) {\n if (!candidates.length)\n return;\n this.#search.current = this.#search.current + key;\n const currentItem = this.#getCurrentItem();\n const currentMatch = candidates.find((item) => item === currentItem)?.textContent?.trim() ?? \"\";\n const values = candidates.map((item) => item.textContent?.trim() ?? \"\");\n const nextMatch = getNextMatch(values, this.#search.current, currentMatch);\n const newItem = candidates.find((item) => item.textContent?.trim() === nextMatch);\n if (newItem)\n this.#onMatch(newItem);\n return newItem;\n }\n resetTypeahead() {\n this.#search.current = \"\";\n }\n get search() {\n return this.#search.current;\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { untrack } from \"svelte\";\n\timport { FloatingAnchorState } from \"../floating-root.svelte.js\";\n\timport type { AnchorProps } from \"./index.js\";\n\timport type { Measurable } from \"../../../../internal/floating-svelte/types.js\";\n\n\tlet { id, children, virtualEl, ref, tooltip = false }: AnchorProps = $props();\n\n\tFloatingAnchorState.create(\n\t\t{\n\t\t\tid: boxWith(() => id),\n\t\t\tvirtualEl: boxWith(() => virtualEl as unknown as Measurable | null),\n\t\t\tref: untrack(() => ref),\n\t\t},\n\t\tuntrack(() => tooltip)\n\t);\n</script>\n\n{@render children?.()}\n","import { kbd } from \"../../internal/kbd.js\";\nexport const SELECTION_KEYS = [kbd.ENTER, kbd.SPACE];\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, kbd.ARROW_RIGHT],\n rtl: [...SELECTION_KEYS, kbd.ARROW_LEFT],\n};\nexport const SUB_CLOSE_KEYS = {\n ltr: [kbd.ARROW_LEFT],\n rtl: [kbd.ARROW_RIGHT],\n};\nexport function isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nexport function getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nexport function isMouseEvent(event) {\n return event.pointerType === \"mouse\";\n}\n","import { getDocument, getWindow } from \"svelte-toolbelt\";\nimport { isBrowser, isElementHidden, isSelectableInput } from \"./is.js\";\n/**\n * Handles `initialFocus` prop behavior for the\n * Calendar & RangeCalendar components.\n */\nexport function handleCalendarInitialFocus(calendar) {\n if (!isBrowser)\n return;\n const selectedDay = calendar.querySelector(\"[data-selected]\");\n if (selectedDay)\n return focusWithoutScroll(selectedDay);\n const today = calendar.querySelector(\"[data-today]\");\n if (today)\n return focusWithoutScroll(today);\n const firstDay = calendar.querySelector(\"[data-calendar-date]\");\n if (firstDay)\n return focusWithoutScroll(firstDay);\n}\n/**\n * A utility function that focuses an element without scrolling.\n */\nexport function focusWithoutScroll(element) {\n const doc = getDocument(element);\n const win = getWindow(element);\n const scrollPosition = {\n x: win.pageXOffset || doc.documentElement.scrollLeft,\n y: win.pageYOffset || doc.documentElement.scrollTop,\n };\n element.focus();\n win.scrollTo(scrollPosition.x, scrollPosition.y);\n}\n/**\n * A utility function that focuses an element.\n */\nexport function focus(element, { select = false } = {}) {\n if (!element || !element.focus)\n return;\n const doc = getDocument(element);\n if (doc.activeElement === element)\n return;\n const previouslyFocusedElement = doc.activeElement;\n // prevent scroll on focus\n element.focus({ preventScroll: true });\n // only elect if its not the same element, it supports selection, and we need to select it\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select) {\n element.select();\n }\n}\n/**\n * Attempts to focus the first element in a list of candidates.\n * Stops when focus is successful.\n */\nexport function focusFirst(candidates, { select = false } = {}, getActiveElement) {\n const previouslyFocusedElement = getActiveElement();\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (getActiveElement() !== previouslyFocusedElement)\n return true;\n }\n}\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nexport function findVisible(elements, container) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isElementHidden(element, container))\n return element;\n }\n}\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nexport function getTabbableCandidates(container) {\n const nodes = [];\n const doc = getDocument(container);\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n // oxlint-disable-next-line no-explicit-any\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput)\n return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode())\n nodes.push(walker.currentNode);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n/**\n * A utility function that returns the first and last elements within a container that are\n * visible and focusable.\n */\nexport function getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n","import { executeCallbacks } from \"svelte-toolbelt\";\nimport { on } from \"svelte/events\";\n// Using global state to avoid multiple listeners.\nlet isUsingKeyboard = $state(false);\n/**\n * Detects whether the user is currently using the keyboard\n * or not by listening to keyboard and pointer events. Uses shared global\n * state to avoid listener duplication.\n */\nexport class IsUsingKeyboard {\n static _refs = 0; // Reference counting to avoid multiple listeners.\n static _cleanup;\n constructor() {\n $effect(() => {\n if (IsUsingKeyboard._refs === 0) {\n IsUsingKeyboard._cleanup = $effect.root(() => {\n const callbacksToDispose = [];\n const handlePointer = (_) => {\n isUsingKeyboard = false;\n };\n const handleKeydown = (_) => {\n isUsingKeyboard = true;\n };\n callbacksToDispose.push(on(document, \"pointerdown\", handlePointer, {\n capture: true,\n }), on(document, \"keydown\", handleKeydown, {\n capture: true,\n }));\n /**\n * `pointermove` fires constantly, so we only keep it attached while we're\n * actually in keyboard mode and have something to switch off. Once it has\n * flipped `isUsingKeyboard` back to `false`, the listener is removed again\n * and mouse movement costs nothing until the next keypress.\n */\n $effect(() => {\n if (!isUsingKeyboard)\n return;\n return on(document, \"pointermove\", handlePointer, {\n capture: true,\n });\n });\n // Don't forget to spread and call twice.\n return executeCallbacks(...callbacksToDispose);\n });\n }\n IsUsingKeyboard._refs++;\n return () => {\n IsUsingKeyboard._refs--;\n if (IsUsingKeyboard._refs === 0) {\n isUsingKeyboard = false;\n IsUsingKeyboard._cleanup?.();\n }\n };\n });\n }\n get current() {\n return isUsingKeyboard;\n }\n set current(value) {\n isUsingKeyboard = value;\n }\n}\n","import { focusable, isFocusable, isTabbable, tabbable } from \"tabbable\";\nimport { getDocument } from \"svelte-toolbelt\";\nfunction getTabbableOptions() {\n return {\n getShadowRoot: true,\n displayCheck: \n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === \"function\" &&\n ResizeObserver.toString().includes(\"[native code]\")\n ? \"full\"\n : \"none\",\n };\n}\n/**\n * Gets all tabbable elements in the body and finds the next/previous tabbable element\n * from the `currentNode` based on the `direction` provided.\n * @param currentNode - the node we want to get the next/previous tabbable from\n */\nexport function getTabbableFrom(currentNode, direction) {\n if (!isTabbable(currentNode, getTabbableOptions())) {\n return getTabbableFromFocusable(currentNode, direction);\n }\n const doc = getDocument(currentNode);\n const allTabbable = tabbable(doc.body, getTabbableOptions());\n if (direction === \"prev\")\n allTabbable.reverse();\n const activeIndex = allTabbable.indexOf(currentNode);\n if (activeIndex === -1)\n return doc.body;\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nexport function getTabbableFromFocusable(currentNode, direction) {\n const doc = getDocument(currentNode);\n if (!isFocusable(currentNode, getTabbableOptions()))\n return doc.body;\n // find all focusable nodes, since some elements may be focusable but not tabbable\n // such as context menu triggers\n const allFocusable = focusable(doc.body, getTabbableOptions());\n // find index of current node among focusable siblings\n if (direction === \"prev\")\n allFocusable.reverse();\n const activeIndex = allFocusable.indexOf(currentNode);\n if (activeIndex === -1)\n return doc.body;\n const nextFocusableElements = allFocusable.slice(activeIndex + 1);\n // find the next focusable node that is also tabbable\n return nextFocusableElements.find((node) => isTabbable(node, getTabbableOptions())) ?? doc.body;\n}\n","import { afterTick, mergeProps, onDestroyEffect, attachRef, DOMContext, getDocument, getWindow, simpleBox, boxWith, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { FIRST_LAST_KEYS, LAST_KEYS, SELECTION_KEYS, SUB_OPEN_KEYS, getCheckedState, isMouseEvent, } from \"./utils.js\";\nimport { focusFirst } from \"../../internal/focus.js\";\nimport { CustomEventDispatcher } from \"../../internal/events.js\";\nimport { isDisabledElement, isElement, isElementOrSVGElement, isHTMLElement, } from \"../../internal/is.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { createBitsAttrs, getAriaChecked, boolToStr, getDataOpenClosed, boolToEmptyStrOrUndef, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { IsUsingKeyboard } from \"../utilities/is-using-keyboard/is-using-keyboard.svelte.js\";\nimport { getTabbableFrom } from \"../../internal/tabbable.js\";\nimport { isTabbable } from \"tabbable\";\nimport { DOMTypeahead } from \"../../internal/dom-typeahead.svelte.js\";\nimport { RovingFocusGroup } from \"../../internal/roving-focus-group.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { arraysAreEqual } from \"../../internal/arrays.js\";\nimport { CONTEXT_MENU_TRIGGER_ATTR } from \"./context-menu-attributes.js\";\nconst MenuRootContext = new Context(\"Menu.Root\");\nconst MenuMenuContext = new Context(\"Menu.Root | Menu.Sub\");\nconst MenuContentContext = new Context(\"Menu.Content\");\nconst MenuGroupContext = new Context(\"Menu.Group | Menu.RadioGroup\");\nconst MenuRadioGroupContext = new Context(\"Menu.RadioGroup\");\nexport const MenuCheckboxGroupContext = new Context(\"Menu.CheckboxGroup\");\nexport const MenuOpenEvent = new CustomEventDispatcher(\"bitsmenuopen\", {\n bubbles: false,\n cancelable: true,\n});\nexport const menuAttrs = createBitsAttrs({\n component: \"menu\",\n parts: [\n \"trigger\",\n \"content\",\n \"sub-trigger\",\n \"item\",\n \"group\",\n \"group-heading\",\n \"checkbox-group\",\n \"checkbox-item\",\n \"radio-group\",\n \"radio-item\",\n \"separator\",\n \"sub-content\",\n \"arrow\",\n ],\n});\n/*\ninterface MenuIntentDebugSnapshot {\n active: boolean;\n target: IntentTarget | null;\n exitPoint: Point | null;\n pointerPoint: Point | null;\n corridor: Polygon | null;\n intentPolygon: Polygon | null;\n}\n\nclass MenuIntentDebugOverlay {\n readonly #enabled: () => boolean;\n readonly #getDocument: () => Document | null;\n #root: HTMLDivElement | null = null;\n #corridorPolygon: SVGPolygonElement | null = null;\n #intentPolygon: SVGPolygonElement | null = null;\n #exitPoint: SVGCircleElement | null = null;\n #pointerPoint: SVGCircleElement | null = null;\n\n constructor(opts: { enabled: () => boolean; getDocument: () => Document | null }) {\n this.#enabled = opts.enabled;\n this.#getDocument = opts.getDocument;\n }\n\n update(state: MenuIntentDebugSnapshot) {\n if (!this.#enabled()) {\n this.#detach();\n return;\n }\n this.#ensureRoot();\n if (!this.#root) return;\n\n if (!state.active || !state.corridor || !state.intentPolygon || !state.exitPoint) {\n this.#root.style.display = \"none\";\n return;\n }\n\n const color = state.target === \"trigger\" ? \"16 185 129\" : \"59 130 246\";\n const strokeColor = `rgb(${color})`;\n const fillColor = `rgb(${color} / 0.18)`;\n const corridorFill = `rgb(${color} / 0.1)`;\n\n this.#root.style.display = \"block\";\n this.#setPolygon(this.#corridorPolygon, state.corridor, corridorFill, strokeColor, 1.5);\n this.#setPolygon(this.#intentPolygon, state.intentPolygon, fillColor, strokeColor, 2);\n this.#setPoint(this.#exitPoint, state.exitPoint, strokeColor, 5);\n this.#setPoint(\n this.#pointerPoint,\n state.pointerPoint,\n \"rgb(15 23 42 / 0.9)\",\n 4,\n \"rgb(255 255 255 / 0.95)\"\n );\n }\n\n destroy() {\n this.#detach();\n }\n\n #setPolygon(\n node: SVGPolygonElement | null,\n points: Polygon | null,\n fill: string,\n stroke: string,\n strokeWidth: number\n ) {\n if (!node || !points || points.length === 0) return;\n node.setAttribute(\"points\", polygonToSvgPoints(points));\n node.setAttribute(\"fill\", fill);\n node.setAttribute(\"stroke\", stroke);\n node.setAttribute(\"stroke-width\", `${strokeWidth}`);\n node.setAttribute(\"stroke-dasharray\", \"6 4\");\n }\n\n #setPoint(\n node: SVGCircleElement | null,\n point: Point | null,\n fill: string,\n radius: number,\n stroke = \"transparent\"\n ) {\n if (!node || !point) return;\n node.setAttribute(\"cx\", `${point.x}`);\n node.setAttribute(\"cy\", `${point.y}`);\n node.setAttribute(\"r\", `${radius}`);\n node.setAttribute(\"fill\", fill);\n node.setAttribute(\"stroke\", stroke);\n node.setAttribute(\"stroke-width\", \"1.5\");\n }\n\n #ensureRoot() {\n if (this.#root) return;\n const doc = this.#getDocument();\n if (!doc?.body) return;\n\n const root = doc.createElement(\"div\");\n root.setAttribute(\"aria-hidden\", \"true\");\n root.style.position = \"fixed\";\n root.style.inset = \"0\";\n root.style.pointerEvents = \"none\";\n root.style.zIndex = \"2147483647\";\n root.style.display = \"none\";\n\n const svg = doc.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.style.overflow = \"visible\";\n\n const corridorPolygon = doc.createElementNS(SVG_NS, \"polygon\");\n const intentPolygon = doc.createElementNS(SVG_NS, \"polygon\");\n const exitPoint = doc.createElementNS(SVG_NS, \"circle\");\n const pointerPoint = doc.createElementNS(SVG_NS, \"circle\");\n\n svg.append(corridorPolygon, intentPolygon, exitPoint, pointerPoint);\n root.append(svg);\n doc.body.append(root);\n\n this.#root = root;\n this.#corridorPolygon = corridorPolygon;\n this.#intentPolygon = intentPolygon;\n this.#exitPoint = exitPoint;\n this.#pointerPoint = pointerPoint;\n }\n\n #detach() {\n this.#root?.remove();\n this.#root = null;\n this.#corridorPolygon = null;\n this.#intentPolygon = null;\n this.#exitPoint = null;\n this.#pointerPoint = null;\n }\n}\n*/\nclass MenuSubmenuIntent {\n #opts;\n // readonly #debugOverlay: MenuIntentDebugOverlay;\n #cleanupDocMove = null;\n #fallbackTimer = null;\n #active = false;\n #target = null;\n #apex = null;\n #pointerPoint = null;\n // #corridor: Polygon | null = null;\n // #intentPolygon: Polygon | null = null;\n #launchPoint = null;\n constructor(opts) {\n this.#opts = opts;\n // this.#debugOverlay = new MenuIntentDebugOverlay({\n // \tenabled: () => this.#opts.debugMode(),\n // \tgetDocument: () => getDocument(this.#opts.triggerNode() ?? this.#opts.contentNode()),\n // });\n watch([opts.triggerNode, opts.contentNode, opts.enabled], ([triggerNode, contentNode, enabled]) => {\n this.#reset();\n if (!triggerNode || !contentNode || !enabled)\n return;\n const onTriggerMove = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#launchPoint = { x: e.clientX, y: e.clientY };\n if (!this.#active)\n this.#preview(e, \"content\");\n };\n const onTriggerLeave = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#engage(e, \"content\");\n };\n const onContentMove = (e) => {\n if (!isMouseEvent(e))\n return;\n if (!this.#active)\n this.#preview(e, \"trigger\");\n };\n const onContentLeave = (e) => {\n if (!isMouseEvent(e))\n return;\n if (isElement(e.relatedTarget)) {\n const selector = this.#opts.subContentSelector();\n const matchedSubContent = e.relatedTarget.closest(selector);\n if (matchedSubContent &&\n matchedSubContent !== contentNode &&\n matchedSubContent.id) {\n const isChild = !!contentNode.querySelector(`[aria-controls=\"${matchedSubContent.id}\"]`);\n if (isChild) {\n return;\n }\n }\n }\n this.#engage(e, \"trigger\");\n };\n const onTriggerEnter = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#disengage();\n };\n const onContentEnter = (e) => {\n if (!isMouseEvent(e))\n return;\n this.#disengage();\n };\n triggerNode.addEventListener(\"pointermove\", onTriggerMove);\n triggerNode.addEventListener(\"pointerleave\", onTriggerLeave);\n triggerNode.addEventListener(\"pointerenter\", onTriggerEnter);\n contentNode.addEventListener(\"pointermove\", onContentMove);\n contentNode.addEventListener(\"pointerleave\", onContentLeave);\n contentNode.addEventListener(\"pointerenter\", onContentEnter);\n return () => {\n triggerNode.removeEventListener(\"pointermove\", onTriggerMove);\n triggerNode.removeEventListener(\"pointerleave\", onTriggerLeave);\n triggerNode.removeEventListener(\"pointerenter\", onTriggerEnter);\n contentNode.removeEventListener(\"pointermove\", onContentMove);\n contentNode.removeEventListener(\"pointerleave\", onContentLeave);\n contentNode.removeEventListener(\"pointerenter\", onContentEnter);\n this.#reset();\n };\n });\n onDestroyEffect(() => {\n this.#reset();\n // this.#debugOverlay.destroy();\n });\n }\n #parentTargetRect() {\n const parent = this.#opts.parentContentNode();\n if (parent)\n return parent.getBoundingClientRect();\n return this.#opts.triggerNode()?.getBoundingClientRect() ?? null;\n }\n #computePolygons(pointerPt, target) {\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode)\n return null;\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n const side = getSide(triggerRect, contentRect);\n let apex;\n let targetRect;\n let sourceRect;\n if (target === \"content\") {\n apex = this.#active ? (this.#apex ?? pointerPt) : pointerPt;\n targetRect = contentRect;\n }\n else {\n apex = this.#launchPoint ?? pointerPt;\n targetRect = this.#parentTargetRect() ?? triggerRect;\n sourceRect = contentRect;\n }\n this.#apex = apex;\n return {\n corridor: getCorridorPolygon(triggerRect, contentRect, side),\n intent: getIntentPolygon(apex, targetRect, side, target, sourceRect),\n targetRect,\n side,\n };\n }\n #isInSafeZone(pt, corridor, intent) {\n return isPointInPolygon(pt, corridor) || isPointInPolygon(pt, intent);\n }\n #preview(e, target) {\n const pt = { x: e.clientX, y: e.clientY };\n const geo = this.#computePolygons(pt, target);\n if (!geo)\n return;\n this.#target = target;\n this.#pointerPoint = pt;\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n // this.#syncDebug();\n }\n #engage(e, target) {\n if (!this.#opts.enabled())\n return;\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode)\n return;\n const related = e.relatedTarget;\n if (isElement(related)) {\n if (target === \"content\" && contentNode.contains(related))\n return;\n if (target === \"trigger\" && triggerNode.contains(related))\n return;\n }\n const pt = { x: e.clientX, y: e.clientY };\n const geo = this.#computePolygons(pt, target);\n if (!geo)\n return;\n if (!isInsideRect(pt, geo.targetRect) &&\n !this.#isInSafeZone(pt, geo.corridor, geo.intent)) {\n this.#clearVisuals();\n return;\n }\n this.#active = true;\n this.#target = target;\n this.#pointerPoint = pt;\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n this.#opts.setIsPointerInTransit(true);\n this.#attachDocMove();\n this.#startFallback();\n // this.#syncDebug();\n }\n #disengageTimer = null;\n #disengage() {\n if (!this.#active)\n return;\n const wasReturning = this.#target === \"trigger\";\n this.#detachDocMove();\n this.#clearFallback();\n this.#active = false;\n this.#clearVisuals();\n if (wasReturning) {\n this.#clearDisengageTimer();\n this.#disengageTimer = setTimeout(() => {\n this.#disengageTimer = null;\n this.#opts.setIsPointerInTransit(false);\n }, 100);\n }\n else {\n this.#opts.setIsPointerInTransit(false);\n }\n }\n #clearDisengageTimer() {\n if (this.#disengageTimer === null)\n return;\n clearTimeout(this.#disengageTimer);\n this.#disengageTimer = null;\n }\n #intentExit() {\n const pointerPoint = this.#pointerPoint;\n this.#detachDocMove();\n this.#clearFallback();\n this.#clearDisengageTimer();\n this.#active = false;\n this.#opts.setIsPointerInTransit(false);\n this.#clearVisuals();\n this.#opts.onIntentExit(pointerPoint);\n }\n #reset() {\n this.#detachDocMove();\n this.#clearFallback();\n this.#clearDisengageTimer();\n if (this.#active)\n this.#opts.setIsPointerInTransit(false);\n this.#active = false;\n this.#target = null;\n this.#apex = null;\n this.#pointerPoint = null;\n // this.#corridor = null;\n // this.#intentPolygon = null;\n this.#launchPoint = null;\n // this.#syncDebug();\n }\n #isPointerInDescendantSubContent(pt) {\n const contentNode = this.#opts.contentNode();\n if (!contentNode)\n return false;\n const doc = contentNode.ownerDocument;\n const el = doc.elementFromPoint(pt.x, pt.y);\n if (!el)\n return false;\n const selector = this.#opts.subContentSelector();\n const subContent = el.closest(selector);\n if (!subContent || subContent === contentNode)\n return false;\n if (subContent.id)\n return !!contentNode.querySelector(`[aria-controls=\"${subContent.id}\"]`);\n return false;\n }\n #onDocMove = (e) => {\n if (!this.#active || !this.#target)\n return;\n if (!isMouseEvent(e))\n return;\n const triggerNode = this.#opts.triggerNode();\n const contentNode = this.#opts.contentNode();\n if (!triggerNode || !contentNode) {\n this.#intentExit();\n return;\n }\n this.#clearFallback();\n const pt = { x: e.clientX, y: e.clientY };\n this.#pointerPoint = pt;\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n if (this.#target === \"content\" && isInsideRect(pt, contentRect)) {\n this.#disengage();\n return;\n }\n if (this.#target === \"trigger\" && isInsideInsetRect(pt, triggerRect, 4)) {\n this.#disengage();\n return;\n }\n if (this.#isPointerInDescendantSubContent(pt)) {\n this.#startFallback();\n return;\n }\n const geo = this.#computePolygons(pt, this.#target);\n if (!geo) {\n this.#intentExit();\n return;\n }\n // this.#corridor = geo.corridor;\n // this.#intentPolygon = geo.intent;\n // this.#syncDebug();\n if (this.#isInSafeZone(pt, geo.corridor, geo.intent)) {\n this.#startFallback();\n return;\n }\n this.#intentExit();\n };\n #attachDocMove() {\n if (this.#cleanupDocMove)\n return;\n const doc = getDocument(this.#opts.triggerNode() ?? this.#opts.contentNode());\n if (!doc)\n return;\n doc.addEventListener(\"pointermove\", this.#onDocMove, true);\n this.#cleanupDocMove = () => {\n doc.removeEventListener(\"pointermove\", this.#onDocMove, true);\n this.#cleanupDocMove = null;\n };\n }\n #detachDocMove() {\n this.#cleanupDocMove?.();\n }\n #startFallback() {\n this.#clearFallback();\n this.#fallbackTimer = setTimeout(() => {\n this.#fallbackTimer = null;\n if (this.#active)\n this.#intentExit();\n }, 500);\n }\n #clearFallback() {\n if (this.#fallbackTimer === null)\n return;\n clearTimeout(this.#fallbackTimer);\n this.#fallbackTimer = null;\n }\n #clearVisuals() {\n this.#target = null;\n this.#apex = null;\n this.#pointerPoint = null;\n // this.#corridor = null;\n // this.#intentPolygon = null;\n // this.#syncDebug();\n }\n}\n/*\nfunction polygonToSvgPoints(points: Polygon): string {\n return points.map((point) => `${point.x},${point.y}`).join(\" \");\n}\n*/\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * (y - yi)) / (yj - yi) + xi);\n if (intersect)\n inside = !inside;\n }\n return inside;\n}\nfunction isInsideRect(point, rect) {\n return (point.x >= rect.left &&\n point.x <= rect.right &&\n point.y >= rect.top &&\n point.y <= rect.bottom);\n}\nfunction isInsideInsetRect(point, rect, inset) {\n return (point.x >= rect.left + inset &&\n point.x <= rect.right - inset &&\n point.y >= rect.top + inset &&\n point.y <= rect.bottom - inset);\n}\nfunction getSide(triggerRect, contentRect) {\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n const contentCenterX = contentRect.left + contentRect.width / 2;\n const contentCenterY = contentRect.top + contentRect.height / 2;\n const deltaX = contentCenterX - triggerCenterX;\n const deltaY = contentCenterY - triggerCenterY;\n if (Math.abs(deltaX) > Math.abs(deltaY)) {\n return deltaX > 0 ? \"right\" : \"left\";\n }\n return deltaY > 0 ? \"bottom\" : \"top\";\n}\nfunction getCorridorPolygon(triggerRect, contentRect, side) {\n const buffer = 2;\n switch (side) {\n case \"top\":\n return [\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: triggerRect.top },\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: contentRect.bottom },\n {\n x: Math.max(triggerRect.right, contentRect.right) + buffer,\n y: contentRect.bottom,\n },\n { x: Math.max(triggerRect.right, contentRect.right) + buffer, y: triggerRect.top },\n ];\n case \"bottom\":\n return [\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: triggerRect.bottom },\n { x: Math.min(triggerRect.left, contentRect.left) - buffer, y: contentRect.top },\n { x: Math.max(triggerRect.right, contentRect.right) + buffer, y: contentRect.top },\n {\n x: Math.max(triggerRect.right, contentRect.right) + buffer,\n y: triggerRect.bottom,\n },\n ];\n case \"left\":\n return [\n { x: triggerRect.left, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n { x: contentRect.right, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n {\n x: contentRect.right,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n {\n x: triggerRect.left,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n ];\n case \"right\":\n return [\n { x: triggerRect.right, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n { x: contentRect.left, y: Math.min(triggerRect.top, contentRect.top) - buffer },\n {\n x: contentRect.left,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n {\n x: triggerRect.right,\n y: Math.max(triggerRect.bottom, contentRect.bottom) + buffer,\n },\n ];\n }\n}\nfunction getIntentPolygon(exitPoint, targetRect, side, target, sourceRect) {\n const edgeBuffer = 8;\n const effectiveSide = target === \"trigger\" ? flipSide(side) : side;\n const top = sourceRect\n ? Math.min(targetRect.top, sourceRect.top) - edgeBuffer\n : targetRect.top - edgeBuffer;\n const bottom = sourceRect\n ? Math.max(targetRect.bottom, sourceRect.bottom) + edgeBuffer\n : targetRect.bottom + edgeBuffer;\n const left = sourceRect\n ? Math.min(targetRect.left, sourceRect.left) - edgeBuffer\n : targetRect.left - edgeBuffer;\n const right = sourceRect\n ? Math.max(targetRect.right, sourceRect.right) + edgeBuffer\n : targetRect.right + edgeBuffer;\n switch (effectiveSide) {\n case \"right\":\n return [exitPoint, { x: targetRect.left, y: top }, { x: targetRect.left, y: bottom }];\n case \"left\":\n return [exitPoint, { x: targetRect.right, y: top }, { x: targetRect.right, y: bottom }];\n case \"bottom\":\n return [exitPoint, { x: left, y: targetRect.top }, { x: right, y: targetRect.top }];\n case \"top\":\n return [\n exitPoint,\n { x: left, y: targetRect.bottom },\n { x: right, y: targetRect.bottom },\n ];\n }\n}\nfunction flipSide(side) {\n switch (side) {\n case \"top\":\n return \"bottom\";\n case \"bottom\":\n return \"top\";\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n }\n}\nexport class MenuRootState {\n static create(opts) {\n const root = new MenuRootState(opts);\n return MenuRootContext.set(root);\n }\n opts;\n isUsingKeyboard = new IsUsingKeyboard();\n ignoreCloseAutoFocus = $state(false);\n isPointerInTransit = $state(false);\n constructor(opts) {\n this.opts = opts;\n }\n getBitsAttr = (part) => {\n return menuAttrs.getAttr(part, this.opts.variant.current);\n };\n}\nexport class MenuMenuState {\n static create(opts, root) {\n return MenuMenuContext.set(new MenuMenuState(opts, root, null));\n }\n opts;\n root;\n parentMenu;\n // the content replaces this box when it mounts; a plain field would leave every\n // derived that read the empty box (a trigger rendered first) pointing at it forever\n contentId = $state.raw(boxWith(() => \"\"));\n contentNode = $state(null);\n contentPresence;\n triggerNode = $state(null);\n constructor(opts, root, parentMenu) {\n this.opts = opts;\n this.root = root;\n this.parentMenu = parentMenu;\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n shouldSkipExitAnimation: () => {\n if (this.root.opts.variant.current !== \"menubar\" || this.parentMenu !== null) {\n return false;\n }\n return this.root.opts.shouldSkipExitAnimation?.() ?? false;\n },\n });\n if (parentMenu) {\n watch(() => parentMenu.opts.open.current, () => {\n if (parentMenu.opts.open.current)\n return;\n this.opts.open.current = false;\n });\n }\n }\n toggleOpen() {\n this.opts.open.current = !this.opts.open.current;\n }\n onOpen() {\n this.opts.open.current = true;\n }\n onClose() {\n this.opts.open.current = false;\n }\n}\nexport class MenuContentState {\n static create(opts) {\n return MenuContentContext.set(new MenuContentState(opts, MenuMenuContext.get()));\n }\n opts;\n parentMenu;\n rovingFocusGroup;\n domContext;\n attachment;\n search = $state(\"\");\n #timer = 0;\n #handleTypeaheadSearch;\n mounted = $state(false);\n /**\n * The item a press started on, and where. The content can scroll under a still\n * pointer before the release, which then lands on a neighbouring item.\n */\n pressedItem = null;\n #isSub;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.domContext = new DOMContext(opts.ref);\n this.attachment = attachRef(this.opts.ref, (v) => {\n if (this.parentMenu.contentNode !== v) {\n this.parentMenu.contentNode = v;\n }\n });\n parentMenu.contentId = opts.id;\n this.#isSub = opts.isSub ?? false;\n this.onkeydown = this.onkeydown.bind(this);\n this.onblur = this.onblur.bind(this);\n this.onfocus = this.onfocus.bind(this);\n this.handleInteractOutside = this.handleInteractOutside.bind(this);\n new MenuSubmenuIntent({\n contentNode: () => this.parentMenu.contentNode,\n triggerNode: () => this.parentMenu.triggerNode,\n parentContentNode: () => this.parentMenu.parentMenu?.contentNode ?? null,\n subContentSelector: () => `[${this.parentMenu.root.getBitsAttr(\"sub-content\")}]`,\n // debugMode: () => this.parentMenu.root.opts.debugMode.current,\n enabled: () => this.parentMenu.opts.open.current &&\n Boolean(this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(\"sub-trigger\"))),\n onIntentExit: (pointerPoint) => {\n this.parentMenu.opts.open.current = false;\n this.#dispatchPointerMoveToHoveredSubTrigger(pointerPoint);\n },\n setIsPointerInTransit: (value) => {\n this.parentMenu.root.isPointerInTransit = value;\n },\n });\n this.#handleTypeaheadSearch = new DOMTypeahead({\n getActiveElement: () => this.domContext.getActiveElement(),\n getWindow: () => this.domContext.getWindow(),\n }).handleTypeaheadSearch;\n this.rovingFocusGroup = new RovingFocusGroup({\n rootNode: boxWith(() => this.parentMenu.contentNode),\n candidateAttr: this.parentMenu.root.getBitsAttr(\"item\"),\n loop: this.opts.loop,\n orientation: boxWith(() => \"vertical\"),\n });\n watch(() => this.parentMenu.contentNode, (contentNode) => {\n if (!contentNode)\n return;\n const handler = () => {\n afterTick(() => {\n if (!this.parentMenu.root.isUsingKeyboard.current)\n return;\n this.rovingFocusGroup.focusFirstCandidate();\n });\n };\n return MenuOpenEvent.listen(contentNode, handler);\n });\n $effect(() => {\n if (!this.parentMenu.opts.open.current) {\n this.domContext.getWindow().clearTimeout(this.#timer);\n this.clearPressedItem();\n }\n });\n }\n #getCandidateNodes() {\n const node = this.parentMenu.contentNode;\n if (!node)\n return [];\n const candidates = Array.from(node.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(\"item\")}]:not([data-disabled])`));\n return candidates;\n }\n #isPointerMovingToSubmenu() {\n return this.parentMenu.root.isPointerInTransit;\n }\n #dispatchPointerMoveToHoveredSubTrigger(pointerPoint) {\n if (!pointerPoint)\n return;\n const parentContentNode = this.parentMenu.parentMenu?.contentNode;\n if (!parentContentNode)\n return;\n const hoveredNode = this.domContext\n .getDocument()\n .elementFromPoint(pointerPoint.x, pointerPoint.y);\n if (!isElement(hoveredNode))\n return;\n const hoveredSubTrigger = hoveredNode.closest(`[${this.parentMenu.root.getBitsAttr(\"sub-trigger\")}]`);\n if (!hoveredSubTrigger || !parentContentNode.contains(hoveredSubTrigger))\n return;\n if (hoveredSubTrigger === this.parentMenu.triggerNode)\n return;\n hoveredSubTrigger.dispatchEvent(new PointerEvent(\"pointermove\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\",\n clientX: pointerPoint.x,\n clientY: pointerPoint.y,\n }));\n }\n onCloseAutoFocus = (e) => {\n this.opts.onCloseAutoFocus.current?.(e);\n if (e.defaultPrevented || this.#isSub)\n return;\n if (this.parentMenu.root.ignoreCloseAutoFocus) {\n e.preventDefault();\n return;\n }\n if (this.parentMenu.triggerNode && isTabbable(this.parentMenu.triggerNode)) {\n e.preventDefault();\n this.parentMenu.triggerNode.focus();\n }\n };\n handleTabKeyDown(e) {\n /**\n * We locate the root `menu`'s trigger by going up the tree until\n * we find a menu that has no parent. This will allow us to focus the next\n * tabbable element before/after the root trigger.\n */\n let rootMenu = this.parentMenu;\n while (rootMenu.parentMenu !== null) {\n rootMenu = rootMenu.parentMenu;\n }\n if (!rootMenu.triggerNode)\n return;\n e.preventDefault();\n const nodeToFocus = getTabbableFrom(rootMenu.triggerNode, e.shiftKey ? \"prev\" : \"next\");\n if (nodeToFocus) {\n /**\n * We set a flag to ignore the `onCloseAutoFocus` event handler\n * as well as the fallbacks inside the focus scope to prevent\n * race conditions causing focus to fall back to the body even\n * though we're trying to focus the next tabbable element.\n */\n this.parentMenu.root.ignoreCloseAutoFocus = true;\n rootMenu.onClose();\n afterTick(() => {\n nodeToFocus.focus();\n afterTick(() => {\n this.parentMenu.root.ignoreCloseAutoFocus = false;\n });\n });\n }\n else {\n this.domContext.getDocument().body.focus();\n }\n }\n onkeydown(e) {\n if (e.defaultPrevented)\n return;\n if (e.key === kbd.TAB) {\n this.handleTabKeyDown(e);\n return;\n }\n const target = e.target;\n const currentTarget = e.currentTarget;\n if (!isHTMLElement(target) || !isHTMLElement(currentTarget))\n return;\n const isKeydownInside = target.closest(`[${this.parentMenu.root.getBitsAttr(\"content\")}]`)?.id ===\n this.parentMenu.contentId.current;\n const isModifierKey = e.ctrlKey || e.altKey || e.metaKey;\n const isCharacterKey = e.key.length === 1;\n const kbdFocusedEl = this.rovingFocusGroup.handleKeydown(target, e);\n if (kbdFocusedEl)\n return;\n // prevent space from being considered with typeahead\n if (e.code === \"Space\")\n return;\n const candidateNodes = this.#getCandidateNodes();\n if (isKeydownInside) {\n if (!isModifierKey && isCharacterKey) {\n this.#handleTypeaheadSearch(e.key, candidateNodes);\n }\n }\n // focus first/last based on key pressed\n if (e.target?.id !== this.parentMenu.contentId.current)\n return;\n if (!FIRST_LAST_KEYS.includes(e.key))\n return;\n e.preventDefault();\n if (LAST_KEYS.includes(e.key)) {\n candidateNodes.reverse();\n }\n focusFirst(candidateNodes, { select: false }, () => this.domContext.getActiveElement());\n }\n onblur(e) {\n if (!isElement(e.currentTarget))\n return;\n if (!isElement(e.target))\n return;\n // clear search buffer when leaving the menu\n if (!e.currentTarget.contains?.(e.target)) {\n this.domContext.getWindow().clearTimeout(this.#timer);\n this.search = \"\";\n }\n }\n onfocus(_) {\n if (!this.parentMenu.root.isUsingKeyboard.current)\n return;\n afterTick(() => this.rovingFocusGroup.focusFirstCandidate());\n }\n onItemEnter() {\n return this.#isPointerMovingToSubmenu();\n }\n onItemLeave(e) {\n if (e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(\"sub-trigger\")))\n return;\n if (this.#isPointerMovingToSubmenu() || this.parentMenu.root.isUsingKeyboard.current)\n return;\n const contentNode = this.parentMenu.contentNode;\n contentNode?.focus({ preventScroll: true });\n this.rovingFocusGroup.setCurrentTabStopId(\"\");\n }\n onTriggerLeave() {\n if (this.#isPointerMovingToSubmenu())\n return true;\n return false;\n }\n handleInteractOutside(e) {\n if (!isElementOrSVGElement(e.target))\n return;\n const triggerId = this.parentMenu.triggerNode?.id;\n if (e.target.id === triggerId) {\n e.preventDefault();\n return;\n }\n if (e.target.closest(`#${triggerId}`)) {\n e.preventDefault();\n return;\n }\n /**\n * when the menu closes due to an outside pointer interaction (for example,\n * clicking another dropdown trigger), avoid focusing this menu's trigger\n * to prevent stealing focus from the new interaction target.\n */\n this.parentMenu.root.ignoreCloseAutoFocus = true;\n afterTick(() => {\n this.parentMenu.root.ignoreCloseAutoFocus = false;\n });\n }\n clearPressedItem = () => {\n this.pressedItem = null;\n };\n get shouldRender() {\n return this.parentMenu.contentPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({ open: this.parentMenu.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n [this.parentMenu.root.getBitsAttr(\"content\")]: \"\",\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n ...getDataTransitionAttrs(this.parentMenu.contentPresence.transitionStatus),\n onkeydown: this.onkeydown,\n onblur: this.onblur,\n onfocus: this.onfocus,\n // every press starts fresh, so a press that ended off an item isn't reused\n onpointerdowncapture: this.clearPressedItem,\n dir: this.parentMenu.root.opts.dir.current,\n style: {\n pointerEvents: \"auto\",\n contain: \"layout style\",\n },\n ...this.attachment,\n }));\n popperProps = {\n onCloseAutoFocus: (e) => this.onCloseAutoFocus(e),\n };\n}\nclass MenuItemSharedState {\n opts;\n content;\n attachment;\n #isFocused = $state(false);\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.attachment = attachRef(this.opts.ref);\n this.onpointermove = this.onpointermove.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n this.onfocus = this.onfocus.bind(this);\n this.onblur = this.onblur.bind(this);\n }\n onpointermove(e) {\n if (e.defaultPrevented)\n return;\n if (!isMouseEvent(e))\n return;\n if (this.opts.disabled.current) {\n this.content.onItemLeave(e);\n }\n else {\n const defaultPrevented = this.content.onItemEnter();\n if (defaultPrevented)\n return;\n const item = e.currentTarget;\n if (!isHTMLElement(item))\n return;\n item.focus({ preventScroll: true });\n }\n }\n onpointerleave(e) {\n if (e.defaultPrevented)\n return;\n if (!isMouseEvent(e))\n return;\n this.content.onItemLeave(e);\n }\n onfocus(e) {\n afterTick(() => {\n if (e.defaultPrevented || this.opts.disabled.current)\n return;\n this.#isFocused = true;\n });\n }\n onblur(e) {\n afterTick(() => {\n if (e.defaultPrevented)\n return;\n this.#isFocused = false;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n tabindex: -1,\n role: \"menuitem\",\n \"aria-disabled\": boolToStr(this.opts.disabled.current),\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-highlighted\": this.#isFocused ? \"\" : undefined,\n [this.content.parentMenu.root.getBitsAttr(\"item\")]: \"\",\n //\n onpointermove: this.onpointermove,\n onpointerleave: this.onpointerleave,\n onfocus: this.onfocus,\n onblur: this.onblur,\n ...this.attachment,\n }));\n}\nexport class MenuItemState {\n static create(opts) {\n const item = new MenuItemSharedState(opts, MenuContentContext.get());\n return new MenuItemState(opts, item);\n }\n opts;\n item;\n root;\n constructor(opts, item) {\n this.opts = opts;\n this.item = item;\n this.root = item.content.parentMenu.root;\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onpointerup = this.onpointerup.bind(this);\n }\n #handleSelect() {\n if (this.item.opts.disabled.current)\n return;\n const selectEvent = new CustomEvent(\"menuitemselect\", { bubbles: true, cancelable: true });\n this.opts.onSelect.current(selectEvent);\n if (selectEvent.defaultPrevented) {\n this.item.content.parentMenu.root.isUsingKeyboard.current = false;\n return;\n }\n if (this.opts.closeOnSelect.current) {\n this.item.content.parentMenu.root.opts.onClose();\n }\n }\n onkeydown(e) {\n const isTypingAhead = this.item.content.search !== \"\";\n if (this.item.opts.disabled.current || (isTypingAhead && e.key === kbd.SPACE))\n return;\n if (SELECTION_KEYS.includes(e.key)) {\n if (!isHTMLElement(e.currentTarget))\n return;\n e.currentTarget.click();\n /**\n * We prevent default browser behavior for selection keys as they should trigger\n * a selection only:\n * - prevents space from scrolling the page.\n * - if keydown causes focus to move, prevents keydown from firing on the new target.\n */\n e.preventDefault();\n }\n }\n onclick(_) {\n if (this.item.opts.disabled.current)\n return;\n this.#handleSelect();\n }\n onpointerup(e) {\n const content = this.item.content;\n const press = content.pressedItem;\n content.pressedItem = null;\n if (e.defaultPrevented)\n return;\n // pressed here: the native click selects\n if (press?.item === this)\n return;\n // released on another item without the pointer moving: the content moved under it\n const target = press && Math.hypot(e.clientX - press.x, e.clientY - press.y) < 4\n ? press.item.item.opts.ref.current\n : e.currentTarget;\n if (!isHTMLElement(target))\n return;\n target.click();\n }\n onpointerdown(e) {\n this.item.content.pressedItem = { item: this, x: e.clientX, y: e.clientY };\n }\n props = $derived.by(() => mergeProps(this.item.props, {\n onclick: this.onclick,\n onpointerdown: this.onpointerdown,\n onpointerup: this.onpointerup,\n onkeydown: this.onkeydown,\n }));\n}\nexport class MenuSubTriggerState {\n static create(opts) {\n const content = MenuContentContext.get();\n const item = new MenuItemSharedState(opts, content);\n const submenu = MenuMenuContext.get();\n return new MenuSubTriggerState(opts, item, content, submenu);\n }\n opts;\n item;\n content;\n submenu;\n attachment;\n #openTimer = null;\n constructor(opts, item, content, submenu) {\n this.opts = opts;\n this.item = item;\n this.content = content;\n this.submenu = submenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.submenu.triggerNode = v));\n this.onpointerleave = this.onpointerleave.bind(this);\n this.onpointermove = this.onpointermove.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n onDestroyEffect(() => {\n this.#clearOpenTimer();\n });\n }\n #clearOpenTimer() {\n if (this.#openTimer === null)\n return;\n this.content.domContext.getWindow().clearTimeout(this.#openTimer);\n this.#openTimer = null;\n }\n onpointermove(e) {\n if (!isMouseEvent(e))\n return;\n if (this.submenu.root.isPointerInTransit) {\n if (this.#openTimer !== null)\n this.#clearOpenTimer();\n return;\n }\n if (!this.item.opts.disabled.current &&\n !this.submenu.opts.open.current &&\n !this.#openTimer) {\n const openDelay = this.opts.openDelay.current;\n if (openDelay <= 0) {\n this.submenu.onOpen();\n return;\n }\n this.#openTimer = this.content.domContext.setTimeout(() => {\n if (this.submenu.root.isPointerInTransit) {\n this.#clearOpenTimer();\n return;\n }\n this.submenu.onOpen();\n this.#clearOpenTimer();\n }, openDelay);\n }\n }\n onpointerleave(e) {\n if (!isMouseEvent(e))\n return;\n this.#clearOpenTimer();\n }\n onkeydown(e) {\n const isTypingAhead = this.content.search !== \"\";\n if (this.item.opts.disabled.current || (isTypingAhead && e.key === kbd.SPACE))\n return;\n if (SUB_OPEN_KEYS[this.submenu.root.opts.dir.current].includes(e.key)) {\n e.currentTarget.click();\n e.preventDefault();\n }\n }\n onclick(e) {\n if (this.item.opts.disabled.current)\n return;\n /**\n * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n * and we rely heavily on `onFocusOutside` for submenus to close when switching\n * between separate submenus.\n */\n if (!isHTMLElement(e.currentTarget))\n return;\n e.currentTarget.focus();\n const selectEvent = new CustomEvent(\"menusubtriggerselect\", {\n bubbles: true,\n cancelable: true,\n });\n this.opts.onSelect.current(selectEvent);\n if (!this.submenu.opts.open.current) {\n this.submenu.onOpen();\n afterTick(() => {\n const contentNode = this.submenu.contentNode;\n if (!contentNode)\n return;\n MenuOpenEvent.dispatch(contentNode);\n });\n }\n }\n props = $derived.by(() => mergeProps({\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": boolToStr(this.submenu.opts.open.current),\n \"data-state\": getDataOpenClosed(this.submenu.opts.open.current),\n \"aria-controls\": this.submenu.opts.open.current\n ? this.submenu.contentId.current\n : undefined,\n [this.submenu.root.getBitsAttr(\"sub-trigger\")]: \"\",\n onclick: this.onclick,\n onpointermove: this.onpointermove,\n onpointerleave: this.onpointerleave,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }, this.item.props));\n}\nexport class MenuCheckboxItemState {\n static create(opts, checkboxGroup) {\n const item = new MenuItemState(opts, new MenuItemSharedState(opts, MenuContentContext.get()));\n return new MenuCheckboxItemState(opts, item, checkboxGroup);\n }\n opts;\n item;\n group;\n constructor(opts, item, group = null) {\n this.opts = opts;\n this.item = item;\n this.group = group;\n // Watch for value changes in the group if we're part of one\n if (this.group) {\n watch(() => this.group.opts.value.current, (groupValues) => {\n this.opts.checked.current = groupValues.includes(this.opts.value.current);\n });\n // Watch for checked state changes and sync with group\n watch(() => this.opts.checked.current, (checked) => {\n if (checked) {\n this.group.addValue(this.opts.value.current);\n }\n else {\n this.group.removeValue(this.opts.value.current);\n }\n });\n }\n }\n toggleChecked() {\n if (this.opts.indeterminate.current) {\n this.opts.indeterminate.current = false;\n this.opts.checked.current = true;\n }\n else {\n this.opts.checked.current = !this.opts.checked.current;\n }\n }\n snippetProps = $derived.by(() => ({\n checked: this.opts.checked.current,\n indeterminate: this.opts.indeterminate.current,\n }));\n props = $derived.by(() => ({\n ...this.item.props,\n role: \"menuitemcheckbox\",\n \"aria-checked\": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),\n \"data-state\": getCheckedState(this.opts.checked.current),\n [this.item.root.getBitsAttr(\"checkbox-item\")]: \"\",\n }));\n}\nexport class MenuGroupState {\n static create(opts) {\n return MenuGroupContext.set(new MenuGroupState(opts, MenuRootContext.get()));\n }\n opts;\n root;\n attachment;\n groupHeadingId = $state(undefined);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n [this.root.getBitsAttr(\"group\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuGroupHeadingState {\n static create(opts) {\n // Try to get checkbox group first, then radio group, then regular group\n const checkboxGroup = MenuCheckboxGroupContext.getOr(null);\n if (checkboxGroup)\n return new MenuGroupHeadingState(opts, checkboxGroup);\n const radioGroup = MenuRadioGroupContext.getOr(null);\n if (radioGroup)\n return new MenuGroupHeadingState(opts, radioGroup);\n return new MenuGroupHeadingState(opts, MenuGroupContext.get());\n }\n opts;\n group;\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.attachment = attachRef(this.opts.ref, (v) => (this.group.groupHeadingId = v?.id));\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.group.root.getBitsAttr(\"group-heading\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuSeparatorState {\n static create(opts) {\n return new MenuSeparatorState(opts, MenuRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"separator\",\n [this.root.getBitsAttr(\"separator\")]: \"\",\n ...this.attachment,\n }));\n}\nexport class MenuArrowState {\n static create() {\n return new MenuArrowState(MenuRootContext.get());\n }\n root;\n constructor(root) {\n this.root = root;\n }\n props = $derived.by(() => ({\n [this.root.getBitsAttr(\"arrow\")]: \"\",\n }));\n}\nexport class MenuRadioGroupState {\n static create(opts) {\n return MenuGroupContext.set(MenuRadioGroupContext.set(new MenuRadioGroupState(opts, MenuContentContext.get())));\n }\n opts;\n content;\n attachment;\n groupHeadingId = $state(null);\n root;\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.root = content.parentMenu.root;\n this.attachment = attachRef(this.opts.ref);\n }\n setValue(v) {\n this.opts.value.current = v;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"radio-group\")]: \"\",\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n ...this.attachment,\n }));\n}\nexport class MenuRadioItemState {\n static create(opts) {\n const radioGroup = MenuRadioGroupContext.get();\n const sharedItem = new MenuItemSharedState(opts, radioGroup.content);\n const item = new MenuItemState(opts, sharedItem);\n return new MenuRadioItemState(opts, item, radioGroup);\n }\n opts;\n item;\n group;\n attachment;\n isChecked = $derived.by(() => this.group.opts.value.current === this.opts.value.current);\n constructor(opts, item, group) {\n this.opts = opts;\n this.item = item;\n this.group = group;\n this.attachment = attachRef(this.opts.ref);\n }\n selectValue() {\n this.group.setValue(this.opts.value.current);\n }\n props = $derived.by(() => ({\n [this.group.root.getBitsAttr(\"radio-item\")]: \"\",\n ...this.item.props,\n role: \"menuitemradio\",\n \"aria-checked\": getAriaChecked(this.isChecked, false),\n \"data-state\": getCheckedState(this.isChecked),\n ...this.attachment,\n }));\n}\nexport class DropdownMenuTriggerState {\n static create(opts) {\n return new DropdownMenuTriggerState(opts, MenuMenuContext.get());\n }\n opts;\n parentMenu;\n attachment;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.parentMenu.triggerNode = v));\n }\n onclick = (e) => {\n /**\n * MacOS VoiceOver sends a click in Safari/Firefox bypassing the keydown event\n * when V0+Space is pressed. Since we already handle the keydown event and the\n * pointerdown events separately, we ignore it if the detail is not 0.\n */\n if (this.opts.disabled.current || e.detail !== 0)\n return;\n this.parentMenu.toggleOpen();\n e.preventDefault();\n };\n onpointerdown = (e) => {\n if (this.opts.disabled.current || isDisabledElement(this.opts.ref.current))\n return;\n if (e.pointerType === \"touch\")\n return e.preventDefault();\n if (e.button === 0 && e.ctrlKey === false) {\n this.parentMenu.toggleOpen();\n // prevent trigger focusing when opening to allow\n // the content to be given focus without competition\n if (!this.parentMenu.opts.open.current)\n e.preventDefault();\n }\n };\n onpointerup = (e) => {\n if (this.opts.disabled.current || isDisabledElement(this.opts.ref.current))\n return;\n if (e.pointerType === \"touch\") {\n e.preventDefault();\n this.parentMenu.toggleOpen();\n }\n };\n onkeydown = (e) => {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n this.parentMenu.toggleOpen();\n e.preventDefault();\n return;\n }\n if (e.key === kbd.ARROW_DOWN) {\n this.parentMenu.onOpen();\n e.preventDefault();\n }\n };\n #ariaControls = $derived.by(() => {\n if (this.parentMenu.opts.open.current && this.parentMenu.contentId.current)\n return this.parentMenu.contentId.current;\n return undefined;\n });\n props = $derived.by(() => ({\n id: this.opts.id.current,\n disabled: this.opts.disabled.current,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": boolToStr(this.parentMenu.opts.open.current),\n \"aria-controls\": this.#ariaControls,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n [this.parentMenu.root.getBitsAttr(\"trigger\")]: \"\",\n //\n onclick: this.onclick,\n onpointerdown: this.onpointerdown,\n onpointerup: this.onpointerup,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\nexport class ContextMenuTriggerState {\n static create(opts) {\n return new ContextMenuTriggerState(opts, MenuMenuContext.get());\n }\n opts;\n parentMenu;\n attachment;\n #point = $state({ x: 0, y: 0 });\n virtualElement = simpleBox({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...this.#point }),\n });\n #longPressTimer = null;\n constructor(opts, parentMenu) {\n this.opts = opts;\n this.parentMenu = parentMenu;\n this.attachment = attachRef(this.opts.ref, (v) => (this.parentMenu.triggerNode = v));\n this.oncontextmenu = this.oncontextmenu.bind(this);\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onpointermove = this.onpointermove.bind(this);\n this.onpointercancel = this.onpointercancel.bind(this);\n this.onpointerup = this.onpointerup.bind(this);\n watch(() => this.#point, (point) => {\n this.virtualElement.current = {\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...point }),\n };\n });\n watch(() => this.opts.disabled.current, (isDisabled) => {\n if (isDisabled) {\n this.#clearLongPressTimer();\n }\n });\n onDestroyEffect(() => this.#clearLongPressTimer());\n }\n #clearLongPressTimer() {\n if (this.#longPressTimer === null)\n return;\n getWindow(this.opts.ref.current).clearTimeout(this.#longPressTimer);\n }\n #handleOpen(e) {\n this.#point = { x: e.clientX, y: e.clientY };\n this.parentMenu.onOpen();\n }\n oncontextmenu(e) {\n if (e.defaultPrevented || this.opts.disabled.current)\n return;\n this.#clearLongPressTimer();\n this.#handleOpen(e);\n e.preventDefault();\n this.parentMenu.contentNode?.focus();\n }\n onpointerdown(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n this.#longPressTimer = getWindow(this.opts.ref.current).setTimeout(() => this.#handleOpen(e), 700);\n }\n onpointermove(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n onpointercancel(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n onpointerup(e) {\n if (this.opts.disabled.current || isMouseEvent(e))\n return;\n this.#clearLongPressTimer();\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n disabled: this.opts.disabled.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"data-state\": getDataOpenClosed(this.parentMenu.opts.open.current),\n [CONTEXT_MENU_TRIGGER_ATTR]: \"\",\n tabindex: -1,\n onpointerdown: this.onpointerdown,\n onpointermove: this.onpointermove,\n onpointercancel: this.onpointercancel,\n onpointerup: this.onpointerup,\n oncontextmenu: this.oncontextmenu,\n ...this.attachment,\n }));\n}\nexport class MenuCheckboxGroupState {\n static create(opts) {\n return MenuCheckboxGroupContext.set(new MenuCheckboxGroupState(opts, MenuContentContext.get()));\n }\n opts;\n content;\n root;\n attachment;\n groupHeadingId = $state(null);\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n this.root = content.parentMenu.root;\n this.attachment = attachRef(this.opts.ref);\n }\n addValue(checkboxValue) {\n if (!checkboxValue)\n return;\n if (!this.opts.value.current.includes(checkboxValue)) {\n const newValue = [...$state.snapshot(this.opts.value.current), checkboxValue];\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n }\n removeValue(checkboxValue) {\n if (!checkboxValue)\n return;\n const index = this.opts.value.current.indexOf(checkboxValue);\n if (index === -1)\n return;\n const newValue = this.opts.value.current.filter((v) => v !== checkboxValue);\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"checkbox-group\")]: \"\",\n role: \"group\",\n \"aria-labelledby\": this.groupHeadingId,\n ...this.attachment,\n }));\n}\nexport class MenuSubmenuState {\n static create(opts) {\n const menu = MenuMenuContext.get();\n return MenuMenuContext.set(new MenuMenuState(opts, menu.root, menu));\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { ContextMenuRootProps } from \"../types.js\";\n\timport FloatingLayer from \"../../utilities/floating-layer/components/floating-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { MenuMenuState, MenuRootState } from \"../../menu/menu.svelte.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tdir = \"ltr\",\n\t\t// debugMode = false,\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: ContextMenuRootProps = $props();\n\n\tconst root = MenuRootState.create({\n\t\tvariant: boxWith(() => \"context-menu\" as const),\n\t\tdir: boxWith(() => dir),\n\t\t// debugMode: boxWith(() => debugMode),\n\t\tonClose: () => {\n\t\t\topen = false;\n\t\t\tonOpenChange?.(false);\n\t\t},\n\t});\n\n\tMenuMenuState.create(\n\t\t{\n\t\t\topen: boxWith(\n\t\t\t\t() => open,\n\t\t\t\t(v) => {\n\t\t\t\t\topen = v;\n\t\t\t\t\tonOpenChange(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t\t},\n\t\troot\n\t);\n</script>\n\n<FloatingLayer>\n\t{@render children?.()}\n</FloatingLayer>\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { MenuItemProps } from \"../types.js\";\n\timport { MenuItemState } from \"../menu.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tdisabled = false,\n\t\tonSelect = noop,\n\t\tcloseOnSelect = true,\n\t\t...restProps\n\t}: MenuItemProps = $props();\n\n\tconst itemState = MenuItemState.create({\n\t\tid: boxWith(() => id),\n\t\tdisabled: boxWith(() => disabled),\n\t\tonSelect: boxWith(() => onSelect),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tcloseOnSelect: boxWith(() => closeOnSelect),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, itemState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ContextMenuContentProps } from \"../types.js\";\n\timport { MenuContentState } from \"../../menu/menu.svelte.js\";\n\timport { CONTEXT_MENU_TRIGGER_ATTR } from \"../../menu/context-menu-attributes.js\";\n\timport { useId } from \"../../../internal/use-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport PopperLayer from \"../../utilities/popper-layer/popper-layer.svelte\";\n\timport { getFloatingContentCSSVars } from \"../../../internal/floating-svelte/floating-utils.svelte.js\";\n\timport PopperLayerForceMount from \"../../utilities/popper-layer/popper-layer-force-mount.svelte\";\n\n\tlet {\n\t\tid = useId(),\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tloop = true,\n\t\tonInteractOutside = noop,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tpreventScroll = true,\n\t\tside = \"right\",\n\t\tsideOffset = 2,\n\t\talign = \"start\",\n\t\t// we need to explicitly pass this prop to the PopperLayer to override\n\t\t// the default menu behavior of handling outside interactions on the trigger\n\t\tonEscapeKeydown = noop,\n\t\tforceMount = false,\n\t\ttrapFocus = false,\n\t\tstyle,\n\t\t...restProps\n\t}: ContextMenuContentProps = $props();\n\n\tconst contentState = MenuContentState.create({\n\t\tid: boxWith(() => id),\n\t\tloop: boxWith(() => loop),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonCloseAutoFocus: boxWith(() => onCloseAutoFocus),\n\t});\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(restProps, contentState.props, {\n\t\t\tside,\n\t\t\tsideOffset,\n\t\t\talign,\n\t\t\tonOpenAutoFocus,\n\t\t\tisValidEvent,\n\t\t\ttrapFocus,\n\t\t\tloop,\n\t\t\tid,\n\t\t\tref: contentState.opts.ref,\n\t\t\tpreventScroll,\n\t\t\tonInteractOutside: handleInteractOutside,\n\t\t\tonEscapeKeydown: handleEscapeKeydown,\n\t\t\tshouldRender: contentState.shouldRender,\n\t\t})\n\t);\n\n\tfunction handleInteractOutside(e: PointerEvent) {\n\t\tonInteractOutside(e);\n\t\tif (e.defaultPrevented) return;\n\n\t\t// don't close if the interaction is with a submenu content or items\n\t\tif (e.target && e.target instanceof Element) {\n\t\t\tconst subContentSelector = `[${contentState.parentMenu.root.getBitsAttr(\"sub-content\")}]`;\n\t\t\tif (e.target.closest(subContentSelector)) return;\n\t\t}\n\t\tcontentState.parentMenu.onClose();\n\t}\n\n\tfunction handleEscapeKeydown(e: KeyboardEvent) {\n\t\tonEscapeKeydown(e);\n\t\tif (e.defaultPrevented) return;\n\t\tcontentState.parentMenu.onClose();\n\t}\n\n\tfunction isValidEvent(e: PointerEvent) {\n\t\tif (\"button\" in e && e.button === 2) {\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tif (!target) return false;\n\t\t\tconst isAnotherContextTrigger =\n\t\t\t\ttarget.closest(`[${CONTEXT_MENU_TRIGGER_ATTR}]`) !==\n\t\t\t\tcontentState.parentMenu.triggerNode;\n\t\t\treturn isAnotherContextTrigger;\n\t\t}\n\t\treturn false;\n\t}\n</script>\n\n{#if forceMount}\n\t<PopperLayerForceMount\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tenabled={contentState.parentMenu.opts.open.current}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"context-menu\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayerForceMount>\n{:else if !forceMount}\n\t<PopperLayer\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\topen={contentState.parentMenu.opts.open.current}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"context-menu\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayer>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ContextMenuTriggerProps } from \"../types.js\";\n\timport { ContextMenuTriggerState } from \"../../menu/menu.svelte.js\";\n\timport { useId } from \"../../../internal/use-id.js\";\n\timport { FloatingLayer } from \"../../utilities/floating-layer/index.js\";\n\n\tlet {\n\t\tid = useId(),\n\t\tref = $bindable(null),\n\t\tchild,\n\t\tchildren,\n\t\tdisabled = false,\n\t\t...restProps\n\t}: ContextMenuTriggerProps = $props();\n\n\tconst triggerState = ContextMenuTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tdisabled: boxWith(() => disabled),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(\n\t\t\trestProps,\n\t\t\ttriggerState.props,\n\t\t\t{ style: { pointerEvents: \"auto\" } },\n\t\t\t{\n\t\t\t\tstyle: restProps.style,\n\t\t\t\ttabindex: restProps.tabindex,\n\t\t\t}\n\t\t)\n\t);\n</script>\n\n<FloatingLayer.Anchor {id} virtualEl={triggerState.virtualElement} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<div {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</div>\n\t{/if}\n</FloatingLayer.Anchor>\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { MenuSeparatorProps } from \"../types.js\";\n\timport { MenuSeparatorState } from \"../menu.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tchild,\n\t\tchildren,\n\t\t...restProps\n\t}: MenuSeparatorProps = $props();\n\n\tconst separatorState = MenuSeparatorState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, separatorState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverTriggerProps } from \"../types.js\";\n\timport { PopoverTriggerState } from \"../popover.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport FloatingLayerAnchor from \"../../utilities/floating-layer/components/floating-layer-anchor.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\ttype = \"button\",\n\t\tdisabled = false,\n\t\topenOnHover = false,\n\t\topenDelay = 700,\n\t\tcloseDelay = 300,\n\t\t...restProps\n\t}: PopoverTriggerProps = $props();\n\n\tconst triggerState = PopoverTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t\topenOnHover: boxWith(() => openOnHover),\n\t\topenDelay: boxWith(() => openDelay),\n\t\tcloseDelay: boxWith(() => closeDelay),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props, { type }));\n</script>\n\n<FloatingLayerAnchor {id} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<button {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</button>\n\t{/if}\n</FloatingLayerAnchor>\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { DialogRootState } from \"../dialog.svelte.js\";\n\timport type { DialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: DialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogCloseState } from \"../dialog.svelte.js\";\n\timport type { DialogCloseProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: DialogCloseProps = $props();\n\n\tconst closeState = DialogCloseState.create({\n\t\tvariant: boxWith(() => \"close\"),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, closeState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogContentState } from \"../dialog.svelte.js\";\n\timport type { DialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: DialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","import { attachRef } from \"svelte-toolbelt\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, boolToTrueOrUndef, } from \"../../internal/attrs.js\";\nexport const toggleAttrs = createBitsAttrs({\n component: \"toggle\",\n parts: [\"root\"],\n});\nexport class ToggleRootState {\n static create(opts) {\n return new ToggleRootState(opts);\n }\n opts;\n attachment;\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n }\n onclick(_) {\n if (this.opts.disabled.current)\n return;\n this.opts.pressed.current = !this.opts.pressed.current;\n }\n snippetProps = $derived.by(() => ({\n pressed: this.opts.pressed.current,\n }));\n props = $derived.by(() => ({\n [toggleAttrs.root]: \"\",\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"aria-pressed\": boolToStr(this.opts.pressed.current),\n \"data-state\": getToggleDataState(this.opts.pressed.current),\n disabled: boolToTrueOrUndef(this.opts.disabled.current),\n onclick: this.onclick,\n ...this.attachment,\n }));\n}\nexport function getToggleDataState(condition) {\n return condition ? \"on\" : \"off\";\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ToggleRootProps } from \"../types.js\";\n\timport { ToggleRootState } from \"../toggle.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tpressed = $bindable(false),\n\t\tonPressedChange = noop,\n\t\tdisabled = false,\n\t\ttype = \"button\",\n\t\tchildren,\n\t\tchild,\n\t\t...restProps\n\t}: ToggleRootProps = $props();\n\n\tconst toggleState = ToggleRootState.create({\n\t\tpressed: boxWith(\n\t\t\t() => pressed,\n\t\t\t(v) => {\n\t\t\t\tpressed = v;\n\t\t\t\tonPressedChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled ?? false),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, toggleState.props, { type }));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps, ...toggleState.snippetProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(toggleState.snippetProps)}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: ContextMenuPrimitive.PortalProps = $props();\n</script>\n\n<ContextMenuPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\timport type { WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport ContextMenuPortal from \"./context-menu-portal.svelte\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tportalProps,\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.ContentProps & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof ContextMenuPortal>>;\n\t} = $props();\n</script>\n\n<ContextMenuPortal {...portalProps}>\n\t<ContextMenuPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"context-menu-content\"\n\t\tclass={cn(\n\t\t\t\"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-lg p-1 shadow-md ring-1 duration-100 z-(--z-floating) max-h-(--bits-context-menu-content-available-height) origin-(--bits-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</ContextMenuPortal>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tinset,\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: ContextMenuPrimitive.ItemProps & {\n\t\tinset?: boolean;\n\t\tvariant?: \"default\" | \"destructive\";\n\t} = $props();\n</script>\n\n<ContextMenuPrimitive.Item\n\tbind:ref\n\tdata-slot=\"context-menu-item\"\n\tdata-inset={inset}\n\tdata-variant={variant}\n\tclass={cn(\n\t\t\"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.SeparatorProps = $props();\n</script>\n\n<ContextMenuPrimitive.Separator\n\tbind:ref\n\tdata-slot=\"context-menu-separator\"\n\tclass={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: ContextMenuPrimitive.TriggerProps = $props();\n</script>\n\n<ContextMenuPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"context-menu-trigger\"\n\tclass={cn(\"select-none\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { ContextMenu as ContextMenuPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: ContextMenuPrimitive.RootProps = $props();\n</script>\n\n<ContextMenuPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\t/**\n\t * \"+42 −10\": the lines a session has added and removed, for the trailing\n\t * meta slot of its sidebar row. Muted and small, so the state indicator\n\t * stays the loudest thing on the row; nothing at all when both are zero.\n\t */\n\timport type { ChangesInfo } from '$shared/types/ws-messages.js';\n\n\tlet { changes }: { changes: ChangesInfo | null | undefined } = $props();\n</script>\n\n{#if changes && (changes.additions > 0 || changes.deletions > 0)}\n\t<span\n\t\tclass=\"diff\"\n\t\ttitle=\"{changes.files} {changes.files === 1 ? 'file' : 'files'} changed ({changes.source === 'git' ? 'git' : 'this session'})\"\n\t>\n\t\t<span class=\"add\">+{changes.additions}</span>\n\t\t<span class=\"del\">−{changes.deletions}</span>\n\t</span>\n{/if}\n\n<style>\n\t.diff {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\twhite-space: nowrap;\n\t\tfont-variant-numeric: tabular-nums;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * The project the session works in: the repo root (else the cwd), the\n\t * branch, and the URLs named in the repo's `.claude-mux.json`. The\n\t * simplest pane there is, shipped with the panel so the container has\n\t * something to hold before the Changes, Files and Web panes arrive.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport type { ProjectInfo } from '$shared/server/project.js';\n\n\tlet { session, base, setActions, active }: PaneBodyProps = $props();\n\n\tlet info = $state<ProjectInfo | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet loading = $state(false);\n\n\t/** Bumped by each load, so an answer that arrives after a newer request is dropped. */\n\tlet seq = 0;\n\n\tasync function load(id: string) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/project`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tif (mine === seq) info = body as ProjectInfo;\n\t\t} catch (err) {\n\t\t\tif (mine === seq) error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === seq) loading = false;\n\t\t}\n\t}\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t// Read when first shown, and again whenever the session moves to another directory.\n\tconst cwd = $derived(session?.cwd ?? null);\n\t$effect(() => {\n\t\tif (sessionId && cwd && active) void load(sessionId);\n\t});\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loading,\n\t\t\t\trun: () => sessionId && void load(sessionId)\n\t\t\t}\n\t\t]);\n\t});\n\n\tconst urls = $derived(Object.entries(info?.config?.urls ?? {}));\n</script>\n\n<div class=\"project\">\n\t{#if error}\n\t\t<p class=\"err\">{error}</p>\n\t{:else if !info}\n\t\t<p class=\"dim\">Loading…</p>\n\t{:else}\n\t\t<dl>\n\t\t\t<dt>{info.repo ? 'Repository' : 'Directory'}</dt>\n\t\t\t<dd class=\"mono\" title={info.root}>{info.root}</dd>\n\t\t\t<dt>Branch</dt>\n\t\t\t<dd class=\"mono\">\n\t\t\t\t{#if info.branch}{info.branch}{:else if info.repo}<span class=\"dim\">detached HEAD</span>{:else}<span\n\t\t\t\t\t\tclass=\"dim\">not a git repository</span\n\t\t\t\t\t>{/if}\n\t\t\t</dd>\n\t\t\t<dt>URLs</dt>\n\t\t\t<dd>\n\t\t\t\t{#if urls.length > 0}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each urls as [name, url] (name)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<span class=\"name\">{name}</span>\n\t\t\t\t\t\t\t\t<a class=\"mono\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">{url}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t{:else if info.configError}\n\t\t\t\t\t<span class=\"err\">.claude-mux.json: {info.configError}</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span class=\"dim\">\n\t\t\t\t\t\tNone. Commit a <code>.claude-mux.json</code> at the root to name them:\n\t\t\t\t\t</span>\n\t\t\t\t\t<pre>{`{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`}</pre>\n\t\t\t\t{/if}\n\t\t\t</dd>\n\t\t</dl>\n\t{/if}\n</div>\n\n<style>\n\t.project {\n\t\tpadding: 16px 18px;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tdl {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: max-content 1fr;\n\t\tgap: 10px 16px;\n\t\tmargin: 0;\n\t}\n\tdt {\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tpadding-top: 2px;\n\t}\n\tdd {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.mono,\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: grid;\n\t\tgap: 6px;\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t\tmin-width: 0;\n\t}\n\t.name {\n\t\tcolor: #a8a29e;\n\t\tmin-width: 3.5em;\n\t}\n\ta {\n\t\tcolor: #93c5fd;\n\t\ttext-decoration: none;\n\t\toverflow-wrap: anywhere;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n\tpre {\n\t\tmargin: 8px 0 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\" module>\n\timport { type VariantProps, tv } from \"tailwind-variants\";\n\n\texport const toggleVariants = tv({\n\t\tbase: \"hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline: \"border-input hover:bg-muted border bg-transparent\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\tsm: \"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\txs: \"h-6 min-w-6 rounded-md px-1.5 text-[11px] [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tlg: \"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t});\n\n\texport type ToggleVariant = VariantProps<typeof toggleVariants>[\"variant\"];\n\texport type ToggleSize = VariantProps<typeof toggleVariants>[\"size\"];\n\texport type ToggleVariants = VariantProps<typeof toggleVariants>;\n</script>\n\n<script lang=\"ts\">\n\timport { Toggle as TogglePrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tpressed = $bindable(false),\n\t\tclass: className,\n\t\tsize = \"default\",\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: TogglePrimitive.RootProps & {\n\t\tvariant?: ToggleVariant;\n\t\tsize?: ToggleSize;\n\t} = $props();\n</script>\n\n<TogglePrimitive.Root\n\tbind:ref\n\tbind:pressed\n\tdata-slot=\"toggle\"\n\tclass={cn(toggleVariants({ variant, size }), className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Changes pane's diff, loaded the first time a diff\n * is drawn so the session page does not carry highlight.js until then.\n *\n * Lines are coloured one at a time: a diff shows fragments, so a construct\n * that opens above the hunk (a block comment, a template string) is never\n * seen whole anyway, and per line keeps a bad guess from spilling further.\n */\nimport type { HLJSApi, LanguageFn } from 'highlight.js';\n\nlet loading: Promise<HLJSApi> | null = null;\n\nconst LOADERS: Record<string, () => Promise<{ default: LanguageFn }>> = {\n\ttypescript: () => import('highlight.js/lib/languages/typescript'),\n\tjavascript: () => import('highlight.js/lib/languages/javascript'),\n\txml: () => import('highlight.js/lib/languages/xml'),\n\tcss: () => import('highlight.js/lib/languages/css'),\n\tscss: () => import('highlight.js/lib/languages/scss'),\n\tjson: () => import('highlight.js/lib/languages/json'),\n\tmarkdown: () => import('highlight.js/lib/languages/markdown'),\n\tpython: () => import('highlight.js/lib/languages/python'),\n\tbash: () => import('highlight.js/lib/languages/bash'),\n\tyaml: () => import('highlight.js/lib/languages/yaml'),\n\tini: () => import('highlight.js/lib/languages/ini'),\n\trust: () => import('highlight.js/lib/languages/rust'),\n\tgo: () => import('highlight.js/lib/languages/go'),\n\tsql: () => import('highlight.js/lib/languages/sql'),\n\tjava: () => import('highlight.js/lib/languages/java'),\n\tkotlin: () => import('highlight.js/lib/languages/kotlin'),\n\tc: () => import('highlight.js/lib/languages/c'),\n\tcpp: () => import('highlight.js/lib/languages/cpp'),\n\truby: () => import('highlight.js/lib/languages/ruby'),\n\tphp: () => import('highlight.js/lib/languages/php'),\n\tswift: () => import('highlight.js/lib/languages/swift'),\n\tlua: () => import('highlight.js/lib/languages/lua'),\n\tdockerfile: () => import('highlight.js/lib/languages/dockerfile'),\n\tmakefile: () => import('highlight.js/lib/languages/makefile')\n};\n\nconst core = () => (loading ??= import('highlight.js/lib/core').then((m) => m.default));\n\n/**\n * Each line as escaped HTML with highlight.js's token spans, or null when the\n * language is unknown (the caller then draws the text as is).\n */\nexport async function highlightLines(lines: string[], language: string | null): Promise<string[] | null> {\n\tif (!language || !LOADERS[language]) return null;\n\tconst load = LOADERS[language];\n\tconst hljs = await core();\n\tif (!hljs.getLanguage(language)) hljs.registerLanguage(language, (await load()).default);\n\treturn lines.map((line) => hljs.highlight(line, { language, ignoreIllegals: true }).value);\n}\n","<script lang=\"ts\">\n\t/**\n\t * A file's hunks drawn as a unified diff: line numbers on both sides, a row\n\t * for each stretch of unchanged lines the diff leaves out, and the code\n\t * coloured once highlight.js has loaded. Given a way to read the file\n\t * (`loadText`), a left-out stretch can be opened a few lines at a time from\n\t * either end, or all at once. The Changes pane and the History pane both\n\t * read a diff through it.\n\t */\n\timport { untrack } from 'svelte';\n\timport { diffRows, languageFor, type DiffRow, type Hunk } from '$lib/side-panel/changes';\n\timport { highlightLines } from '$lib/side-panel/highlight';\n\n\tlet {\n\t\thunks,\n\t\tfile,\n\t\tloadText\n\t}: {\n\t\thunks: Hunk[];\n\t\tfile: string;\n\t\t/** The file's new side, whole, or null when it cannot be read as text. */\n\t\tloadText?: () => Promise<string | null>;\n\t} = $props();\n\n\ttype Gap = Extract<DiffRow, { type: 'gap' }>;\n\t/** A stretch still hidden, with what is left of it and which ends can be opened further. */\n\ttype Hidden = { type: 'hidden'; gap: Gap; left: number | null; first: boolean; last: boolean };\n\ttype Shown = Exclude<DiffRow, Gap> | Hidden;\n\n\t/** Lines shown per press on one end of a hidden stretch. */\n\tconst STEP = 20;\n\n\t/** The file's lines once someone has asked for hidden ones; false when it could not be read. */\n\tlet text = $state<string[] | false | null>(null);\n\tlet reading = $state(false);\n\t/** Lines opened at the top and the bottom of each hidden stretch, keyed by where it starts. */\n\tlet opened = $state<Record<number, { top: number; bottom: number }>>({});\n\n\tconst canOpen = $derived(loadText !== undefined && text !== false);\n\tconst base = $derived(diffRows(hunks, { tail: loadText !== undefined }));\n\n\tconst rows = $derived.by((): Shown[] => {\n\t\tconst out: Shown[] = [];\n\t\tconst gaps = base.filter((r): r is Gap => r.type === 'gap');\n\t\tfor (const row of base) {\n\t\t\tif (row.type !== 'gap') {\n\t\t\t\tout.push(row);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst lines = text || null;\n\t\t\tconst count = row.count ?? (lines ? Math.max(0, lines.length - row.from + 1) : null);\n\t\t\tconst open = opened[row.from] ?? { top: 0, bottom: 0 };\n\t\t\tconst top = count === null ? open.top : Math.min(open.top, count);\n\t\t\tconst bottom = count === null ? 0 : Math.min(open.bottom, count - top);\n\t\t\tconst line = (n: number): Shown => ({\n\t\t\t\ttype: 'context',\n\t\t\t\told: row.old + (n - row.from),\n\t\t\t\tnew: n,\n\t\t\t\ttext: lines?.[n - 1] ?? ''\n\t\t\t});\n\t\t\tfor (let i = 0; i < top; i++) out.push(line(row.from + i));\n\t\t\tconst left = count === null ? null : count - top - bottom;\n\t\t\t// The rest of a file that turns out to end where the diff does needs no row.\n\t\t\tif (left === null ? canOpen : left > 0) {\n\t\t\t\tout.push({ type: 'hidden', gap: row, left, first: row === gaps[0] && row.from === 1, last: row.count === null });\n\t\t\t}\n\t\t\tif (count !== null) for (let i = bottom; i > 0; i--) out.push(line(row.from + count - i));\n\t\t}\n\t\treturn out;\n\t});\n\n\tasync function open(gap: Gap, end: 'top' | 'bottom' | 'all') {\n\t\tif (text === null && loadText && !reading) {\n\t\t\treading = true;\n\t\t\ttry {\n\t\t\t\tconst read = await loadText();\n\t\t\t\ttext = read === null ? false : read.replace(/\\n$/, '').split('\\n');\n\t\t\t} catch {\n\t\t\t\ttext = false;\n\t\t\t} finally {\n\t\t\t\treading = false;\n\t\t\t}\n\t\t}\n\t\tif (!text) return;\n\t\tconst was = opened[gap.from] ?? { top: 0, bottom: 0 };\n\t\topened[gap.from] =\n\t\t\tend === 'all' ? { top: Infinity, bottom: 0 } : { ...was, [end]: was[end] + STEP };\n\t}\n\n\t// Another file is another set of hidden lines.\n\t$effect(() => {\n\t\tvoid file;\n\t\tuntrack(() => {\n\t\t\ttext = null;\n\t\t\topened = {};\n\t\t});\n\t});\n\n\tconst SIGN = { add: '+', del: '−', context: ' ' } as const;\n\n\t/** Rows past this many are drawn plain: colouring them costs more than it gives. */\n\tconst PAINT_LIMIT = 4000;\n\t/** Highlighted HTML per row index, filled in once highlight.js has loaded. */\n\tlet painted = $state<(string | null)[] | null>(null);\n\t$effect(() => {\n\t\tpainted = null;\n\t\tif (rows.length === 0 || rows.length > PAINT_LIMIT) return;\n\t\tconst lines = rows.map((r) => ('text' in r ? r.text : ''));\n\t\tconst language = untrack(() => languageFor(file));\n\t\tlet stale = false;\n\t\tvoid highlightLines(lines, language).then((html) => {\n\t\t\tif (!stale && html) painted = html;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n</script>\n\n<div class=\"lines\">\n\t{#each rows as row, i (i)}\n\t\t{#if row.type === 'hunk'}\n\t\t\t<div class=\"hunk\">{row.header}</div>\n\t\t{:else if row.type === 'hidden'}\n\t\t\t{@const some = row.left === null || row.left > STEP}\n\t\t\t<div class=\"gap\">\n\t\t\t\t{#if canOpen && some && !row.first}\n\t\t\t\t\t<button type=\"button\" title=\"Show {STEP} more lines below\" aria-label=\"Show {STEP} more lines below\" onclick={() => void open(row.gap, 'top')}>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-expand-down\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t{#if canOpen}\n\t\t\t\t\t<button type=\"button\" class=\"all\" title=\"Show all of these lines\" onclick={() => void open(row.gap, 'all')}>\n\t\t\t\t\t\t{#if row.left === null}\n\t\t\t\t\t\t\t{reading ? 'Reading…' : 'the rest of the file'}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{row.left} unchanged {row.left === 1 ? 'line' : 'lines'}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{:else}\n\t\t\t\t\t<span>⋯ {row.left} unchanged {row.left === 1 ? 'line' : 'lines'} ⋯</span>\n\t\t\t\t{/if}\n\t\t\t\t{#if canOpen && some && !row.last}\n\t\t\t\t\t<button type=\"button\" title=\"Show {STEP} more lines above\" aria-label=\"Show {STEP} more lines above\" onclick={() => void open(row.gap, 'bottom')}>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-expand-up\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<div class=\"ln {row.type}\">\n\t\t\t\t<span class=\"no\">{row.old ?? ''}</span><span class=\"no\">{row.new ?? ''}</span><span class=\"sign\"\n\t\t\t\t\t>{SIGN[row.type]}</span\n\t\t\t\t><!-- eslint-disable-next-line svelte/no-at-html-tags -- highlight.js escapes the text it colours --><span\n\t\t\t\t\tclass=\"code\">{#if painted?.[i] != null}{@html painted[i]}{:else}{row.text}{/if}</span\n\t\t\t\t>\n\t\t\t</div>\n\t\t{/if}\n\t{/each}\n</div>\n\n<style>\n\t.lines {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 16px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.hunk {\n\t\tpadding: 2px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #161616;\n\t\twhite-space: pre;\n\t}\n\t.gap {\n\t\tposition: sticky;\n\t\tleft: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 4px;\n\t\tmin-height: 26px;\n\t\tpadding: 0 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #141414;\n\t}\n\t.gap button {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\theight: 24px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 5px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.gap button:hover {\n\t\tbackground: #232323;\n\t\tcolor: #f5f5f4;\n\t}\n\t.gap button:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t.gap iconify-icon {\n\t\tfont-size: 14px;\n\t}\n\t@media (pointer: coarse) {\n\t\t.gap {\n\t\t\tmin-height: 38px;\n\t\t}\n\t\t.gap button {\n\t\t\theight: 34px;\n\t\t\tpadding: 0 12px;\n\t\t}\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcolor: #a8a29e;\n\t}\n\t.ln.add {\n\t\tbackground: #0f2417;\n\t\tcolor: #bbf7d0;\n\t}\n\t.ln.del {\n\t\tbackground: #2a1215;\n\t\tcolor: #fecaca;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: 4ch;\n\t\tpadding-right: 1ch;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tuser-select: none;\n\t}\n\t.sign {\n\t\tflex: none;\n\t\twidth: 2ch;\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t}\n\t.ln.add .sign {\n\t\tcolor: #4ade80;\n\t}\n\t.ln.del .sign {\n\t\tcolor: #f87171;\n\t}\n\t.code {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* highlight.js tokens, muted so the add/del backgrounds still lead. */\n\t.code :global(.hljs-keyword),\n\t.code :global(.hljs-built_in),\n\t.code :global(.hljs-literal),\n\t.code :global(.hljs-selector-tag) {\n\t\tcolor: #c4b5fd;\n\t}\n\t.code :global(.hljs-string),\n\t.code :global(.hljs-regexp),\n\t.code :global(.hljs-attr),\n\t.code :global(.hljs-selector-attr) {\n\t\tcolor: #fcd34d;\n\t}\n\t.code :global(.hljs-number),\n\t.code :global(.hljs-symbol) {\n\t\tcolor: #fdba74;\n\t}\n\t.code :global(.hljs-comment),\n\t.code :global(.hljs-meta) {\n\t\tcolor: #78716c;\n\t\tfont-style: italic;\n\t}\n\t.code :global(.hljs-title),\n\t.code :global(.hljs-function),\n\t.code :global(.hljs-section) {\n\t\tcolor: #93c5fd;\n\t}\n\t.code :global(.hljs-type),\n\t.code :global(.hljs-class),\n\t.code :global(.hljs-name),\n\t.code :global(.hljs-selector-class) {\n\t\tcolor: #5eead4;\n\t}\n\t.code :global(.hljs-variable),\n\t.code :global(.hljs-template-variable),\n\t.code :global(.hljs-property) {\n\t\tcolor: #f9a8d4;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * What the session changed, from one of two sources: Current (git's\n\t * working tree, which catches edits made through Bash) or Session (the\n\t * edits in the session's own log, which reach files outside the repo and\n\t * know which turn made each). A file list on the left, the selected\n\t * file's diff on the right; narrower than the two fit, one at a time.\n\t *\n\t * The URL holds the file (`file`), the Session turn (`turn`, its number in\n\t * the session) and the source (`source`), so a link can open any of it.\n\t * While shown, the pane re-reads whenever the session's hooks report in.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tdisplayPath,\n\t\tisGenerated,\n\t\tstatusLetter,\n\t\tsumCounts,\n\t\ttype Diff,\n\t\ttype Listing,\n\t\ttype Source\n\t} from '$lib/side-panel/changes';\n\timport DiffLines from './DiffLines.svelte';\n\n\tlet { session, base, params, setParams, setActions, openPane, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t/** Git when the session sits in a repo, else its log; a `source` param overrides. */\n\tconst inRepo = $derived(!!session?.git_root || session?.changes?.source === 'git');\n\t/** Set once git answered that the session is not in a work tree. */\n\tlet gitMissing = $state(false);\n\tconst wanted = $derived<Source>(\n\t\tparams.source === 'session' || params.source === 'git' ? params.source : inRepo ? 'git' : 'session'\n\t);\n\tconst source = $derived<Source>(gitMissing && wanted === 'git' ? 'session' : wanted);\n\n\tlet listing = $state<Listing | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loadingList = $state(false);\n\t/** Bumped by each listing read, so the diff is read again with it. */\n\tlet listStamp = $state(0);\n\tlet listSeq = 0;\n\t/** A reload asked for while one was in flight: run once more when it lands. */\n\tlet again: { id: string; src: Source } | null = null;\n\n\tasync function loadList(id: string, src: Source) {\n\t\tif (loadingList) {\n\t\t\tagain = { id, src };\n\t\t\treturn;\n\t\t}\n\t\tconst mine = ++listSeq;\n\t\tloadingList = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/changes?source=${src}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (res.status === 404 && src === 'git') {\n\t\t\t\tgitMissing = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tlisting = body as Listing;\n\t\t\tlistStamp++;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loadingList = false;\n\t\t\tconst next = again;\n\t\t\tagain = null;\n\t\t\tif (next) void loadList(next.id, next.src);\n\t\t}\n\t}\n\n\t/**\n\t * Re-read whenever a hook reports in or the broadcast count moves — what\n\t * makes git re-read the repo, too. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(\n\t\t`${session?.last_update ?? 0}:${session?.changes?.additions ?? 0}:${session?.changes?.deletions ?? 0}:${session?.changes?.files ?? 0}`\n\t);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tconst id = sessionId;\n\t\tconst src = source;\n\t\t// Untracked: `loadList` reads its own `loadingList`, and an effect that\n\t\t// depended on that ran again the moment each read finished. The list was\n\t\t// then read without pause, every read asked for the diff afresh, and each\n\t\t// diff was thrown away as stale before it could be drawn.\n\t\tif (id && active) untrack(() => void loadList(id, src));\n\t});\n\n\t// A listing for the other source is no answer for this one.\n\tconst current = $derived(listing?.source === source ? listing : null);\n\tconst turns = $derived(current?.turns ?? []);\n\tconst turn = $derived(\n\t\tsource === 'session' && params.turn !== undefined\n\t\t\t? (turns.find((t) => String(t.n) === params.turn) ?? null)\n\t\t\t: null\n\t);\n\tconst files = $derived(turn ? turn.files : (current?.files ?? []));\n\tconst root = $derived(current?.root ?? session?.git_root ?? session?.cwd ?? null);\n\tconst totals = $derived(turn ? sumCounts(files) : (current?.totals ?? sumCounts(files)));\n\t/** Newest first, each with its own totals. */\n\tconst chips = $derived(turns.map((t) => ({ ...t, ...sumCounts(t.files) })).reverse());\n\n\tlet showGenerated = $state(false);\n\tconst split = $derived.by(() => {\n\t\tconst generated: typeof files = [];\n\t\tconst kept: typeof files = [];\n\t\t// Relative to the root, so a repo that sits under a `build/` is not all generated.\n\t\tfor (const f of files) (isGenerated(displayPath(f.file, root)) ? generated : kept).push(f);\n\t\treturn { generated, kept };\n\t});\n\tconst shown = $derived(showGenerated ? files : split.kept);\n\n\t/** The file the URL names, else the first one listed, so a wide pane never sits empty. */\n\tconst selected = $derived(\n\t\tfiles.find((f) => f.file === params.file) ?? (params.file ? null : (shown[0] ?? null))\n\t);\n\n\tfunction pick(file: string) {\n\t\tsetParams({ file });\n\t}\n\n\tfunction setSource(next: Source) {\n\t\tif (next === source) return;\n\t\tsetParams({ source: next, turn: null, file: null });\n\t}\n\n\tfunction setTurn(n: number | null) {\n\t\tsetParams({ turn: n === null ? null : String(n), file: null });\n\t}\n\n\tconst NO_PROMPT = 'Before the first prompt';\n\n\t/** Scroll the transcript to the prompt that opened a turn; the page does the scrolling. */\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── the selected file's diff ─────────────────────────────────────────\n\n\tlet diff = $state<Diff | null>(null);\n\tlet diffError = $state<{ file: string; message: string } | null>(null);\n\tlet diffSeq = 0;\n\t/** The answer `diff` was parsed from, to tell a new one from the same again. */\n\tlet diffText: string | null = null;\n\n\tasync function loadDiff(id: string, src: Source, file: string, turnId: string | null | undefined) {\n\t\tconst mine = ++diffSeq;\n\t\tconst q = new URLSearchParams({ source: src, file });\n\t\t// An empty turn is the one before the first prompt; no turn at all is every turn.\n\t\tif (turnId !== undefined) q.set('turn', turnId ?? '');\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/changes/diff?${q}`);\n\t\t\tconst text = await res.text();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error((JSON.parse(text) as { error?: string }).error ?? `HTTP ${res.status}`);\n\t\t\t// The diff is asked for again with every hook; an answer that says\n\t\t\t// the same thing is not even parsed, and the rows and their colouring stay.\n\t\t\tif (text !== diffText) {\n\t\t\t\tdiffText = text;\n\t\t\t\tdiff = JSON.parse(text) as Diff;\n\t\t\t}\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) {\n\t\t\t\tdiffText = null;\n\t\t\t\tdiff = null;\n\t\t\t\tdiffError = { file, message: err instanceof Error ? err.message : String(err) };\n\t\t\t}\n\t\t}\n\t}\n\n\t/** What the diff depends on: the file, the turn, and each fresh read of the list. */\n\tconst diffKey = $derived(\n\t\tselected ? `${source}\\0${selected.file}\\0${turn ? `t${turn.n}` : ''}\\0${listStamp}` : null\n\t);\n\t$effect(() => {\n\t\tif (!diffKey || !sessionId || !active) return;\n\t\t// Only the key decides: a reloaded list hands back new objects for the same file.\n\t\tconst id = sessionId;\n\t\tuntrack(() => void loadDiff(id, source, selected!.file, turn ? turn.id : undefined));\n\t});\n\n\t/**\n\t * The file as it is on disk, for the lines the git diff leaves out: its new\n\t * side is the working tree. The session source's hunks are from the log,\n\t * whose new side may no longer be what is on disk, so it offers none.\n\t */\n\tasync function workingText(file: string): Promise<string | null> {\n\t\tif (!sessionId) return null;\n\t\tconst res = await fetch(`${sessionApiAt(base, sessionId)}/files/read?${new URLSearchParams({ path: file })}`);\n\t\tif (!res.ok) return null;\n\t\tconst read = (await res.json()) as { kind: string; text?: string };\n\t\treturn read.kind === 'text' ? (read.text ?? null) : null;\n\t}\n\n\tconst shownDiff = $derived(diff && diff.file === selected?.file ? diff : null);\n\tconst shownError = $derived(diffError?.file === selected?.file ? diffError!.message : null);\n\tconst hunkCount = $derived(shownDiff?.hunks.length ?? 0);\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loadingList,\n\t\t\t\trun: () => sessionId && void loadList(sessionId, source)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the files, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (shown.length === 0) return;\n\t\tconst at = selected ? shown.findIndex((f) => f.file === selected.file) : -1;\n\t\tconst next = e.key === 'j' ? Math.min(at + 1, shown.length - 1) : Math.max(at - 1, 0);\n\t\te.preventDefault();\n\t\tpick(shown[next].file);\n\t\tdocument\n\t\t\t.querySelector(`[data-change-file=\"${CSS.escape(shown[next].file)}\"]`)\n\t\t\t?.scrollIntoView({ block: 'nearest' });\n\t}\n\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"changes\" class:picked={!!params.file}>\n\t<div class=\"bar\">\n\t\t<span class=\"title\">\n\t\t\t{#if current}\n\t\t\t\t{files.length} {files.length === 1 ? 'file' : 'files'} changed\n\t\t\t\t{#if totals.additions || totals.deletions}\n\t\t\t\t\t<span class=\"mono\"><span class=\"add\">+{totals.additions}</span> <span class=\"del\">−{totals.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\tChanges\n\t\t\t{/if}\n\t\t</span>\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Source\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'git', (on) => on && setSource('git')}\n\t\t\t\tdisabled={gitMissing}\n\t\t\t\ttitle={gitMissing ? 'Not a git repository' : 'What git sees in the working tree now'}>Current · git</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'session', (on) => on && setSource('session')}\n\t\t\t\ttitle=\"The edits this session's tools made\">Session</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if source === 'session' && turns.length > 0}\n\t\t<div class=\"turns\" role=\"group\" aria-label=\"Turn\">\n\t\t\t<Toggle\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"chip\"\n\t\t\t\tbind:pressed={() => !turn, (on) => on && setTurn(null)}>All turns</Toggle\n\t\t\t>\n\t\t\t{#each chips as t (t.n)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={t.prompt || NO_PROMPT}\n\t\t\t\t\tbind:pressed={() => turn?.n === t.n, (on) => on && setTurn(t.n)}\n\t\t\t\t>\n\t\t\t\t\t{t.n === 0 ? 'Start' : `Turn ${t.n}`}\n\t\t\t\t\t{#if t.additions}<span class=\"add\">+{t.additions}</span>{/if}\n\t\t\t\t\t{#if t.deletions}<span class=\"del\">−{t.deletions}</span>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t\t{#if turn}\n\t\t\t<div class=\"turn-note\">\n\t\t\t\t<span class=\"prompt\" title={turn.prompt}>{turn.prompt || NO_PROMPT}</span>\n\t\t\t\t{#if turn.id}\n\t\t\t\t\t{@const id = turn.id}\n\t\t\t\t\t<Button variant=\"link\" size=\"sm\" class=\"link\" onclick={() => revealTurn(id)}>Show in transcript</Button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t{/if}\n\n\t{#if listError && !current}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !current}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if files.length === 0}\n\t\t<p class=\"msg\">\n\t\t\t{source === 'git' ? 'The working tree is clean.' : 'This session has not edited any files yet.'}\n\t\t</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Changed files\">\n\t\t\t\t{#each shown as f (f.file)}\n\t\t\t\t\t{@const letter = statusLetter(f)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\tclass:on={selected?.file === f.file}\n\t\t\t\t\t\tclass:untracked={f.untracked}\n\t\t\t\t\t\taria-current={selected?.file === f.file ? 'true' : undefined}\n\t\t\t\t\t\tdata-change-file={f.file}\n\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\tonclick={() => pick(f.file)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"st st-{letter === '?' ? 'u' : letter.toLowerCase()}\">{letter}</span>\n\t\t\t\t\t\t<!-- rtl puts the ellipsis on the left; bdi keeps the path itself left to right. -->\n\t\t\t\t\t\t<span class=\"path\"><bdi>{displayPath(f.file, root)}</bdi></span>\n\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{#if f.additions}<span class=\"add\">+{f.additions}</span>{/if}\n\t\t\t\t\t\t\t{#if f.deletions}<span class=\"del\">−{f.deletions}</span>{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if split.generated.length > 0}\n\t\t\t\t\t<Button variant=\"ghost\" size=\"sm\" class=\"more\" onclick={() => (showGenerated = !showGenerated)}>\n\t\t\t\t\t\t{showGenerated ? 'Hide generated' : `+ ${split.generated.length} generated (show)`}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t<section class=\"diff\" aria-label=\"Diff\">\n\t\t\t\t{#if selected}\n\t\t\t\t\t<div class=\"diff-head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to files\" onclick={() => setParams({ file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<span class=\"path\" title={selected.file}>{displayPath(selected.file, root)}</span>\n\t\t\t\t\t\t<span class=\"sp\"></span>\n\t\t\t\t\t\t{#if hunkCount}<span class=\"dim\">{hunkCount} {hunkCount === 1 ? 'hunk' : 'hunks'}</span>{/if}\n\t\t\t\t\t\t{#if selected.kind !== 'deleted'}\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"tofiles\"\n\t\t\t\t\t\t\t\ttitle=\"Open this file in the Files pane\"\n\t\t\t\t\t\t\t\taria-label=\"Open in Files\"\n\t\t\t\t\t\t\t\tonclick={() => openPane('files', { file: selected.file, line: null })}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree-outline\"></iconify-icon>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if shownError}\n\t\t\t\t\t\t<p class=\"msg err\">{shownError}</p>\n\t\t\t\t\t{:else if shownDiff?.binary}\n\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t{:else if shownDiff && shownDiff.hunks.length > 0}\n\t\t\t\t\t\t<DiffLines\n\t\t\t\t\t\t\thunks={shownDiff.hunks}\n\t\t\t\t\t\t\tfile={selected.file}\n\t\t\t\t\t\t\tloadText={source === 'git' && selected.kind !== 'deleted' ? () => workingText(selected.file) : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t{:else if diff}\n\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">That file has no change here.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n\t<div class=\"foot\"><kbd>j</kbd>/<kbd>k</kbd> next / previous file</div>\n</div>\n\n<style>\n\t.changes {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.mono,\n\tnav,\n\t.diff,\n\t.turns {\n\t\tfont-family: var(--font-mono);\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.title {\n\t\tfont-size: 13.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\tdisplay: inline-flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t}\n\t.title .mono {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.turns {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.turns :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 28px;\n\t\tpadding: 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turns :global(.chip:hover) {\n\t\tcolor: #f5f5f4;\n\t}\n\t.turns :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.turn-note {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t\tflex: none;\n\t}\n\t.prompt,\n\t.file .path,\n\t.diff-head .path {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.prompt {\n\t\tflex: 1;\n\t}\n\t.turn-note :global(.link) {\n\t\tflex: none;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 4px 0;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turn-note :global(.link:hover) {\n\t\ttext-decoration: underline;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\twidth: 250px;\n\t\tflex: none;\n\t\toverflow-y: auto;\n\t\tborder-right: 1px solid #222;\n\t\tpadding: 8px 6px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tfont-size: 12px;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-height: 32px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.file:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.file.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.file.untracked {\n\t\tcolor: #78716c;\n\t}\n\t.file .path {\n\t\tflex: 1;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.st {\n\t\twidth: 10px;\n\t\tflex: none;\n\t}\n\t.st-m,\n\t.st-r {\n\t\tcolor: #fbbf24;\n\t}\n\t.st-a {\n\t\tcolor: #4ade80;\n\t}\n\t.st-d {\n\t\tcolor: #f87171;\n\t}\n\t.st-u {\n\t\tcolor: #78716c;\n\t}\n\tnav :global(.more) {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: left;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\tnav :global(.more:hover) {\n\t\tcolor: #d6d3d1;\n\t}\n\t.add {\n\t\tcolor: #4ade80;\n\t}\n\t.del {\n\t\tcolor: #f87171;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 12px;\n\t}\n\t.diff-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.tofiles {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.tofiles:hover {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: -8px 0 -8px -12px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.foot {\n\t\tflex: none;\n\t\tpadding: 8px 14px;\n\t\tborder-top: 1px solid #222;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\tkbd {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tpadding: 0 4px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1f1f1f;\n\t\tcolor: #a8a29e;\n\t}\n\n\t/* Too narrow for both: the list, or the picked file's diff with a way back. */\n\t@container (max-width: 38rem) {\n\t\tnav {\n\t\t\twidth: auto;\n\t\t\tflex: 1;\n\t\t\tborder-right: 0;\n\t\t}\n\t\t.diff {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked .diff {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.foot {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* A finger needs room. */\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","<script lang=\"ts\">\n\timport { cn } from \"$lib/utils.js\";\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: PopoverPrimitive.TriggerProps = $props();\n</script>\n\n<PopoverPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"popover-trigger\"\n\tclass={cn(\"\", className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Files pane, loaded the first time a file is shown\n * so the session page does not carry Shiki until the pane is opened. The\n * fine-grained build: Shiki's core, its JavaScript regex engine (no WASM),\n * one theme, and a grammar only when a file of that language is opened.\n * Anything else is drawn plain.\n */\nimport type { HighlighterCore, LanguageRegistration, ThemedToken } from 'shiki/core';\n\ntype Grammar = () => Promise<{ default: LanguageRegistration[] }>;\n\nconst GRAMMARS: Record<string, Grammar> = {\n\ttypescript: () => import('shiki/langs/typescript.mjs'),\n\ttsx: () => import('shiki/langs/tsx.mjs'),\n\tjavascript: () => import('shiki/langs/javascript.mjs'),\n\tjsx: () => import('shiki/langs/jsx.mjs'),\n\tsvelte: () => import('shiki/langs/svelte.mjs'),\n\thtml: () => import('shiki/langs/html.mjs'),\n\txml: () => import('shiki/langs/xml.mjs'),\n\tcss: () => import('shiki/langs/css.mjs'),\n\tscss: () => import('shiki/langs/scss.mjs'),\n\tjson: () => import('shiki/langs/json.mjs'),\n\tjsonc: () => import('shiki/langs/jsonc.mjs'),\n\tmarkdown: () => import('shiki/langs/markdown.mjs'),\n\tpython: () => import('shiki/langs/python.mjs'),\n\tshellscript: () => import('shiki/langs/shellscript.mjs'),\n\tyaml: () => import('shiki/langs/yaml.mjs'),\n\ttoml: () => import('shiki/langs/toml.mjs'),\n\trust: () => import('shiki/langs/rust.mjs'),\n\tgo: () => import('shiki/langs/go.mjs'),\n\tsql: () => import('shiki/langs/sql.mjs'),\n\tdiff: () => import('shiki/langs/diff.mjs'),\n\tdocker: () => import('shiki/langs/docker.mjs'),\n\tmake: () => import('shiki/langs/make.mjs')\n};\n\nconst THEME = 'github-dark-default';\n\n/** Text longer than this is drawn plain: tokenizing it would stall the page. */\nconst HIGHLIGHT_LIMIT_CHARS = 400_000;\n\nlet core: Promise<HighlighterCore> | null = null;\n\nfunction highlighter(): Promise<HighlighterCore> {\n\treturn (core ??= (async () => {\n\t\tconst [{ createHighlighterCore }, { createJavaScriptRegexEngine }, theme] = await Promise.all([\n\t\t\timport('shiki/core'),\n\t\t\timport('shiki/engine/javascript'),\n\t\t\timport('shiki/themes/github-dark-default.mjs')\n\t\t]);\n\t\treturn createHighlighterCore({ themes: [theme.default], langs: [], engine: createJavaScriptRegexEngine() });\n\t})());\n}\n\n/**\n * Each line's tokens with their colours, or null when the language is not one\n * this loads or the text is too long (the caller then draws it plain).\n */\nexport async function highlightFile(text: string, language: string | null): Promise<ThemedToken[][] | null> {\n\tif (!language || !GRAMMARS[language] || text.length > HIGHLIGHT_LIMIT_CHARS) return null;\n\tconst shiki = await highlighter();\n\tif (!shiki.getLoadedLanguages().includes(language)) await shiki.loadLanguage((await GRAMMARS[language]()).default);\n\treturn shiki.codeToTokens(text, { lang: language, theme: THEME }).tokens;\n}\n","import { createPersisted } from './persisted';\n\n/** What the Files pane keeps per session between visits; the URL holds the open file. */\nexport interface FilesPrefs {\n\t/** Directories open in the tree, relative to the project root. */\n\texpanded?: string[];\n\t/** The file last open, which the pane reopens when the URL names none. */\n\tfile?: string;\n\t/** List the entries git ignores. */\n\tshowIgnored?: boolean;\n}\n\nconst persisted = createPersisted<Record<string, FilesPrefs>>('claude-mux-files-pane', {});\n\n/** The Files pane's per-session preferences, keyed by session id: a pane target is reused by later sessions. */\nclass FilesPaneStore {\n\tprivate state = $state<Record<string, FilesPrefs>>(persisted.load());\n\n\tget(id: string | null): FilesPrefs {\n\t\treturn (id && this.state[id]) || {};\n\t}\n\n\tupdate(id: string | null, patch: FilesPrefs): void {\n\t\tif (!id) return;\n\t\tthis.state[id] = { ...this.state[id], ...patch };\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const filesPaneStore = new FilesPaneStore();\n","export function cn(...classes) {\n return classes.filter(Boolean).join(' ');\n}\nexport const isBrowser = typeof document !== 'undefined';\n","import { isBrowser } from './internal/helpers.js';\nimport { sonnerContext } from './internal/ctx.js';\nimport { untrack } from 'svelte';\nlet toastsCounter = 0;\n// A toast keeps the id it was given, otherwise it gets the next one from the counter.\n// `custom` needs the same id `create` would pick, as it hands it to the component.\nfunction getToastId(data) {\n return typeof data?.id === 'number' || (typeof data?.id === 'string' && data.id.length > 0)\n ? data.id\n : toastsCounter++;\n}\nclass ToastState {\n toasts = $state([]);\n heights = $state([]);\n // Removals whose exit animation is running but whose entry hasn't been removed yet\n #pendingRemovals = new Map();\n #findToastIdx = (id) => {\n const idx = this.toasts.findIndex((toast) => toast.id === id);\n if (idx === -1)\n return null;\n return idx;\n };\n #findHeightIdx = (toastId) => this.heights.findIndex((height) => height.toastId === toastId);\n addToast = (data) => {\n if (!isBrowser)\n return;\n this.toasts.unshift(data);\n };\n updateToast = ({ id, data, type, message }) => {\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n const toastToUpdate = this.toasts[toastIdx];\n this.toasts[toastIdx] = {\n ...toastToUpdate,\n ...data,\n id,\n title: message,\n type,\n // A dismissal that hasn't been processed yet gets cancelled: the toast is\n // still on screen, so this is an update of it rather than a new toast.\n dismiss: false,\n delete: false,\n updated: true\n };\n };\n // Flags a toast that was dismissed from inside the Toast component (close button,\n // swipe, action/cancel click, auto-close) so `create` treats an id reuse as a new\n // toast instead of merging the old props into it.\n markDismissed = (id) => {\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n const toast = this.toasts[toastIdx];\n if (!toast)\n return;\n if (!toast.dismiss || !toast.delete) {\n this.toasts[toastIdx] = { ...toast, dismiss: true, delete: true };\n }\n };\n scheduleRemoval = (id, delay) => {\n this.cancelRemoval(id);\n this.#pendingRemovals.set(id, setTimeout(() => {\n this.#pendingRemovals.delete(id);\n this.remove(id);\n }, delay));\n };\n cancelRemoval = (id) => {\n const timeout = this.#pendingRemovals.get(id);\n if (timeout !== undefined) {\n clearTimeout(timeout);\n this.#pendingRemovals.delete(id);\n }\n };\n create = (data) => {\n const { message, ...rest } = data;\n const id = getToastId(data);\n // Support deprecated `dismissable` as a fallback for backwards compatibility\n const dismissible = data.dismissible !== undefined\n ? data.dismissible\n : data.dismissable !== undefined\n ? data.dismissable\n : true;\n const type = data.type === undefined ? 'default' : data.type;\n untrack(() => {\n // A removal that hasn't run yet gets cancelled: this create() supersedes it,\n // otherwise the old toast's unmount timeout would remove the new one.\n this.cancelRemoval(id);\n const alreadyExists = this.toasts.find((toast) => toast.id === id);\n if (alreadyExists?.dismiss || alreadyExists?.delete) {\n // The previous toast with this id was dismissed, so this is a brand new\n // toast. Drop the old one instead of merging into it, otherwise its\n // props (e.g. `action`) leak into the new one. `updated` makes the still\n // mounted component reset its auto-close timer: when the recreate happens\n // in the same tick as the dismissal, the keyed each reuses the component\n // before it ever processed the dismissal, so the old timer would\n // otherwise keep running.\n this.remove(id);\n this.addToast({\n ...rest,\n id,\n title: message,\n dismissible,\n type,\n updated: true\n });\n }\n else if (alreadyExists) {\n this.updateToast({ id, data, type, message, dismissible });\n }\n else {\n this.addToast({ ...rest, id, title: message, dismissible, type });\n }\n });\n return id;\n };\n dismiss = (id) => {\n untrack(() => {\n if (id === undefined) {\n // we're dismissing all the active toasts\n this.toasts = this.toasts.map((toast) => toast.dismiss ? toast : { ...toast, dismiss: true });\n return;\n }\n // we're dismissing a specific toast\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n if (this.toasts[toastIdx]) {\n this.toasts[toastIdx] = { ...this.toasts[toastIdx], dismiss: true };\n }\n });\n return id;\n };\n remove = (id) => {\n if (id === undefined) {\n // remove all toasts\n this.toasts = [];\n return;\n }\n // remove a specific toast\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n this.toasts.splice(toastIdx, 1);\n return id;\n };\n message = (message, data) => {\n return this.create({ ...data, type: 'default', message });\n };\n error = (message, data) => {\n return this.create({ ...data, type: 'error', message });\n };\n success = (message, data) => {\n return this.create({ ...data, type: 'success', message });\n };\n info = (message, data) => {\n return this.create({ ...data, type: 'info', message });\n };\n warning = (message, data) => {\n return this.create({ ...data, type: 'warning', message });\n };\n loading = (message, data) => {\n return this.create({ ...data, type: 'loading', message });\n };\n promise = (promise, data) => {\n if (!data) {\n // Nothing to show\n return;\n }\n let id = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: typeof data.loading === 'string' ? data.loading : data.loading()\n });\n }\n const p = promise instanceof Promise ? promise : promise();\n let shouldDismiss = id !== undefined;\n p.then((response) => {\n if (typeof response === 'object' &&\n response &&\n 'ok' in response &&\n typeof response.ok === 'boolean' &&\n !response.ok) {\n shouldDismiss = false;\n const message = constructPromiseErrorMessage(response);\n this.create({ id, type: 'error', message });\n }\n else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? data.success(response) : data.success;\n this.create({ id, type: 'success', message });\n }\n })\n .catch((error) => {\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? data.error(error) : data.error;\n this.create({ id, type: 'error', message });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n data.finally?.();\n });\n return id;\n };\n custom = (component, data) => {\n const id = getToastId(data);\n this.create({ component, ...data, id });\n return id;\n };\n removeHeight = (id) => {\n this.heights = this.heights.filter((height) => height.toastId !== id);\n };\n setHeight = (data) => {\n // untrack: setHeight runs inside a $effect; a tracked read of this.heights\n // would re-trigger it on the write below (effect_update_depth_exceeded).\n untrack(() => {\n const heightIdx = this.#findHeightIdx(data.toastId);\n if (heightIdx !== -1) {\n this.heights[heightIdx] = data;\n return;\n }\n // The offset math and --front-toast-height assume heights share the\n // newest-first order of `toasts`, so insert at the matching position.\n // With batched mounts (several toasts created in one tick, or created\n // before the Toaster mounted) the components mount newest-first and a\n // plain unshift would reverse them.\n const order = new Map(this.toasts.map((toast, idx) => [toast.id, idx]));\n const toastOrder = order.get(data.toastId) ?? -1;\n const insertIdx = this.heights.findIndex((height) => (order.get(height.toastId) ?? Infinity) > toastOrder);\n if (insertIdx === -1) {\n this.heights.push(data);\n }\n else {\n this.heights.splice(insertIdx, 0, data);\n }\n });\n };\n reset = () => {\n this.toasts = [];\n this.heights = [];\n this.#pendingRemovals.forEach((timeout) => clearTimeout(timeout));\n this.#pendingRemovals.clear();\n };\n}\nfunction constructPromiseErrorMessage(response) {\n if (response && typeof response === 'object' && 'status' in response) {\n return `HTTP error! Status: ${response.status}`;\n }\n return `Error! ${response}`;\n}\nexport const toastState = new ToastState();\nfunction toastFunction(message, data) {\n return toastState.message(message, data);\n}\nexport class SonnerState {\n /**\n * A derived state of the toasts that are not dismissed.\n */\n #activeToasts = $derived(toastState.toasts.filter((toast) => !toast.dismiss));\n get toasts() {\n return this.#activeToasts;\n }\n}\n/**\n * A hook to get a reference to the sonner toast state.\n *\n * Returns a class instance a getter for the `toasts` array.\n *\n * @example\n * ```svelte\n * <script lang=\"ts\">\n * import { useSonner } from 'svelte-sonner';\n *\n * const sonner = useSonner();\n *\n * // Reactive access to the toasts\n * $effect(() => console.log(sonner.toasts))\n * </script>\n * ```\n */\nexport function useSonner() {\n return sonnerContext.get();\n}\nconst basicToast = toastFunction;\nexport const toast = Object.assign(basicToast, {\n success: toastState.success,\n info: toastState.info,\n warning: toastState.warning,\n error: toastState.error,\n custom: toastState.custom,\n message: toastState.message,\n promise: toastState.promise,\n dismiss: toastState.dismiss,\n loading: toastState.loading,\n getActiveToasts: () => {\n return toastState.toasts.filter((toast) => !toast.dismiss);\n }\n});\n","import { toast } from 'svelte-sonner';\n\n/** Copy `text` and say so, or say that it could not be copied. */\nexport async function copyWithToast(text: string, done = 'Copied'): Promise<void> {\n\ttry {\n\t\tawait navigator.clipboard.writeText(text);\n\t\ttoast.success(done, { description: text });\n\t} catch {\n\t\ttoast.error('Could not copy');\n\t}\n}\n","<script lang=\"ts\">\n\t/**\n\t * The session's project, read-only. With no file open the tree takes the\n\t * whole pane; once one is, the file has the pane and the tree narrows to a\n\t * column on its far side, which a button in the file's header puts away\n\t * and brings back. On a narrow pane the two take turns instead. The\n\t * arrangement and its measures follow t3code's FilePreviewPanel\n\t * (https://github.com/pingdotgg/t3code, MIT, © T3 Tools Inc.).\n\t *\n\t * The URL holds the file (`file`, relative to the project root) and the\n\t * line to show (`line`). Which directories are open, the last file, and\n\t * whether ignored entries are listed persist per session. Shiki loads the\n\t * first time a file is drawn.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { ThemedToken } from 'shiki/core';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport * as ContextMenu from '$lib/components/ui/context-menu';\n\timport * as Popover from '$lib/components/ui/popover';\n\timport { Input } from '$lib/components/ui/input';\n\timport {\n\t\tancestors,\n\t\tbaseName,\n\t\tfuzzyFilter,\n\t\tisMarkdown,\n\t\tparentOf,\n\t\tshikiLanguage,\n\t\ttype DirListing,\n\t\ttype FileEntry,\n\t\ttype FileRead\n\t} from '$lib/side-panel/files';\n\timport { displayPath } from '$lib/side-panel/changes';\n\timport { highlightFile } from '$lib/side-panel/shiki';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { filesPaneStore } from '$lib/stores/filesPane.svelte';\n\timport { preferences } from '$lib/stores/preferences.svelte';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\n\tlet { session, base, params, setParams, setActions, mention, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `${sessionApiAt(base, sessionId)}/files` : null);\n\tconst prefs = $derived(filesPaneStore.get(sessionId));\n\tconst showIgnored = $derived(prefs.showIgnored === true);\n\t// Only paths inside the root belong here; an older build could save others.\n\tconst expanded = $derived(new Set((prefs.expanded ?? []).filter((d) => d && !d.startsWith('/'))));\n\n\t// ── the tree ─────────────────────────────────────────────────────────\n\n\ttype DirState = DirListing | { error: string } | 'loading';\n\tlet dirs = $state<Record<string, DirState>>({});\n\t/** Bumped by a reload or the ignored toggle, so answers for the old tree are dropped. */\n\tlet treeEpoch = 0;\n\n\tasync function loadDir(dir: string) {\n\t\tif (!api) return;\n\t\tconst epoch = treeEpoch;\n\t\tdirs[dir] = 'loading';\n\t\tconst q = new URLSearchParams({ dir });\n\t\tif (showIgnored) q.set('ignored', '1');\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/tree?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (epoch !== treeEpoch) return;\n\t\t\tdirs[dir] = res.ok ? (body as DirListing) : { error: body.error ?? `HTTP ${res.status}` };\n\t\t} catch (err) {\n\t\t\tif (epoch === treeEpoch) dirs[dir] = { error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tfunction reloadTree() {\n\t\ttreeEpoch++;\n\t\tdirs = {};\n\t\tvoid loadDir('');\n\t\tfor (const dir of expanded) void loadDir(dir);\n\t}\n\n\t/** A directory's entries, once they have been read. */\n\tfunction listingOf(dir: string): DirListing | null {\n\t\tconst d = dirs[dir];\n\t\treturn d && d !== 'loading' && 'entries' in d ? d : null;\n\t}\n\tconst rootListing = $derived(listingOf(''));\n\tconst root = $derived(rootListing?.root ?? null);\n\tconst repo = $derived(rootListing?.repo ?? false);\n\n\t/** What the tree was last read for; showing the pane again reuses it, Reload reads it afresh. */\n\tlet readFor: string | null = null;\n\t$effect(() => {\n\t\tconst key = `${api}\\0${showIgnored}`;\n\t\tif (!active || !api || key === readFor) return;\n\t\treadFor = key;\n\t\tuntrack(reloadTree);\n\t});\n\n\tfunction setExpanded(dir: string, open: boolean) {\n\t\tconst next = new Set(expanded);\n\t\tif (open) next.add(dir);\n\t\telse next.delete(dir);\n\t\tfilesPaneStore.update(sessionId, { expanded: [...next] });\n\t\tif (open && !dirs[dir]) void loadDir(dir);\n\t}\n\n\t/** Enough to open any project worth reading as a tree, and a stop for one that is not. */\n\tconst EXPAND_ALL_DIRS = 400;\n\n\t/**\n\t * Open every directory, a level at a time. Ignored directories and links\n\t * stay shut: `node_modules` is nobody's idea of \"everything\", and a link\n\t * can lead back up the tree.\n\t */\n\tasync function expandAll() {\n\t\tconst open: string[] = [];\n\t\tlet level = [''];\n\t\twhile (level.length > 0 && open.length < EXPAND_ALL_DIRS) {\n\t\t\tconst next: string[] = [];\n\t\t\t// All at once: the browser already holds a host to a few requests at a time.\n\t\t\tawait Promise.all(level.filter((dir) => !listingOf(dir)).map(loadDir));\n\t\t\tfor (const dir of level) {\n\t\t\t\tfor (const entry of listingOf(dir)?.entries ?? []) {\n\t\t\t\t\tif (entry.type === 'dir' && !entry.ignored && !entry.link) next.push(entry.path);\n\t\t\t\t}\n\t\t\t}\n\t\t\topen.push(...next);\n\t\t\tlevel = next;\n\t\t}\n\t\tfilesPaneStore.update(sessionId, { expanded: open.slice(0, EXPAND_ALL_DIRS) });\n\t}\n\n\tfunction collapseAll() {\n\t\tfilesPaneStore.update(sessionId, { expanded: [] });\n\t}\n\n\tfunction toggleIgnored() {\n\t\tfilesPaneStore.update(sessionId, { showIgnored: !showIgnored });\n\t}\n\n\t// ── the open file ────────────────────────────────────────────────────\n\n\t/** The file the URL names, made relative when it is an absolute path inside the root. */\n\tconst wantedFile = $derived(params.file ? displayPath(params.file, root) : null);\n\tconst wantedLine = $derived.by(() => {\n\t\tconst n = Number(params.line);\n\t\treturn Number.isInteger(n) && n > 0 ? n : null;\n\t});\n\n\t// No file in the URL: reopen the one last open here.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => prefs.file);\n\t\tif (!params.file && last) setParams({ file: last });\n\t});\n\n\ttype Shown = { path: string; read: FileRead } | { path: string; error: string; binary?: boolean };\n\tlet shown = $state<Shown | null>(null);\n\tlet fileSeq = 0;\n\n\tasync function loadFile(path: string) {\n\t\tif (!api) return;\n\t\tconst mine = ++fileSeq;\n\t\ttry {\n\t\t\t// The URL's file may come from a message, which seldom spells it from the root.\n\t\t\tconst res = await fetch(`${api}/read?${new URLSearchParams({ path, locate: '1' })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== fileSeq) return;\n\t\t\tif (!res.ok) {\n\t\t\t\tshown = { path, error: body.error ?? `HTTP ${res.status}`, binary: body.binary === true };\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst read = body as FileRead;\n\t\t\tshown = { path, read };\n\t\t\t// An absolute or roundabout spelling settles on the path inside the root.\n\t\t\tif (read.path !== path) {\n\t\t\t\tfileReadFor = `${read.path}\\0${params.line ?? ''}`;\n\t\t\t\tsetParams({ file: read.path });\n\t\t\t}\n\t\t\trevealInTree(read.path);\n\t\t\tfilesPaneStore.update(sessionId, { file: read.path });\n\t\t} catch (err) {\n\t\t\tif (mine === fileSeq) shown = { path, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\t/**\n\t * What the file was last read for: its path and the line asked. A link\n\t * that names the open file again (after Claude edited it, say) reads it\n\t * afresh rather than scrolling stale text; showing the pane again does not.\n\t */\n\tlet fileReadFor: string | null = null;\n\t$effect(() => {\n\t\tconst path = wantedFile;\n\t\tif (!path || !active) return;\n\t\tconst key = `${path}\\0${params.line ?? ''}`;\n\t\tif (key === fileReadFor) return;\n\t\tfileReadFor = key;\n\t\tuntrack(() => void loadFile(path));\n\t});\n\n\t/** Open the directories that hold `path` (inside the root), so the tree shows where it is. */\n\tfunction revealInTree(path: string) {\n\t\tconst missing = ancestors(path).filter((d) => !expanded.has(d));\n\t\tif (missing.length === 0) return;\n\t\tfilesPaneStore.update(sessionId, { expanded: [...expanded, ...missing] });\n\t\tfor (const d of missing) if (!dirs[d]) void loadDir(d);\n\t}\n\n\tconst current = $derived(\n\t\tshown && wantedFile && (shown.path === wantedFile || ('read' in shown && shown.read.path === wantedFile))\n\t\t\t? shown\n\t\t\t: null\n\t);\n\tconst read = $derived(current && 'read' in current ? current.read : null);\n\tconst openPath = $derived(read?.path ?? wantedFile);\n\n\tfunction openFile(path: string, line?: number) {\n\t\tsetParams({ file: path, line: line ? String(line) : null }, { push: true });\n\t}\n\n\tfunction closeFile() {\n\t\tfilesPaneStore.update(sessionId, { file: undefined });\n\t\tsetParams({ file: null, line: null });\n\t}\n\n\t/** Markdown opens rendered; this flips the open file to its source. */\n\tlet mdSource = $state(false);\n\tconst markdown = $derived(read?.kind === 'text' && isMarkdown(read.path));\n\tconst rendered = $derived(markdown && !mdSource && wantedLine === null);\n\n\tconst lines = $derived(read?.kind === 'text' ? read.text.replace(/\\n$/, '').split('\\n') : []);\n\tlet tokens = $state<ThemedToken[][] | null>(null);\n\t$effect(() => {\n\t\ttokens = null;\n\t\tif (read?.kind !== 'text' || rendered) return;\n\t\tconst { text, path } = read;\n\t\tlet stale = false;\n\t\tvoid highlightFile(text, shikiLanguage(path)).then((t) => {\n\t\t\tif (!stale) tokens = t;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t/** Lines are drawn in blocks the browser may skip laying out while off screen. */\n\tconst CHUNK = 200;\n\tconst chunks = $derived(\n\t\tArray.from({ length: Math.ceil(lines.length / CHUNK) }, (_, i) => i * CHUNK)\n\t);\n\n\tlet codeEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\tconst line = wantedLine;\n\t\tif (!line || !codeEl || lines.length === 0) return;\n\t\tvoid tokens;\n\t\trequestAnimationFrame(() =>\n\t\t\tcodeEl?.querySelector(`[data-line=\"${line}\"]`)?.scrollIntoView({ block: 'center' })\n\t\t);\n\t});\n\n\tfunction pickLine(n: number) {\n\t\tsetParams({ line: wantedLine === n ? null : String(n) });\n\t}\n\n\tconst copyText = (text: string) => copyWithToast(text, 'Path copied');\n\n\tfunction copyPath() {\n\t\tif (openPath) void copyText(wantedLine ? `${openPath}:${wantedLine}` : openPath);\n\t}\n\n\t/**\n\t * How Claude Code is told about a path. It reads an `@path` from the\n\t * session's cwd, which may sit below the root this pane lists from: the\n\t * path is made relative to the cwd, or left absolute when the cwd is not\n\t * inside the root.\n\t */\n\tfunction mentionOf(path: string): string | null {\n\t\tif (!root) return null;\n\t\tconst cwd = session?.cwd ?? root;\n\t\treturn `@${cwd === root ? path : displayPath(`${root}/${path}`, cwd)}`;\n\t}\n\n\tfunction mentionPath(path: string | null) {\n\t\tconst text = path && mentionOf(path);\n\t\tif (text) mention(text);\n\t}\n\n\t// ── a row's own menu, and dragging it to the composer ────────────────\n\n\t/** The row the context menu was opened on; one menu serves the whole tree. */\n\tlet menuEntry = $state<{ path: string; dir: boolean } | null>(null);\n\n\t/** Right-clicking the list between rows is the browser's business, not ours. */\n\tfunction onListContextMenu(e: MouseEvent) {\n\t\tconst row = (e.target as Element | null)?.closest<HTMLElement>('[data-path]');\n\t\tconst path = row?.dataset.path;\n\t\tif (!path) return e.stopPropagation();\n\t\tmenuEntry = { path, dir: row.dataset.type === 'dir' };\n\t}\n\n\t/** Dropped on the composer, a row becomes a mention of it; anywhere else, its path. */\n\tfunction onRowDrag(e: DragEvent, path: string) {\n\t\tif (!e.dataTransfer) return;\n\t\te.dataTransfer.setData('text/plain', `${mentionOf(path) ?? path} `);\n\t\te.dataTransfer.effectAllowed = 'copy';\n\t}\n\n\t// ── the breadcrumb, which finds its way around without the tree ──────\n\n\t/** The crumb whose menu is open, and the directory that menu is showing. */\n\tlet crumbFor = $state<string | null>(null);\n\tlet browsing = $state('');\n\n\tfunction browse(dir: string) {\n\t\tbrowsing = dir;\n\t\tif (!dirs[dir]) void loadDir(dir);\n\t}\n\n\tconst crumbs = $derived(openPath ? ancestors(openPath) : []);\n\tconst rootName = $derived((root && baseName(root)) || 'root');\n\tconst explorerLabel = $derived(preferences.fileExplorerOpen ? 'Hide file explorer' : 'Show file explorer');\n\n\t/** The file's own name is what was asked for, so the row of crumbs rests on it. */\n\tlet crumbsEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\t// Everything that changes how wide the row or its box is.\n\t\tvoid [openPath, rootName, read, markdown, preferences.fileExplorerOpen];\n\t\tconst el = crumbsEl;\n\t\t// After the frame: the crumbs for the new path are not laid out yet.\n\t\tif (el) requestAnimationFrame(() => (el.scrollLeft = el.scrollWidth));\n\t});\n\n\tfunction formatSize(bytes: number): string {\n\t\tif (bytes < 1024) return `${bytes} B`;\n\t\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\t\treturn `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n\t}\n\n\t// ── quick open ───────────────────────────────────────────────────────\n\n\tlet query = $state('');\n\tlet allFiles = $state<string[] | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet listing = false;\n\tlet picked = $state(0);\n\n\tasync function loadAll() {\n\t\tif (allFiles || listing || !api) return;\n\t\tlisting = true;\n\t\tlistError = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/list`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tallFiles = (body as { files: string[] }).files;\n\t\t} catch (err) {\n\t\t\tlistError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tlisting = false;\n\t\t}\n\t}\n\n\tconst results = $derived(query.trim() && allFiles ? fuzzyFilter(query, allFiles) : []);\n\t$effect(() => {\n\t\tvoid results;\n\t\tpicked = 0;\n\t});\n\n\tfunction openResult(path: string) {\n\t\tquery = '';\n\t\topenFile(path);\n\t}\n\n\tfunction onQueryKey(e: KeyboardEvent) {\n\t\tif (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n\t\t\te.preventDefault();\n\t\t\tconst n = results.length;\n\t\t\tif (n) picked = (picked + (e.key === 'ArrowDown' ? 1 : n - 1)) % n;\n\t\t\tdocument.querySelector(`[data-result=\"${picked}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t\t} else if (e.key === 'Enter' && results[picked]) {\n\t\t\te.preventDefault();\n\t\t\topenResult(results[picked]);\n\t\t} else if (e.key === 'Escape' && query) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tquery = '';\n\t\t}\n\t}\n\n\t// ── header actions ───────────────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t...(repo\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: showIgnored ? 'mdi:eye-outline' : 'mdi:eye-off-outline',\n\t\t\t\t\t\t\tlabel: showIgnored ? 'Hide ignored files' : 'Show ignored files',\n\t\t\t\t\t\t\tpressed: showIgnored,\n\t\t\t\t\t\t\trun: toggleIgnored\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\texpanded.size > 0\n\t\t\t\t? { icon: 'mdi:unfold-less-horizontal', label: 'Collapse all folders', run: collapseAll }\n\t\t\t\t: { icon: 'mdi:unfold-more-horizontal', label: 'Expand all folders', run: () => void expandAll() },\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId,\n\t\t\t\trun: () => {\n\t\t\t\t\tallFiles = null;\n\t\t\t\t\tif (query.trim()) void loadAll();\n\t\t\t\t\treloadTree();\n\t\t\t\t\tif (wantedFile) void loadFile(wantedFile);\n\t\t\t\t}\n\t\t\t}\n\t\t]);\n\t});\n</script>\n\n{#snippet tree(dir: string, depth: number)}\n\t{@const d = dirs[dir]}\n\t{#if d === 'loading' || d === undefined}\n\t\t<div class=\"note\" style:--depth={depth}>Loading…</div>\n\t{:else if 'error' in d}\n\t\t<div class=\"note err\" style:--depth={depth}>{d.error}</div>\n\t{:else}\n\t\t{#each d.entries as entry (entry.path)}\n\t\t\t{@render node(entry, depth)}\n\t\t{/each}\n\t\t{#if d.entries.length === 0}\n\t\t\t<div class=\"note\" style:--depth={depth}>{d.hidden ? `${d.hidden} ignored` : 'Empty'}</div>\n\t\t{/if}\n\t{/if}\n{/snippet}\n\n{#snippet node(entry: FileEntry, depth: number)}\n\t{#if entry.type === 'dir'}\n\t\t{@const open = expanded.has(entry.path)}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item dir\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tstyle:--depth={depth}\n\t\t\taria-expanded={open}\n\t\t\ttitle={entry.path}\n\t\t\tdata-path={entry.path}\n\t\t\tdata-type=\"dir\"\n\t\t\tdraggable=\"true\"\n\t\t\tondragstart={(e) => onRowDrag(e, entry.path)}\n\t\t\tonclick={() => setExpanded(entry.path, !open)}\n\t\t>\n\t\t\t<iconify-icon class=\"chev\" class:open icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t<iconify-icon class=\"ico\" icon={open ? 'mdi:folder-open-outline' : 'mdi:folder-outline'}></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t\t{#if open}{@render tree(entry.path, depth + 1)}{/if}\n\t{:else}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item file\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tclass:on={openPath === entry.path}\n\t\t\taria-current={openPath === entry.path ? 'true' : undefined}\n\t\t\tstyle:--depth={depth}\n\t\t\ttitle={entry.path}\n\t\t\tdata-path={entry.path}\n\t\t\tdata-type=\"file\"\n\t\t\tdraggable=\"true\"\n\t\t\tondragstart={(e) => onRowDrag(e, entry.path)}\n\t\t\tonclick={() => openFile(entry.path)}\n\t\t>\n\t\t\t<span class=\"chev\"></span>\n\t\t\t<iconify-icon class=\"ico\" icon=\"mdi:file-outline\"></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t{/if}\n{/snippet}\n\n<!-- A folder in the breadcrumb opens onto what it holds, and from there onto any folder below it. -->\n{#snippet crumb(dir: string, label: string)}\n\t<Popover.Root\n\t\tbind:open={() => crumbFor === dir, (open) => {\n\t\t\tcrumbFor = open ? dir : null;\n\t\t\tif (open) browse(dir);\n\t\t}}\n\t>\n\t\t<Popover.Trigger class=\"shrink-0 cursor-pointer rounded px-1 py-0.5 font-mono text-xs text-stone-400 hover:bg-[#1f1f1f] hover:text-stone-100\">\n\t\t\t{label}\n\t\t</Popover.Trigger>\n\t\t<Popover.Content align=\"start\" class=\"w-64 max-w-[80vw] border-[#333] bg-[#1a1a1a] p-1\">\n\t\t\t{@const listing = listingOf(browsing)}\n\t\t\t<div class=\"flex max-h-72 flex-col overflow-y-auto font-mono text-xs\">\n\t\t\t\t{#if browsing !== dir}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"flex min-h-8 items-center gap-1.5 rounded px-2 text-left text-stone-400 hover:bg-[#262626]\"\n\t\t\t\t\t\tonclick={() => browse(parentOf(browsing))}\n\t\t\t\t\t>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\tBack to {baseName(parentOf(browsing)) || rootName}\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t{#if !listing}\n\t\t\t\t\t<div class=\"px-2 py-1.5 text-stone-500\">\n\t\t\t\t\t\t{dirs[browsing] && dirs[browsing] !== 'loading' ? 'Could not read this folder' : 'Loading…'}\n\t\t\t\t\t</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each listing.entries as entry (entry.path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"flex min-h-8 items-center gap-1.5 rounded px-2 text-left text-stone-200 hover:bg-[#262626] {entry.path ===\n\t\t\t\t\t\t\topenPath\n\t\t\t\t\t\t\t\t? 'bg-[#262626]'\n\t\t\t\t\t\t\t\t: ''} {entry.ignored ? 'text-stone-500' : ''}\"\n\t\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\t\tif (entry.type === 'dir') return browse(entry.path);\n\t\t\t\t\t\t\t\tcrumbFor = null;\n\t\t\t\t\t\t\t\topenFile(entry.path);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<iconify-icon icon={entry.type === 'dir' ? 'mdi:folder-outline' : 'mdi:file-outline'}></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 truncate\">{entry.name}</span>\n\t\t\t\t\t\t\t{#if entry.type === 'dir'}<iconify-icon icon=\"mdi:chevron-right\"></iconify-icon>{/if}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t\t{#if listing.entries.length === 0}\n\t\t\t\t\t\t<div class=\"px-2 py-1.5 text-stone-500\">Empty</div>\n\t\t\t\t\t{/if}\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</Popover.Content>\n\t</Popover.Root>\n{/snippet}\n\n<div class=\"files\" class:picked={!!wantedFile} class:tree-off={!preferences.fileExplorerOpen}>\n\t<nav aria-label=\"Project files\">\n\t\t{#if repo}\n\t\t\t<div class=\"search\">\n\t\t\t\t<iconify-icon icon=\"mdi:magnify\"></iconify-icon>\n\t\t\t\t<Input\n\t\t\t\t\tbind:value={query}\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder=\"Go to file…\"\n\t\t\t\t\taria-label=\"Go to file\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tspellcheck={false}\n\t\t\t\t\tonfocus={loadAll}\n\t\t\t\t\tonkeydown={onQueryKey}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t{/if}\n\t\t<!-- svelte-ignore a11y_no_static_element_interactions -->\n\t\t<div class=\"list\" oncontextmenucapture={onListContextMenu}>\n\t\t\t{#if query.trim()}\n\t\t\t\t{#if listError}\n\t\t\t\t\t<div class=\"note err\">{listError}</div>\n\t\t\t\t{:else if !allFiles}\n\t\t\t\t\t<div class=\"note\">Loading…</div>\n\t\t\t\t{:else if results.length === 0}\n\t\t\t\t\t<div class=\"note\">No file matches.</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each results as path, i (path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"item result\"\n\t\t\t\t\t\t\tclass:on={i === picked}\n\t\t\t\t\t\t\tdata-result={i}\n\t\t\t\t\t\t\ttitle={path}\n\t\t\t\t\t\t\tonclick={() => openResult(path)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"name\">{baseName(path)}</span>\n\t\t\t\t\t\t\t<span class=\"dirname\"><bdi>{parentOf(path)}</bdi></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t{#if root}\n\t\t\t\t\t<div class=\"root\" title={root}>{rootName}</div>\n\t\t\t\t{/if}\n\t\t\t\t<ContextMenu.Root>\n\t\t\t\t\t<ContextMenu.Trigger>{@render tree('', 0)}</ContextMenu.Trigger>\n\t\t\t\t\t<ContextMenu.Content class=\"min-w-44\">\n\t\t\t\t\t\t{#if menuEntry}\n\t\t\t\t\t\t\t{@const entry = menuEntry}\n\t\t\t\t\t\t\t{#if !entry.dir}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => openFile(entry.path)}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-eye-outline\"></iconify-icon>\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => setExpanded(entry.path, !expanded.has(entry.path))}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon={expanded.has(entry.path) ? 'mdi:folder-outline' : 'mdi:folder-open-outline'}\n\t\t\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t\t\t{expanded.has(entry.path) ? 'Collapse' : 'Expand'}\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => mentionPath(entry.path)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t\t\t\t\tAdd to chat\n\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t<ContextMenu.Separator />\n\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => void copyText(entry.path)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t\tCopy path\n\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{#if root}\n\t\t\t\t\t\t\t\t<ContextMenu.Item onSelect={() => void copyText(`${root}/${entry.path}`)}>\n\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t\t\tCopy absolute path\n\t\t\t\t\t\t\t\t</ContextMenu.Item>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</ContextMenu.Content>\n\t\t\t\t</ContextMenu.Root>\n\t\t\t\t{#if rootListing && !showIgnored && rootListing.hidden > 0}\n\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={toggleIgnored}>\n\t\t\t\t\t\t+ {rootListing.hidden} ignored at the top level (show)\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t{/if}\n\t\t</div>\n\t</nav>\n\n\t{#if wantedFile}\n\t\t<section class=\"viewer\" aria-label=\"File\">\n\t\t\t<div class=\"vhead\">\n\t\t\t\t<button type=\"button\" class=\"icon back\" aria-label=\"Back to files\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<div class=\"crumbs\" bind:this={crumbsEl} title={openPath}>\n\t\t\t\t\t{@render crumb('', rootName)}\n\t\t\t\t\t{#each crumbs as dir (dir)}\n\t\t\t\t\t\t<iconify-icon class=\"sep\" icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t\t\t\t{@render crumb(dir, baseName(dir))}\n\t\t\t\t\t{/each}\n\t\t\t\t\t<iconify-icon class=\"sep\" icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t\t\t<span class=\"leaf\">{openPath ? baseName(openPath) : ''}</span>\n\t\t\t\t</div>\n\t\t\t\t{#if read}<span class=\"dim size\">{formatSize(read.size)}</span>{/if}\n\t\t\t\t{#if markdown}\n\t\t\t\t\t<div class=\"seg\" role=\"group\" aria-label=\"Markdown view\">\n\t\t\t\t\t\t<Toggle\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tbind:pressed={() => rendered, (on) => {\n\t\t\t\t\t\t\t\tif (on) {\n\t\t\t\t\t\t\t\t\tmdSource = false;\n\t\t\t\t\t\t\t\t\tsetParams({ line: null });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}>Preview</Toggle\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<Toggle size=\"sm\" bind:pressed={() => !rendered, (on) => on && (mdSource = true)}>Source</Toggle>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t\t<button type=\"button\" class=\"icon\" title=\"Copy path\" aria-label=\"Copy path\" onclick={copyPath}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\ttitle=\"Mention in composer\"\n\t\t\t\t\taria-label=\"Mention in composer\"\n\t\t\t\t\tonclick={() => mentionPath(openPath)}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t{#if read?.kind === 'text' && !rendered}\n\t\t\t\t\t{@const wrapLabel = preferences.fileWordWrap ? 'Let long lines scroll' : 'Wrap long lines'}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\t\tclass:on={preferences.fileWordWrap}\n\t\t\t\t\t\taria-pressed={preferences.fileWordWrap}\n\t\t\t\t\t\ttitle={wrapLabel}\n\t\t\t\t\t\taria-label={wrapLabel}\n\t\t\t\t\t\tonclick={() => (preferences.fileWordWrap = !preferences.fileWordWrap)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:wrap\"></iconify-icon>\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon wide-only\"\n\t\t\t\t\tclass:on={preferences.fileExplorerOpen}\n\t\t\t\t\taria-pressed={preferences.fileExplorerOpen}\n\t\t\t\t\ttitle={explorerLabel}\n\t\t\t\t\taria-label={explorerLabel}\n\t\t\t\t\tonclick={() => (preferences.fileExplorerOpen = !preferences.fileExplorerOpen)}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"icon wide-only\" title=\"Close file\" aria-label=\"Close file\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:close\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if read?.kind === 'text' && read.truncated}\n\t\t\t\t<div class=\"banner\">Truncated at 1 MB: showing the first {formatSize(read.shown)} of {formatSize(read.size)}.</div>\n\t\t\t{/if}\n\t\t\t{#if !current}\n\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t{:else if 'error' in current}\n\t\t\t\t<p class=\"msg\" class:err={!current.binary}>\n\t\t\t\t\t{current.binary ? 'Binary file; not shown.' : current.error}\n\t\t\t\t</p>\n\t\t\t{:else if read?.kind === 'image'}\n\t\t\t\t<div class=\"image\">\n\t\t\t\t\t<img src=\"{api}/read?{new URLSearchParams({ path: read.path, raw: '1' })}\" alt={read.path} />\n\t\t\t\t</div>\n\t\t\t{:else if rendered && read?.kind === 'text'}\n\t\t\t\t<!-- eslint-disable-next-line svelte/no-at-html-tags -- markdown output with raw HTML escaped -->\n\t\t\t\t<div class=\"md markdown\">{@html renderMarkdown(read.text)}</div>\n\t\t\t{:else if lines.length === 0}\n\t\t\t\t<p class=\"msg\">Empty file.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"code\" class:wrap={preferences.fileWordWrap} bind:this={codeEl} style:--gutter=\"{String(lines.length).length + 1}ch\">\n\t\t\t\t\t{#each chunks as start (start)}\n\t\t\t\t\t\t<div class=\"chunk\" style:--rows={Math.min(CHUNK, lines.length - start)}>\n\t\t\t\t\t\t\t{#each lines.slice(start, start + CHUNK) as text, j (j)}\n\t\t\t\t\t\t\t\t{@const n = start + j + 1}\n\t\t\t\t\t\t\t\t<div class=\"ln\" class:hl={wantedLine === n} data-line={n}>\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"no\" tabindex=\"-1\" onclick={() => pickLine(n)}>{n}</button>\n\t\t\t\t\t\t\t\t\t<span class=\"src\"\n\t\t\t\t\t\t\t\t\t\t>{#if tokens?.[n - 1]}{#each tokens[n - 1] as t, k (k)}<span style:color={t.color}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>{t.content}</span\n\t\t\t\t\t\t\t\t\t\t\t\t>{/each}{:else}{text}{/if}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</section>\n\t{/if}\n</div>\n\n<style>\n\t.files {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t/* Beside an open file the tree sits past it, on the pane's far edge. */\n\t.picked nav {\n\t\torder: 1;\n\t\tflex: none;\n\t\twidth: min(22rem, 46%);\n\t\tmin-width: 16rem;\n\t\tborder-left: 1px solid #222;\n\t}\n\t.picked.tree-off nav {\n\t\tdisplay: none;\n\t}\n\t.search {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tcolor: #78716c;\n\t\tflex: none;\n\t}\n\t.search :global(input) {\n\t\theight: 32px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #1a1a1a;\n\t\tborder-color: #2a2a2a;\n\t}\n\t.list {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 6px 16px;\n\t}\n\t.root {\n\t\tpadding: 4px 8px 6px;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.item {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\twidth: 100%;\n\t\tmin-height: 28px;\n\t\tpadding: 0 8px 0 calc(4px + var(--depth, 0) * 14px);\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.item:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.item.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.item.ignored {\n\t\tcolor: #6b6560;\n\t}\n\t.chev {\n\t\tflex: none;\n\t\twidth: 14px;\n\t\tcolor: #78716c;\n\t\ttransition: transform 0.12s;\n\t}\n\t.chev.open {\n\t\ttransform: rotate(90deg);\n\t}\n\t.ico {\n\t\tflex: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 14px;\n\t}\n\t.dir .ico {\n\t\tcolor: #93c5fd;\n\t}\n\t.ignored .ico {\n\t\tcolor: inherit;\n\t\topacity: 0.6;\n\t}\n\t.link {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 12px;\n\t}\n\t.name {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.result {\n\t\tgap: 10px;\n\t\tpadding-left: 8px;\n\t}\n\t.result .name {\n\t\tflex: none;\n\t\tmax-width: 60%;\n\t}\n\t.dirname {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tcolor: #78716c;\n\t}\n\t.note {\n\t\tpadding: 5px 8px 5px calc(26px + var(--depth, 0) * 14px);\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.more {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t\ttext-align: left;\n\t}\n\t.more:hover {\n\t\tcolor: #d6d3d1;\n\t}\n\t.viewer {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.vhead {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-height: 44px;\n\t\tpadding: 6px 8px 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t/* The way to the file, scrolled to its end: the name is what was asked for. */\n\t.crumbs {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\toverflow-x: auto;\n\t\tscrollbar-width: none;\n\t\twhite-space: nowrap;\n\t}\n\t.crumbs::-webkit-scrollbar {\n\t\tdisplay: none;\n\t}\n\t.crumbs .sep {\n\t\tflex: none;\n\t\tfont-size: 13px;\n\t\tcolor: #57534e;\n\t}\n\t.leaf {\n\t\tflex: none;\n\t\tpadding: 0 4px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tcolor: #e7e5e4;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.size {\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.icon {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.icon:hover,\n\t.icon.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tmargin-left: -8px;\n\t}\n\t.seg {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 2px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 26px;\n\t\tfont-size: 12px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.banner {\n\t\tflex: none;\n\t\tpadding: 6px 14px;\n\t\tbackground: #2a2110;\n\t\tcolor: #fcd34d;\n\t\tfont-size: 12px;\n\t\tborder-bottom: 1px solid #3a2e14;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.msg.err {\n\t\tcolor: #f87171;\n\t}\n\t.image {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px;\n\t\tbackground:\n\t\t\trepeating-conic-gradient(#161616 0 25%, #1c1c1c 0 50%) 0 0 / 16px 16px;\n\t}\n\t.image img {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tdisplay: block;\n\t\tmargin: 0 auto;\n\t}\n\t.md {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px 20px 32px;\n\t\tfont-size: 14px;\n\t\tline-height: 1.6;\n\t}\n\t/* A document, not a reply: its headings stand out more than the transcript's. */\n\t.md :global(h1) {\n\t\tfont-size: 1.45em;\n\t\tmargin-top: 4px;\n\t}\n\t.md :global(h2) {\n\t\tfont-size: 1.2em;\n\t\tmargin-top: 20px;\n\t}\n\t.md :global(h3) {\n\t\tfont-size: 1.05em;\n\t}\n\t.code {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 24px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.chunk {\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-size: auto calc(var(--rows) * 1.65em);\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\tcolor: #c9d1d9;\n\t}\n\t.ln.hl {\n\t\tbackground: #2a2a1a;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: calc(var(--gutter) + 1ch);\n\t\tpadding: 0 1.5ch 0 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t}\n\t.no:hover,\n\t.hl .no {\n\t\tcolor: #d6d3d1;\n\t}\n\t.src {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* Folded at the pane's edge: a block is then as wide as the pane, not as its longest line. */\n\t.wrap .chunk {\n\t\twidth: auto;\n\t}\n\t.wrap .src {\n\t\tmin-width: 0;\n\t\twhite-space: pre-wrap;\n\t\toverflow-wrap: anywhere;\n\t}\n\n\t/* Too narrow for both: the tree, or the open file with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.wide-only {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.item,\n\t\t.more {\n\t\t\tmin-height: 40px;\n\t\t}\n\t\t.icon {\n\t\t\twidth: 40px;\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","/**\n * Lanes for a commit graph.\n *\n * Commits arrive newest first, each naming its parents. A lane is a column a\n * line of history runs down; a commit sits in the lane that was waiting for\n * it, its first parent carries that lane on, and any other parent opens a lane\n * of its own (or joins the one already waiting for it). Lanes never shift\n * sideways, so a branch is a straight line from its tip to where it forks.\n */\n\nexport interface GraphInput {\n hash: string;\n parents: string[];\n}\n\nexport interface GraphRow {\n /** The column the commit's dot sits in. */\n lane: number;\n /** Lanes with a line arriving from above that end at this commit. */\n into: number[];\n /** Lanes with a line that passes this row without touching the commit. */\n through: number[];\n /** Lanes a line leaves this commit toward, one per parent that is listed further down. */\n out: number[];\n}\n\nexport interface Graph {\n rows: GraphRow[];\n /** The most lanes any row uses, for sizing the column the graph is drawn in. */\n width: number;\n}\n\nexport function layoutGraph(commits: readonly GraphInput[]): Graph {\n const listed = new Set(commits.map((c) => c.hash));\n /** What each lane is waiting for next, or null when it is free. */\n const waiting: (string | null)[] = [];\n const free = () => {\n const at = waiting.indexOf(null);\n return at === -1 ? waiting.length : at;\n };\n const rows: GraphRow[] = [];\n let width = 0;\n\n for (const commit of commits) {\n const into: number[] = [];\n waiting.forEach((hash, lane) => {\n if (hash === commit.hash) into.push(lane);\n });\n const lane = into[0] ?? free();\n const through: number[] = [];\n waiting.forEach((hash, i) => {\n if (hash !== null && hash !== commit.hash) through.push(i);\n });\n // Every lane that was waiting for this commit ends here; its own carries on below.\n for (const i of into) waiting[i] = null;\n waiting[lane] = null;\n\n const out: number[] = [];\n // A parent outside the listing (history cut short) draws no line: nothing is there to reach.\n const parents = commit.parents.filter((p) => listed.has(p));\n parents.forEach((parent, n) => {\n // The first parent carries this lane on, even when another lane already\n // waits for the same commit: the two meet there, and neither bends early.\n let to = n === 0 ? lane : waiting.indexOf(parent);\n if (to === -1) to = free();\n waiting[to] = parent;\n if (!out.includes(to)) out.push(to);\n });\n\n while (waiting.length > 0 && waiting[waiting.length - 1] === null) waiting.pop();\n width = Math.max(width, lane + 1, ...through.map((i) => i + 1), ...out.map((i) => i + 1));\n rows.push({ lane, into, through, out });\n }\n return { rows, width };\n}\n","<script lang=\"ts\">\n\t/**\n\t * The repo's commits, read-only: the list on one side, the picked commit's\n\t * files and their diffs on the other, and on a narrow pane the two take\n\t * turns. \"List\" follows the checked-out branch, filed by day; \"Graph\" adds\n\t * every worktree's branch and the upstream, each in a lane of its own, and\n\t * names a lane's tip after the worker running there.\n\t *\n\t * What no other git client can say is said here: which commits this\n\t * session made (and the turn that made them), and which have not left the\n\t * machine yet.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { layoutGraph, type GraphRow } from '$shared/git-graph.js';\n\timport { dayOf, readRef, shortHash, type Commit, type CommitFile, type History } from '$lib/side-panel/history';\n\timport { statusLetter, type Diff } from '$lib/side-panel/changes';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\timport { sessionStore } from '$lib/stores/sessions.svelte';\n\timport { clock } from '$lib/stores/clock.svelte';\n\timport { formatAgo } from '$lib/format';\n\timport DiffLines from './DiffLines.svelte';\n\timport GithubRefCards from '$lib/components/GithubRefCards.svelte';\n\timport { renderMarkdown } from '$lib/markdown';\n\n\tlet { session, base, params, setParams, setActions, mention, openPane, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `${sessionApiAt(base, sessionId)}/history` : null);\n\tconst graph = $derived(params.view === 'graph');\n\n\t// ── the commits ──────────────────────────────────────────────────────\n\n\tlet subjectEl = $state<HTMLElement | null>(null);\n\n\t/** A subject as text, but with each `#n` marked to resolve in the session's repo. */\n\tfunction subjectHtml(subject: string): string {\n\t\tconst html = renderMarkdown(subject.replace(/[\\\\`*_[\\]<>]/g, '\\\\$&'), { github: { bare: true } }).trim();\n\t\treturn html.replace(/^<p>([\\s\\S]*)<\\/p>$/, '$1');\n\t}\n\n\tlet history = $state<History | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loading = $state(false);\n\tlet listSeq = 0;\n\n\tasync function loadList(url: string, all: boolean) {\n\t\tconst mine = ++listSeq;\n\t\tloading = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}?scope=${all ? 'all' : 'branch'}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\thistory = body as History;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loading = false;\n\t\t}\n\t}\n\n\t/**\n\t * Commits change when a turn ends or the working tree's count moves (a\n\t * commit empties it), not with every hook, so that is when the log is read\n\t * again. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(`${session?.turn_completed_at ?? 0}:${session?.changes?.files ?? 0}`);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tconst url = api;\n\t\tconst all = graph;\n\t\tif (url && active) untrack(() => void loadList(url, all));\n\t});\n\n\tconst commits = $derived(history?.commits ?? []);\n\tconst layout = $derived(layoutGraph(commits));\n\tconst unpushed = $derived(commits.filter((c) => !c.pushed).length);\n\tconst branches = $derived(new Set((history?.tips ?? []).flatMap((t) => (t.branch ? [t.branch] : []))));\n\n\t/** The worker whose worktree has `branch` checked out, named as the sidebar names it. */\n\tfunction workerOn(branch: string): string | null {\n\t\tconst tip = history?.tips.find((t) => t.branch === branch);\n\t\tconst worker = tip && sessionStore.sessions.find((s) => s.git_root === tip.path && s.maestro_issue != null);\n\t\tif (!worker) return null;\n\t\treturn worker.issue ? `#${worker.maestro_issue} ${worker.issue.title}` : `#${worker.maestro_issue}`;\n\t}\n\n\t// ── drawing a row of the graph ───────────────────────────────────────\n\n\tconst ROW = 44;\n\tconst LANE = 14;\n\tconst PAD = 11;\n\tconst LANES = ['#a8a29e', '#a78bfa', '#2dd4bf', '#7dd3fc', '#fbbf24', '#f9a8d4'];\n\tconst laneX = (lane: number) => PAD + lane * LANE;\n\tconst laneColor = (lane: number) => LANES[lane % LANES.length];\n\tconst railWidth = $derived(PAD * 2 + Math.max(0, layout.width - 1) * LANE);\n\n\t/** A line from a lane at one edge of the row to the commit's dot, bending only if the lanes differ. */\n\tfunction bend(lane: number, row: GraphRow, fromTop: boolean): string {\n\t\tconst x = laneX(lane);\n\t\tconst cx = laneX(row.lane);\n\t\tconst edge = fromTop ? 0 : ROW;\n\t\tconst mid = ROW / 2;\n\t\treturn x === cx\n\t\t\t? `M${x} ${edge} L${cx} ${mid}`\n\t\t\t: `M${x} ${edge} C${x} ${(edge + mid) / 2} ${cx} ${(edge + mid) / 2} ${cx} ${mid}`;\n\t}\n\n\t// ── the picked commit ────────────────────────────────────────────────\n\n\tconst picked = $derived(commits.find((c) => c.hash === params.commit) ?? null);\n\n\tlet files = $state<{ hash: string; files: CommitFile[] } | null>(null);\n\tlet filesError = $state<string | null>(null);\n\tlet filesSeq = 0;\n\tasync function loadFiles(url: string, hash: string) {\n\t\tconst mine = ++filesSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}/commit?hash=${hash}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== filesSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tfiles = body as { hash: string; files: CommitFile[] };\n\t\t\tfilesError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === filesSeq) filesError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\t$effect(() => {\n\t\tconst url = api;\n\t\tconst hash = params.commit;\n\t\tif (url && hash && active) untrack(() => void loadFiles(url, hash));\n\t});\n\tconst shownFiles = $derived(files && files.hash === params.commit ? files.files : null);\n\n\tlet diff = $state<{ hash: string; diff: Diff } | null>(null);\n\tlet diffError = $state<string | null>(null);\n\tlet diffSeq = 0;\n\tasync function loadDiff(url: string, hash: string, file: string) {\n\t\tconst mine = ++diffSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${url}/diff?${new URLSearchParams({ hash, file })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tdiff = { hash, diff: body as Diff };\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) diffError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\t$effect(() => {\n\t\tconst url = api;\n\t\tconst hash = params.commit;\n\t\tconst file = params.file;\n\t\tif (url && hash && file && active) untrack(() => void loadDiff(url, hash, file));\n\t});\n\tconst shownDiff = $derived(\n\t\tdiff && diff.hash === params.commit && diff.diff.file === params.file ? diff.diff : null\n\t);\n\n\t/** The file as the picked commit left it, for the lines its diff leaves out. */\n\tasync function fileText(hash: string, file: string): Promise<string | null> {\n\t\tif (!api) return null;\n\t\tconst res = await fetch(`${api}/file?${new URLSearchParams({ hash, file })}`);\n\t\treturn res.ok ? ((await res.json()) as { text: string }).text : null;\n\t}\n\n\tfunction pick(hash: string) {\n\t\tsetParams({ commit: hash, file: null }, { push: true });\n\t}\n\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !api || loading,\n\t\t\t\trun: () => api && void loadList(api, graph)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the commits, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (commits.length === 0) return;\n\t\tconst at = picked ? commits.indexOf(picked) : -1;\n\t\tconst next = commits[e.key === 'j' ? Math.min(at + 1, commits.length - 1) : Math.max(at - 1, 0)];\n\t\te.preventDefault();\n\t\tsetParams({ commit: next.hash, file: null });\n\t\tdocument.querySelector(`[data-commit=\"${next.hash}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t}\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"history\" class:picked={!!params.commit}>\n\t<div class=\"bar\">\n\t\t<span class=\"branch\">\n\t\t\t<iconify-icon icon=\"mdi:source-branch\"></iconify-icon>\n\t\t\t{history?.branch ?? (history ? 'detached HEAD' : 'History')}\n\t\t</span>\n\t\t{#if unpushed > 0}\n\t\t\t<span class=\"chip local\" title=\"Commits no remote branch has yet\">{unpushed} to push</span>\n\t\t{/if}\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"How the commits are shown\">\n\t\t\t<Toggle size=\"sm\" bind:pressed={() => !graph, (on) => on && setParams({ view: null })}\n\t\t\t\ttitle=\"The checked-out branch, by day\">List</Toggle\n\t\t\t>\n\t\t\t<Toggle size=\"sm\" bind:pressed={() => graph, (on) => on && setParams({ view: 'graph' })}\n\t\t\t\ttitle=\"Every worktree's branch and the upstream, a lane each\">Graph</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if listError}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !history}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if commits.length === 0}\n\t\t<p class=\"msg\">No commits yet.</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Commits\">\n\t\t\t\t{#each commits as commit, i (commit.hash)}\n\t\t\t\t\t{@const row = layout.rows[i]}\n\t\t\t\t\t{@const day = dayOf(commit.at, clock.now)}\n\t\t\t\t\t{#if !graph && (i === 0 || day !== dayOf(commits[i - 1].at, clock.now))}\n\t\t\t\t\t\t<div class=\"day\" style:padding-left=\"{railWidth + 6}px\">{day}</div>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"commit\"\n\t\t\t\t\t\tclass:on={commit.hash === params.commit}\n\t\t\t\t\t\taria-current={commit.hash === params.commit ? 'true' : undefined}\n\t\t\t\t\t\tdata-commit={commit.hash}\n\t\t\t\t\t\tonclick={() => pick(commit.hash)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg class=\"rail\" width={railWidth} height={ROW} viewBox=\"0 0 {railWidth} {ROW}\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t{#each row.through as lane (lane)}\n\t\t\t\t\t\t\t\t<path d=\"M{laneX(lane)} 0 L{laneX(lane)} {ROW}\" stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#each row.into as lane (lane)}\n\t\t\t\t\t\t\t\t<path d={bend(lane, row, true)} stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#each row.out as lane (lane)}\n\t\t\t\t\t\t\t\t<path d={bend(lane, row, false)} stroke={laneColor(lane)} />\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t{#if commit.refs.some((r) => r.startsWith('tag: '))}\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tclass=\"dot tag\"\n\t\t\t\t\t\t\t\t\tx={laneX(row.lane) - 4}\n\t\t\t\t\t\t\t\t\ty={ROW / 2 - 4}\n\t\t\t\t\t\t\t\t\twidth=\"8\"\n\t\t\t\t\t\t\t\t\theight=\"8\"\n\t\t\t\t\t\t\t\t\ttransform=\"rotate(45 {laneX(row.lane)} {ROW / 2})\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\t\t\tclass=\"dot\"\n\t\t\t\t\t\t\t\t\tclass:mine={commit.mine}\n\t\t\t\t\t\t\t\t\tcx={laneX(row.lane)}\n\t\t\t\t\t\t\t\t\tcy={ROW / 2}\n\t\t\t\t\t\t\t\t\tr=\"4\"\n\t\t\t\t\t\t\t\t\tstroke={commit.mine ? undefined : laneColor(row.lane)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t<span class=\"what\">\n\t\t\t\t\t\t\t<span class=\"subject\">{commit.subject}</span>\n\t\t\t\t\t\t\t<span class=\"meta\">\n\t\t\t\t\t\t\t\t<span>{shortHash(commit.hash)}</span>\n\t\t\t\t\t\t\t\t<span>{formatAgo(commit.at, clock.now)}</span>\n\t\t\t\t\t\t\t\t{#each commit.refs as ref (ref)}\n\t\t\t\t\t\t\t\t\t{@const r = readRef(ref, branches)}\n\t\t\t\t\t\t\t\t\t{@const worker = r.kind === 'branch' ? workerOn(r.name) : null}\n\t\t\t\t\t\t\t\t\t<span class=\"chip {worker ? 'worker' : r.kind}\" title={worker ? `${r.name}, where this worker runs` : ref}\n\t\t\t\t\t\t\t\t\t\t>{worker ?? r.name}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t\t{#if commit.mine}<span class=\"chip mine\" title=\"Made by this session\">this session</span>{/if}\n\t\t\t\t\t\t\t\t{#if !commit.pushed}<span class=\"chip local\" title=\"No remote branch has this commit yet\">local</span>{/if}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{#if commit.additions || commit.deletions}\n\t\t\t\t\t\t\t<span class=\"nums\"><span class=\"add\">+{commit.additions}</span> <span class=\"del\">−{commit.deletions}</span></span>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if history.truncated}\n\t\t\t\t\t<p class=\"more\">Older commits are not listed.</p>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t{#if subjectEl && sessionId}\n\t\t\t\t<GithubRefCards root={subjectEl} session={sessionId} {base} onOpen={(ref) => openPane('github', { ref })} />\n\t\t\t{/if}\n\t\t\t<section class=\"detail\" aria-label=\"Commit\">\n\t\t\t\t{#if picked}\n\t\t\t\t\t<div class=\"head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to commits\" onclick={() => setParams({ commit: null, file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<div class=\"title\">\n\t\t\t\t\t\t\t<!-- A `(#116)` in the subject is a chip that opens the GitHub pane. -->\n\t\t\t\t\t\t\t<h3 bind:this={subjectEl}>{@html subjectHtml(picked.subject)}</h3>\n\t\t\t\t\t\t\t<p class=\"who\">\n\t\t\t\t\t\t\t\t<span>{shortHash(picked.hash)}</span>\n\t\t\t\t\t\t\t\t<span>{picked.author}</span>\n\t\t\t\t\t\t\t\t<span>{new Date(picked.at).toLocaleString()}</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"acts\">\n\t\t\t\t\t\t<button type=\"button\" class=\"act\" onclick={() => mention(shortHash(picked.hash))}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon> Add to chat\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button type=\"button\" class=\"act\" onclick={() => void copyWithToast(picked.hash, 'Hash copied')}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon> Copy hash\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{#if picked.turn}\n\t\t\t\t\t\t\t{@const turn = picked.turn}\n\t\t\t\t\t\t\t<button type=\"button\" class=\"act\" title=\"Show the turn of the conversation that made this commit\" onclick={() => revealTurn(turn)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:message-arrow-left-outline\"></iconify-icon> Go to turn\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if filesError}\n\t\t\t\t\t\t<p class=\"msg err\">{filesError}</p>\n\t\t\t\t\t{:else if !shownFiles}\n\t\t\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t\t\t{:else if shownFiles.length === 0}\n\t\t\t\t\t\t<p class=\"msg\">This commit changed no files.</p>\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<div class=\"files\">\n\t\t\t\t\t\t\t{#each shownFiles as f (f.file)}\n\t\t\t\t\t\t\t\t{@const open = f.file === params.file}\n\t\t\t\t\t\t\t\t<!-- The way to the Files pane rides on the file's own row, so it costs the diff no height. -->\n\t\t\t\t\t\t\t\t<div class=\"filerow\" class:on={open}>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\t\t\t\t\tonclick={() => setParams({ file: open ? null : f.file })}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"st {f.kind}\">{statusLetter(f)}</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"path\"><bdi>{f.file}</bdi></span>\n\t\t\t\t\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"nums\"><span class=\"add\">+{f.additions}</span> <span class=\"del\">−{f.deletions}</span></span>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t{#if f.kind !== 'deleted'}\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"tofiles\"\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Open in Files, as the file is on disk now\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Open {f.file} in Files\"\n\t\t\t\t\t\t\t\t\t\t\tonclick={() => openPane('files', { file: f.file, line: null })}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:file-tree-outline\"></iconify-icon>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{#if open}\n\t\t\t\t\t\t\t\t\t<div class=\"diff\">\n\t\t\t\t\t\t\t\t\t\t{#if diffError}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg err\">{diffError}</p>\n\t\t\t\t\t\t\t\t\t\t{:else if !shownDiff}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t\t\t\t\t\t\t\t{:else if shownDiff.binary}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t\t\t\t\t\t{:else if shownDiff.hunks.length === 0}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t{#key `${picked.hash}\\0${f.file}`}\n\t\t\t\t\t\t\t\t\t\t\t\t<DiffLines\n\t\t\t\t\t\t\t\t\t\t\t\t\thunks={shownDiff.hunks}\n\t\t\t\t\t\t\t\t\t\t\t\t\tfile={f.file}\n\t\t\t\t\t\t\t\t\t\t\t\t\tloadText={f.kind === 'deleted' ? undefined : () => fileText(picked.hash, f.file)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{/key}\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">Pick a commit to see what it changed.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n</div>\n\n<style>\n\t.history {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.branch {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow-y: auto;\n\t\tpadding: 4px 0 12px;\n\t}\n\t.picked nav {\n\t\tflex: none;\n\t\twidth: min(24rem, 46%);\n\t\tborder-right: 1px solid #222;\n\t}\n\t.day {\n\t\tpadding: 10px 12px 2px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t.commit {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\theight: 44px;\n\t\tpadding: 0 12px 0 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.commit:hover {\n\t\tbackground: #171717;\n\t}\n\t.commit.on {\n\t\tbackground: #1f1f1f;\n\t}\n\t.commit:focus-visible,\n\t.file:focus-visible,\n\t.act:focus-visible,\n\t.tofiles:focus-visible,\n\t.back:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t.rail {\n\t\tflex: none;\n\t}\n\t.rail path {\n\t\tfill: none;\n\t\tstroke-width: 2;\n\t}\n\t.dot {\n\t\tfill: #111111;\n\t\tstroke-width: 2;\n\t}\n\t.dot.mine {\n\t\tfill: #2dd4bf;\n\t\tstroke: #2dd4bf;\n\t}\n\t.dot.tag {\n\t\tstroke: #fbbf24;\n\t}\n\t.what {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t}\n\t.subject {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #e7e5e4;\n\t}\n\t.meta {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t.chip {\n\t\tflex: none;\n\t\tmax-width: 16rem;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tpadding: 0 5px;\n\t\tborder: 1px solid #3a3532;\n\t\tborder-radius: 4px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tline-height: 1.5;\n\t\tcolor: #a8a29e;\n\t}\n\t.chip.tag {\n\t\tcolor: #fbbf24;\n\t\tborder-color: #6b5312;\n\t}\n\t.chip.remote {\n\t\tcolor: #7dd3fc;\n\t\tborder-color: #1e4a5f;\n\t}\n\t.chip.mine {\n\t\tcolor: #2dd4bf;\n\t\tborder-color: #14524a;\n\t}\n\t.chip.worker {\n\t\tcolor: #a78bfa;\n\t\tborder-color: #4a3c7a;\n\t}\n\t.chip.local {\n\t\tcolor: #fdba74;\n\t\tborder-color: #6b3d12;\n\t}\n\t.nums {\n\t\tflex: none;\n\t\tpadding-left: 10px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\twhite-space: nowrap;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n\t.more {\n\t\tmargin: 0;\n\t\tpadding: 10px 14px;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\n\t.detail {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: none;\n\t\tflex-direction: column;\n\t\toverflow-y: auto;\n\t}\n\t.picked .detail {\n\t\tdisplay: flex;\n\t}\n\t.head {\n\t\tdisplay: flex;\n\t\talign-items: flex-start;\n\t\tgap: 4px;\n\t\tpadding: 12px 14px 0;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 40px;\n\t\theight: 40px;\n\t\tmargin: -8px 0 0 -10px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.title {\n\t\tmin-width: 0;\n\t}\n\th3 {\n\t\tmargin: 0;\n\t\tfont-size: 14.5px;\n\t\tfont-weight: 600;\n\t\tline-height: 1.35;\n\t\tcolor: #f5f5f4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.who {\n\t\tmargin: 4px 0 0;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 2px 10px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t\tcolor: #a8a29e;\n\t}\n\t.acts {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tpadding: 10px 14px 12px;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\t.act {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 30px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tborder-radius: 7px;\n\t\tbackground: #1a1a1a;\n\t\tcolor: #e7e5e4;\n\t\tfont: inherit;\n\t\tfont-size: 12px;\n\t\tcursor: pointer;\n\t}\n\t.act:hover {\n\t\tbackground: #232323;\n\t}\n\t.files {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.filerow {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t\tborder-bottom: 1px solid #1c1c1c;\n\t}\n\t.filerow:hover {\n\t\tbackground: #171717;\n\t}\n\t.filerow.on {\n\t\tbackground: #1f1f1f;\n\t}\n\t.filerow.on .file {\n\t\tcolor: #f5f5f4;\n\t}\n\t.tofiles {\n\t\tflex: none;\n\t\twidth: 36px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #78716c;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t\t/* Out of the way until the row is the one in hand; always there where nothing hovers. */\n\t\topacity: 0;\n\t}\n\t.filerow:hover .tofiles,\n\t.filerow.on .tofiles,\n\t.tofiles:focus-visible {\n\t\topacity: 1;\n\t}\n\t.tofiles:hover {\n\t\tcolor: #f5f5f4;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tmin-height: 34px;\n\t\tpadding: 0 4px 0 14px;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.st {\n\t\tflex: none;\n\t\twidth: 1ch;\n\t\tfont-weight: 600;\n\t\tcolor: #fbbf24;\n\t}\n\t.st.added {\n\t\tcolor: #4ade80;\n\t}\n\t.st.deleted {\n\t\tcolor: #f87171;\n\t}\n\t.path {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmax-height: 70vh;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\n\t/* Too narrow for both: the commits, or the picked one with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t\t.act {\n\t\t\theight: 38px;\n\t\t}\n\t\t.file {\n\t\t\tmin-height: 42px;\n\t\t}\n\t\t.tofiles {\n\t\t\twidth: 44px;\n\t\t\topacity: 1;\n\t\t}\n\t}\n</style>\n","/** A hostname or bound address that only this machine can reach. */\nexport function isLoopback(host: string): boolean {\n\tconst h = host.replace(/^\\[|\\]$/g, '').toLowerCase();\n\treturn h === 'localhost' || h.endsWith('.localhost') || h === '::1' || /^(::ffff:)?127\\./.test(h);\n}\n","/**\n * The Web pane's logic, apart from the component: which URL a choice names,\n * and how a URL can be shown from the device the page is open on.\n *\n * claude-mux is usually reached over HTTPS through tailscale serve, so an\n * `http://` page cannot be framed (mixed content), and a `localhost` URL means\n * the phone itself when opened on the phone. A dev server on this machine is\n * therefore framed through its tailscale serve HTTPS mapping when it has one,\n * and otherwise offered in a new tab with the command that would map it.\n *\n * A session on another machine reads `localhost` as that machine, which the\n * device reaches by the machine's own tailnet name, never by the page's.\n */\nimport { isLoopback } from '$shared/utils/loopback.js';\nimport type { DevServer, WebInfo } from '$shared/server/web-preview.js';\n\nexport type { DevServer, FrameCheck, WebInfo } from '$shared/server/web-preview.js';\n\n/** The named choices; anything else in `?url=` is a URL typed by hand. */\nexport type WebChoice = 'prod' | 'dev';\n\n/**\n * The URL a choice names. `dev` falls back to the first dev server found\n * running in the project when `.claude-mux.json` names none.\n */\nexport function choiceUrl(choice: string, info: Pick<WebInfo, 'urls' | 'detected'> | null): string | null {\n\tif (choice === 'prod') return info?.urls.prod ?? null;\n\tif (choice === 'dev') return info?.urls.dev ?? info?.detected[0]?.url ?? null;\n\treturn choice;\n}\n\n/** A URL typed into the bar, given a scheme when it has none. Null when it will not parse. */\nexport function normalizeTyped(text: string): string | null {\n\tconst t = text.trim();\n\tif (!t) return null;\n\tconst hasScheme = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(t);\n\ttry {\n\t\tlet u = new URL(hasScheme ? t : `http://${t}`);\n\t\t// Without a scheme, only this machine is assumed to speak plain HTTP.\n\t\tif (!hasScheme && !pointsHere(u)) u = new URL(`https://${t}`);\n\t\treturn u.protocol === 'http:' || u.protocol === 'https:' ? u.href : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** A URL that points at the machine claude-mux runs on. */\nfunction pointsHere(u: URL): boolean {\n\treturn isLoopback(u.hostname) || u.hostname === '0.0.0.0';\n}\n\nfunction portOf(u: URL): number {\n\treturn Number(u.port || (u.protocol === 'https:' ? 443 : 80));\n}\n\nexport type Embed =\n\t| {\n\t\t\tkind: 'frame';\n\t\t\tsrc: string;\n\t }\n\t| {\n\t\t\tkind: 'card';\n\t\t\t/** Why it cannot be framed from here. */\n\t\t\treason: string;\n\t\t\t/** The URL that opens it in a tab of its own. */\n\t\t\topen: string;\n\t\t\t/** The command that would make it embeddable. */\n\t\t\tcommand?: string;\n\t };\n\nexport interface EmbedContext {\n\t/** Where this page is open: `location`. */\n\tpage: { protocol: string; hostname: string };\n\t/**\n\t * The host name of the session's machine when it is not the one that\n\t * served the page; null or absent for the page's own machine.\n\t */\n\tmachine?: string | null;\n\tserves: WebInfo['serves'];\n\tdetected: DevServer[];\n}\n\n/** How `target` can be shown in the pane from the page in `ctx`. */\nexport function resolveEmbed(target: string, ctx: EmbedContext): Embed {\n\tconst u = new URL(target);\n\tconst pageSecure = ctx.page.protocol === 'https:';\n\tif (!pointsHere(u)) {\n\t\tif (pageSecure && u.protocol === 'http:') {\n\t\t\treturn {\n\t\t\t\tkind: 'card',\n\t\t\t\treason: 'This page is served over HTTPS, and browsers will not frame a plain-HTTP page inside it.',\n\t\t\t\topen: u.href\n\t\t\t};\n\t\t}\n\t\treturn { kind: 'frame', src: u.href };\n\t}\n\n\tconst port = portOf(u);\n\tconst served = ctx.serves[port];\n\tif (served) {\n\t\treturn { kind: 'frame', src: `${served}${u.pathname}${u.search}${u.hash}` };\n\t}\n\t// Opened on the machine itself, localhost is the same machine, and browsers treat it as secure.\n\tif (!ctx.machine && isLoopback(ctx.page.hostname)) {\n\t\treturn { kind: 'frame', src: u.href.replace('//0.0.0.0', '//localhost') };\n\t}\n\n\t// Whatever name the device reached claude-mux by reaches this machine's other ports too;\n\t// another machine's ports are reached by that machine's name.\n\tconst remote = new URL(u.href);\n\tremote.hostname = ctx.machine || ctx.page.hostname;\n\tconst card = { kind: 'card' as const, open: remote.href, command: `tailscale serve --bg --https=${port} http://localhost:${port}` };\n\t// The command maps a port of the machine it runs on, so another machine's card says where.\n\tconst where = ctx.machine ? ` Run it on ${ctx.machine.split('.')[0]}.` : '';\n\tconst machine = ctx.machine ? ctx.machine.split('.')[0] : 'this machine';\n\tif (ctx.detected.find((d) => d.port === port)?.loopbackOnly) {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `The server on port ${port} listens on 127.0.0.1 only, so nothing off ${machine} reaches it. Map it with tailscale serve, or restart it bound to 0.0.0.0.${where}`\n\t\t};\n\t}\n\tif (pageSecure && remote.protocol === 'http:') {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `Port ${port} has no tailscale serve HTTPS mapping on ${machine}, and this page, served over HTTPS, cannot frame plain HTTP.${where}`\n\t\t};\n\t}\n\treturn { kind: 'frame', src: remote.href };\n}\n","/**\n * The Web pane's Browser source, apart from the component: turning what\n * happens on the canvas into the messages the stream takes (see\n * `toCdpInput()` in `src/server/browser-view.ts`), and picking the tab to show.\n */\nimport type { BrowserInfo, BrowserTab } from '$shared/server/browser-view.js';\n\nexport type { BrowserInfo, BrowserWsMessage } from '$shared/server/browser-view.js';\n\n/** The `?url=` value that names the remote browser rather than a site. */\nexport const BROWSER_CHOICE = 'browser';\n\n/** The size, in CSS pixels, of the remote viewport a frame shows. */\nexport interface FrameSize {\n\twidth: number;\n\theight: number;\n}\n\n/** The box the frame is drawn in, as `getBoundingClientRect()` has it. */\nexport interface Box {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * A point on this screen as a point in the remote page, in its CSS pixels.\n * The canvas is the frame scaled to fit, so the mapping is one ratio; a point\n * dragged past the edge is held to it.\n */\nexport function toPagePoint(clientX: number, clientY: number, box: Box, frame: FrameSize): { x: number; y: number } {\n\tconst along = (at: number, start: number, size: number, remote: number) =>\n\t\tsize > 0 ? Math.round(Math.min(Math.max((at - start) / size, 0), 1) * remote) : 0;\n\treturn {\n\t\tx: along(clientX, box.left, box.width, frame.width),\n\t\ty: along(clientY, box.top, box.height, frame.height)\n\t};\n}\n\n/** How the canvas is magnified on this side: a scale about its centre, then a shift in screen pixels. */\nexport interface View {\n\tscale: number;\n\tx: number;\n\ty: number;\n}\n\nexport const UNZOOMED: View = { scale: 1, x: 0, y: 0 };\nconst MAX_ZOOM = 8;\n\n/**\n * `view` after a zoom by `factor` that carries what was under `from` to `to`\n * (both screen points): a pinch whose midpoint moved, or a wheel zoom about\n * the pointer when the two are the same. `box` is where the canvas lies\n * unzoomed, and `room` the size of the space it may fill, which it is centred\n * in. The canvas never shrinks below its fit, and once it is larger than the\n * room on an axis it never leaves a gap at that axis's edges.\n */\nexport function zoomView(\n\tview: View,\n\tfrom: { x: number; y: number },\n\tto: { x: number; y: number },\n\tfactor: number,\n\tbox: Box,\n\troom: { width: number; height: number } = box\n): View {\n\tconst scale = Math.min(Math.max(view.scale * factor, 1), MAX_ZOOM);\n\tconst cx = box.left + box.width / 2;\n\tconst cy = box.top + box.height / 2;\n\tconst shift = (at: number, dest: number, centre: number, offset: number, size: number, space: number) => {\n\t\tconst limit = Math.max(0, (scale * size - space) / 2);\n\t\t// The point of the canvas under `at`, measured from its centre before any zoom.\n\t\tconst on = (at - centre - offset) / view.scale;\n\t\treturn Math.min(Math.max(dest - centre - scale * on, -limit), limit);\n\t};\n\treturn {\n\t\tscale,\n\t\tx: shift(from.x, to.x, cx, view.x, box.width, room.width),\n\t\ty: shift(from.y, to.y, cy, view.y, box.height, room.height)\n\t};\n}\n\ninterface Modified {\n\taltKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n}\n\n/** CDP's modifier bit field: Alt 1, Ctrl 2, Meta 4, Shift 8. */\nexport function modifiersOf(e: Modified): number {\n\treturn (e.altKey ? 1 : 0) | (e.ctrlKey ? 2 : 0) | (e.metaKey ? 4 : 0) | (e.shiftKey ? 8 : 0);\n}\n\nconst MOUSE_BUTTONS = ['left', 'middle', 'right', 'back', 'forward'] as const;\n\n/** The name CDP gives `MouseEvent.button`. */\nexport function buttonName(button: number): string {\n\treturn MOUSE_BUTTONS[button] ?? 'none';\n}\n\n/** The button a move is dragging with, from `MouseEvent.buttons`. */\nexport function heldButton(buttons: number): string {\n\treturn buttons & 1 ? 'left' : buttons & 2 ? 'right' : buttons & 4 ? 'middle' : 'none';\n}\n\ninterface KeyLike extends Modified {\n\tkey: string;\n\tcode: string;\n\tkeyCode: number;\n}\n\ninterface KeyMessage {\n\ttype: 'key';\n\tevent: 'down' | 'up';\n\tkey: string;\n\tcode: string;\n\tkeyCode: number;\n\ttext?: string;\n\tmodifiers: number;\n}\n\n/**\n * The message for a key going down or up, or null for one the remote page\n * should not get: the side panel's own Alt+Shift shortcuts, and paste, whose\n * text arrives by the paste event from this machine's clipboard instead of\n * the remote one's.\n */\nexport function keyMessage(e: KeyLike, event: 'down' | 'up'): KeyMessage | null {\n\tif (e.altKey && e.shiftKey) return null;\n\tconst command = e.ctrlKey || e.metaKey;\n\tif (command && e.key.toLowerCase() === 'v') return null;\n\tconst msg: KeyMessage = { type: 'key', event, key: e.key, code: e.code, keyCode: e.keyCode, modifiers: modifiersOf(e) };\n\t// A key that types carries its text; without it the page sees the key and no character.\n\tif (event === 'down' && !command) {\n\t\tif (e.key === 'Enter') msg.text = '\\r';\n\t\telse if ([...e.key].length === 1) msg.text = e.key;\n\t}\n\treturn msg;\n}\n\n/**\n * What to do remotely so that text which read `prev` reads `next`: how many\n * characters to delete off the end, then what to type. The phone keyboard's\n * field is mirrored this way, because autocorrect and composition rewrite\n * what is already there rather than only appending.\n */\nexport function textDelta(prev: string, next: string): { backspaces: number; insert: string } {\n\tconst a = [...prev];\n\tconst b = [...next];\n\tlet same = 0;\n\twhile (same < a.length && same < b.length && a[same] === b[same]) same++;\n\treturn { backspaces: a.length - same, insert: b.slice(same).join('') };\n}\n\n/**\n * The tab to show: the one the URL names while it is open, else the one\n * already showing (`staying`), else the one the session last opened or\n * selected, else the browser's first. The session's tab is found by its URL,\n * which stops matching as soon as the page goes anywhere, so without\n * `staying` a click on a link would hand the view, and the person's next\n * keystrokes, to some other tab.\n */\nexport function pickTab(\n\tinfo: Pick<BrowserInfo, 'tabs' | 'preferred'> | null,\n\twanted: string | undefined,\n\tstaying: string | null = null\n): BrowserTab | null {\n\tif (!info) return null;\n\tconst byId = (id: string | null | undefined) => (id ? info.tabs.find((t) => t.id === id) : undefined);\n\treturn byId(wanted) ?? byId(staying) ?? byId(info.preferred) ?? info.tabs[0] ?? null;\n}\n\n/** The tabs whose title or URL contains every word of `query`. */\nexport function filterTabs(tabs: BrowserTab[], query: string): BrowserTab[] {\n\tconst words = query.toLowerCase().split(/\\s+/).filter(Boolean);\n\tif (words.length === 0) return tabs;\n\treturn tabs.filter((t) => {\n\t\tconst hay = `${t.title} ${t.url}`.toLowerCase();\n\t\treturn words.every((w) => hay.includes(w));\n\t});\n}\n\n/** Whether the remote browser on `base`'s machine answers, so a page can be opened in it. */\nexport async function browserAnswers(base: string): Promise<boolean> {\n\ttry {\n\t\tconst res = await fetch(`${base}/api/browser/tabs`);\n\t\tif (!res.ok) return false;\n\t\tconst info = (await res.json()) as BrowserInfo;\n\t\treturn !!info.name && !info.error;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Show a GitHub page in the remote browser, in a background tab of its own\n * (the same one again for a page opened before), and answer that tab's id.\n */\nexport async function openInBrowser(base: string, url: string): Promise<{ tab: string } | { error: string }> {\n\ttry {\n\t\tconst res = await fetch(`${base}/api/browser/open`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tbody: JSON.stringify({ url })\n\t\t});\n\t\tconst body = (await res.json().catch(() => null)) as { tab?: unknown; error?: unknown } | null;\n\t\tif (res.ok && typeof body?.tab === 'string') return { tab: body.tab };\n\t\treturn { error: typeof body?.error === 'string' ? body.error : `HTTP ${res.status}` };\n\t} catch (err) {\n\t\treturn { error: `Could not reach claude-mux: ${err}` };\n\t}\n}\n","import { createPersisted } from './persisted';\n\nconst persisted = createPersisted<Record<string, string>>('claude-mux-web-pane', {});\n\n/**\n * The URL the Web pane last showed, per session id: `prod`, `dev`, or a URL\n * typed by hand. The pane reopens it when the page's URL names none.\n */\nclass WebPaneStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\n\tget(id: string | null): string | null {\n\t\treturn (id && this.state[id]) || null;\n\t}\n\n\tset(id: string | null, url: string): void {\n\t\tif (!id || this.state[id] === url) return;\n\t\tthis.state[id] = url;\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const webPaneStore = new WebPaneStore();\n","import { ReliableWebSocket } from './websocket-base.svelte';\nimport type { BrowserWsMessage } from '$lib/side-panel/browser';\n\ntype Frame = Extract<BrowserWsMessage, { type: 'frame' }>;\n\n/**\n * The Web pane's connection to one remote browser tab: frames come in, input\n * goes out. The server holds the tab's DevTools connection only while a\n * socket like this one is open, so closing it is what ends the screencast.\n */\nexport class BrowserStream extends ReliableWebSocket {\n\t/** Why the server ended the stream (the tab or the browser went away), until the next `open`. */\n\tclosedReason = $state<string | null>(null);\n\t/** Where the tab has navigated to since the stream opened. */\n\turl = $state<string | null>(null);\n\t/** Called with each frame; the canvas draws it. */\n\tonFrame: ((frame: Frame) => void) | null = null;\n\n\tprivate tabId: string | null = null;\n\t/** Where the tab's machine is reached: '' for the origin, `/fleet/<id>` through its relay. */\n\tprivate base = '';\n\n\t/**\n\t * Show `tabId` of the browser the machine at `base` drives. Opening the\n\t * tab already open does nothing unless `again`.\n\t */\n\topen(tabId: string, base: string, again = false): void {\n\t\tif (this.tabId === tabId && this.base === base && !again && this.closedReason === null) return;\n\t\tthis.doDisconnect();\n\t\tthis.tabId = tabId;\n\t\tthis.base = base;\n\t\tthis.closedReason = null;\n\t\tthis.url = null;\n\t\tthis.resetReceived();\n\t\tthis.doConnect();\n\t}\n\n\tclose(): void {\n\t\tthis.tabId = null;\n\t\tthis.doDisconnect();\n\t}\n\n\t/** Send one input message; it is dropped when the socket is not up. */\n\tinput(msg: object): void {\n\t\tthis.send(JSON.stringify(msg));\n\t}\n\n\tprotected getWsUrl(): string {\n\t\tconst protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';\n\t\treturn `${protocol}//${window.location.host}${this.base}/api/browser/${encodeURIComponent(this.tabId!)}/stream`;\n\t}\n\n\tprotected getLogPrefix(): string {\n\t\treturn '[browser]';\n\t}\n\n\tprotected shouldReconnect(): boolean {\n\t\treturn this.tabId !== null && this.closedReason === null;\n\t}\n\n\tprotected handleMessage(event: MessageEvent): void {\n\t\tlet msg: BrowserWsMessage;\n\t\ttry {\n\t\t\tmsg = JSON.parse(event.data);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tif (msg.type === 'frame') this.onFrame?.(msg);\n\t\telse if (msg.type === 'nav') this.url = msg.url;\n\t\telse if (msg.type === 'closed') this.closedReason = msg.reason;\n\t}\n}\n","<script lang=\"ts\">\n\t/**\n\t * The Web pane's Browser source: one tab of the remote browser a session\n\t * drives, live, and open to the pointer, the keyboard and touch. Frames\n\t * arrive over the stream and are drawn on a canvas scaled to the pane;\n\t * what happens on the canvas goes back as input for the page. A desktop\n\t * page is small on a phone, so two fingers (or Ctrl+wheel) magnify and\n\t * move the picture on this side, and one finger is the page's.\n\t *\n\t * The tab shown is the one the session last opened or selected until the\n\t * person picks another. The stream is open only while the pane is showing,\n\t * because the server holds the tab's DevTools connection for exactly as\n\t * long.\n\t */\n\timport { onDestroy, untrack } from 'svelte';\n\timport * as Popover from '$lib/components/ui/popover';\n\timport { Badge } from '$lib/components/ui/badge';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport {\n\t\tbuttonName,\n\t\tfilterTabs,\n\t\theldButton,\n\t\tkeyMessage,\n\t\tmodifiersOf,\n\t\tpickTab,\n\t\ttextDelta,\n\t\ttoPagePoint,\n\t\tUNZOOMED,\n\t\tzoomView,\n\t\ttype BrowserInfo,\n\t\ttype FrameSize,\n\t\ttype View\n\t} from '$lib/side-panel/browser';\n\timport { BrowserStream } from '$lib/stores/browserStream.svelte';\n\n\tinterface Props {\n\t\tsessionId: string | null;\n\t\t/**\n\t\t * Where the session's machine is reached: '' for the origin, `/fleet/<id>`\n\t\t * for another, whose own page the relay makes this one.\n\t\t */\n\t\tbase: string;\n\t\t/** The pane is the one showing. */\n\t\tactive: boolean;\n\t\t/** The tab the URL pins, if any. */\n\t\ttab: string | undefined;\n\t\t/** Pin a tab, or with null go back to following the session. */\n\t\tonPick: (id: string | null) => void;\n\t\t/** The URL of the tab being shown, for the pane's bar. */\n\t\tonUrl: (url: string | null) => void;\n\t}\n\n\tlet { sessionId, base, active, tab, onPick, onUrl }: Props = $props();\n\n\t/** How often the tab list is read while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\t/** Two presses this close in time and place are a double click. */\n\tconst MULTI_CLICK_MS = 500;\n\tconst MULTI_CLICK_PX = 6;\n\t/** What one wheel notch scrolls when the wheel reports lines rather than pixels. */\n\tconst LINE_PX = 40;\n\n\t// ── the tabs ─────────────────────────────────────────────────────────\n\n\tlet info = $state<BrowserInfo | null>(null);\n\tlet loading = $state(false);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo() {\n\t\tconst mine = ++infoSeq;\n\t\tloading = true;\n\t\ttry {\n\t\t\tconst q = sessionId ? `?session=${encodeURIComponent(sessionId)}` : '';\n\t\t\tconst res = await fetch(`${base}/api/browser/tabs${q}`);\n\t\t\tconst body = (await res.json()) as BrowserInfo;\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(`HTTP ${res.status}`);\n\t\t\t// The session opened or selected another tab: the view goes with it.\n\t\t\tif (body.preferred && body.preferred !== followed) {\n\t\t\t\tfollowed = body.preferred;\n\t\t\t\tstaying = null;\n\t\t\t}\n\t\t\tinfo = body;\n\t\t} catch (err) {\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tinfo = { name: info?.name ?? 'the browser', error: `Could not ask claude-mux for the tabs: ${err}`, tabs: [], preferred: null };\n\t\t} finally {\n\t\t\tif (mine === infoSeq) loading = false;\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tvoid sessionId;\n\t\tif (!active) return;\n\t\tuntrack(() => void loadInfo());\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo();\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t/**\n\t * A pinned tab the list has not seen yet (one opened for the GitHub pane a\n\t * moment ago) is looked for once more before anything else is shown, so the\n\t * view never streams some other logged-in tab in its place.\n\t */\n\tlet lookingFor = $state<string | null>(null);\n\tlet lookedFor: string | null = null;\n\t$effect(() => {\n\t\tconst want = tab;\n\t\tif (!active || !want || !info || want === lookedFor || info.tabs.some((t) => t.id === want)) return;\n\t\tlookedFor = want;\n\t\tlookingFor = want;\n\t\tuntrack(() => void loadInfo().finally(() => (lookingFor = null)));\n\t});\n\n\t/** The tab on show, kept while it stays open however its URL changes. */\n\tlet staying = $state<string | null>(null);\n\t/** The session's tab as last reported, to tell when the session moves to another. */\n\tlet followed: string | null = null;\n\tconst current = $derived(lookingFor && lookingFor === tab ? null : pickTab(info, tab, staying));\n\tconst currentId = $derived(current?.id ?? null);\n\t$effect(() => {\n\t\tif (currentId) staying = currentId;\n\t});\n\n\tlet pickerOpen = $state(false);\n\tlet query = $state('');\n\tconst shown = $derived(filterTabs(info?.tabs ?? [], query));\n\n\tfunction pick(id: string) {\n\t\t// The session's own tab is followed rather than pinned, so the view moves on when the session does.\n\t\tonPick(id === info?.preferred ? null : id);\n\t\tstaying = id;\n\t\tpickerOpen = false;\n\t\tquery = '';\n\t}\n\n\tfunction hostOf(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host || url;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n\n\tconst labelOf = (t: { title: string; url: string }) => t.title || hostOf(t.url) || 'Untitled';\n\n\t// ── the stream ───────────────────────────────────────────────────────\n\n\tconst stream = new BrowserStream();\n\tlet canvas = $state<HTMLCanvasElement | null>(null);\n\t/** The remote viewport the canvas is showing, once a frame has been drawn. */\n\tlet frame = $state<FrameSize | null>(null);\n\tlet decodeSeq = 0;\n\tlet drawnSeq = 0;\n\n\tstream.onFrame = (f) => {\n\t\tconst seq = ++decodeSeq;\n\t\tconst img = new Image();\n\t\timg.onload = () => {\n\t\t\t// Frames decode on their own time; an older one must not paint over a newer.\n\t\t\tif (seq < drawnSeq || !canvas) return;\n\t\t\tdrawnSeq = seq;\n\t\t\tif (canvas.width !== img.naturalWidth || canvas.height !== img.naturalHeight) {\n\t\t\t\tcanvas.width = img.naturalWidth;\n\t\t\t\tcanvas.height = img.naturalHeight;\n\t\t\t}\n\t\t\tcanvas.getContext('2d')?.drawImage(img, 0, 0);\n\t\t\tif (frame?.width !== f.width || frame?.height !== f.height) frame = { width: f.width, height: f.height };\n\t\t};\n\t\timg.src = `data:image/jpeg;base64,${f.data}`;\n\t};\n\n\t$effect(() => {\n\t\tconst id = currentId;\n\t\tconst at = base;\n\t\tif (active && id) {\n\t\t\tuntrack(() => stream.open(id, at));\n\t\t} else {\n\t\t\tuntrack(() => {\n\t\t\t\tstream.close();\n\t\t\t\tframe = null;\n\t\t\t});\n\t\t}\n\t});\n\n\t// Another tab starts from an empty canvas, not from the last tab's picture.\n\t$effect(() => {\n\t\tvoid currentId;\n\t\tuntrack(() => {\n\t\t\tframe = null;\n\t\t\t// Frames of the last tab still decoding must not paint over this one.\n\t\t\tdrawnSeq = decodeSeq + 1;\n\t\t\tview = UNZOOMED;\n\t\t\ttouches.clear();\n\t\t\tpinch = null;\n\t\t\tpendingMove = null;\n\t\t\tclearTyped();\n\t\t});\n\t});\n\n\t// The canvas goes when the stream ends, and its frame with it.\n\t$effect(() => {\n\t\tif (stream.closedReason !== null) frame = null;\n\t});\n\n\tonDestroy(() => stream.close());\n\n\t$effect(() => {\n\t\tonUrl(stream.url ?? current?.url ?? null);\n\t});\n\n\t/** Reload the remote tab, or reconnect when the stream has ended. */\n\texport function reload() {\n\t\tif (!currentId || stream.closedReason !== null || info?.error) return retry();\n\t\tstream.input({ type: 'reload' });\n\t}\n\n\tfunction retry() {\n\t\tvoid loadInfo().then(() => {\n\t\t\tif (active && currentId) stream.open(currentId, base, true);\n\t\t});\n\t}\n\n\t// ── pointer, wheel and touch ─────────────────────────────────────────\n\n\tfunction at(e: { clientX: number; clientY: number }) {\n\t\treturn canvas && frame ? toPagePoint(e.clientX, e.clientY, canvas.getBoundingClientRect(), frame) : null;\n\t}\n\n\tlet lastPress = { at: 0, x: 0, y: 0, count: 0, button: 0 };\n\t/** The fingers down, by pointer id: where each is in the page, and on this screen. */\n\tconst touches = new Map<number, { x: number; y: number; sx: number; sy: number }>();\n\n\t/** How the picture is magnified on this side. The page itself is never zoomed. */\n\tlet view = $state<View>(UNZOOMED);\n\tlet stage = $state<HTMLDivElement | null>(null);\n\t/** A two-finger gesture in progress: the view and the fingers as it began. */\n\tlet pinch: { view: View; mid: { x: number; y: number }; span: number } | null = null;\n\n\t/** `view` zoomed by `factor` so that what was under `from` lands on `to`, or as it was while nothing is drawn. */\n\tfunction zoomed(from: View, a: { x: number; y: number }, b: { x: number; y: number }, factor: number): View {\n\t\tif (!canvas || !stage) return from;\n\t\tconst room = stage.getBoundingClientRect();\n\t\tconst width = canvas.offsetWidth;\n\t\tconst height = canvas.offsetHeight;\n\t\t// With no zoom the canvas sits centred in the stage at its laid-out size.\n\t\tconst box = { left: room.left + (room.width - width) / 2, top: room.top + (room.height - height) / 2, width, height };\n\t\treturn zoomView(from, a, b, factor, box, room);\n\t}\n\n\tfunction fingers() {\n\t\tconst [a, b] = [...touches.values()];\n\t\treturn { mid: { x: (a.sx + b.sx) / 2, y: (a.sy + b.sy) / 2 }, span: Math.hypot(a.sx - b.sx, a.sy - b.sy) || 1 };\n\t}\n\t/** A move waiting for the next animation frame, so a fast pointer sends one message per paint. */\n\tlet pendingMove: Record<string, unknown> | null = null;\n\n\tfunction flushMove() {\n\t\tif (pendingMove) stream.input(pendingMove);\n\t\tpendingMove = null;\n\t}\n\n\tfunction sendMove(msg: Record<string, unknown>) {\n\t\tif (!pendingMove) requestAnimationFrame(flushMove);\n\t\tpendingMove = msg;\n\t}\n\n\t/** Put a finger where it now is, in the page and on this screen. */\n\tfunction track(e: PointerEvent, p: { x: number; y: number }) {\n\t\ttouches.set(e.pointerId, { ...p, sx: e.clientX, sy: e.clientY });\n\t}\n\n\tfunction press(event: 'down' | 'up', e: PointerEvent, p: { x: number; y: number }) {\n\t\tstream.input({\n\t\t\ttype: 'mouse',\n\t\t\tevent,\n\t\t\t...p,\n\t\t\t// A cancelled pointer no longer says which button it was.\n\t\t\tbutton: buttonName(e.type === 'pointercancel' ? lastPress.button : e.button),\n\t\t\tbuttons: e.buttons,\n\t\t\tclickCount: lastPress.count,\n\t\t\tmodifiers: modifiersOf(e)\n\t\t});\n\t}\n\n\tfunction touchMessage(event: 'start' | 'move' | 'end' | 'cancel') {\n\t\treturn { type: 'touch', event, points: [...touches].map(([id, p]) => ({ id, x: p.x, y: p.y })) };\n\t}\n\n\tfunction onPointerDown(e: PointerEvent) {\n\t\tconst p = at(e);\n\t\tif (!p) return;\n\t\tcanvas?.focus({ preventScroll: true });\n\t\ttry {\n\t\t\tcanvas?.setPointerCapture(e.pointerId);\n\t\t} catch {\n\t\t\t// a pointer that is already gone; the press still counts\n\t\t}\n\t\tflushMove();\n\t\tif (e.pointerType === 'touch') {\n\t\t\t// A second finger makes it a gesture on the picture, so the page's touch is called off.\n\t\t\tif (touches.size === 1 && !pinch) stream.input({ type: 'touch', event: 'cancel', points: [] });\n\t\t\ttrack(e, p);\n\t\t\tif (touches.size === 1 && !pinch) stream.input(touchMessage('start'));\n\t\t\telse if (touches.size === 2) pinch = { view, ...fingers() };\n\t\t\treturn;\n\t\t}\n\t\te.preventDefault();\n\t\tconst again =\n\t\t\te.timeStamp - lastPress.at < MULTI_CLICK_MS &&\n\t\t\tMath.abs(e.clientX - lastPress.x) < MULTI_CLICK_PX &&\n\t\t\tMath.abs(e.clientY - lastPress.y) < MULTI_CLICK_PX;\n\t\tlastPress = { at: e.timeStamp, x: e.clientX, y: e.clientY, count: again ? (lastPress.count % 3) + 1 : 1, button: e.button };\n\t\tpress('down', e, p);\n\t}\n\n\tfunction onPointerMove(e: PointerEvent) {\n\t\tconst p = at(e);\n\t\tif (!p) return;\n\t\tif (e.pointerType === 'touch') {\n\t\t\tif (!touches.has(e.pointerId)) return;\n\t\t\ttrack(e, p);\n\t\t\tif (!pinch) return sendMove(touchMessage('move'));\n\t\t\tif (touches.size === 2) {\n\t\t\t\tconst now = fingers();\n\t\t\t\tview = zoomed(pinch.view, pinch.mid, now.mid, now.span / pinch.span);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsendMove({ type: 'mouse', event: 'move', ...p, button: heldButton(e.buttons), buttons: e.buttons, modifiers: modifiersOf(e) });\n\t}\n\n\tfunction onPointerUp(e: PointerEvent) {\n\t\tflushMove();\n\t\tif (e.pointerType === 'touch') {\n\t\t\tif (!touches.delete(e.pointerId)) return;\n\t\t\tif (pinch) {\n\t\t\t\t// The gesture lasts until every finger is up; the one left behind does not become a touch.\n\t\t\t\tif (touches.size === 0) pinch = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstream.input(touchMessage(e.type === 'pointercancel' ? 'cancel' : 'end'));\n\t\t\treturn;\n\t\t}\n\t\t// A cancelled press is still let go of, or the page is left holding the button.\n\t\tconst p = at(e);\n\t\tif (p) press('up', e, p);\n\t}\n\n\t// A wheel listener has to be non-passive to keep the pane itself from scrolling.\n\t$effect(() => {\n\t\tconst el = canvas;\n\t\tif (!el) return;\n\t\tconst onWheel = (e: WheelEvent) => {\n\t\t\tconst p = at(e);\n\t\t\tif (!p) return;\n\t\t\te.preventDefault();\n\t\t\t// Ctrl+wheel is also what a trackpad pinch sends. It magnifies the picture; the page's own zoom is left alone.\n\t\t\tif (e.ctrlKey) {\n\t\t\t\tconst here = { x: e.clientX, y: e.clientY };\n\t\t\t\tview = zoomed(view, here, here, Math.exp(-e.deltaY * 0.01));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst scale = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? LINE_PX : 1;\n\t\t\tstream.input({ type: 'wheel', ...p, deltaX: e.deltaX * scale, deltaY: e.deltaY * scale, modifiers: modifiersOf(e) });\n\t\t};\n\t\tel.addEventListener('wheel', onWheel, { passive: false });\n\t\treturn () => el.removeEventListener('wheel', onWheel);\n\t});\n\n\t// ── keys ─────────────────────────────────────────────────────────────\n\n\tfunction onKey(e: KeyboardEvent) {\n\t\tconst msg = keyMessage(e, e.type === 'keyup' ? 'up' : 'down');\n\t\tif (!msg) return;\n\t\te.preventDefault();\n\t\tstream.input(msg);\n\t}\n\n\tfunction onPaste(e: ClipboardEvent) {\n\t\tconst text = e.clipboardData?.getData('text/plain');\n\t\tif (!text) return;\n\t\te.preventDefault();\n\t\tstream.input({ type: 'text', text });\n\t}\n\n\tfunction pressKey(key: string, keyCode: number) {\n\t\tconst e = { key, code: key, keyCode, altKey: false, ctrlKey: false, metaKey: false, shiftKey: false };\n\t\tfor (const event of ['down', 'up'] as const) {\n\t\t\tconst msg = keyMessage(e, event);\n\t\t\tif (msg) stream.input(msg);\n\t\t}\n\t}\n\n\t/**\n\t * A phone has no keys to forward until a text field has focus, so this\n\t * field stands in: whatever is typed into it is typed into the page, and\n\t * what it holds is only an echo of that.\n\t */\n\tlet typing = $state(false);\n\tlet typedLocal = $state('');\n\tlet typedRemote = '';\n\tlet typingEl = $state<HTMLInputElement | null>(null);\n\n\tfunction mirrorTyped() {\n\t\tconst { backspaces, insert } = textDelta(typedRemote, typedLocal);\n\t\tfor (let i = 0; i < backspaces; i++) pressKey('Backspace', 8);\n\t\tif (insert) stream.input({ type: 'text', text: insert });\n\t\ttypedRemote = typedLocal;\n\t}\n\n\tfunction onTypingKey(e: KeyboardEvent) {\n\t\tif (e.isComposing) return;\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tsendEnter();\n\t\t} else if (e.key === 'Backspace' && typedLocal === '') {\n\t\t\tpressKey('Backspace', 8);\n\t\t} else if (e.key === 'Tab') {\n\t\t\te.preventDefault();\n\t\t\tpressKey('Tab', 9);\n\t\t\tclearTyped();\n\t\t}\n\t}\n\n\tfunction clearTyped() {\n\t\ttypedLocal = typedRemote = '';\n\t}\n\n\tfunction sendEnter() {\n\t\tpressKey('Enter', 13);\n\t\tclearTyped();\n\t\ttypingEl?.focus();\n\t}\n\n\t$effect(() => {\n\t\tif (typing) typingEl?.focus();\n\t});\n</script>\n\n{#snippet failed(icon: string, heading: string, text: string)}\n\t<div class=\"empty\">\n\t\t<iconify-icon {icon}></iconify-icon>\n\t\t<h3>{heading}</h3>\n\t\t<p>{text}</p>\n\t\t<Button size=\"sm\" onclick={retry} disabled={loading}>\n\t\t\t<iconify-icon icon=\"mdi:refresh\"></iconify-icon> Try again\n\t\t</Button>\n\t</div>\n{/snippet}\n\n<div class=\"browser\">\n\t{#if info?.name && !info.error && info.tabs.length > 0}\n\t\t<div class=\"strip\">\n\t\t\t<Popover.Root bind:open={pickerOpen}>\n\t\t\t\t<Popover.Trigger class=\"tab-trigger\" aria-label=\"Choose a tab\">\n\t\t\t\t\t<span class=\"live\" class:on={stream.connected && frame !== null}></span>\n\t\t\t\t\t<span class=\"title\">{current ? labelOf(current) : 'Untitled'}</span>\n\t\t\t\t\t<span class=\"count\">{info.tabs.length} tabs</span>\n\t\t\t\t\t<iconify-icon icon=\"mdi:chevron-down\"></iconify-icon>\n\t\t\t\t</Popover.Trigger>\n\t\t\t\t<Popover.Content class=\"tab-picker\" align=\"start\" sideOffset={4}>\n\t\t\t\t\t<Input bind:value={query} class=\"filter\" type=\"search\" placeholder=\"Find a tab…\" aria-label=\"Find a tab\" autocomplete=\"off\" />\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each shown as t (t.id)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<button type=\"button\" class:current={t.id === currentId} onclick={() => pick(t.id)}>\n\t\t\t\t\t\t\t\t\t<span class=\"row1\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"t\">{labelOf(t)}</span>\n\t\t\t\t\t\t\t\t\t\t{#if t.id === info.preferred}<Badge variant=\"secondary\" title=\"The tab this session last opened or selected\">Session</Badge>{/if}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"u\">{t.url}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<li class=\"none\">No tab matches “{query}”.</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t</Popover.Content>\n\t\t\t</Popover.Root>\n\t\t\t<Toggle class=\"kbd\" size=\"sm\" variant=\"outline\" bind:pressed={typing} title=\"Type into the page\" aria-label=\"Type into the page\">\n\t\t\t\t<iconify-icon icon=\"mdi:keyboard-outline\"></iconify-icon>\n\t\t\t</Toggle>\n\t\t</div>\n\t{/if}\n\n\t<div class=\"stage\" bind:this={stage}>\n\t\t{#if !info}\n\t\t\t<p class=\"msg dim\">Looking for the browser's tabs…</p>\n\t\t{:else if !info.name}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:monitor-off\"></iconify-icon>\n\t\t\t\t<h3>No remote browser set up</h3>\n\t\t\t\t<p>\n\t\t\t\t\tThis shows the browser a session drives through an MCP server started with\n\t\t\t\t\t<code>--browserUrl</code>. None is listed in <code>~/.claude.json</code>.\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t{:else if info.error}\n\t\t\t{@render failed('mdi:lan-disconnect', \"Can't reach the browser\", info.error)}\n\t\t{:else if !current}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:tab-unselected\"></iconify-icon>\n\t\t\t\t<h3>No tabs open</h3>\n\t\t\t\t<p>The browser behind {info.name} is running with no page to show.</p>\n\t\t\t</div>\n\t\t{:else if stream.closedReason}\n\t\t\t{@render failed('mdi:tab-remove', 'The view ended', stream.closedReason)}\n\t\t{:else}\n\t\t\t{#if !frame}<p class=\"msg dim waiting\">Connecting to {hostOf(current.url)}…</p>{/if}\n\t\t\t<canvas\n\t\t\t\tbind:this={canvas}\n\t\t\t\tclass:blank={!frame}\n\t\t\t\tstyle:--ratio={frame ? frame.width / frame.height : 1.6}\n\t\t\t\tstyle:transform={view.scale === 1 ? null : `translate(${view.x}px, ${view.y}px) scale(${view.scale})`}\n\t\t\t\ttabindex=\"0\"\n\t\t\t\taria-label={`Live view of ${current.title || current.url}`}\n\t\t\t\tonpointerdown={onPointerDown}\n\t\t\t\tonpointermove={onPointerMove}\n\t\t\t\tonpointerup={onPointerUp}\n\t\t\t\tonpointercancel={onPointerUp}\n\t\t\t\toncontextmenu={(e) => e.preventDefault()}\n\t\t\t\tonkeydown={onKey}\n\t\t\t\tonkeyup={onKey}\n\t\t\t\tonpaste={onPaste}\n\t\t\t></canvas>\n\t\t{/if}\n\t</div>\n\n\t{#if typing && current && !info?.error}\n\t\t<form\n\t\t\tclass=\"typing\"\n\t\t\tonsubmit={(e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tsendEnter();\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tbind:ref={typingEl}\n\t\t\t\tbind:value={typedLocal}\n\t\t\t\toninput={mirrorTyped}\n\t\t\t\tonkeydown={onTypingKey}\n\t\t\t\tclass=\"field\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tplaceholder=\"Tap a field in the page, then type here\"\n\t\t\t\taria-label=\"Type into the page\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tautocapitalize=\"off\"\n\t\t\t\tautocorrect=\"off\"\n\t\t\t\tspellcheck={false}\n\t\t\t\tenterkeyhint=\"enter\"\n\t\t\t/>\n\t\t\t<Button type=\"submit\" size=\"sm\" variant=\"secondary\" title=\"Press Enter in the page\">\n\t\t\t\t<iconify-icon icon=\"mdi:keyboard-return\"></iconify-icon> Enter\n\t\t\t</Button>\n\t\t</form>\n\t{/if}\n</div>\n\n<style>\n\t.browser {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.strip {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.strip :global(.tab-trigger) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\theight: 28px;\n\t\tpadding: 0 8px 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tcolor: #e7e5e4;\n\t\tfont-size: 12px;\n\t\ttext-align: left;\n\t}\n\t.strip :global(.tab-trigger:hover) {\n\t\tborder-color: #3f3f46;\n\t}\n\t.strip :global(.tab-trigger:focus-visible) {\n\t\toutline: 2px solid #a8a29e;\n\t\toutline-offset: 1px;\n\t}\n\t.live {\n\t\tflex: none;\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #57534e;\n\t}\n\t.live.on {\n\t\tbackground: #34d399;\n\t}\n\t.title {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.count {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t}\n\t.strip :global(.kbd) {\n\t\tflex: none;\n\t\theight: 28px;\n\t\tborder-color: #2a2a2a;\n\t\tcolor: #a8a29e;\n\t\tdisplay: none;\n\t}\n\t.strip :global(.kbd[data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t/* Only a device with no keys of its own needs the field. */\n\t@media (pointer: coarse) {\n\t\t.strip :global(.kbd) {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t}\n\t:global(.tab-picker) {\n\t\twidth: min(420px, calc(100vw - 24px));\n\t\tpadding: 8px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\t:global(.tab-picker .filter) {\n\t\theight: 32px;\n\t\tfont-size: 13px;\n\t}\n\t:global(.tab-picker) ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tmax-height: min(50vh, 380px);\n\t\toverflow-y: auto;\n\t}\n\t:global(.tab-picker) button {\n\t\twidth: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tpadding: 6px 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t:global(.tab-picker) button:hover,\n\t:global(.tab-picker) button:focus-visible {\n\t\tbackground: #232326;\n\t\toutline: none;\n\t}\n\t:global(.tab-picker) button.current {\n\t\tbackground: #2a2a2e;\n\t}\n\t:global(.tab-picker) .row1 {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-width: 0;\n\t}\n\t:global(.tab-picker) .t {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-size: 13px;\n\t\tcolor: #f5f5f4;\n\t}\n\t:global(.tab-picker) .u {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t\tcolor: #78716c;\n\t}\n\t:global(.tab-picker) .none {\n\t\tpadding: 10px 8px;\n\t\tcolor: #78716c;\n\t\tfont-size: 12.5px;\n\t}\n\t.stage {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tcontainer-type: size;\n\t\tbackground: #0c0c0c;\n\t\toverflow: hidden;\n\t}\n\tcanvas {\n\t\t/* The frame, as large as the pane allows at its own shape. */\n\t\twidth: min(100cqw, calc(100cqh * var(--ratio)));\n\t\taspect-ratio: var(--ratio);\n\t\theight: auto;\n\t\tbackground: #fff;\n\t\ttouch-action: none;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\toutline: none;\n\t\tcursor: default;\n\t}\n\tcanvas.blank {\n\t\tvisibility: hidden;\n\t}\n\tcanvas:focus-visible {\n\t\tbox-shadow: inset 0 0 0 2px #a8a29e;\n\t}\n\t.waiting {\n\t\tposition: absolute;\n\t\tinset: 0 auto auto 0;\n\t}\n\t.typing {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-top: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.typing :global(.field) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 36px;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\talign-self: flex-start;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t\toverflow-wrap: anywhere;\n\t}\n\tcode {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * The project's site in a frame: the prod or dev URL `.claude-mux.json`\n\t * names, a dev server found running inside the project, or a URL typed into\n\t * the bar. The URL holds the choice (`?url=prod|dev|<url>`), and the last\n\t * one persists per session.\n\t *\n\t * A URL on this machine is framed through its tailscale serve mapping when\n\t * it has one, so the phone reaches it too; one that cannot be framed from\n\t * here (mixed content, X-Frame-Options, CSP frame-ancestors) gets a card\n\t * that opens it in a tab of its own instead of a blank frame. Discovery is\n\t * polled only while the pane is showing.\n\t *\n\t * One more source is not a site at all: `?url=browser` shows a tab of the\n\t * remote browser a session drives (`BrowserView.svelte`), `?tab=` naming it.\n\t */\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { copyWithToast } from '$lib/side-panel/clipboard';\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tchoiceUrl,\n\t\tnormalizeTyped,\n\t\tresolveEmbed,\n\t\ttype FrameCheck,\n\t\ttype WebChoice,\n\t\ttype WebInfo\n\t} from '$lib/side-panel/web';\n\timport { BROWSER_CHOICE } from '$lib/side-panel/browser';\n\timport { webPaneStore } from '$lib/stores/webPane.svelte';\n\timport BrowserView from './BrowserView.svelte';\n\n\tlet { session, base, machineHost, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\t/** How often discovery runs while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\tconst CONFIG_SAMPLE = `{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`;\n\n\tconst sessionId = $derived(session?.id ?? null);\n\n\t// ── discovery ────────────────────────────────────────────────────────\n\n\tlet info = $state<WebInfo | null>(null);\n\tlet infoError = $state<string | null>(null);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo(id: string) {\n\t\tconst mine = ++infoSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${sessionApiAt(base, id)}/web`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tinfo = body as WebInfo;\n\t\t\tinfoError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === infoSeq) infoError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tuntrack(() => void loadInfo(id));\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo(id);\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t// ── the choice ───────────────────────────────────────────────────────\n\n\tconst devConfigured = $derived(!!info?.urls.dev);\n\t/** What to show when neither the URL nor this browser names anything. */\n\tconst fallback = $derived<WebChoice | null>(\n\t\tdevConfigured || info?.detected.length ? 'dev' : info?.urls.prod ? 'prod' : null\n\t);\n\tconst choice = $derived(params.url ?? fallback);\n\t/** The remote browser is showing, not a site. */\n\tconst browsing = $derived(choice === BROWSER_CHOICE);\n\tconst target = $derived(choice && !browsing ? choiceUrl(choice, info) : null);\n\tlet browserView = $state<ReturnType<typeof BrowserView> | null>(null);\n\t/** The URL of the remote tab on show, which the bar displays and \"Open in new tab\" opens. */\n\tlet browserUrl = $state<string | null>(null);\n\n\t// No URL in the address: put the one last shown here back.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored || !sessionId) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => webPaneStore.get(sessionId));\n\t\tif (!params.url && last) setParams({ url: last });\n\t});\n\n\t$effect(() => {\n\t\tif (params.url) webPaneStore.set(sessionId, params.url);\n\t});\n\n\t/**\n\t * The choices shown before this one, newest last, for Back. A frame on\n\t * another origin keeps its own history out of reach, so Back steps\n\t * through what was picked here rather than through the page's links.\n\t */\n\tlet trail = $state<string[]>([]);\n\n\tfunction choose(next: string) {\n\t\tif (next === choice) return;\n\t\tif (choice) trail = [...trail, choice];\n\t\tsetParams({ url: next, tab: null });\n\t}\n\n\tfunction goBack() {\n\t\tconst prev = trail.at(-1);\n\t\tif (!prev) return;\n\t\ttrail = trail.slice(0, -1);\n\t\tsetParams({ url: prev, tab: null });\n\t}\n\n\t// ── the bar ──────────────────────────────────────────────────────────\n\n\tlet typed = $state('');\n\t$effect(() => {\n\t\ttyped = (browsing ? browserUrl : target) ?? '';\n\t});\n\n\tfunction submitTyped(e: SubmitEvent) {\n\t\te.preventDefault();\n\t\t// The bar only reads a remote tab's address: typing there must not send someone's tab elsewhere.\n\t\tif (browsing) return;\n\t\tconst url = normalizeTyped(typed);\n\t\tif (!url) {\n\t\t\ttoast.error('Not an http(s) URL', { description: typed });\n\t\t\treturn;\n\t\t}\n\t\tconst named = (['prod', 'dev'] as const).find((c) => {\n\t\t\tconst configured = choiceUrl(c, info);\n\t\t\treturn configured !== null && normalizeTyped(configured) === url;\n\t\t});\n\t\tchoose(named ?? url);\n\t}\n\n\t// ── what is drawn ────────────────────────────────────────────────────\n\n\tconst embed = $derived.by(() => {\n\t\tif (!target || !info) return null;\n\t\ttry {\n\t\t\treturn resolveEmbed(target, { page: location, machine: machineHost, serves: info.serves, detected: info.detected });\n\t\t} catch {\n\t\t\treturn 'invalid' as const;\n\t\t}\n\t});\n\tconst frameSrc = $derived(embed !== 'invalid' && embed?.kind === 'frame' ? embed.src : null);\n\tconst openUrl = $derived(\n\t\tbrowsing ? browserUrl : embed === 'invalid' ? null : embed ? (embed.kind === 'frame' ? embed.src : embed.open) : target\n\t);\n\n\t/** The frame check for the frame's URL; until it lands the frame is not drawn. */\n\tlet check = $state<{ src: string; result: FrameCheck } | null>(null);\n\t$effect(() => {\n\t\tconst src = frameSrc;\n\t\tif (!src) return;\n\t\tlet stale = false;\n\t\tconst q = new URLSearchParams({ url: src, origin: location.origin });\n\t\tfetch(`${base}/api/web/frame?${q}`)\n\t\t\t.then((res) => res.json() as Promise<FrameCheck>)\n\t\t\t.catch((err): FrameCheck => ({ embeddable: null, reason: String(err) }))\n\t\t\t.then((result) => {\n\t\t\t\tif (!stale) check = { src, result };\n\t\t\t});\n\t\treturn () => (stale = true);\n\t});\n\tconst verdict = $derived(check && check.src === frameSrc ? check.result : null);\n\t/** Why the target is shown as a card rather than framed, or null to frame it. */\n\tconst blocked = $derived.by((): { reason: string; open: string; command?: string } | null => {\n\t\tif (embed === 'invalid') return null;\n\t\tif (embed?.kind === 'card') return embed;\n\t\tif (embed && verdict?.embeddable === false) {\n\t\t\treturn { reason: `The site forbids framing. ${verdict.reason}`, open: embed.src };\n\t\t}\n\t\treturn null;\n\t});\n\n\tlet reloads = $state(0);\n\n\tfunction reload() {\n\t\tif (browsing) browserView?.reload();\n\t\tif (frameSrc) reloads++;\n\t\tif (sessionId) void loadInfo(sessionId);\n\t}\n\n\tconst copy = (text: string) => copyWithToast(text);\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:arrow-left', label: 'Back', disabled: trail.length === 0, run: goBack },\n\t\t\t{ icon: 'mdi:refresh', label: 'Reload', disabled: !sessionId, run: reload },\n\t\t\t{\n\t\t\t\ticon: 'mdi:open-in-new',\n\t\t\t\tlabel: 'Open in new tab',\n\t\t\t\tdisabled: !openUrl,\n\t\t\t\trun: () => openUrl && window.open(openUrl, '_blank', 'noopener,noreferrer')\n\t\t\t}\n\t\t]);\n\t});\n\n\tfunction hostLabel(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n</script>\n\n<div class=\"web\">\n\t<form class=\"bar\" onsubmit={submitTyped}>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Site\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!info?.urls.prod}\n\t\t\t\ttitle={info?.urls.prod ?? 'No prod URL in .claude-mux.json'}\n\t\t\t\tbind:pressed={() => choice === 'prod', (on) => on && choose('prod')}>Prod</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!devConfigured && !info?.detected.length}\n\t\t\t\ttitle={info?.urls.dev ?? (info?.detected.length ? 'A dev server found running in the project' : 'No dev server found')}\n\t\t\t\tbind:pressed={() =>\n\t\t\t\t\tchoice === 'dev' || (!devConfigured && !!info?.detected.some((d) => d.url === choice)),\n\t\t\t\t(on) => on && choose('dev')}>Dev</Toggle\n\t\t\t>\n\t\t\t{#if info?.browser}\n\t\t\t\t<Toggle\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttitle={`The browser sessions drive through ${info.browser}, live`}\n\t\t\t\t\tbind:pressed={() => browsing, (on) => on && choose(BROWSER_CHOICE)}>Browser</Toggle\n\t\t\t\t>\n\t\t\t{/if}\n\t\t</div>\n\t\t<Input\n\t\t\tbind:value={typed}\n\t\t\tclass=\"url\"\n\t\t\ttype=\"text\"\n\t\t\tinputmode=\"url\"\n\t\t\tplaceholder=\"Type a URL…\"\n\t\t\taria-label=\"URL\"\n\t\t\treadonly={browsing}\n\t\t\tautocomplete=\"off\"\n\t\t\tspellcheck={false}\n\t\t/>\n\t</form>\n\n\t{#if browsing}\n\t\t<BrowserView\n\t\t\tbind:this={browserView}\n\t\t\t{sessionId}\n\t\t\t{base}\n\t\t\t{active}\n\t\t\ttab={params.tab}\n\t\t\tonPick={(id) => setParams({ tab: id })}\n\t\t\tonUrl={(url) => (browserUrl = url)}\n\t\t/>\n\t{:else}\n\t\t{#if info && !devConfigured && info.detected.length > 0}\n\t\t\t<div class=\"detected\">\n\t\t\t\t<span class=\"label\">Detected dev servers</span>\n\t\t\t\t{#each info.detected as server, i (server.port)}\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\t\ttitle={`${server.process} (pid ${server.pid}) · ${server.url}`}\n\t\t\t\t\t\tbind:pressed={() => target === server.url, (on) => on && choose(i === 0 ? 'dev' : server.url)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"dot\"></span>:{server.port}\n\t\t\t\t\t\t<span class=\"proc\">{server.process}</span>\n\t\t\t\t\t\t{#if server.loopbackOnly}<iconify-icon icon=\"mdi:lock-outline\" title=\"127.0.0.1 only\"></iconify-icon>{/if}\n\t\t\t\t\t</Toggle>\n\t\t\t\t{/each}\n\t\t\t</div>\n\t\t{/if}\n\n\t\t<div class=\"view\">\n\t\t\t{#if infoError && !info}\n\t\t\t\t<p class=\"msg err\">{infoError}</p>\n\t\t\t{:else if !info && !params.url}\n\t\t\t\t<p class=\"msg dim\">Looking for the project's URLs…</p>\n\t\t\t{:else if !target}\n\t\t\t\t<div class=\"empty\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:web-off\"></iconify-icon>\n\t\t\t\t\t{#if choice === 'prod'}\n\t\t\t\t\t\t<h3>No prod URL</h3>\n\t\t\t\t\t\t<p>Name one as <code>urls.prod</code> in <code>.claude-mux.json</code> at the repo root.</p>\n\t\t\t\t\t{:else if choice === 'dev'}\n\t\t\t\t\t\t<h3>No dev server running</h3>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\tNothing inside <code>{info?.root}</code> is serving HTML. Start the dev server, or name one as\n\t\t\t\t\t\t\t<code>urls.dev</code> in <code>.claude-mux.json</code>.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<h3>Nothing to show yet</h3>\n\t\t\t\t\t\t<p>Type a URL above, start a dev server in the project, or commit a <code>.claude-mux.json</code>:</p>\n\t\t\t\t\t\t<pre>{CONFIG_SAMPLE}</pre>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if info?.configError}<p class=\"err\">.claude-mux.json: {info.configError}</p>{/if}\n\t\t\t\t</div>\n\t\t\t{:else if embed === 'invalid'}\n\t\t\t\t<p class=\"msg err\">Not a URL: {target}</p>\n\t\t\t{:else if !embed}\n\t\t\t\t<p class=\"msg dim\">Resolving {target}…</p>\n\t\t\t{:else if blocked}\n\t\t\t\t{@const command = blocked.command}\n\t\t\t\t<div class=\"empty card\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:application-brackets-outline\"></iconify-icon>\n\t\t\t\t\t<h3>Can't show {hostLabel(blocked.open)} here</h3>\n\t\t\t\t\t<p>{blocked.reason}</p>\n\t\t\t\t\t<Button href={blocked.open} target=\"_blank\" rel=\"noopener noreferrer\" size=\"sm\">\n\t\t\t\t\t\t<iconify-icon icon=\"mdi:open-in-new\"></iconify-icon> Open in new tab\n\t\t\t\t\t</Button>\n\t\t\t\t\t{#if command}\n\t\t\t\t\t\t<p class=\"dim\">To show it here, map the port over HTTPS on this machine:</p>\n\t\t\t\t\t\t<div class=\"cmd\">\n\t\t\t\t\t\t\t<code>{command}</code>\n\t\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-sm\" title=\"Copy command\" aria-label=\"Copy command\" onclick={() => copy(command)}>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t{:else if frameSrc && !verdict}\n\t\t\t\t<p class=\"msg dim\">Checking {hostLabel(frameSrc)}…</p>\n\t\t\t{:else if frameSrc}\n\t\t\t\t{#key `${frameSrc}\\0${reloads}`}\n\t\t\t\t\t<iframe src={frameSrc} title=\"Web preview\" allow=\"clipboard-read; clipboard-write; fullscreen\"></iframe>\n\t\t\t\t{/key}\n\t\t\t{/if}\n\t\t</div>\n\t{/if}\n</div>\n\n<style>\n\t.web {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmin-width: 0;\n\t\tcolor: #d6d3d1;\n\t\tfont-size: 13px;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tflex: none;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 28px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.bar :global(.url) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 34px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.detected {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.label {\n\t\tcolor: #78716c;\n\t\tfont-size: 10.5px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\twhite-space: nowrap;\n\t\tmargin-right: 2px;\n\t}\n\t.detected :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 26px;\n\t\tpadding: 0 9px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.detected :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.dot {\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #34d399;\n\t}\n\t.proc {\n\t\tcolor: #78716c;\n\t}\n\t.view {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\tiframe {\n\t\tflex: 1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: 0;\n\t\tbackground: #fff;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t}\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tpre {\n\t\tmargin: 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t\ttext-align: left;\n\t}\n\t.cmd {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmax-width: 100%;\n\t\tpadding: 6px 6px 6px 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\ttext-align: left;\n\t}\n\t.cmd code {\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\">\n\t/**\n\t * A pull request or issue drawn from GitHub's data, read-only, so a link to\n\t * one opens beside the session (github.com refuses to be framed). The\n\t * header says where it stands; for a pull request the reviews and checks\n\t * follow; then the body and the conversation, newest first.\n\t *\n\t * `?ref=owner/name#n` names what shows. With none, the pane shows the pull\n\t * request of the session's branch, else the issue the session works on as a\n\t * worker. The row of refs above the header holds both, and the last few\n\t * opened here, to go back with a click.\n\t *\n\t * The pane only reads. To comment, review or merge, \"Open in Browser\"\n\t * shows the real page in the Web pane's Browser source, in a background\n\t * tab of the remote browser that is already signed in; it is offered only\n\t * while that browser answers.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { sessionApiAt } from '$lib/stores/fleet.svelte';\n\timport { clock } from '$lib/stores/clock.svelte';\n\timport { formatAgo } from '$lib/format';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { githubRefVisual } from '$shared/github-ref.js';\n\timport {\n\t\tdescribeChecks,\n\t\tgroupChecks,\n\t\tparseRefParam,\n\t\treadableComments,\n\t\trefParam,\n\t\tvisibleBody,\n\t\ttype GithubComment,\n\t\ttype ReviewVerdict\n\t} from '$shared/github-item.js';\n\timport {\n\t\tloadGithubItem,\n\t\tloadSessionGithub,\n\t\tmediaHref,\n\t\tpeekGithubItem,\n\t\ttype GithubItemResult,\n\t\ttype SessionGithub\n\t} from '$lib/github-items';\n\timport { BROWSER_CHOICE, browserAnswers, openInBrowser } from '$lib/side-panel/browser';\n\timport GithubRefCards from '$lib/components/GithubRefCards.svelte';\n\n\tlet { session, target, base, params, setParams, setActions, openPane, active }: PaneBodyProps = $props();\n\n\t/** How often an item on screen is read again; the server's cache and ETag make most of these free. */\n\tconst REFRESH_MS = 60_000;\n\tconst COMMENT_PAGE = 10;\n\tconst RECENT_MAX = 6;\n\n\t// ── what shows ───────────────────────────────────────────────────────\n\n\tlet defaults = $state<SessionGithub | null>(null);\n\tconst sessionId = $derived(session?.id ?? null);\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tconst api = sessionApiAt(base, id);\n\t\tuntrack(() => {\n\t\t\tif (defaults) return;\n\t\t\tvoid loadSessionGithub(api).then((d) => {\n\t\t\t\tif (sessionId === id) defaults = d;\n\t\t\t});\n\t\t});\n\t});\n\n\tconst picked = $derived(parseRefParam(params.ref));\n\tconst fallback = $derived.by(() => {\n\t\tif (!defaults?.repo) return null;\n\t\tconst number = defaults.pull ?? defaults.issue;\n\t\treturn number ? { repo: defaults.repo, number } : null;\n\t});\n\tconst shown = $derived(picked ?? fallback);\n\tconst shownKey = $derived(shown ? refParam(shown.repo, shown.number) : null);\n\n\tfunction openRef(ref: string) {\n\t\tif (ref !== params.ref) setParams({ ref }, { push: true });\n\t}\n\n\t// ── recently opened, per session, kept in this browser ───────────────\n\n\tconst recentKey = $derived(`gh-pane-recent:${base}|${target}`);\n\tlet recent = $state<string[]>([]);\n\t$effect(() => {\n\t\tconst k = recentKey;\n\t\ttry {\n\t\t\tconst kept = JSON.parse(localStorage.getItem(k) ?? '[]');\n\t\t\trecent = Array.isArray(kept) ? kept.filter((r) => typeof r === 'string' && parseRefParam(r)) : [];\n\t\t} catch {\n\t\t\trecent = [];\n\t\t}\n\t});\n\t$effect(() => {\n\t\tconst ref = shownKey;\n\t\tif (!ref) return;\n\t\tuntrack(() => {\n\t\t\tif (recent[0] === ref) return;\n\t\t\trecent = [ref, ...recent.filter((r) => r !== ref)].slice(0, RECENT_MAX);\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(recentKey, JSON.stringify(recent));\n\t\t\t} catch {\n\t\t\t\t// Storage may be off; the list then lasts as long as the page.\n\t\t\t}\n\t\t});\n\t});\n\n\t/** The shortcuts above the header: the session's own two, then what was opened here. */\n\tconst shortcuts = $derived.by(() => {\n\t\tconst list: { ref: string; label: string; icon: string; hint: string }[] = [];\n\t\tconst repo = defaults?.repo;\n\t\tif (repo && defaults?.pull) {\n\t\t\tlist.push({ ref: refParam(repo, defaults.pull), label: `#${defaults.pull}`, icon: 'mdi:source-branch', hint: \"This branch's pull request\" });\n\t\t}\n\t\tif (repo && defaults?.issue) {\n\t\t\tlist.push({ ref: refParam(repo, defaults.issue), label: `#${defaults.issue}`, icon: 'mdi:account-hard-hat-outline', hint: 'The issue this worker owns' });\n\t\t}\n\t\tfor (const ref of recent) {\n\t\t\tif (list.some((s) => s.ref === ref)) continue;\n\t\t\tconst p = parseRefParam(ref)!;\n\t\t\tconst own = p.repo.toLowerCase() === repo?.toLowerCase();\n\t\t\tlist.push({ ref, label: own ? `#${p.number}` : ref, icon: 'mdi:history', hint: `Opened lately: ${ref}` });\n\t\t}\n\t\treturn list;\n\t});\n\n\t// ── the read ─────────────────────────────────────────────────────────\n\n\tlet result = $state<GithubItemResult | null>(null);\n\tlet loading = $state(false);\n\tlet seq = 0;\n\n\tasync function load(repo: string, number: number, fresh = false) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\tconst answer = await loadGithubItem(base, repo, number, fresh);\n\t\tif (mine !== seq) return;\n\t\t// A failed refresh keeps what is on screen.\n\t\tif (answer.item || !result?.item || refParam(result.item.repo, result.item.number) !== refParam(repo, number)) {\n\t\t\tresult = answer;\n\t\t}\n\t\tloading = false;\n\t}\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want) return;\n\t\tuntrack(() => {\n\t\t\tconst ready = peekGithubItem(base, want.repo, want.number);\n\t\t\tresult = ready;\n\t\t\tolderShown = 0;\n\t\t\tshowBots = false;\n\t\t\tchecksOpen = false;\n\t\t\tpassingOpen = false;\n\t\t\texpanded = new Set();\n\t\t\tscroller?.scrollTo({ top: 0 });\n\t\t\tvoid load(want.repo, want.number);\n\t\t});\n\t});\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want || !active) return;\n\t\tconst id = setInterval(() => void load(want.repo, want.number), REFRESH_MS);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tconst item = $derived(result?.item ?? null);\n\tconst visual = $derived(item && githubRefVisual(item));\n\tconst pull = $derived(item?.pull ?? null);\n\n\t// ── the real page, in the remote browser ─────────────────────────────\n\n\t/** How often the pane asks whether the remote browser answers, while showing. */\n\tconst BROWSER_POLL_MS = 30_000;\n\tlet browserUp = $state(false);\n\tlet opening = $state(false);\n\n\tconst showing = $derived(!!shown);\n\t$effect(() => {\n\t\tconst at = base;\n\t\tbrowserUp = false;\n\t\tif (!active || !showing) return;\n\t\tconst ask = () => void browserAnswers(at).then((up) => base === at && (browserUp = up));\n\t\task();\n\t\tconst id = setInterval(() => document.visibilityState === 'visible' && ask(), BROWSER_POLL_MS);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tasync function openInRemote(url: string) {\n\t\tconst from = { base, ref: shownKey };\n\t\topening = true;\n\t\tconst opened = await openInBrowser(base, url);\n\t\topening = false;\n\t\t// The person moved on while the browser answered: leave the panel where they took it.\n\t\tif (!active || base !== from.base || shownKey !== from.ref) return;\n\t\tif ('tab' in opened) openPane('web', { url: BROWSER_CHOICE, tab: opened.tab });\n\t\telse toast.error('Could not open it in the browser', { description: opened.error });\n\t}\n\n\t$effect(() => {\n\t\tconst want = shown;\n\t\tif (!want) {\n\t\t\tsetActions([]);\n\t\t\treturn;\n\t\t}\n\t\tconst pageUrl = item?.url ?? githubUrl(want.repo, want.number);\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:refresh', label: 'Read again', run: () => void load(want.repo, want.number, true), disabled: loading },\n\t\t\t...(browserUp\n\t\t\t\t? [{ icon: 'mdi:monitor-share', label: 'Open in Browser', run: () => void openInRemote(pageUrl), disabled: opening }]\n\t\t\t\t: []),\n\t\t\t{ icon: 'mdi:open-in-new', label: 'Open on GitHub', run: () => window.open(pageUrl, '_blank', 'noopener') }\n\t\t]);\n\t});\n\n\tfunction githubUrl(repo: string, number: number): string {\n\t\t// GitHub sends an issue URL on to the pull request when the number is one.\n\t\treturn `https://github.com/${repo}/issues/${number}`;\n\t}\n\n\t// ── the header folds as the body scrolls ─────────────────────────────\n\n\tlet scroller = $state<HTMLElement | null>(null);\n\tlet folded = $state(false);\n\n\t// ── reviews and checks ───────────────────────────────────────────────\n\n\tconst VERDICT: Record<Exclude<ReviewVerdict, 'dismissed'>, { icon: string; word: string; tone: string }> = {\n\t\tapproved: { icon: 'mdi:check-circle', word: 'Approved', tone: 'good' },\n\t\tchanges_requested: { icon: 'mdi:file-document-edit-outline', word: 'Changes requested', tone: 'bad' },\n\t\tcommented: { icon: 'mdi:comment-outline', word: 'Commented', tone: 'quiet' }\n\t};\n\n\tlet checksOpen = $state(false);\n\tlet passingOpen = $state(false);\n\tconst checks = $derived(pull ? groupChecks(pull.checks) : null);\n\tconst checksTone = $derived(!checks ? 'quiet' : checks.failing.length ? 'bad' : checks.running.length ? 'busy' : 'good');\n\n\t// ── the conversation ─────────────────────────────────────────────────\n\n\tlet olderShown = $state(0);\n\tlet showBots = $state(false);\n\tlet expanded = $state(new Set<string>());\n\tconst talk = $derived(item?.comments ? readableComments(item.comments) : null);\n\t/** Newest first. */\n\tconst listed = $derived.by(() => {\n\t\tif (!talk) return [];\n\t\tconst all = showBots ? [...talk.people, ...talk.bots].sort((a, b) => (a.at ?? 0) - (b.at ?? 0)) : talk.people;\n\t\treturn [...all].reverse();\n\t});\n\tconst visibleComments = $derived(listed.slice(0, COMMENT_PAGE + olderShown));\n\tconst unread = $derived(item ? Math.max(0, item.comments_total - (item.comments?.length ?? 0)) : 0);\n\n\tfunction md(text: string): string {\n\t\treturn renderMarkdown(text, { github: { bare: true }, githubBody: { media: mediaHref(base) } });\n\t}\n\n\t/** Marks a comment whose body runs past the cap, so it can offer the rest. */\n\tfunction capped(node: HTMLElement) {\n\t\tconst check = () => node.classList.toggle('long', node.scrollHeight > node.clientHeight + 24);\n\t\tconst seen = new ResizeObserver(check);\n\t\tseen.observe(node);\n\t\tcheck();\n\t\treturn { destroy: () => seen.disconnect() };\n\t}\n\n\tfunction toggleComment(c: GithubComment) {\n\t\tconst next = new Set(expanded);\n\t\tif (next.has(c.id)) next.delete(c.id);\n\t\telse next.add(c.id);\n\t\texpanded = next;\n\t}\n\n\tfunction ago(at: number | null): string {\n\t\tif (!at) return '';\n\t\tconst a = formatAgo(at, clock.now);\n\t\treturn a === 'now' ? 'just now' : `${a} ago`;\n\t}\n\n\tfunction labelStyle(color: string): string {\n\t\tconst hex = /^[0-9a-f]{6}$/i.test(color) ? `#${color}` : '#78716c';\n\t\treturn `--label: ${hex}`;\n\t}\n</script>\n\n<div class=\"gh\">\n\t{#if shortcuts.length > 0}\n\t\t<nav class=\"refs\" aria-label=\"Pull requests and issues\">\n\t\t\t{#each shortcuts as s (s.ref)}\n\t\t\t\t<button type=\"button\" class=\"ref\" class:on={s.ref === shownKey} title={s.hint} onclick={() => openRef(s.ref)}>\n\t\t\t\t\t<iconify-icon icon={s.icon}></iconify-icon>\n\t\t\t\t\t<span>{s.label}</span>\n\t\t\t\t</button>\n\t\t\t{/each}\n\t\t</nav>\n\t{/if}\n\n\t{#if !shown}\n\t\t<div class=\"empty\">\n\t\t\t<iconify-icon icon=\"mdi:github\"></iconify-icon>\n\t\t\t{#if !defaults}\n\t\t\t\t<p>Looking for this session's pull request…</p>\n\t\t\t{:else if !defaults.repo}\n\t\t\t\t<p>This session is not in a GitHub repo.</p>\n\t\t\t{:else}\n\t\t\t\t<p>No pull request for this branch yet. Click a link to an issue or pull request in the conversation to open it here.</p>\n\t\t\t{/if}\n\t\t</div>\n\t{:else if !item}\n\t\t{#if result?.error}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:github\"></iconify-icon>\n\t\t\t\t{#if result.error === 'no-gh'}\n\t\t\t\t\t<p>The GitHub CLI is not signed in on this session's machine. Run <code>gh auth login</code> there to read it here.</p>\n\t\t\t\t{:else if result.error === 'not-found'}\n\t\t\t\t\t<p>GitHub has no {shown.repo}#{shown.number}, or this machine cannot see it.</p>\n\t\t\t\t{:else}\n\t\t\t\t\t<p>GitHub did not answer for {shown.repo}#{shown.number}.</p>\n\t\t\t\t{/if}\n\t\t\t\t<a class=\"out\" href={githubUrl(shown.repo, shown.number)} target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\tOpen on github.com <iconify-icon icon=\"mdi:open-in-new\"></iconify-icon>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t{:else}\n\t\t\t<div class=\"ghost\" aria-busy=\"true\" aria-label=\"Loading\">\n\t\t\t\t<span style:width=\"40%\"></span>\n\t\t\t\t<span style:width=\"85%\"></span>\n\t\t\t\t<span style:width=\"60%\"></span>\n\t\t\t\t<span class=\"gap\" style:width=\"100%\"></span>\n\t\t\t\t<span style:width=\"92%\"></span>\n\t\t\t\t<span style:width=\"70%\"></span>\n\t\t\t</div>\n\t\t{/if}\n\t{:else if visual}\n\t\t<header class=\"head\" class:folded style:--state={visual.color}>\n\t\t\t<div class=\"line1\">\n\t\t\t\t<span class=\"state\">\n\t\t\t\t\t<iconify-icon icon={visual.icon}></iconify-icon>\n\t\t\t\t\t{visual.label}\n\t\t\t\t</span>\n\t\t\t\t<a class=\"num\" href={item.url} target=\"_blank\" rel=\"noopener\" title=\"Open on GitHub\">\n\t\t\t\t\t{item.repo.toLowerCase() === defaults?.repo?.toLowerCase() ? '' : item.repo}#{item.number}\n\t\t\t\t</a>\n\t\t\t\t{#if result?.stale}<span class=\"stale\" title=\"GitHub did not answer the last read; this is the one before\">not current</span>{/if}\n\t\t\t\t{#if folded && pull}\n\t\t\t\t\t<span class=\"mini\"><span class=\"add\">+{pull.additions}</span> <span class=\"del\">−{pull.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<h2 title={item.title}>{item.title}</h2>\n\t\t\t<div class=\"fold\">\n\t\t\t\t<div class=\"fold-in\">\n\t\t\t\t\t<p class=\"meta\">\n\t\t\t\t\t\t{#if item.author}<span class=\"who\">{item.author}</span>{/if}\n\t\t\t\t\t\t{#if item.updated_at}<span title={new Date(item.updated_at).toLocaleString()}>updated {ago(item.updated_at)}</span>{/if}\n\t\t\t\t\t</p>\n\t\t\t\t\t{#if pull}\n\t\t\t\t\t\t<p class=\"branch\">\n\t\t\t\t\t\t\t<span class=\"names\" title=\"{pull.base} ← {pull.head}\">\n\t\t\t\t\t\t\t\t<span class=\"b\">{pull.base}</span>\n\t\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t\t\t<span class=\"b\">{pull.head}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"nums\">\n\t\t\t\t\t\t\t\t<span class=\"add\">+{pull.additions}</span>\n\t\t\t\t\t\t\t\t<span class=\"del\">−{pull.deletions}</span>\n\t\t\t\t\t\t\t\t<span>{pull.files} {pull.files === 1 ? 'file' : 'files'}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if item.labels.length}\n\t\t\t\t\t\t<p class=\"labels\">\n\t\t\t\t\t\t\t{#each item.labels as l (l.name)}\n\t\t\t\t\t\t\t\t<span class=\"label\" style={labelStyle(l.color)}>{l.name}</span>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</header>\n\n\t\t<div class=\"scroll\" bind:this={scroller} onscroll={(e) => (folded = e.currentTarget.scrollTop > 24)}>\n\t\t\t{#if pull && (pull.reviews.length || pull.requested.length || pull.checks.length)}\n\t\t\t\t<section class=\"facts\" aria-label=\"Reviews and checks\">\n\t\t\t\t\t{#each pull.reviews as r (r.author)}\n\t\t\t\t\t\t{@const v = VERDICT[r.verdict as keyof typeof VERDICT]}\n\t\t\t\t\t\t<div class=\"fact {v.tone}\" class:old={r.stale} title={r.stale ? 'Given before the latest commit' : undefined}>\n\t\t\t\t\t\t\t<iconify-icon icon={v.icon}></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"who\">{r.author}</span>\n\t\t\t\t\t\t\t<span class=\"word\">{v.word.toLowerCase()}</span>\n\t\t\t\t\t\t\t{#if r.at}<span class=\"when\">{ago(r.at)}</span>{/if}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t\t{#if pull.requested.length}\n\t\t\t\t\t\t<div class=\"fact quiet\">\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:account-clock-outline\"></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"word\">Waiting on {pull.requested.join(', ')}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if checks && pull.checks.length}\n\t\t\t\t\t\t<button type=\"button\" class=\"fact checks {checksTone}\" aria-expanded={checksOpen} onclick={() => (checksOpen = !checksOpen)}>\n\t\t\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\t\t\ticon={checksTone === 'bad' ? 'mdi:close-circle' : checksTone === 'busy' ? 'mdi:progress-clock' : 'mdi:check-circle'}\n\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t<span class=\"word\">{describeChecks(pull.checks)}</span>\n\t\t\t\t\t\t\t<iconify-icon class=\"chev\" icon={checksOpen ? 'mdi:chevron-up' : 'mdi:chevron-down'}></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{#if checksOpen}\n\t\t\t\t\t\t\t<ul class=\"checklist\">\n\t\t\t\t\t\t\t\t{#each [...checks.failing, ...checks.running, ...(passingOpen || (!checks.failing.length && !checks.running.length) ? checks.passing : [])] as c, i (`${c.name}:${i}`)}\n\t\t\t\t\t\t\t\t\t<li class={c.bucket}>\n\t\t\t\t\t\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\t\t\t\t\t\ticon={c.bucket === 'failing' ? 'mdi:close-circle' : c.bucket === 'running' ? 'mdi:progress-clock' : 'mdi:check-circle'}\n\t\t\t\t\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t\t\t\t\t{#if c.url}\n\t\t\t\t\t\t\t\t\t\t\t<a href={c.url} target=\"_blank\" rel=\"noopener\">{c.name}</a>\n\t\t\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"name\">{c.name}</span>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t<span class=\"status\">{c.status}</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t{#if !passingOpen && checks.passing.length && (checks.failing.length || checks.running.length)}\n\t\t\t\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={() => (passingOpen = true)}>Show {checks.passing.length} passing</button>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t{/if}\n\t\t\t\t</section>\n\t\t\t{/if}\n\n\t\t\t<article class=\"body markdown\">\n\t\t\t\t{#if visibleBody(item.body)}\n\t\t\t\t\t{@html md(item.body)}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"none\">No description.</p>\n\t\t\t\t{/if}\n\t\t\t</article>\n\n\t\t\t<section class=\"talk\" aria-label=\"Comments\">\n\t\t\t\t<div class=\"talk-head\">\n\t\t\t\t\t<span>{item.comments_total} {item.comments_total === 1 ? 'comment' : 'comments'}</span>\n\t\t\t\t\t{#if talk?.bots.length}\n\t\t\t\t\t\t<button type=\"button\" class=\"more\" aria-pressed={showBots} onclick={() => (showBots = !showBots)}>\n\t\t\t\t\t\t\t{showBots ? `Hide ${talk.bots.length} from bots` : `${talk.bots.length} from bots hidden`}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t\t{#if item.comments === null}\n\t\t\t\t\t<p class=\"none\">The comments could not be read.</p>\n\t\t\t\t{/if}\n\t\t\t\t{#each visibleComments as c (c.id)}\n\t\t\t\t\t<div class=\"comment\" class:bot={c.bot}>\n\t\t\t\t\t\t<p class=\"c-head\">\n\t\t\t\t\t\t\t<span class=\"who\">{c.author}</span>\n\t\t\t\t\t\t\t{#if c.at}\n\t\t\t\t\t\t\t\t<a class=\"when\" href={c.url} target=\"_blank\" rel=\"noopener\" title={new Date(c.at).toLocaleString()}>{ago(c.at)}</a>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div class=\"c-body markdown\" class:open={expanded.has(c.id)} use:capped>\n\t\t\t\t\t\t\t{@html md(c.body)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button type=\"button\" class=\"more showmore\" onclick={() => toggleComment(c)}>\n\t\t\t\t\t\t\t{expanded.has(c.id) ? 'Show less' : 'Show more'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t{/each}\n\t\t\t\t{#if listed.length > visibleComments.length}\n\t\t\t\t\t<button type=\"button\" class=\"more older\" onclick={() => (olderShown += COMMENT_PAGE)}>\n\t\t\t\t\t\tShow older ({listed.length - visibleComments.length} more)\n\t\t\t\t\t</button>\n\t\t\t\t{:else if unread}\n\t\t\t\t\t<a class=\"more older\" href={item.url} target=\"_blank\" rel=\"noopener\">{unread} older on GitHub</a>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t\t{#if scroller}\n\t\t\t<GithubRefCards root={scroller} repo={item.repo} {base} onOpen={openRef} />\n\t\t{/if}\n\t{/if}\n</div>\n\n<style>\n\t.gh {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t\tmin-width: 0;\n\t}\n\t.refs {\n\t\tflex: none;\n\t\tdisplay: flex;\n\t\tgap: 4px;\n\t\tpadding: 6px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tscrollbar-width: none;\n\t}\n\t.ref {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\theight: 26px;\n\t\tmax-width: 16rem;\n\t\tpadding: 0 8px;\n\t\tborder: 1px solid transparent;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\t.ref span {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.ref:hover {\n\t\tcolor: #e7e5e4;\n\t\tbackground: #1a1a1a;\n\t}\n\t.ref.on {\n\t\tcolor: #f5f5f4;\n\t\tborder-color: #2a2a2a;\n\t\tbackground: #1f1f1f;\n\t}\n\t.empty {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 10px;\n\t\tpadding: 24px 18px;\n\t\tcolor: #a8a29e;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 22px;\n\t\tcolor: #57534e;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tmax-width: 34rem;\n\t}\n\t.empty code {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #292524;\n\t\tborder-radius: 4px;\n\t\tpadding: 1px 5px;\n\t}\n\t.out {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\tcolor: #93c5fd;\n\t}\n\t.ghost {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 9px;\n\t\tpadding: 18px;\n\t}\n\t.ghost span {\n\t\theight: 11px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1c1c1c;\n\t\tanimation: ghost 1.4s ease-in-out infinite;\n\t}\n\t.ghost .gap {\n\t\theight: 1px;\n\t\tmargin: 6px 0;\n\t}\n\t@keyframes ghost {\n\t\t50% {\n\t\t\topacity: 0.45;\n\t\t}\n\t}\n\n\t/* The header: its left rule and the state word carry the state's colour, nothing else does. */\n\t.head {\n\t\tflex: none;\n\t\tpadding: 10px 14px 10px 12px;\n\t\tborder-bottom: 1px solid #222;\n\t\tborder-left: 2px solid var(--state);\n\t}\n\t.line1 {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-width: 0;\n\t\tfont-size: 12px;\n\t}\n\t.state {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\tcolor: var(--state);\n\t\tfont-weight: 600;\n\t}\n\t.state iconify-icon {\n\t\tfont-size: 15px;\n\t}\n\t.num {\n\t\tfont-family: var(--font-mono);\n\t\tcolor: #a8a29e;\n\t\ttext-decoration: none;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.num:hover {\n\t\tcolor: #e7e5e4;\n\t\ttext-decoration: underline;\n\t}\n\t.stale {\n\t\tpadding: 0 5px;\n\t\tborder: 1px solid #3a3532;\n\t\tborder-radius: 4px;\n\t\tfont-size: 10.5px;\n\t\tcolor: #a8a29e;\n\t}\n\t.mini {\n\t\tmargin-left: auto;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11px;\n\t}\n\th2 {\n\t\tmargin: 4px 0 0;\n\t\tfont-size: 14.5px;\n\t\tfont-weight: 600;\n\t\tline-height: 1.35;\n\t\tcolor: #f5f5f4;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.fold {\n\t\tdisplay: grid;\n\t\tgrid-template-rows: 1fr;\n\t\ttransition: grid-template-rows 160ms ease;\n\t}\n\t.folded .fold {\n\t\tgrid-template-rows: 0fr;\n\t}\n\t.fold-in {\n\t\toverflow: hidden;\n\t\tmin-height: 0;\n\t}\n\t.meta,\n\t.branch,\n\t.labels {\n\t\tmargin: 6px 0 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 4px 10px;\n\t\tflex-wrap: wrap;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t}\n\t.who {\n\t\tcolor: #d6d3d1;\n\t\tfont-weight: 500;\n\t}\n\t.branch {\n\t\tflex-wrap: nowrap;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.names {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t}\n\t.names iconify-icon {\n\t\tflex: none;\n\t\tcolor: #57534e;\n\t}\n\t.b {\n\t\tmin-width: 0;\n\t\tmax-width: 50%;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #d6d3d1;\n\t}\n\t.nums {\n\t\tflex: none;\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\t.add {\n\t\tcolor: #3f9d63;\n\t}\n\t.del {\n\t\tcolor: #b4565a;\n\t}\n\t.label {\n\t\tpadding: 0 7px;\n\t\tborder: 1px solid color-mix(in srgb, var(--label) 55%, #111);\n\t\tborder-radius: 999px;\n\t\tbackground: color-mix(in srgb, var(--label) 16%, #111);\n\t\tcolor: color-mix(in srgb, var(--label) 45%, #e7e5e4);\n\t\tfont-size: 11px;\n\t\tline-height: 1.6;\n\t}\n\n\t.scroll {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow-y: auto;\n\t\tpadding-bottom: 24px;\n\t}\n\t.facts {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 8px 0;\n\t\tborder-bottom: 1px solid #222;\n\t}\n\t.fact {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 7px;\n\t\tmin-height: 28px;\n\t\tpadding: 0 14px;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tfont-size: 12.5px;\n\t\ttext-align: left;\n\t}\n\t.fact iconify-icon {\n\t\tflex: none;\n\t\tfont-size: 15px;\n\t}\n\t.fact.good iconify-icon {\n\t\tcolor: #34d399;\n\t}\n\t.fact.bad iconify-icon {\n\t\tcolor: #f87171;\n\t}\n\t.fact.busy iconify-icon {\n\t\tcolor: #a8a29e;\n\t}\n\t.fact.quiet iconify-icon {\n\t\tcolor: #78716c;\n\t}\n\t.fact.old {\n\t\topacity: 0.5;\n\t}\n\t.fact .when {\n\t\tmargin-left: auto;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\t.checks {\n\t\tcursor: pointer;\n\t}\n\t.checks:hover {\n\t\tbackground: #171717;\n\t}\n\t.checks .word {\n\t\tcolor: #d6d3d1;\n\t}\n\t.chev {\n\t\tmargin-left: auto;\n\t\tcolor: #78716c;\n\t}\n\t.checklist {\n\t\tmargin: 2px 0 4px;\n\t\tpadding: 0;\n\t\tlist-style: none;\n\t}\n\t.checklist li {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 7px;\n\t\tmin-height: 26px;\n\t\tpadding: 0 14px 0 34px;\n\t\tfont-size: 12px;\n\t}\n\t.checklist iconify-icon {\n\t\tflex: none;\n\t\tfont-size: 13px;\n\t}\n\t.checklist .failing iconify-icon {\n\t\tcolor: #f87171;\n\t}\n\t.checklist .running iconify-icon {\n\t\tcolor: #a8a29e;\n\t}\n\t.checklist .passing iconify-icon {\n\t\tcolor: #34d399;\n\t}\n\t.checklist a,\n\t.checklist .name {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tcolor: #d6d3d1;\n\t\ttext-decoration: none;\n\t}\n\t.checklist a:hover {\n\t\ttext-decoration: underline;\n\t}\n\t.status {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 11.5px;\n\t}\n\t.more {\n\t\talign-self: flex-start;\n\t\tmargin: 2px 14px;\n\t\tpadding: 2px 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tfont-size: 12px;\n\t\tcursor: pointer;\n\t\ttext-decoration: none;\n\t}\n\t.more:hover {\n\t\ttext-decoration: underline;\n\t}\n\t.body {\n\t\tpadding: 14px;\n\t\tline-height: 1.55;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.none {\n\t\tmargin: 0;\n\t\tcolor: #78716c;\n\t}\n\t.talk {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tborder-top: 1px solid #222;\n\t}\n\t.talk-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px 4px;\n\t\tfont-size: 12px;\n\t\tcolor: #78716c;\n\t}\n\t.talk-head .more {\n\t\tmargin: 0;\n\t}\n\t.talk > .none {\n\t\tpadding: 6px 14px;\n\t}\n\t.comment {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #1c1c1c;\n\t\t/* Long bot reports off screen skip layout until scrolled to. */\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-block-size: auto 120px;\n\t}\n\t.comment.bot {\n\t\topacity: 0.8;\n\t}\n\t.c-head {\n\t\tmargin: 0 0 4px;\n\t\tdisplay: flex;\n\t\talign-items: baseline;\n\t\tgap: 8px;\n\t\tfont-size: 12px;\n\t}\n\t.c-head .when {\n\t\tcolor: #78716c;\n\t\ttext-decoration: none;\n\t}\n\t.c-head .when:hover {\n\t\tcolor: #a8a29e;\n\t\ttext-decoration: underline;\n\t}\n\t.c-body {\n\t\tmax-height: 240px;\n\t\toverflow: hidden;\n\t\tline-height: 1.55;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.c-body:global(.long):not(.open) {\n\t\tmask-image: linear-gradient(to bottom, #000 70%, transparent);\n\t}\n\t.c-body.open {\n\t\tmax-height: none;\n\t}\n\t.showmore {\n\t\tdisplay: none;\n\t\tmargin: 4px 0 0;\n\t}\n\t.c-body:global(.long) + .showmore,\n\t.c-body.open + .showmore {\n\t\tdisplay: inline;\n\t}\n\t.older {\n\t\tmargin: 10px 14px;\n\t}\n\n\t/* What a body holds beyond the transcript's markdown. */\n\t.gh :global(.markdown img) {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tborder-radius: 4px;\n\t}\n\t.gh :global(.markdown details) {\n\t\tmargin: 6px 0;\n\t\tpadding: 4px 10px;\n\t\tborder: 1px solid #262626;\n\t\tborder-radius: 6px;\n\t}\n\t.gh :global(.markdown summary) {\n\t\tcursor: pointer;\n\t\tcolor: #a8a29e;\n\t}\n\t.gh :global(.markdown details[open] > summary) {\n\t\tmargin-bottom: 6px;\n\t}\n\t.gh :global(.gh-alert) {\n\t\tmargin: 8px 0;\n\t\tpadding: 2px 0 2px 12px;\n\t\tborder-left: 3px solid var(--alert);\n\t}\n\t.gh :global(.gh-alert-title) {\n\t\tcolor: var(--alert);\n\t\tfont-weight: 600;\n\t\tmargin-bottom: 3px;\n\t}\n\t.gh :global(.gh-alert-note) {\n\t\t--alert: #60a5fa;\n\t}\n\t.gh :global(.gh-alert-tip) {\n\t\t--alert: #34d399;\n\t}\n\t.gh :global(.gh-alert-important) {\n\t\t--alert: #a78bfa;\n\t}\n\t.gh :global(.gh-alert-warning) {\n\t\t--alert: #fb923c;\n\t}\n\t.gh :global(.gh-alert-caution) {\n\t\t--alert: #f87171;\n\t}\n\t.ref:focus-visible,\n\t.fact:focus-visible,\n\t.more:focus-visible,\n\t.num:focus-visible {\n\t\toutline: 2px solid #7dd3fc;\n\t\toutline-offset: -2px;\n\t}\n\t@media (pointer: coarse) {\n\t\t.ref {\n\t\t\theight: 34px;\n\t\t}\n\t\t.fact {\n\t\t\tmin-height: 36px;\n\t\t}\n\t\t.more {\n\t\t\tpadding: 8px 0;\n\t\t}\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.fold {\n\t\t\ttransition: none;\n\t\t}\n\t\t.ghost span {\n\t\t\tanimation: none;\n\t\t}\n\t}\n</style>\n","/**\n * The pane kinds the side panel can show. A pane registers here: its kind\n * (the `?panel=` value), icon, label, the key that toggles it, the URL params\n * it owns, its body component, and when it cannot apply. Its header actions\n * come from the body itself, through `setActions`, since they usually depend\n * on what the body is showing.\n */\nimport type { Component } from 'svelte';\nimport type { Session } from '$lib/stores/sessions.svelte';\nimport type { ChangesInfo } from '$shared/types/ws-messages.js';\nimport ProjectPane from '$lib/components/side-panel/ProjectPane.svelte';\nimport ChangesPane from '$lib/components/side-panel/ChangesPane.svelte';\nimport FilesPane from '$lib/components/side-panel/FilesPane.svelte';\nimport HistoryPane from '$lib/components/side-panel/HistoryPane.svelte';\nimport WebPane from '$lib/components/side-panel/WebPane.svelte';\nimport GithubPane from '$lib/components/side-panel/GithubPane.svelte';\nimport { IS_MAC } from '$lib/constants';\n\nexport interface PaneAction {\n\ticon: string;\n\tlabel: string;\n\trun: () => void;\n\t/** For an action that toggles, whether it is on. */\n\tpressed?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PaneBodyProps {\n\tsession: Session | null;\n\ttarget: string;\n\t/**\n\t * Where the session's machine's API is reached from this page: '' for the\n\t * origin's own, `/fleet/<id>` through the relay for another machine's.\n\t */\n\tbase: string;\n\t/**\n\t * The host name that reaches another machine's own ports (its dev servers),\n\t * or null for the origin's own session.\n\t */\n\tmachineHost: string | null;\n\t/** The params this pane owns, as the URL has them. */\n\tparams: Record<string, string>;\n\t/** Change this pane's params; a null value removes one. Replaces the history entry unless `push`. */\n\tsetParams: (own: Record<string, string | null>, opts?: { push?: boolean }) => void;\n\t/** The actions the panel header draws beside the pane's title. */\n\tsetActions: (actions: PaneAction[]) => void;\n\t/** The pane is the one showing; a hidden pane stays mounted but may idle. */\n\tactive: boolean;\n\t/** Put `text` into the session's composer, at the end of the draft. */\n\tmention: (text: string) => void;\n\t/** Show another pane, with the params it owns set to `own`. */\n\topenPane: (kind: string, own: Record<string, string | null>) => void;\n}\n\nexport interface PaneDef {\n\tkind: string;\n\tlabel: string;\n\ticon: string;\n\t/** The letter that, with Alt+Shift, toggles this pane. */\n\tkey: string;\n\t/** The query params this pane owns besides `panel`. */\n\tparams: readonly string[];\n\tbody: Component<PaneBodyProps>;\n\t/** Why the pane cannot apply to this session, or null when it can. */\n\tunavailable?: (session: Session | null) => string | null;\n\t/** Lines added and removed, drawn on the pane's toggle while non-zero. */\n\tcount?: (session: Session | null) => ChangesInfo | null;\n}\n\nexport const PANES: readonly PaneDef[] = [\n\t{\n\t\tkind: 'changes',\n\t\tlabel: 'Changes',\n\t\ticon: 'mdi:plus-minus-variant',\n\t\tkey: 'C',\n\t\tparams: ['file', 'turn', 'source'],\n\t\tbody: ChangesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session'),\n\t\tcount: (s) => s?.changes ?? null\n\t},\n\t{\n\t\tkind: 'history',\n\t\tlabel: 'History',\n\t\ticon: 'mdi:source-commit',\n\t\tkey: 'H',\n\t\tparams: ['commit', 'file', 'view'],\n\t\tbody: HistoryPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'files',\n\t\tlabel: 'Files',\n\t\ticon: 'mdi:file-tree-outline',\n\t\tkey: 'F',\n\t\tparams: ['file', 'line'],\n\t\tbody: FilesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'web',\n\t\tlabel: 'Web',\n\t\ticon: 'mdi:web',\n\t\tkey: 'W',\n\t\tparams: ['url', 'tab'],\n\t\tbody: WebPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'github',\n\t\tlabel: 'GitHub',\n\t\ticon: 'mdi:github',\n\t\tkey: 'G',\n\t\tparams: ['ref'],\n\t\tbody: GithubPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'project',\n\t\tlabel: 'Project',\n\t\ticon: 'mdi:folder-information-outline',\n\t\tkey: 'P',\n\t\tparams: [],\n\t\tbody: ProjectPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t}\n];\n\nexport const PANE_KINDS = PANES.map((p) => p.kind);\n/** Every param any pane owns, which switching panes clears. */\nexport const PANE_PARAMS = [...new Set(PANES.flatMap((p) => p.params))];\n\nexport function paneDef(kind: string | null): PaneDef | null {\n\treturn PANES.find((p) => p.kind === kind) ?? null;\n}\n\n/** How Alt+Shift+`letter` is written for this keyboard. */\nfunction altShift(letter: string): string {\n\treturn IS_MAC ? `⌥⇧${letter}` : `Alt Shift ${letter}`;\n}\n\n/** How the keys that toggle a pane are written for this keyboard. */\nexport function paneKeys(def: PaneDef): string {\n\treturn altShift(def.key);\n}\n/** Toggles maximize. */\nconst MAXIMIZE_KEY = 'M';\nexport const MAXIMIZE_KEYS = altShift(MAXIMIZE_KEY);\n/** Closes the panel, or reopens the pane last shown. */\nexport const CLOSE_KEYS = IS_MAC ? '⌘\\\\' : 'Ctrl \\\\';\n\n/** The pane an Alt+Shift+letter press names, or 'maximize'. */\nexport function panelKeyAction(e: KeyboardEvent): PaneDef | 'maximize' | 'toggle' | null {\n\tif ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.code === 'Backslash') return 'toggle';\n\tif (!e.altKey || !e.shiftKey || e.ctrlKey || e.metaKey) return null;\n\tif (e.code === `Key${MAXIMIZE_KEY}`) return 'maximize';\n\treturn PANES.find((p) => e.code === `Key${p.key}`) ?? null;\n}\n","// File attachments staged for the next send, kept per target the way drafts\n// are (see docs/adr/0001, 0002). In memory only: a chip holds the File and a\n// blob URL, neither of which survives a reload.\nexport type AttachmentStatus = 'uploading' | 'ready' | 'failed';\nexport interface Attachment {\n\tlocalId: string;\n\tfile: File;\n\tname: string;\n\tsize: number;\n\tmime: string;\n\tstatus: AttachmentStatus;\n\tpath?: string;\n\terror?: string;\n\tthumb?: string;\n\tabort?: AbortController;\n}\n\nconst NONE: Attachment[] = [];\n\nfunction release(chip: Attachment): void {\n\tchip.abort?.abort();\n\tif (chip.thumb) URL.revokeObjectURL(chip.thumb);\n}\n\nclass AttachmentsStore {\n\tprivate state = $state<Record<string, Attachment[]>>({});\n\n\tget(target: string | null): Attachment[] {\n\t\tif (!target) return NONE;\n\t\treturn this.state[target] ?? NONE;\n\t}\n\n\tcount(target: string | null): number {\n\t\treturn this.get(target).length;\n\t}\n\n\tadd(target: string | null, chip: Attachment): void {\n\t\tif (!target) return;\n\t\tthis.state[target] = [...this.get(target), chip];\n\t}\n\n\t/** Patch a chip in its own target's list; a no-op once it has been removed. */\n\tpatch(target: string, localId: string, changes: Partial<Attachment>): void {\n\t\tconst list = this.state[target];\n\t\tif (!list?.some((a) => a.localId === localId)) return;\n\t\tthis.state[target] = list.map((a) => (a.localId === localId ? { ...a, ...changes } : a));\n\t}\n\n\t/** Drop one chip, aborting its upload and revoking its blob URL. */\n\tremove(target: string | null, localId: string): Attachment | undefined {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tconst chip = list?.find((a) => a.localId === localId);\n\t\tif (!target || !list || !chip) return undefined;\n\t\trelease(chip);\n\t\tconst rest = list.filter((a) => a.localId !== localId);\n\t\tif (rest.length) this.state[target] = rest;\n\t\telse delete this.state[target];\n\t\treturn chip;\n\t}\n\n\tclear(target: string | null): void {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tif (!target || !list) return;\n\t\tlist.forEach(release);\n\t\tdelete this.state[target];\n\t}\n}\n\nexport const attachmentsStore = new AttachmentsStore();\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: DialogPrimitive.RootProps = $props();\n</script>\n\n<DialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: DialogPrimitive.PortalProps = $props();\n</script>\n\n<DialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.TitleProps = $props();\n</script>\n\n<DialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"dialog-title\"\n\tclass={cn(\"text-lg leading-none font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.OverlayProps = $props();\n</script>\n\n<DialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M18 6 6 18\" }], [\"path\", { \"d\": \"m6 6 12 12\" }]];\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"x\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport DialogPortal from \"./dialog-portal.svelte\";\n\timport XIcon from \"@lucide/svelte/icons/x\";\n\timport type { Snippet } from \"svelte\";\n\timport * as Dialog from \"./index.js\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\tchildren,\n\t\tshowCloseButton = true,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;\n\t\tchildren: Snippet;\n\t\tshowCloseButton?: boolean;\n\t} = $props();\n</script>\n\n<DialogPortal {...portalProps}>\n\t<Dialog.Overlay />\n\t<DialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t>\n\t\t{@render children?.()}\n\t\t{#if showCloseButton}\n\t\t\t<DialogPrimitive.Close\n\t\t\t\tclass=\"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t>\n\t\t\t\t<XIcon />\n\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t</DialogPrimitive.Close>\n\t\t{/if}\n\t</DialogPrimitive.Content>\n</DialogPortal>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.DescriptionProps = $props();\n</script>\n\n<DialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport * as Dialog from '$lib/components/ui/dialog';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { sessionStore, type Session } from '$lib/stores/sessions.svelte';\n\n\tinterface Props {\n\t\t/** The session to rename; `null` keeps the dialog closed. */\n\t\tsessionId: string | null;\n\t\tonClose: () => void;\n\t\t/** Another machine's sessions, and the relay path to it; this machine's by default. */\n\t\tsessions?: Session[];\n\t\tbase?: string;\n\t}\n\n\tlet { sessionId, onClose, sessions, base = '' }: Props = $props();\n\n\t// Looked up rather than passed in, so the dialog reads the live session\n\t// instead of a snapshot frozen at the moment the row was clicked.\n\tconst session = $derived.by(() => {\n\t\tif (!sessionId) return null;\n\t\tif (sessions) return sessions.find((s) => s.id === sessionId) ?? null;\n\t\treturn sessionStore.sessionById.get(sessionId) ?? null;\n\t});\n\n\tlet value = $state('');\n\tlet inputEl = $state<HTMLInputElement | null>(null);\n\t/**\n\t * The kill arms before it fires. On a phone this dialog is the long-press\n\t * menu — the only place a pane can be killed at all, since the row's kill\n\t * switch needs a hover to appear — so it sits next to a text field a thumb\n\t * is already aiming at, and one stray tap must not end a session.\n\t */\n\tlet killArmed = $state(false);\n\n\t// Seed the field once per opening. The name is read untracked so a rename\n\t// arriving back over the WebSocket cannot overwrite what is being typed.\n\t$effect(() => {\n\t\tif (sessionId) {\n\t\t\tvalue = untrack(() => session?.display_name ?? '');\n\t\t\tkillArmed = false;\n\t\t}\n\t});\n\n\tconst TOP_MARGIN_PX = 16;\n\t/** Below this share of the layout viewport, the shortfall is the keyboard. */\n\tconst KEYBOARD_RATIO = 0.75;\n\n\t/**\n\t * The dialog is `position: fixed`, which anchors it to the layout viewport —\n\t * on a phone the on-screen keyboard then covers it, and the focused field\n\t * sits behind the keys. Pinning it to the top of `visualViewport` instead\n\t * keeps it in sight as the keyboard opens and closes.\n\t *\n\t * Android resizes the layout viewport along with the keyboard, so the default\n\t * centring already lands above it and there is nothing to correct. iOS Safari\n\t * does not, and supports neither `env(keyboard-inset-height)` nor\n\t * `interactive-widget`, which is why this is done in script.\n\t */\n\tlet positionStyle = $state<string | undefined>(undefined);\n\n\t$effect(() => {\n\t\tconst vv = window.visualViewport;\n\t\tif (!sessionId || !vv) return;\n\t\t// Assigning the same string is a no-op in Svelte, so the per-frame `scroll`\n\t\t// events an opening keyboard produces cost nothing extra. Reading\n\t\t// `positionStyle` here to compare would make this effect depend on its own\n\t\t// output and re-subscribe the listeners on every change.\n\t\tconst sync = () => {\n\t\t\t// `translate` (not `transform`) is what centres the panel, so the vertical\n\t\t\t// half of it has to be cancelled here or the panel rides off the top.\n\t\t\tpositionStyle =\n\t\t\t\tvv.height < window.innerHeight * KEYBOARD_RATIO\n\t\t\t\t\t? `top: ${vv.offsetTop + TOP_MARGIN_PX}px; translate: -50% 0;`\n\t\t\t\t\t: undefined;\n\t\t};\n\t\tsync();\n\t\tvv.addEventListener('resize', sync);\n\t\tvv.addEventListener('scroll', sync);\n\t\treturn () => {\n\t\t\tvv.removeEventListener('resize', sync);\n\t\t\tvv.removeEventListener('scroll', sync);\n\t\t\tpositionStyle = undefined;\n\t\t};\n\t});\n\n\tasync function commit() {\n\t\tconst target = session;\n\t\tconst next = value.trim();\n\t\tonClose();\n\t\tif (!target || next === (target.display_name ?? '')) return;\n\t\ttry {\n\t\t\tawait fetch(`${base}/api/sessions/${encodeURIComponent(target.id)}/rename`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ name: next || null })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tasync function kill() {\n\t\tconst target = session;\n\t\tif (!target) return;\n\t\tif (!killArmed) {\n\t\t\tkillArmed = true;\n\t\t\treturn;\n\t\t}\n\t\tonClose();\n\t\ttry {\n\t\t\tawait fetch(`${base}/api/sessions/${encodeURIComponent(target.id)}/kill`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ pid: target.pid, tmux_target: target.tmux_target })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tfunction onKeydown(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tvoid commit();\n\t\t}\n\t}\n</script>\n\n<Dialog.Root open={session !== null} onOpenChange={(open) => { if (!open) onClose(); }}>\n\t<Dialog.Content\n\t\tclass=\"max-w-sm\"\n\t\tstyle={positionStyle}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\t// bits-ui focuses the panel itself; the point of this dialog is to type\n\t\t\t// straight away, so hand focus to the field instead.\n\t\t\te.preventDefault();\n\t\t\tinputEl?.focus();\n\t\t\tinputEl?.select();\n\t\t}}\n\t>\n\t\t<Dialog.Header>\n\t\t\t<Dialog.Title>Rename session</Dialog.Title>\n\t\t\t<Dialog.Description>\n\t\t\t\tAlso sent to the agent as <code>/rename</code>, once its pane is back at a prompt. Leave\n\t\t\t\tblank to fall back to the tmux target.\n\t\t\t</Dialog.Description>\n\t\t</Dialog.Header>\n\t\t<Input\n\t\t\tbind:ref={inputEl}\n\t\t\tbind:value\n\t\t\tonkeydown={onKeydown}\n\t\t\tclass=\"font-mono\"\n\t\t\ttype=\"text\"\n\t\t\tplaceholder={session?.tmux_target ?? session?.id ?? 'session name'}\n\t\t\taria-label=\"Session name\"\n\t\t\tautocomplete=\"off\"\n\t\t\tautocapitalize=\"off\"\n\t\t\tspellcheck=\"false\"\n\t\t\tenterkeyhint=\"done\"\n\t\t\tmaxlength={120}\n\t\t/>\n\t\t<Dialog.Footer>\n\t\t\t<Button\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tclass=\"min-h-11 text-destructive hover:text-destructive sm:mr-auto\"\n\t\t\t\tonclick={kill}\n\t\t\t>\n\t\t\t\t{killArmed ? 'Confirm kill' : 'Kill session'}\n\t\t\t</Button>\n\t\t\t<Button variant=\"ghost\" class=\"min-h-11\" onclick={onClose}>Cancel</Button>\n\t\t\t<Button class=\"min-h-11\" onclick={commit}>Rename</Button>\n\t\t</Dialog.Footer>\n\t</Dialog.Content>\n</Dialog.Root>\n","export interface FuzzyMatch {\n /** Higher is better. */\n score: number;\n /** Indices of the characters in `text` that the query matched. */\n positions: number[];\n}\n\n/**\n * Subsequence fuzzy match with the matched character positions.\n * Prefers: prefix match, matches at word boundaries, contiguous runs, shorter names.\n * Returns null when the query is not a subsequence of the text.\n * Pass `wantPositions: false` when only the score is used — it skips collecting them.\n */\nexport function fuzzyMatch(text: string, q: string, wantPositions = true): FuzzyMatch | null {\n if (!q) return { score: 0, positions: [] };\n const t = text.toLowerCase();\n const needle = q.toLowerCase();\n // Fast path: substring\n const idx = t.indexOf(needle);\n if (idx !== -1) {\n const positions = wantPositions\n ? Array.from({ length: needle.length }, (_, i) => idx + i)\n : [];\n return { score: 1000 - idx * 5 - t.length, positions };\n }\n const positions: number[] = [];\n let score = 0;\n let ti = 0;\n let prev = -2;\n for (let qi = 0; qi < needle.length; qi++) {\n const ch = needle[qi];\n const found = t.indexOf(ch, ti);\n if (found === -1) return null;\n score += found === prev + 1 ? 10 : 1;\n if (found === 0 || /[^a-z0-9]/.test(t[found - 1] ?? \"\")) score += 5;\n if (wantPositions) positions.push(found);\n prev = found;\n ti = found + 1;\n }\n return { score: score - t.length * 0.1, positions };\n}\n\n/** Score only — skips collecting match positions. Higher is better; null = no match. */\nexport function fuzzyScore(text: string, q: string): number | null {\n return fuzzyMatch(text, q, false)?.score ?? null;\n}\n\n/** Split `text` into alternating plain/matched runs for highlighting. */\nexport function highlightRuns(text: string, positions: number[]): { text: string; hit: boolean }[] {\n if (positions.length === 0) return [{ text, hit: false }];\n const runs: { text: string; hit: boolean }[] = [];\n let cut = 0;\n for (let i = 0; i < positions.length; ) {\n // positions is ascending, so a run of matched chars is one slice\n const from = positions[i];\n let to = from;\n while (i + 1 < positions.length && positions[i + 1] === to + 1) {\n to = positions[++i];\n }\n i++;\n if (from > cut) runs.push({ text: text.slice(cut, from), hit: false });\n runs.push({ text: text.slice(from, to + 1), hit: true });\n cut = to + 1;\n }\n if (cut < text.length) runs.push({ text: text.slice(cut), hit: false });\n return runs;\n}\n\n/**\n * Ranking shared by the web command list and spoken-command resolution: a\n * fuzzy match on the name (boosted so any name hit beats any description\n * hit), else a substring match on the description — substring only, because\n * a subsequence over long prose matches everything. Lives here rather than\n * beside the command scanner so the browser bundle never sees \"fs\".\n */\nexport function scoreCommand(\n cmd: { name: string; description: string },\n query: string\n): number | null {\n const nameScore = fuzzyScore(cmd.name, query);\n if (nameScore != null) return nameScore + 500;\n const descIdx = query ? cmd.description.toLowerCase().indexOf(query.toLowerCase()) : -1;\n return descIdx === -1 ? null : 100 - descIdx * 0.5;\n}\n","/**\n * The side panel's half of the session page's URL.\n *\n * `?panel=<kind>` names the pane showing, and each pane owns a few plain query\n * params of its own (Changes `file` and `turn`, Files `file` and `line`, Web\n * `url`). Two panes may own a param of the same name, so switching panes drops\n * every pane param before setting the new pane's; the page's own params\n * (`view`, `embed`, `with`) are never touched.\n */\n\nconst PANEL_PARAM = 'panel';\n\n/** Which pane the URL asks for, if it is one of `kinds`. */\nexport function readPanel<K extends string>(params: URLSearchParams, kinds: readonly K[]): K | null {\n\tconst kind = params.get(PANEL_PARAM);\n\treturn kind && (kinds as readonly string[]).includes(kind) ? (kind as K) : null;\n}\n\n/** The params a pane owns, read off the URL. */\nexport function readPaneParams(params: URLSearchParams, owned: readonly string[]): Record<string, string> {\n\tconst out: Record<string, string> = {};\n\tfor (const name of owned) {\n\t\tconst value = params.get(name);\n\t\tif (value !== null) out[name] = value;\n\t}\n\treturn out;\n}\n\n/**\n * The query after opening `kind` (or closing the panel, for null). `paneParams`\n * lists every param any pane owns; `own` sets this pane's, a null value\n * removing one. Opening the pane already showing keeps the params it has.\n */\nexport function panelQuery(\n\tparams: URLSearchParams,\n\tkind: string | null,\n\tpaneParams: readonly string[],\n\town: Record<string, string | null> = {}\n): URLSearchParams {\n\tconst next = new URLSearchParams(params);\n\tif (kind === null || next.get(PANEL_PARAM) !== kind) {\n\t\tfor (const name of paneParams) next.delete(name);\n\t}\n\tif (kind === null) {\n\t\tnext.delete(PANEL_PARAM);\n\t\treturn next;\n\t}\n\tnext.set(PANEL_PARAM, kind);\n\tfor (const [name, value] of Object.entries(own)) {\n\t\tif (value === null) next.delete(name);\n\t\telse next.set(name, value);\n\t}\n\treturn next;\n}\n\n/**\n * Where a pull request or issue (`owner/name#n`) opens beside the session on\n * screen: the page's own URL with the GitHub pane on it, or null when the\n * page is not a session's (then the link goes to github.com).\n */\nexport function githubPaneHref(url: URL, ref: string, paneParams: readonly string[]): string | null {\n\tif (!/^(?:\\/m\\/[^/]+)?\\/session\\/[^/]+\\/?$/.test(url.pathname)) return null;\n\treturn `${url.pathname}?${panelQuery(url.searchParams, 'github', paneParams, { ref })}`;\n}\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();\n</script>\n\n<CollapsiblePrimitive.Content bind:ref data-slot=\"collapsible-content\" {...restProps} />\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();\n</script>\n\n<CollapsiblePrimitive.Trigger bind:ref data-slot=\"collapsible-trigger\" {...restProps} />\n","<script lang=\"ts\">\n\timport { Collapsible as CollapsiblePrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\topen = $bindable(false),\n\t\t...restProps\n\t}: CollapsiblePrimitive.RootProps = $props();\n</script>\n\n<CollapsiblePrimitive.Root bind:ref bind:open data-slot=\"collapsible\" {...restProps} />\n","export type ChordAction = {\n\tlabel: string;\n\ticon: string;\n\trun: () => void;\n\tdanger?: boolean;\n\t/** Drawn but not pickable; menus that cannot grey a row out may ignore it. */\n\tdisabled?: boolean;\n\tflashing?: boolean;\n\tvariant?: 'destructive' | 'secondary';\n};\n\nfunction sameShape(a: ChordAction[], b: ChordAction[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (\n\t\t\tx.label !== y.label ||\n\t\t\tx.icon !== y.icon ||\n\t\t\tx.danger !== y.danger ||\n\t\t\tx.variant !== y.variant ||\n\t\t\tx.flashing !== y.flashing\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass SidebarActionsStore {\n\tactions: ChordAction[] = $state([]);\n\n\tset(actions: ChordAction[]): void {\n\t\tif (sameShape(this.actions, actions)) return;\n\t\tthis.actions = actions;\n\t}\n\n\tclear(): void {\n\t\tif (this.actions.length === 0) return;\n\t\tthis.actions = [];\n\t}\n}\n\nexport const sidebarActionsStore = new SidebarActionsStore();\n"],"file":"C00rm3mY.js"}