termdock 1.4.322 → 1.4.324

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 (364) hide show
  1. package/dist/client/assets/App-7IUcmCLC.js +186 -0
  2. package/dist/client/assets/App-7IUcmCLC.js.br +0 -0
  3. package/dist/client/assets/App-7IUcmCLC.js.gz +0 -0
  4. package/dist/client/assets/{ArchitecturePanel-VDM6hrwp.js → ArchitecturePanel-CUAB0wFe.js} +6 -6
  5. package/dist/client/assets/ArchitecturePanel-CUAB0wFe.js.br +0 -0
  6. package/dist/client/assets/ArchitecturePanel-CUAB0wFe.js.gz +0 -0
  7. package/dist/client/assets/{ChangeWalkthroughPanel-B64j3i8o.js → ChangeWalkthroughPanel-CKIG8diY.js} +2 -2
  8. package/dist/client/assets/ChangeWalkthroughPanel-CKIG8diY.js.br +0 -0
  9. package/dist/client/assets/ChangeWalkthroughPanel-CKIG8diY.js.gz +0 -0
  10. package/dist/client/assets/CollaborationMainWorkspace-CIq-JAbF.js +1 -0
  11. package/dist/client/assets/CollaborationMainWorkspace-CIq-JAbF.js.br +0 -0
  12. package/dist/client/assets/CollaborationMainWorkspace-CIq-JAbF.js.gz +0 -0
  13. package/dist/client/assets/CollaborationTaskContent-7vWDzH-d.js +2 -0
  14. package/dist/client/assets/{ComputerControlView-Co-TTYas.js → ComputerControlView-CPSI-M86.js} +2 -2
  15. package/dist/client/assets/ComputerControlView-CPSI-M86.js.br +0 -0
  16. package/dist/client/assets/ComputerControlView-CPSI-M86.js.gz +0 -0
  17. package/dist/client/assets/{DagPlayground-kJczdJ6J.js → DagPlayground-BxocNRPm.js} +1 -1
  18. package/dist/client/assets/DagPlayground-BxocNRPm.js.br +0 -0
  19. package/dist/client/assets/DagPlayground-BxocNRPm.js.gz +0 -0
  20. package/dist/client/assets/{DiffLab-BaaioC-q.js → DiffLab-COGOFO0s.js} +2 -2
  21. package/dist/client/assets/DiffLab-COGOFO0s.js.br +0 -0
  22. package/dist/client/assets/DiffLab-COGOFO0s.js.gz +0 -0
  23. package/dist/client/assets/{DiffReview-Wfck3RIS.js → DiffReview-5ERdwz1C.js} +1 -1
  24. package/dist/client/assets/DiffReview-5ERdwz1C.js.br +0 -0
  25. package/dist/client/assets/DiffReview-5ERdwz1C.js.gz +0 -0
  26. package/dist/client/assets/{DiffReviewLab-Dblr3wgw.js → DiffReviewLab-BSz9IND6.js} +1 -1
  27. package/dist/client/assets/DiffReviewLab-BSz9IND6.js.br +0 -0
  28. package/dist/client/assets/DiffReviewLab-BSz9IND6.js.gz +0 -0
  29. package/dist/client/assets/{DiffViewer-C-utC5Ga.js → DiffViewer-RT-p-ZBo.js} +8 -8
  30. package/dist/client/assets/DiffViewer-RT-p-ZBo.js.br +0 -0
  31. package/dist/client/assets/DiffViewer-RT-p-ZBo.js.gz +0 -0
  32. package/dist/client/assets/{ModelPreview-BBLnHWVQ.js → ModelPreview-DI9anVWA.js} +1 -1
  33. package/dist/client/assets/ModelPreview-DI9anVWA.js.br +0 -0
  34. package/dist/client/assets/ModelPreview-DI9anVWA.js.gz +0 -0
  35. package/dist/client/assets/{RightSidebar-CUHSFkmZ.js → RightSidebar-DOLn8R7c.js} +36 -36
  36. package/dist/client/assets/RightSidebar-DOLn8R7c.js.br +0 -0
  37. package/dist/client/assets/RightSidebar-DOLn8R7c.js.gz +0 -0
  38. package/dist/client/assets/{abnfDiagram-VCTEODGH-DDd99QpA.js → abnfDiagram-VCTEODGH-CXd0unH5.js} +1 -1
  39. package/dist/client/assets/abnfDiagram-VCTEODGH-CXd0unH5.js.br +0 -0
  40. package/dist/client/assets/abnfDiagram-VCTEODGH-CXd0unH5.js.gz +0 -0
  41. package/dist/client/assets/app-DCFOZi_L.js +35 -0
  42. package/dist/client/assets/app-DCFOZi_L.js.br +0 -0
  43. package/dist/client/assets/app-DCFOZi_L.js.gz +0 -0
  44. package/dist/client/assets/{arc-C3dck_E0.js → arc-DCqJmX8M.js} +1 -1
  45. package/dist/client/assets/arc-DCqJmX8M.js.br +0 -0
  46. package/dist/client/assets/arc-DCqJmX8M.js.gz +0 -0
  47. package/dist/client/assets/{architectureDiagram-5GKGNRK7-C3bCQc2w.js → architectureDiagram-5GKGNRK7-DGu_m54H.js} +1 -1
  48. package/dist/client/assets/architectureDiagram-5GKGNRK7-DGu_m54H.js.br +0 -0
  49. package/dist/client/assets/architectureDiagram-5GKGNRK7-DGu_m54H.js.gz +0 -0
  50. package/dist/client/assets/{blockDiagram-I7D4REHJ-znMn6iCQ.js → blockDiagram-I7D4REHJ-BI0gsxDN.js} +1 -1
  51. package/dist/client/assets/blockDiagram-I7D4REHJ-BI0gsxDN.js.br +0 -0
  52. package/dist/client/assets/blockDiagram-I7D4REHJ-BI0gsxDN.js.gz +0 -0
  53. package/dist/client/assets/{c4Diagram-7LVT6UL2-C0sopIsj.js → c4Diagram-7LVT6UL2-Ct3xzGtD.js} +1 -1
  54. package/dist/client/assets/c4Diagram-7LVT6UL2-Ct3xzGtD.js.br +0 -0
  55. package/dist/client/assets/c4Diagram-7LVT6UL2-Ct3xzGtD.js.gz +0 -0
  56. package/dist/client/assets/channel-BLSCUksA.js +1 -0
  57. package/dist/client/assets/{chunk-2Q5K7J3B-f7USyccJ.js → chunk-2Q5K7J3B-BPd2UShA.js} +1 -1
  58. package/dist/client/assets/{chunk-5VM5RSS4-Ck2xirDs.js → chunk-5VM5RSS4-CoFZ5Fo3.js} +1 -1
  59. package/dist/client/assets/{chunk-F27PBJKO-DaDCIj30.js → chunk-F27PBJKO-C5gZrGp4.js} +1 -1
  60. package/dist/client/assets/chunk-F27PBJKO-C5gZrGp4.js.br +0 -0
  61. package/dist/client/assets/chunk-F27PBJKO-C5gZrGp4.js.gz +0 -0
  62. package/dist/client/assets/{chunk-IMKFNOWR-DEC_On5x.js → chunk-IMKFNOWR-GW8b9ya-.js} +1 -1
  63. package/dist/client/assets/chunk-IMKFNOWR-GW8b9ya-.js.br +0 -0
  64. package/dist/client/assets/chunk-IMKFNOWR-GW8b9ya-.js.gz +0 -0
  65. package/dist/client/assets/{chunk-JWPE2WC7-BrswC3n2.js → chunk-JWPE2WC7-GpMoViQf.js} +1 -1
  66. package/dist/client/assets/{chunk-POPQ4Y6H-ClMbDV47.js → chunk-POPQ4Y6H-C_vgVPaw.js} +1 -1
  67. package/dist/client/assets/{chunk-SVP7TREG-D7_1VwC5.js → chunk-SVP7TREG-bA7RXwWn.js} +1 -1
  68. package/dist/client/assets/chunk-SVP7TREG-bA7RXwWn.js.br +0 -0
  69. package/dist/client/assets/chunk-SVP7TREG-bA7RXwWn.js.gz +0 -0
  70. package/dist/client/assets/{chunk-TICWLB2K-D5jzVTZ8.js → chunk-TICWLB2K-BG8DAtll.js} +1 -1
  71. package/dist/client/assets/chunk-TICWLB2K-BG8DAtll.js.br +0 -0
  72. package/dist/client/assets/chunk-TICWLB2K-BG8DAtll.js.gz +0 -0
  73. package/dist/client/assets/{chunk-XXDRQBXY-DOhaoLcX.js → chunk-XXDRQBXY-Ces56sud.js} +1 -1
  74. package/dist/client/assets/classDiagram-ZZMXUADV-DkVIqOvw.js +1 -0
  75. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DkVIqOvw.js +1 -0
  76. package/dist/client/assets/{cose-bilkent-JH36ORCC-DOsaKgiX.js → cose-bilkent-JH36ORCC-Bwch0qL5.js} +1 -1
  77. package/dist/client/assets/cose-bilkent-JH36ORCC-Bwch0qL5.js.br +0 -0
  78. package/dist/client/assets/cose-bilkent-JH36ORCC-Bwch0qL5.js.gz +0 -0
  79. package/dist/client/assets/{cynefin-OW5HDTMX-CMcLh_wh.js → cynefin-OW5HDTMX-CrAXyA2Z.js} +1 -1
  80. package/dist/client/assets/cynefin-OW5HDTMX-CrAXyA2Z.js.br +0 -0
  81. package/dist/client/assets/cynefin-OW5HDTMX-CrAXyA2Z.js.gz +0 -0
  82. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Dd8bfq9V.js → cynefinDiagram-5FMLGOSQ-YlP0Q93l.js} +1 -1
  83. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-YlP0Q93l.js.br +0 -0
  84. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-YlP0Q93l.js.gz +0 -0
  85. package/dist/client/assets/{dagre-GXQ25YYZ-BlW7fAi0.js → dagre-GXQ25YYZ-CZ4XcPK9.js} +1 -1
  86. package/dist/client/assets/dagre-GXQ25YYZ-CZ4XcPK9.js.br +0 -0
  87. package/dist/client/assets/dagre-GXQ25YYZ-CZ4XcPK9.js.gz +0 -0
  88. package/dist/client/assets/{diagram-S7CK7UJ4-B0-tKahG.js → diagram-S7CK7UJ4-c_8HfHGA.js} +1 -1
  89. package/dist/client/assets/{diagram-S7CK7UJ4-B0-tKahG.js.br → diagram-S7CK7UJ4-c_8HfHGA.js.br} +0 -0
  90. package/dist/client/assets/diagram-S7CK7UJ4-c_8HfHGA.js.gz +0 -0
  91. package/dist/client/assets/{diagram-UQ7AKVKN-BQumj4Dw.js → diagram-UQ7AKVKN-BGtRfxMR.js} +1 -1
  92. package/dist/client/assets/diagram-UQ7AKVKN-BGtRfxMR.js.br +0 -0
  93. package/dist/client/assets/diagram-UQ7AKVKN-BGtRfxMR.js.gz +0 -0
  94. package/dist/client/assets/{diagram-VSXAHHWV-Zx_FLmPP.js → diagram-VSXAHHWV-_9yZnhuv.js} +1 -1
  95. package/dist/client/assets/diagram-VSXAHHWV-_9yZnhuv.js.br +0 -0
  96. package/dist/client/assets/diagram-VSXAHHWV-_9yZnhuv.js.gz +0 -0
  97. package/dist/client/assets/{diagram-VX7I27RA-CEZvatNH.js → diagram-VX7I27RA-C_mnc4_u.js} +1 -1
  98. package/dist/client/assets/diagram-VX7I27RA-C_mnc4_u.js.br +0 -0
  99. package/dist/client/assets/diagram-VX7I27RA-C_mnc4_u.js.gz +0 -0
  100. package/dist/client/assets/{diagram-Z3DM3KII-CJ9IEQ8j.js → diagram-Z3DM3KII-sZ_AiSpj.js} +1 -1
  101. package/dist/client/assets/diagram-Z3DM3KII-sZ_AiSpj.js.br +0 -0
  102. package/dist/client/assets/diagram-Z3DM3KII-sZ_AiSpj.js.gz +0 -0
  103. package/dist/client/assets/{ebnfDiagram-PWID7BFC-sQQMv3ea.js → ebnfDiagram-PWID7BFC-Dm-BXeqS.js} +1 -1
  104. package/dist/client/assets/ebnfDiagram-PWID7BFC-Dm-BXeqS.js.br +0 -0
  105. package/dist/client/assets/ebnfDiagram-PWID7BFC-Dm-BXeqS.js.gz +0 -0
  106. package/dist/client/assets/{erDiagram-RLTQ6QDP-D3rMpj7M.js → erDiagram-RLTQ6QDP-Dz4cBepd.js} +1 -1
  107. package/dist/client/assets/erDiagram-RLTQ6QDP-Dz4cBepd.js.br +0 -0
  108. package/dist/client/assets/erDiagram-RLTQ6QDP-Dz4cBepd.js.gz +0 -0
  109. package/dist/client/assets/{flowDiagram-HODETNUW-B6QZiE0-.js → flowDiagram-HODETNUW-CbRG8-WW.js} +1 -1
  110. package/dist/client/assets/flowDiagram-HODETNUW-CbRG8-WW.js.br +0 -0
  111. package/dist/client/assets/flowDiagram-HODETNUW-CbRG8-WW.js.gz +0 -0
  112. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Bw9bltcu.js → ganttDiagram-EL5Y4UJY-CmBXWlr0.js} +1 -1
  113. package/dist/client/assets/ganttDiagram-EL5Y4UJY-CmBXWlr0.js.br +0 -0
  114. package/dist/client/assets/ganttDiagram-EL5Y4UJY-CmBXWlr0.js.gz +0 -0
  115. package/dist/client/assets/{gestureArbiter-Cczz34oI.js → gestureArbiter-B26W6rS7.js} +1 -1
  116. package/dist/client/assets/gestureArbiter-B26W6rS7.js.br +0 -0
  117. package/dist/client/assets/gestureArbiter-B26W6rS7.js.gz +0 -0
  118. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-mdnkxjeD.js → gitGraphDiagram-WWUBYQGX-JW5QMYEk.js} +1 -1
  119. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-JW5QMYEk.js.br +0 -0
  120. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-JW5QMYEk.js.gz +0 -0
  121. package/dist/client/assets/index-Ctz-IDjR.css +1 -0
  122. package/dist/client/assets/index-Ctz-IDjR.css.br +0 -0
  123. package/dist/client/assets/{index-B4bEMUyn.css.gz → index-Ctz-IDjR.css.gz} +0 -0
  124. package/dist/client/assets/{infoDiagram-27XIBGKW-DyrPP3Yf.js → infoDiagram-27XIBGKW-CsA6WdPn.js} +1 -1
  125. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CEPH_ePM.js → ishikawaDiagram-5VMMS53U-CsKPUwTw.js} +1 -1
  126. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CsKPUwTw.js.br +0 -0
  127. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CsKPUwTw.js.gz +0 -0
  128. package/dist/client/assets/{journeyDiagram-3NMN7TZE-CQ0PjBy7.js → journeyDiagram-3NMN7TZE-DpN98gN0.js} +1 -1
  129. package/dist/client/assets/journeyDiagram-3NMN7TZE-DpN98gN0.js.br +0 -0
  130. package/dist/client/assets/journeyDiagram-3NMN7TZE-DpN98gN0.js.gz +0 -0
  131. package/dist/client/assets/{kanban-definition-UXKFOSKX-BpQUXA60.js → kanban-definition-UXKFOSKX-RHO--43O.js} +1 -1
  132. package/dist/client/assets/kanban-definition-UXKFOSKX-RHO--43O.js.br +0 -0
  133. package/dist/client/assets/kanban-definition-UXKFOSKX-RHO--43O.js.gz +0 -0
  134. package/dist/client/assets/{layout-BdptC7rq.js → layout-Cm_prknW.js} +1 -1
  135. package/dist/client/assets/layout-Cm_prknW.js.br +0 -0
  136. package/dist/client/assets/layout-Cm_prknW.js.gz +0 -0
  137. package/dist/client/assets/{linear-C2cSRCxu.js → linear-BVAsPkvS.js} +1 -1
  138. package/dist/client/assets/linear-BVAsPkvS.js.br +0 -0
  139. package/dist/client/assets/linear-BVAsPkvS.js.gz +0 -0
  140. package/dist/client/assets/{mermaid.core-ClVMFyAU.js → mermaid.core-ufe77Xaz.js} +5 -5
  141. package/dist/client/assets/mermaid.core-ufe77Xaz.js.br +0 -0
  142. package/dist/client/assets/mermaid.core-ufe77Xaz.js.gz +0 -0
  143. package/dist/client/assets/{mindmap-definition-YA3MSWOX-D0AFCmsY.js → mindmap-definition-YA3MSWOX-CRyy1U2d.js} +1 -1
  144. package/dist/client/assets/mindmap-definition-YA3MSWOX-CRyy1U2d.js.br +0 -0
  145. package/dist/client/assets/mindmap-definition-YA3MSWOX-CRyy1U2d.js.gz +0 -0
  146. package/dist/client/assets/passwordBootstrap-3_SIzSH7.js +2 -0
  147. package/dist/client/assets/passwordBootstrap-3_SIzSH7.js.br +0 -0
  148. package/dist/client/assets/passwordBootstrap-3_SIzSH7.js.gz +0 -0
  149. package/dist/client/assets/{pegDiagram-XKGWAZYB-BGAh0bwg.js → pegDiagram-XKGWAZYB-DSHgdU9q.js} +1 -1
  150. package/dist/client/assets/pegDiagram-XKGWAZYB-DSHgdU9q.js.br +0 -0
  151. package/dist/client/assets/pegDiagram-XKGWAZYB-DSHgdU9q.js.gz +0 -0
  152. package/dist/client/assets/{pieDiagram-E7YTZNPT-CDOZUF44.js → pieDiagram-E7YTZNPT-lIUeAuhN.js} +1 -1
  153. package/dist/client/assets/pieDiagram-E7YTZNPT-lIUeAuhN.js.br +0 -0
  154. package/dist/client/assets/pieDiagram-E7YTZNPT-lIUeAuhN.js.gz +0 -0
  155. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-D_Qn6NTU.js → quadrantDiagram-AXDQQJYC-CIgG9vBX.js} +1 -1
  156. package/dist/client/assets/quadrantDiagram-AXDQQJYC-CIgG9vBX.js.br +0 -0
  157. package/dist/client/assets/quadrantDiagram-AXDQQJYC-CIgG9vBX.js.gz +0 -0
  158. package/dist/client/assets/{railroadDiagram-O6MQD6OU-qUVGWhJN.js → railroadDiagram-O6MQD6OU-DjP8oesA.js} +1 -1
  159. package/dist/client/assets/railroadDiagram-O6MQD6OU-DjP8oesA.js.br +0 -0
  160. package/dist/client/assets/railroadDiagram-O6MQD6OU-DjP8oesA.js.gz +0 -0
  161. package/dist/client/assets/{rdpSession-hgCM4i-j.js → rdpSession-BshIobdj.js} +1 -1
  162. package/dist/client/assets/rdpSession-BshIobdj.js.br +0 -0
  163. package/dist/client/assets/rdpSession-BshIobdj.js.gz +0 -0
  164. package/dist/client/assets/{referenceLongPress-BEMsP11a.js → referenceLongPress-DBJnfFHa.js} +1 -1
  165. package/dist/client/assets/referenceLongPress-DBJnfFHa.js.br +0 -0
  166. package/dist/client/assets/referenceLongPress-DBJnfFHa.js.gz +0 -0
  167. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BBQMQuVZ.js → requirementDiagram-BXWQKSXE-Dbvu6IC_.js} +1 -1
  168. package/dist/client/assets/requirementDiagram-BXWQKSXE-Dbvu6IC_.js.br +0 -0
  169. package/dist/client/assets/requirementDiagram-BXWQKSXE-Dbvu6IC_.js.gz +0 -0
  170. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-CeEExsqW.js → sankeyDiagram-P5KCCOFB-1mZ4s-lv.js} +1 -1
  171. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-CeEExsqW.js.br → sankeyDiagram-P5KCCOFB-1mZ4s-lv.js.br} +0 -0
  172. package/dist/client/assets/sankeyDiagram-P5KCCOFB-1mZ4s-lv.js.gz +0 -0
  173. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-7ZPO-X0a.js → sequenceDiagram-WJ2MYXX4-Cu3hhzlV.js} +1 -1
  174. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-Cu3hhzlV.js.br +0 -0
  175. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-Cu3hhzlV.js.gz +0 -0
  176. package/dist/client/assets/{sizeCapture-INFHLROL-MBjz7Snm.js → sizeCapture-INFHLROL-xfm69HlR.js} +1 -1
  177. package/dist/client/assets/sizeCapture-INFHLROL-xfm69HlR.js.br +0 -0
  178. package/dist/client/assets/sizeCapture-INFHLROL-xfm69HlR.js.gz +0 -0
  179. package/dist/client/assets/{sparkles-C9ShmGPf.js → sparkles-CDonlwGu.js} +1 -1
  180. package/dist/client/assets/{stateDiagram-D77RDMKH-DtLp89uP.js → stateDiagram-D77RDMKH-u-bh6mDK.js} +1 -1
  181. package/dist/client/assets/stateDiagram-D77RDMKH-u-bh6mDK.js.br +0 -0
  182. package/dist/client/assets/stateDiagram-D77RDMKH-u-bh6mDK.js.gz +0 -0
  183. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BQ_m8Gzd.js +1 -0
  184. package/dist/client/assets/{swimlanes-42K2YHIH-Bc02S1q-.js → swimlanes-42K2YHIH-U8WN__SO.js} +1 -1
  185. package/dist/client/assets/swimlanes-42K2YHIH-U8WN__SO.js.br +0 -0
  186. package/dist/client/assets/swimlanes-42K2YHIH-U8WN__SO.js.gz +0 -0
  187. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-FDEo3QWw.js +8 -0
  188. package/dist/client/assets/{timeline-definition-24CTP7MA-BLLwbOm5.js → timeline-definition-24CTP7MA-CMsoNo4F.js} +1 -1
  189. package/dist/client/assets/timeline-definition-24CTP7MA-CMsoNo4F.js.br +0 -0
  190. package/dist/client/assets/timeline-definition-24CTP7MA-CMsoNo4F.js.gz +0 -0
  191. package/dist/client/assets/{triangle-alert-i_L8ws6U.js → triangle-alert-BgErMO2V.js} +1 -1
  192. package/dist/client/assets/{vennDiagram-4TSXK5OY-8FcrAdbk.js → vennDiagram-4TSXK5OY-CPE6pVwh.js} +1 -1
  193. package/dist/client/assets/{vennDiagram-4TSXK5OY-8FcrAdbk.js.br → vennDiagram-4TSXK5OY-CPE6pVwh.js.br} +0 -0
  194. package/dist/client/assets/vennDiagram-4TSXK5OY-CPE6pVwh.js.gz +0 -0
  195. package/dist/client/assets/{videoCompression-RIaDabW4.js → videoCompression-BWkZvEjM.js} +1 -1
  196. package/dist/client/assets/videoCompression-BWkZvEjM.js.br +0 -0
  197. package/dist/client/assets/videoCompression-BWkZvEjM.js.gz +0 -0
  198. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-paL2wRrJ.js → wardleyDiagram-VM6X3IG4-4lWd-R4N.js} +1 -1
  199. package/dist/client/assets/wardleyDiagram-VM6X3IG4-4lWd-R4N.js.br +0 -0
  200. package/dist/client/assets/wardleyDiagram-VM6X3IG4-4lWd-R4N.js.gz +0 -0
  201. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BM5qJ4E7.js → xychartDiagram-S5SC5T6Z-CpKJMCWV.js} +1 -1
  202. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CpKJMCWV.js.br +0 -0
  203. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CpKJMCWV.js.gz +0 -0
  204. package/dist/client/index.html +2 -2
  205. package/dist/client/index.html.br +0 -0
  206. package/dist/client/index.html.gz +0 -0
  207. package/dist/client/sw-encrypted-background.js +1 -1
  208. package/dist/client/sw-encrypted-background.js.br +0 -0
  209. package/dist/client/sw-encrypted-background.js.gz +0 -0
  210. package/dist/client/sw.js +1 -1
  211. package/dist/client/sw.js.br +0 -0
  212. package/dist/client/sw.js.gz +0 -0
  213. package/dist/server/agent/collaborationGroupRoutes.js +15 -0
  214. package/dist/server/agent/collaborationStore.js +63 -2
  215. package/dist/server/agent/collaborationTaskRoutes.js +5 -1
  216. package/dist/server/agent/integrationCli.js +38 -20
  217. package/dist/server/agent/integrationServer.js +18 -1
  218. package/dist/server/federation/packets.js +179 -28
  219. package/dist/server/federation/requestContext.js +6 -1
  220. package/dist/server/federation/runtime.js +19 -8
  221. package/dist/server/routes/terminal.js +60 -20
  222. package/dist/server/utils/autoUpdate.js +55 -8
  223. package/dist/server/utils/npmUpdate.js +84 -8
  224. package/dist/server/utils/terminalPasteBuffer.js +66 -0
  225. package/dist/server/utils/tmuxClientCapabilities.js +4 -0
  226. package/dist/server/utils/tmuxCopySelection.js +94 -0
  227. package/dist/server/utils/tmuxEmptyServerProbe.js +15 -0
  228. package/docs/integrations.md +36 -0
  229. package/package.json +5 -2
  230. package/runtime-manifest.json +3 -3
  231. package/.desktop-dist/main.js +0 -1989
  232. package/dist/client/assets/App-DEKo4SNL.js +0 -186
  233. package/dist/client/assets/App-DEKo4SNL.js.br +0 -0
  234. package/dist/client/assets/App-DEKo4SNL.js.gz +0 -0
  235. package/dist/client/assets/ArchitecturePanel-VDM6hrwp.js.br +0 -0
  236. package/dist/client/assets/ArchitecturePanel-VDM6hrwp.js.gz +0 -0
  237. package/dist/client/assets/ChangeWalkthroughPanel-B64j3i8o.js.br +0 -0
  238. package/dist/client/assets/ChangeWalkthroughPanel-B64j3i8o.js.gz +0 -0
  239. package/dist/client/assets/CollaborationMainWorkspace-DG8TQNqo.js +0 -1
  240. package/dist/client/assets/CollaborationMainWorkspace-DG8TQNqo.js.br +0 -0
  241. package/dist/client/assets/CollaborationMainWorkspace-DG8TQNqo.js.gz +0 -0
  242. package/dist/client/assets/CollaborationTaskContent-msQsgVaI.js +0 -2
  243. package/dist/client/assets/ComputerControlView-Co-TTYas.js.br +0 -0
  244. package/dist/client/assets/ComputerControlView-Co-TTYas.js.gz +0 -0
  245. package/dist/client/assets/DagPlayground-kJczdJ6J.js.br +0 -0
  246. package/dist/client/assets/DagPlayground-kJczdJ6J.js.gz +0 -0
  247. package/dist/client/assets/DiffLab-BaaioC-q.js.br +0 -0
  248. package/dist/client/assets/DiffLab-BaaioC-q.js.gz +0 -0
  249. package/dist/client/assets/DiffReview-Wfck3RIS.js.br +0 -0
  250. package/dist/client/assets/DiffReview-Wfck3RIS.js.gz +0 -0
  251. package/dist/client/assets/DiffReviewLab-Dblr3wgw.js.br +0 -0
  252. package/dist/client/assets/DiffReviewLab-Dblr3wgw.js.gz +0 -0
  253. package/dist/client/assets/DiffViewer-C-utC5Ga.js.br +0 -0
  254. package/dist/client/assets/DiffViewer-C-utC5Ga.js.gz +0 -0
  255. package/dist/client/assets/ModelPreview-BBLnHWVQ.js.br +0 -0
  256. package/dist/client/assets/ModelPreview-BBLnHWVQ.js.gz +0 -0
  257. package/dist/client/assets/RightSidebar-CUHSFkmZ.js.br +0 -0
  258. package/dist/client/assets/RightSidebar-CUHSFkmZ.js.gz +0 -0
  259. package/dist/client/assets/abnfDiagram-VCTEODGH-DDd99QpA.js.br +0 -0
  260. package/dist/client/assets/abnfDiagram-VCTEODGH-DDd99QpA.js.gz +0 -0
  261. package/dist/client/assets/app-CfqF7_nh.js +0 -35
  262. package/dist/client/assets/app-CfqF7_nh.js.br +0 -0
  263. package/dist/client/assets/app-CfqF7_nh.js.gz +0 -0
  264. package/dist/client/assets/arc-C3dck_E0.js.br +0 -0
  265. package/dist/client/assets/arc-C3dck_E0.js.gz +0 -0
  266. package/dist/client/assets/architectureDiagram-5GKGNRK7-C3bCQc2w.js.br +0 -0
  267. package/dist/client/assets/architectureDiagram-5GKGNRK7-C3bCQc2w.js.gz +0 -0
  268. package/dist/client/assets/blockDiagram-I7D4REHJ-znMn6iCQ.js.br +0 -0
  269. package/dist/client/assets/blockDiagram-I7D4REHJ-znMn6iCQ.js.gz +0 -0
  270. package/dist/client/assets/c4Diagram-7LVT6UL2-C0sopIsj.js.br +0 -0
  271. package/dist/client/assets/c4Diagram-7LVT6UL2-C0sopIsj.js.gz +0 -0
  272. package/dist/client/assets/channel-CMC8t83j.js +0 -1
  273. package/dist/client/assets/chunk-F27PBJKO-DaDCIj30.js.br +0 -0
  274. package/dist/client/assets/chunk-F27PBJKO-DaDCIj30.js.gz +0 -0
  275. package/dist/client/assets/chunk-IMKFNOWR-DEC_On5x.js.br +0 -0
  276. package/dist/client/assets/chunk-IMKFNOWR-DEC_On5x.js.gz +0 -0
  277. package/dist/client/assets/chunk-SVP7TREG-D7_1VwC5.js.br +0 -0
  278. package/dist/client/assets/chunk-SVP7TREG-D7_1VwC5.js.gz +0 -0
  279. package/dist/client/assets/chunk-TICWLB2K-D5jzVTZ8.js.br +0 -0
  280. package/dist/client/assets/chunk-TICWLB2K-D5jzVTZ8.js.gz +0 -0
  281. package/dist/client/assets/classDiagram-ZZMXUADV-ElMHzA-E.js +0 -1
  282. package/dist/client/assets/classDiagram-v2-VYDZK3BY-ElMHzA-E.js +0 -1
  283. package/dist/client/assets/cose-bilkent-JH36ORCC-DOsaKgiX.js.br +0 -0
  284. package/dist/client/assets/cose-bilkent-JH36ORCC-DOsaKgiX.js.gz +0 -0
  285. package/dist/client/assets/cynefin-OW5HDTMX-CMcLh_wh.js.br +0 -0
  286. package/dist/client/assets/cynefin-OW5HDTMX-CMcLh_wh.js.gz +0 -0
  287. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-Dd8bfq9V.js.br +0 -0
  288. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-Dd8bfq9V.js.gz +0 -0
  289. package/dist/client/assets/dagre-GXQ25YYZ-BlW7fAi0.js.br +0 -0
  290. package/dist/client/assets/dagre-GXQ25YYZ-BlW7fAi0.js.gz +0 -0
  291. package/dist/client/assets/diagram-S7CK7UJ4-B0-tKahG.js.gz +0 -0
  292. package/dist/client/assets/diagram-UQ7AKVKN-BQumj4Dw.js.br +0 -0
  293. package/dist/client/assets/diagram-UQ7AKVKN-BQumj4Dw.js.gz +0 -0
  294. package/dist/client/assets/diagram-VSXAHHWV-Zx_FLmPP.js.br +0 -0
  295. package/dist/client/assets/diagram-VSXAHHWV-Zx_FLmPP.js.gz +0 -0
  296. package/dist/client/assets/diagram-VX7I27RA-CEZvatNH.js.br +0 -0
  297. package/dist/client/assets/diagram-VX7I27RA-CEZvatNH.js.gz +0 -0
  298. package/dist/client/assets/diagram-Z3DM3KII-CJ9IEQ8j.js.br +0 -0
  299. package/dist/client/assets/diagram-Z3DM3KII-CJ9IEQ8j.js.gz +0 -0
  300. package/dist/client/assets/ebnfDiagram-PWID7BFC-sQQMv3ea.js.br +0 -0
  301. package/dist/client/assets/ebnfDiagram-PWID7BFC-sQQMv3ea.js.gz +0 -0
  302. package/dist/client/assets/erDiagram-RLTQ6QDP-D3rMpj7M.js.br +0 -0
  303. package/dist/client/assets/erDiagram-RLTQ6QDP-D3rMpj7M.js.gz +0 -0
  304. package/dist/client/assets/flowDiagram-HODETNUW-B6QZiE0-.js.br +0 -0
  305. package/dist/client/assets/flowDiagram-HODETNUW-B6QZiE0-.js.gz +0 -0
  306. package/dist/client/assets/ganttDiagram-EL5Y4UJY-Bw9bltcu.js.br +0 -0
  307. package/dist/client/assets/ganttDiagram-EL5Y4UJY-Bw9bltcu.js.gz +0 -0
  308. package/dist/client/assets/gestureArbiter-Cczz34oI.js.br +0 -0
  309. package/dist/client/assets/gestureArbiter-Cczz34oI.js.gz +0 -0
  310. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-mdnkxjeD.js.br +0 -0
  311. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-mdnkxjeD.js.gz +0 -0
  312. package/dist/client/assets/index-B4bEMUyn.css +0 -1
  313. package/dist/client/assets/index-B4bEMUyn.css.br +0 -0
  314. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CEPH_ePM.js.br +0 -0
  315. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CEPH_ePM.js.gz +0 -0
  316. package/dist/client/assets/journeyDiagram-3NMN7TZE-CQ0PjBy7.js.br +0 -0
  317. package/dist/client/assets/journeyDiagram-3NMN7TZE-CQ0PjBy7.js.gz +0 -0
  318. package/dist/client/assets/kanban-definition-UXKFOSKX-BpQUXA60.js.br +0 -0
  319. package/dist/client/assets/kanban-definition-UXKFOSKX-BpQUXA60.js.gz +0 -0
  320. package/dist/client/assets/layout-BdptC7rq.js.br +0 -0
  321. package/dist/client/assets/layout-BdptC7rq.js.gz +0 -0
  322. package/dist/client/assets/linear-C2cSRCxu.js.br +0 -0
  323. package/dist/client/assets/linear-C2cSRCxu.js.gz +0 -0
  324. package/dist/client/assets/mermaid.core-ClVMFyAU.js.br +0 -0
  325. package/dist/client/assets/mermaid.core-ClVMFyAU.js.gz +0 -0
  326. package/dist/client/assets/mindmap-definition-YA3MSWOX-D0AFCmsY.js.br +0 -0
  327. package/dist/client/assets/mindmap-definition-YA3MSWOX-D0AFCmsY.js.gz +0 -0
  328. package/dist/client/assets/passwordBootstrap-R2qlU2Pq.js +0 -2
  329. package/dist/client/assets/passwordBootstrap-R2qlU2Pq.js.br +0 -0
  330. package/dist/client/assets/passwordBootstrap-R2qlU2Pq.js.gz +0 -0
  331. package/dist/client/assets/pegDiagram-XKGWAZYB-BGAh0bwg.js.br +0 -0
  332. package/dist/client/assets/pegDiagram-XKGWAZYB-BGAh0bwg.js.gz +0 -0
  333. package/dist/client/assets/pieDiagram-E7YTZNPT-CDOZUF44.js.br +0 -0
  334. package/dist/client/assets/pieDiagram-E7YTZNPT-CDOZUF44.js.gz +0 -0
  335. package/dist/client/assets/quadrantDiagram-AXDQQJYC-D_Qn6NTU.js.br +0 -0
  336. package/dist/client/assets/quadrantDiagram-AXDQQJYC-D_Qn6NTU.js.gz +0 -0
  337. package/dist/client/assets/railroadDiagram-O6MQD6OU-qUVGWhJN.js.br +0 -0
  338. package/dist/client/assets/railroadDiagram-O6MQD6OU-qUVGWhJN.js.gz +0 -0
  339. package/dist/client/assets/rdpSession-hgCM4i-j.js.br +0 -0
  340. package/dist/client/assets/rdpSession-hgCM4i-j.js.gz +0 -0
  341. package/dist/client/assets/referenceLongPress-BEMsP11a.js.br +0 -0
  342. package/dist/client/assets/referenceLongPress-BEMsP11a.js.gz +0 -0
  343. package/dist/client/assets/requirementDiagram-BXWQKSXE-BBQMQuVZ.js.br +0 -0
  344. package/dist/client/assets/requirementDiagram-BXWQKSXE-BBQMQuVZ.js.gz +0 -0
  345. package/dist/client/assets/sankeyDiagram-P5KCCOFB-CeEExsqW.js.gz +0 -0
  346. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-7ZPO-X0a.js.br +0 -0
  347. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-7ZPO-X0a.js.gz +0 -0
  348. package/dist/client/assets/sizeCapture-INFHLROL-MBjz7Snm.js.br +0 -0
  349. package/dist/client/assets/sizeCapture-INFHLROL-MBjz7Snm.js.gz +0 -0
  350. package/dist/client/assets/stateDiagram-D77RDMKH-DtLp89uP.js.br +0 -0
  351. package/dist/client/assets/stateDiagram-D77RDMKH-DtLp89uP.js.gz +0 -0
  352. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CIQb4Dp7.js +0 -1
  353. package/dist/client/assets/swimlanes-42K2YHIH-Bc02S1q-.js.br +0 -0
  354. package/dist/client/assets/swimlanes-42K2YHIH-Bc02S1q-.js.gz +0 -0
  355. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-RiKL7eXI.js +0 -8
  356. package/dist/client/assets/timeline-definition-24CTP7MA-BLLwbOm5.js.br +0 -0
  357. package/dist/client/assets/timeline-definition-24CTP7MA-BLLwbOm5.js.gz +0 -0
  358. package/dist/client/assets/vennDiagram-4TSXK5OY-8FcrAdbk.js.gz +0 -0
  359. package/dist/client/assets/videoCompression-RIaDabW4.js.br +0 -0
  360. package/dist/client/assets/videoCompression-RIaDabW4.js.gz +0 -0
  361. package/dist/client/assets/wardleyDiagram-VM6X3IG4-paL2wRrJ.js.br +0 -0
  362. package/dist/client/assets/wardleyDiagram-VM6X3IG4-paL2wRrJ.js.gz +0 -0
  363. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BM5qJ4E7.js.br +0 -0
  364. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BM5qJ4E7.js.gz +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rdpSession-hgCM4i-j.js","assets/app-CfqF7_nh.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/index-B4bEMUyn.css","assets/ChangeWalkthroughPanel-B64j3i8o.js","assets/sparkles-C9ShmGPf.js","assets/triangle-alert-i_L8ws6U.js","assets/RightSidebar-CUHSFkmZ.js","assets/App-DEKo4SNL.js","assets/gestureArbiter-Cczz34oI.js","assets/gestureArbiter-C2J0D0kV.css","assets/referenceLongPress-BEMsP11a.js","assets/DiffReview-Wfck3RIS.js","assets/DiffViewer-C-utC5Ga.js","assets/DiffViewer-T3uj2-aP.css","assets/RightSidebar-DW-JEgm2.css"])))=>i.map(i=>d[i]);
2
- import{ag as Pe,cx as St,da as xt,by as t,cu as Me,bx as Ue,W as at,o as it,l as Lt,X as Tt,_ as lt}from"./app-CfqF7_nh.js";import{b as o,r as ut}from"./dnd-BCFAPC0L.js";import{a as At}from"./ChangeWalkthroughPanel-B64j3i8o.js";import{L as dt}from"./RightSidebar-CUHSFkmZ.js";import{X as mt,K as Ve,j as pt}from"./App-DEKo4SNL.js";import{M as Rt}from"./triangle-alert-i_L8ws6U.js";const _t=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],ft=Pe("mouse-pointer-2",_t);const Mt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],It=Pe("settings-2",Mt);const Pt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Dt=Pe("zoom-in",Pt);const zt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ot=Pe("zoom-out",zt);function Ke(e){const c=e==="darwin"?"mac":e==="win32"?"windows":"linux",f={host:"127.0.0.1",platform:c,protocol:c==="mac"?"vnc":"rdp",port:"3389",username:"",domain:"",ignoreCert:!1,rememberLogin:!0};return{target:"local",local:f,remote:{...f,host:""},viewOnly:!1,fit:!0,autoConnect:!0}}function ht(e,c){const f=Ke(c);if(!e||typeof e!="object")return f;const u=e,p=(x,d)=>{const s=x&&typeof x=="object"?x:{},v=(g,P)=>typeof s[g]=="string"&&s[g].length<=P&&!/[\x00-\x1f]/.test(s[g])?s[g]:d[g];return{host:v("host",253),username:v("username",255),domain:v("domain",255),platform:["mac","linux","windows"].includes(String(s.platform))?s.platform:d.platform,protocol:s.protocol==="rdp"||s.protocol==="vnc"?s.protocol:d.protocol,port:typeof s.port=="string"&&/^\d{0,5}$/.test(s.port)&&Number(s.port)<=65535?s.port:d.port,ignoreCert:s.ignoreCert===!0,rememberLogin:s.rememberLogin!==!1}};return{target:u.target==="remote"?"remote":"local",local:{...p(u.local,f.local),host:"127.0.0.1"},remote:p(u.remote,f.remote),viewOnly:u.viewOnly===!0,fit:u.fit!==!1,autoConnect:u.autoConnect!==!1}}function gt(e){return JSON.stringify([e.host.trim().toLowerCase(),e.protocol,e.protocol==="vnc"?5900:Number(e.port),e.username.trim(),e.domain.trim()])}function Ft(e){const[c,f]=o.useState(Ke),[u,p]=o.useState(!1),[x,d]=o.useState("loading"),[s,v]=o.useState(0),[g,P]=o.useState([]),[W,T]=o.useState("idle"),k=o.useRef(c),A=o.useRef(0),a=o.useRef(0),N=o.useRef(""),b=o.useRef(null),C=o.useRef(new Set),K=o.useCallback(w=>{k.current=w(k.current),A.current++,f(k.current),d("saving")},[]);o.useEffect(()=>{const w=++a.current;A.current=0,N.current="",b.current=null,k.current=Ke(),f(k.current),p(!1),d("loading"),P([]),T("idle");const D=new AbortController;return fetch("/api/computer/preferences",{signal:D.signal}).then(async h=>{if(!h.ok)throw new Error("PREFERENCES_LOAD_FAILED");return await h.json()}).then(h=>{if(w!==a.current||D.signal.aborted)return;let R=ht(h.preferences);const O=A.current>0;if(!h.configured&&!O)try{const E=localStorage.getItem(`termdock:computer-host:${e}`);if(E){const U=/^(127\.0\.0\.1|localhost|::1|\[::1\])$/i.test(E)?"local":"remote";R=ht({...R,target:U,[U]:{...R[U],host:E,platform:localStorage.getItem(`termdock:computer-platform:${e}`)||R[U].platform,protocol:localStorage.getItem(`termdock:computer-protocol:${e}`)||"vnc",port:localStorage.getItem(`termdock:computer-rdp-port:${e}`)||"3389"}}),A.current++}}catch{}O||(k.current=R),N.current=h.configured?JSON.stringify(R):"",f(k.current),p(!0),d(h.configured?"saved":"saving"),P(Array.isArray(h.credentialKeys)?h.credentialKeys.filter(E=>typeof E=="string"):[]),T(h.credentialError?"error":"idle")}).catch(()=>{!D.signal.aborted&&w===a.current&&d("error")}),()=>{++a.current,D.abort();for(const h of C.current)h.abort();C.current.clear()}},[e,s]);const H=o.useCallback(()=>{if(b.current)return b.current;if(!u)return Promise.resolve(!1);const w=a.current,D=(async()=>{for(;N.current!==JSON.stringify(k.current);){const h=JSON.stringify(k.current),R=new AbortController;C.current.add(R),d("saving");try{if(!(await fetch("/api/computer/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:h,signal:R.signal})).ok)throw new Error("PREFERENCES_SAVE_FAILED");if(w!==a.current)return!1;N.current=h}catch{return w===a.current&&d("error"),!1}finally{C.current.delete(R)}}return w===a.current&&d("saved"),!0})();return b.current=D,D.finally(()=>{b.current===D&&(b.current=null)}),D},[u]);o.useEffect(()=>{if(!u||N.current===JSON.stringify(c))return;const w=setTimeout(()=>{H()},300);return()=>clearTimeout(w)},[u,c,H]);const q=o.useCallback(async(w,D,h)=>{const R=a.current,O=new AbortController;w!=="use"&&T("saving");try{if(!await H()||R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");C.current.add(O);const E=await fetch(`/api/computer/credentials/${w}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:D,...w==="save"?{password:h}:{}}),signal:O.signal});if(R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");if(!E.ok)throw new Error(w==="use"&&E.status===404?"COMPUTER_CREDENTIALS_MISSING":"COMPUTER_CREDENTIALS_FAILED");const ne=await E.json();if(R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");const U=gt(D);if(w==="save"&&P(ae=>[...new Set([...ae,U])]),w==="forget"&&P(ae=>ae.filter(pe=>pe!==U)),w==="use"&&(typeof ne.password!="string"||!ne.password))throw new Error("COMPUTER_CREDENTIALS_MISSING");return T("idle"),ne.password}catch(E){throw R===a.current&&!O.signal.aborted&&T("error"),E}finally{C.current.delete(O)}},[H]);return{preferences:c,change:K,loaded:u,saveState:x,flush:H,credentialKeys:g,loginState:W,credentialRequest:q,retry:()=>u?void H():v(w=>w+1)}}class $t{binaryType="arraybuffer";protocol="";CONNECTING=0;OPEN=1;CLOSING=2;CLOSED=3;onopen=null;onmessage=null;onerror=null;onclose=null;socket;get readyState(){return this.socket.readyState}constructor(c,f){this.socket=St(`/api/computer/ws?host=${encodeURIComponent(c)}`),this.socket.onopen=u=>this.onopen?.(u),this.socket.onerror=u=>this.onerror?.(u),this.socket.onclose=u=>{(u.code!==1e3||u.reason)&&f(u.reason||"COMPUTER_DISCONNECTED"),this.onclose?.(u)},this.socket.onmessage=u=>{try{const p=JSON.parse(u.data);if(p.type!=="data"||typeof p.data!="string"||!Number.isSafeInteger(p.seq))throw new Error("Invalid VNC record");const x=Uint8Array.from(atob(p.data),d=>d.charCodeAt(0));this.onmessage?.(new MessageEvent("message",{data:x.buffer})),this.socket.readyState===1&&this.socket.send(JSON.stringify({type:"ack",seq:p.seq}))}catch{f("COMPUTER_INVALID_MESSAGE"),this.close(),this.onclose?.(new CloseEvent("close",{code:4400}))}}}send(c){const f=ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c);for(let u=0;u<f.length;u+=32*1024){const p=f.subarray(u,u+32768);let x="";for(const d of p)x+=String.fromCharCode(d);this.socket.send(JSON.stringify({type:"data",data:btoa(x)}))}}close(){this.socket.close()}}function Ut(e){return e==="mac"||e==="linux"||e==="windows"}function Vt(e){const c=e==="mac"?[65513,"MetaLeft"]:[65507,"ControlLeft"],f=e==="mac"?c:[65515,"MetaLeft"];return{escape:[[65307,"Escape"]],enter:[[65293,"Enter"]],backspace:[[65288,"Backspace"]],tab:[e==="mac"?c:[65513,"AltLeft"],[65289,"Tab"]],search:e==="mac"?[f,[32,"Space"]]:[f],copy:[c,[99,"KeyC"]],paste:[c,[118,"KeyV"]],up:[[65362,"ArrowUp"]],down:[[65364,"ArrowDown"]],left:[[65361,"ArrowLeft"]],right:[[65363,"ArrowRight"]]}}function Ht(e){const c=e;return{size:()=>({width:c._fbWidth,height:c._fbHeight}),surface:()=>c._canvas,send:(f,u,p)=>{const x=c._display.scale,d=(f-c._display.absX(0))*x,s=(u-c._display.absY(0))*x;c._mousePos={x:d,y:s},c._mouseMoveTimer!==null&&clearTimeout(c._mouseMoveTimer),c._mouseMoveTimer=null,c._mouseButtonMask=p,c._mouseLastMoveTime=Date.now(),c._sendMouse(d,s,p)}}}const bt="termdock:computer-touch-mode:v1";function Bt(){try{const e=localStorage.getItem(bt);if(e==="trackpad"||e==="direct")return e}catch{}return navigator.maxTouchPoints>0&&window.matchMedia("(any-pointer: coarse)").matches?"trackpad":"direct"}function Kt(e){try{localStorage.setItem(bt,e)}catch{}}const Yt=8,Xt=300,Wt=450,He=18,Ce=(e,c)=>Math.max(0,Math.min(e,Math.max(0,c-1)));function qt(e,c,f,u,p={}){const x=new AbortController,d=new Map;let s=0,v=0,g=!1,P=!1,W=!1,T=!1,k=0,A=1,a=0,N=0,b,C=!1,K=!0,H=!0,q,w=!1;const D=()=>{const n=c.size(),l=u.current??={x:n.width/2,y:n.height/2};return l.x=Ce(l.x,n.width),l.y=Ce(l.y,n.height),l};let h;const R=()=>{const n=c.size();if((!h||h.width!==n.width||h.height!==n.height)&&(H=!0),!H&&h)return h;const l=c.surface(),S=e.getBoundingClientRect(),m=l.getBoundingClientRect(),y=[];for(let L=l.parentElement;L&&L!==e;L=L.parentElement){const j=getComputedStyle(L),$=/auto|scroll/.test(j.overflowX)?Math.max(0,L.scrollWidth-L.clientWidth):0,Ae=/auto|scroll/.test(j.overflowY)?Math.max(0,L.scrollHeight-L.clientHeight):0;if(!$&&!Ae)continue;const xe=L.getBoundingClientRect();y.push({element:L,left:xe.left-S.left,top:xe.top-S.top,right:xe.right-S.left,bottom:xe.bottom-S.top,maxX:$,maxY:Ae})}return h={...n,left:m.left-S.left,top:m.top-S.top,scaleX:n.width&&m.width?m.width/n.width:1,scaleY:n.height&&m.height?m.height/n.height:1,viewportWidth:S.width,viewportHeight:S.height,clientLeft:S.left,clientTop:S.top,scrollers:y},H=!1,h},O=()=>{const n=R(),l=D();if(!n.width||!n.height||!K||T||p.mode==="direct"||p.viewOnly){f.hidden=!0;return}let S=n.left+l.x*n.scaleX,m=n.top+l.y*n.scaleY;for(const y of n.scrollers){if(y.maxX){const L=y.element.scrollLeft,j=S<y.left+20?S-y.left-20:S>y.right-20?S-y.right+20:0,$=Math.max(0,Math.min(y.maxX,L+j));L!==$&&(y.element.scrollLeft=$,S-=$-L,n.left-=$-L)}if(y.maxY){const L=y.element.scrollTop,j=m<y.top+20?m-y.top-20:m>y.bottom-20?m-y.bottom+20:0,$=Math.max(0,Math.min(y.maxY,L+j));L!==$&&(y.element.scrollTop=$,m-=$-L,n.top-=$-L)}}f.hidden=S<0||m<0||S>=n.viewportWidth||m>=n.viewportHeight,f.style.transform=`translate3d(${S}px, ${m}px, 0)`},E=(n=N)=>{if(p.viewOnly)return;const l=D();c.send(Math.round(l.x),Math.round(l.y),n)},ne=()=>{b=void 0,O(),C&&(C=!1,E());let n=0;for(;Math.abs(a)>=He&&n++<8;){const l=a>0?16:8;E(l),E(0),a-=Math.sign(a)*He}},U=()=>{w||(b??=requestAnimationFrame(ne))},ae=()=>{b!==void 0&&(cancelAnimationFrame(b),ne())},pe=()=>{clearTimeout(q),ae(),N&&(N=0,E())},fe=n=>{n.cancelable&&n.preventDefault(),n.stopImmediatePropagation()},je=()=>[...d.values()].reduce((n,l)=>n+l.y,0)/d.size,he=()=>{const[n,l]=[...d.values()];return{distance:Math.hypot(n.x-l.x,n.y-l.y),x:(n.x+l.x)/2,y:(n.y+l.y)/2}},Z=n=>{const l=R();u.current={x:Ce((n.clientX-l.clientLeft-l.left)/l.scaleX,l.width),y:Ce((n.clientY-l.clientTop-l.top)/l.scaleY,l.height)}},ke=n=>{if(!(n.pointerType!=="touch"&&n.pointerType!=="pen")){fe(n),K=!0,U(),d.size||(s=performance.now(),v=0,g=!1,P=!1,W=!1,T=!1,a=0,p.mode==="direct"&&Z(n)),d.set(n.pointerId,{x:n.clientX,y:n.clientY,startX:n.clientX,startY:n.clientY}),v=Math.max(v,d.size);try{e.setPointerCapture(n.pointerId)}catch{}clearTimeout(q),d.size===1&&v===1?q=setTimeout(()=>{!w&&d.size===1&&!g&&!P&&(N=1,E())},Wt):(pe(),W=!0,d.size===2&&(k=he().distance,A=p.zoom?.get()??1))}},ie=n=>{if(n.pointerType==="mouse"){const j=R();u.current={x:Ce((n.clientX-j.clientLeft-j.left)/j.scaleX,j.width),y:Ce((n.clientY-j.clientTop-j.top)/j.scaleY,j.height)},K=!1,f.hidden=!0;return}const l=d.get(n.pointerId);if(!l)return;fe(n);const S=je(),m=d.size===2?he():void 0,y=n.clientX-l.x,L=n.clientY-l.y;if(l.x=n.clientX,l.y=n.clientY,Math.hypot(l.x-l.startX,l.y-l.startY)>Yt&&(g=!0,clearTimeout(q)),d.size===2&&!P){const j=he();if(p.zoom&&k>0&&(T||Math.abs(j.distance/k-1)>.06)){T=!0,g=!0,a=0,p.zoom.set(A*j.distance/k,j),H=!0,m&&p.zoom.pan(j.x-m.x,j.y-m.y),U();return}if(p.mode==="direct"&&p.zoom&&p.zoom.get()>1&&m){g=!0,p.zoom.pan(j.x-m.x,j.y-m.y),H=!0,U();return}a+=S-je(),Math.abs(a)>=He&&(g=!0,U())}else if(d.size===1&&!W&&!P){if(p.mode==="direct"){Z(n),g&&(N=1),C=!0,U();return}const j=D(),$=R();j.x+=y/$.scaleX,j.y+=L/$.scaleY,D(),C=!0,U()}},Y=n=>{if(!d.has(n.pointerId))return;fe(n);const l=N!==0;n.type!=="pointerup"&&(P=!0),pe(),d.delete(n.pointerId);try{e.hasPointerCapture(n.pointerId)&&e.releasePointerCapture(n.pointerId)}catch{}d.size||(a=0,!P&&!l&&!g&&v<=2&&performance.now()-s<=Xt&&(p.mode!=="direct"||v===1)&&(E(v===2?4:1),E(0)))},_=()=>{P=!0,pe();const n=[...d.keys()];d.clear(),a=0;for(const l of n)try{e.hasPointerCapture(l)&&e.releasePointerCapture(l)}catch{}},B={capture:!0,passive:!1,signal:x.signal};e.addEventListener("pointerdown",ke,B),e.addEventListener("pointermove",ie,B),e.addEventListener("pointerup",Y,B),e.addEventListener("pointercancel",Y,B),e.addEventListener("lostpointercapture",Y,B);for(const n of["touchstart","touchmove","touchend","touchcancel","contextmenu"])e.addEventListener(n,fe,B);const G=()=>{H=!0,U()};e.addEventListener("scroll",G,{capture:!0,signal:x.signal}),window.addEventListener("blur",_,{signal:x.signal});const J=()=>{document.hidden&&_()};document.addEventListener("visibilitychange",J,{signal:x.signal});const Ne=new ResizeObserver(G);return Ne.observe(e),Ne.observe(c.surface()),O(),()=>{w||(w=!0,x.abort(),_(),Ne.disconnect(),f.hidden=!0)}}function Zt(e,c){e=Math.max(1,e||1280),c=Math.max(1,c||800);const f=Math.max(1,640/e,480/c);return{width:Math.max(640,Math.min(2560,Math.round(e*f))),height:Math.max(480,Math.min(1600,Math.round(c*f)))}}const Be="​",Gt={Enter:"enter",Backspace:"backspace",Delete:"delete",Tab:"tab",ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"};function Jt({sendText:e,sendKey:c,inputRef:f,onFocusChange:u}){const{t:p}=xt(),x=o.useRef(null),d=o.useRef(!1),s=o.useRef(null),v=f??x,g=o.useRef({sendText:e,sendKey:c});g.current={sendText:e,sendKey:c};const[P,W]=o.useState(!1),T=()=>{v.current&&(v.current.value=Be,v.current.setSelectionRange(1,1)),W(!1)},k=()=>{const a=(v.current?.value||"").replace(/^\u200b/,"");a&&g.current.sendText(a),T()},A=()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),k()};return o.useLayoutEffect(()=>{const a=v.current;a.value=Be,a.setSelectionRange(1,1),a.focus({preventScroll:!0});const N=b=>{if(d.current||b.isComposing)return;const C=b.inputType==="deleteContentBackward"?"backspace":b.inputType==="deleteContentForward"?"delete":["insertLineBreak","insertParagraph"].includes(b.inputType)?"enter":null;if(!C)return;b.preventDefault();const K=C==="enter"&&s.current!==null;A(),K||g.current.sendKey(C)};return a.addEventListener("beforeinput",N),()=>{a.removeEventListener("beforeinput",N),s.current!==null&&cancelAnimationFrame(s.current)}},[]),t.jsxs("div",{className:"relative shrink-0 border-t border-border bg-surface px-3 py-2",children:[!P&&t.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-2 left-6 flex items-center text-sm text-muted-foreground",children:p("computer.keyboardPlaceholder")}),t.jsx("input",{ref:v,className:"min-h-11 w-full rounded-md border border-border bg-background px-3 text-base outline-none focus:border-primary","aria-label":p("computer.keyboardInput"),autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",spellCheck:!1,inputMode:"text",enterKeyHint:"enter",maxLength:1025,defaultValue:Be,onChange:a=>{if(W(!!a.target.value.replace(/^\u200b/,"")),d.current||a.nativeEvent.isComposing||s.current!==null)return;a.nativeEvent.inputType==="deleteContentBackward"&&!a.target.value?(g.current.sendKey("backspace"),T()):k()},onCompositionStart:()=>{s.current!==null&&A(),d.current=!0},onCompositionEnd:()=>{d.current=!1,s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,k()})},onFocus:()=>u?.(!0),onBlur:()=>{!d.current&&s.current!==null&&A(),u?.(!1)},onKeyDown:a=>{if(d.current||a.nativeEvent.isComposing||a.keyCode===229)return;const N=Gt[a.key];N&&(a.preventDefault(),A(),g.current.sendKey(N))}})]})}function Qt(e){let c=[],f=null;const u=new Map,p=()=>{f=null,c.splice(0,32).forEach(x=>{e(x),x[2]?u.set(x[0],x):u.delete(x[0])}),c.length&&(f=requestAnimationFrame(p))};return{send(x){c.push(...x),f===null&&p()},clear(){f!==null&&cancelAnimationFrame(f),f=null,c=[];const x=[...u.values()].reverse();u.clear();for(const[d,s]of x)try{e([d,s,!1])}catch{}}}}const er=e=>Math.max(1,Math.min(8,Number.isFinite(e)?e:1));function tr(e,c){let f=1;const u="viewportZoom"in e,p=e,x=()=>u?e.pointerTarget.surface():p._canvas,d=()=>u?e.viewportScroller:p._screen,s=u?void 0:p._updateScale;return s&&(p._updateScale=function(){s.call(p),p._display.scale*=f}),{get:()=>f,set(v,g){const P=er(v),W=x(),T=d(),k=W.getBoundingClientRect(),A=T.getBoundingClientRect(),a=g??{x:A.left+A.width/2,y:A.top+A.height/2},N={x:(a.x-k.left)/(k.width||1),y:(a.y-k.top)/(k.height||1)};f=P,u?e.viewportZoom=f:p._updateScale();const b=W.getBoundingClientRect();T.scrollLeft+=b.left+N.x*b.width-a.x,T.scrollTop+=b.top+N.y*b.height-a.y,f===1&&(T.scrollLeft=0,T.scrollTop=0),c(f)},pan(v,g){const P=d();P.scrollLeft-=v,P.scrollTop-=g},dispose(){s&&(p._updateScale=s)}}}const ce="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-border px-2.5 text-xs hover:bg-surface-2 disabled:opacity-40",me="min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm outline-none focus:border-primary";function Ie(e){return/API_NOT_ALLOWED|AUTHORIZATION|revoked|PAIRING/.test(e)?"computer.permission":e.includes("RDP_BACKEND_UNAVAILABLE")?"computer.rdpBackendUnavailable":e.includes("RDP_CERTIFICATE")?"computer.rdpCertificate":e.includes("CREDENTIALS_MISSING")?"computer.loginExpired":e.includes("CREDENTIALS_FAILED")?"computer.loginSaveFailed":e.includes("AUTH_FAILED")?"computer.authFailed":e.includes("RDP_FAILED")?"computer.rdpFailed":e.includes("SCREEN_SHARING_OFF")?"computer.sharingOff":e.includes("PRIVATE_HOST_ONLY")?"computer.privateOnly":e.includes("INVALID_HOST")?"computer.invalidHost":e.includes("TIMEOUT")?"computer.timeout":e.includes("UNREACHABLE")?"computer.unreachable":e.includes("DISCONNECTED")?"computer.disconnected":"computer.failed"}function rr(){const{t:e}=xt(),[c,f]=o.useState(()=>Me()?.targetPeerId??""),[u,p]=o.useState(null),{preferences:x,change:d,loaded:s,saveState:v,flush:g,retry:P,credentialKeys:W,loginState:T,credentialRequest:k}=Ft(c),A=x.target==="local",a=x[x.target],{host:N,platform:b,protocol:C,port:K,domain:H,ignoreCert:q,username:w}=a,D=C==="rdp"&&u?.rdpAvailable===!1,{viewOnly:h,fit:R}=x,O=a.rememberLogin&&W.includes(gt(a)),E=r=>d(i=>({...i,[i.target]:{...i[i.target],...r}})),ne=r=>E({username:r}),U=r=>E({domain:r}),ae=r=>{E({ignoreCert:r}),g()},pe=r=>E({port:r}),fe=r=>{r&&(le.current(),Le.clear(),y(null)),d(i=>({...i,viewOnly:r})),g()},[je,he]=o.useState(!1),Z=Vt(b),ke=b==="mac"?"⌘V":"Ctrl+V",[ie,Y]=o.useState(""),[_,B]=o.useState("idle"),[G,J]=o.useState(null),[Ne,n]=o.useState(""),[l,S]=o.useState(!1),[m,y]=o.useState(null),L=o.useRef(null),[j,$]=o.useState(!1),[Ae,xe]=o.useState(!1),Ye=o.useRef(0),[Q,yt]=o.useState(()=>navigator.maxTouchPoints>0||window.innerWidth<=640);o.useEffect(()=>{const r=()=>yt(navigator.maxTouchPoints>0||window.innerWidth<=640);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]);const Re=m==="keyboard"&&j&&(!Q||!window.visualViewport||Ae),[Ee,Xe]=o.useState(1),ee=o.useRef(null),De=o.useRef(null),[_e,We]=o.useState(""),[vt,Se]=o.useState(!1),[wt,Ct]=o.useState(!1),[oe,jt]=o.useState(Bt),qe=o.useRef(null),Ze=o.useRef(null),le=o.useRef(()=>{}),[Ge,kt]=o.useState(Ue),ve=o.useRef(!1),ue=o.useRef(""),Je=o.useRef(()=>{}),Qe=o.useRef(null),ze=o.useRef(null),ge=o.useMemo(()=>{const r=document.createElement("div");return r.className="h-full w-full min-h-0 overflow-hidden",r},[]),F=o.useRef(null),Le=o.useMemo(()=>Qt(([r,i,I])=>F.current?.sendKey(r,i,I)),[]),Oe=o.useRef(null),se=o.useRef(0),Fe=o.useRef(void 0),te=o.useCallback(()=>{le.current(),ee.current?.dispose(),ee.current=null,Le.clear(),Ze.current=null,se.current++,clearTimeout(Fe.current);const r=F.current;F.current=null,r?.disconnect(),Oe.current?.close(),Oe.current=null,ge.replaceChildren()},[ge,Le]);o.useLayoutEffect(()=>(ze.current?.appendChild(ge),()=>{ge.remove()}),[ge,l]),o.useEffect(()=>()=>te(),[te]),o.useEffect(()=>{const r=()=>{const i=Ue();kt(i),!i&&(ve.current=!1,ue.current="",te(),B("idle"),Y(""),S(!1),y(null))};return window.addEventListener(at,r),()=>window.removeEventListener(at,r)},[te]),o.useEffect(()=>{const r=()=>f(Me()?.targetPeerId??"");return window.addEventListener(it,r),()=>window.removeEventListener(it,r)},[]),o.useEffect(()=>{te(),ve.current=!1,ue.current="",B("idle"),J(null),Y(""),p(null),S(!1),y(null),he(!1),n(""),We(""),Se(!1);const r=new AbortController;return fetch("/api/computer/status",{signal:r.signal}).then(async i=>{if(!i.ok)throw new Error(i.status===403?"API_NOT_ALLOWED":"COMPUTER_FAILED");return await i.json()}).then(i=>{r.signal.aborted||p(i)}).catch(i=>{r.signal.aborted||J(Ie(String(i)))}),()=>{r.abort(),te()}},[c,te]),o.useEffect(()=>{F.current&&(F.current.viewOnly=h)},[h]),o.useEffect(()=>{F.current&&(F.current.scaleViewport=R)},[R]),o.useEffect(()=>{F.current&&"pauseResize"in F.current&&(F.current.pauseResize=!!m)},[m]),o.useEffect(()=>{const r=F.current;r&&("keyboardActive"in r?r.keyboardActive=m==="keyboard":r.focusOnClick=m!=="keyboard")},[m]);const et=r=>{r===A||X||!s||(Y(""),J(null),d(i=>({...i,target:r?"local":"remote"})),g())},tt=()=>{ve.current=!0,ue.current="",te(),B("idle"),Y(""),S(!1),y(null),Se(!1)},rt=async r=>{if(r?.preventDefault(),D)return;if(ve.current=!0,_==="credentials"&&F.current&&"sendCredentials"in F.current){ue.current=ie,F.current.sendCredentials({username:w,password:ie}),B("connecting");return}if(!Ue()||!s||!ie&&!O)return;g(),te(),J(null),n(""),B("connecting"),Se(!1);const i=se.current,I=z=>{i===se.current&&(te(),B("error"),J(z),y(null),ue.current="",(z==="computer.authFailed"||z==="computer.permission"||z==="computer.loginExpired")&&Y(""),O&&(z==="computer.authFailed"||z==="computer.loginExpired")&&k("forget",a).catch(()=>{}))};Fe.current=setTimeout(()=>I("computer.timeout"),6e4);try{let z=ie||await k("use",a);if(i!==se.current)return;ue.current=z||"";let V;if(C==="rdp"){const{RdpSession:re}=await lt(async()=>{const{RdpSession:$e}=await import("./rdpSession-hgCM4i-j.js");return{RdpSession:$e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));if(i!==se.current)return;const ye=window.innerWidth<=640,de=De.current?.getBoundingClientRect(),Te=Zt(ye?window.innerWidth:de?.width||1280,Math.max(1,(ye?window.innerHeight:de?.height||800)-100));V=new re(ge,{host:N.trim(),port:Number(K),username:w.trim(),password:z||"",domain:H.trim(),ignoreCert:q,...Te},$e=>I(Ie($e)))}else{const{default:re}=await lt(async()=>{const{default:Te}=await import("./rfb-CxsXsMUX.js");return{default:Te}},[]);if(i!==se.current)return;const ye=new $t(N.trim(),Te=>I(Ie(Te)));Oe.current=ye;const de=new re(ge,ye,{shared:!0,credentials:{username:w.trim()||void 0,password:z}});de.background="var(--chrome-bg)",de.resizeSession=!1,de.qualityLevel=6,de.compressionLevel=2,V=de}z=void 0,F.current=V,V.scaleViewport=R,V.viewOnly=h,V.addEventListener("connect",()=>{if(i!==se.current)return;clearTimeout(Fe.current),B("connected"),Y(""),window.innerWidth<=640&&(document.activeElement?.blur?.(),S(!0));const re=ue.current;ue.current="",a.rememberLogin&&re&&k("save",a,re).catch(()=>{})}),V.addEventListener("credentialsrequired",re=>{if(i!==se.current)return;const ye=re.detail.types;Ct(ye.includes("username")),B("credentials")}),V.addEventListener("securityfailure",()=>I("computer.authFailed")),V.addEventListener("disconnect",()=>I("computer.disconnected")),V.addEventListener("desktopname",re=>{i===se.current&&n(re.detail.name)})}catch(z){I(Ie(String(z)))}},be=r=>{!F.current||_!=="connected"||h||Le.send([...r.map(([I,z])=>[I,z,!0]),...[...r].reverse().map(([I,z])=>[I,z,!1])])},M=_==="connected",X=_==="connecting"||_==="credentials";o.useEffect(()=>{const r=F.current;if(!M||!r||!("viewportZoom"in r)&&!("_display"in r))return;const i=tr(r,Xe);return ee.current=i,Xe(1),()=>{i.dispose(),ee.current===i&&(ee.current=null)}},[M]),o.useEffect(()=>{const r=F.current,i=ze.current,I=qe.current;if(!M||m&&m!=="keyboard"||oe!=="trackpad"&&!(navigator.maxTouchPoints>0)||!r||!i||!I)return;const z="pointerTarget"in r?r.pointerTarget:Ht(r),V=qt(i,z,I,Ze,{mode:oe,zoom:ee.current??void 0,viewOnly:h});return le.current=V,()=>{V(),le.current===V&&(le.current=()=>{})}},[M,h,oe,l,m]);const nt=r=>{r!==oe&&(le.current(),jt(r),Kt(r))};Je.current=()=>{rt()},o.useEffect(()=>{Ge&&s&&u&&!D&&x.autoConnect&&O&&_==="idle"&&!ve.current&&Je.current()},[Ge,s,u,D,x.autoConnect,O,_]);const ot=()=>{ve.current=!0,k("forget",a).catch(()=>{})},we=r=>{if(r==="keyboard"){if(m==="keyboard"&&!Re){L.current?.blur(),L.current?.focus({preventScroll:!0});return}le.current(),Ye.current=window.visualViewport?.height??window.innerHeight,ut.flushSync(()=>{$(!1),xe(!1),y(i=>i===r?null:r)})}else le.current(),y(i=>i===r?null:r)},Nt=()=>{ee.current?.set(1),d(r=>({...r,fit:!0})),g()},Et=r=>{if(!F.current||h)return;const i=[];for(const I of r){const z=I.codePointAt(0),V=I===`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rdpSession-BshIobdj.js","assets/app-DCFOZi_L.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/index-Ctz-IDjR.css","assets/ChangeWalkthroughPanel-CKIG8diY.js","assets/sparkles-CDonlwGu.js","assets/triangle-alert-BgErMO2V.js","assets/RightSidebar-DOLn8R7c.js","assets/App-7IUcmCLC.js","assets/gestureArbiter-B26W6rS7.js","assets/gestureArbiter-C2J0D0kV.css","assets/referenceLongPress-DBJnfFHa.js","assets/DiffReview-5ERdwz1C.js","assets/DiffViewer-RT-p-ZBo.js","assets/DiffViewer-T3uj2-aP.css","assets/RightSidebar-DW-JEgm2.css"])))=>i.map(i=>d[i]);
2
+ import{ai as Pe,cJ as St,dr as xt,bH as t,cG as Me,bG as Ue,W as at,p as it,m as Lt,X as Tt,_ as lt}from"./app-DCFOZi_L.js";import{b as o,r as ut}from"./dnd-BCFAPC0L.js";import{a as At}from"./ChangeWalkthroughPanel-CKIG8diY.js";import{L as dt}from"./RightSidebar-DOLn8R7c.js";import{X as mt,K as Ve,j as pt}from"./App-7IUcmCLC.js";import{M as Rt}from"./triangle-alert-BgErMO2V.js";const _t=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],ft=Pe("mouse-pointer-2",_t);const Mt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],It=Pe("settings-2",Mt);const Pt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Dt=Pe("zoom-in",Pt);const zt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ot=Pe("zoom-out",zt);function Ke(e){const c=e==="darwin"?"mac":e==="win32"?"windows":"linux",f={host:"127.0.0.1",platform:c,protocol:c==="mac"?"vnc":"rdp",port:"3389",username:"",domain:"",ignoreCert:!1,rememberLogin:!0};return{target:"local",local:f,remote:{...f,host:""},viewOnly:!1,fit:!0,autoConnect:!0}}function ht(e,c){const f=Ke(c);if(!e||typeof e!="object")return f;const u=e,p=(x,d)=>{const s=x&&typeof x=="object"?x:{},v=(g,P)=>typeof s[g]=="string"&&s[g].length<=P&&!/[\x00-\x1f]/.test(s[g])?s[g]:d[g];return{host:v("host",253),username:v("username",255),domain:v("domain",255),platform:["mac","linux","windows"].includes(String(s.platform))?s.platform:d.platform,protocol:s.protocol==="rdp"||s.protocol==="vnc"?s.protocol:d.protocol,port:typeof s.port=="string"&&/^\d{0,5}$/.test(s.port)&&Number(s.port)<=65535?s.port:d.port,ignoreCert:s.ignoreCert===!0,rememberLogin:s.rememberLogin!==!1}};return{target:u.target==="remote"?"remote":"local",local:{...p(u.local,f.local),host:"127.0.0.1"},remote:p(u.remote,f.remote),viewOnly:u.viewOnly===!0,fit:u.fit!==!1,autoConnect:u.autoConnect!==!1}}function gt(e){return JSON.stringify([e.host.trim().toLowerCase(),e.protocol,e.protocol==="vnc"?5900:Number(e.port),e.username.trim(),e.domain.trim()])}function Ft(e){const[c,f]=o.useState(Ke),[u,p]=o.useState(!1),[x,d]=o.useState("loading"),[s,v]=o.useState(0),[g,P]=o.useState([]),[W,T]=o.useState("idle"),k=o.useRef(c),A=o.useRef(0),a=o.useRef(0),N=o.useRef(""),b=o.useRef(null),C=o.useRef(new Set),K=o.useCallback(w=>{k.current=w(k.current),A.current++,f(k.current),d("saving")},[]);o.useEffect(()=>{const w=++a.current;A.current=0,N.current="",b.current=null,k.current=Ke(),f(k.current),p(!1),d("loading"),P([]),T("idle");const D=new AbortController;return fetch("/api/computer/preferences",{signal:D.signal}).then(async h=>{if(!h.ok)throw new Error("PREFERENCES_LOAD_FAILED");return await h.json()}).then(h=>{if(w!==a.current||D.signal.aborted)return;let R=ht(h.preferences);const O=A.current>0;if(!h.configured&&!O)try{const E=localStorage.getItem(`termdock:computer-host:${e}`);if(E){const U=/^(127\.0\.0\.1|localhost|::1|\[::1\])$/i.test(E)?"local":"remote";R=ht({...R,target:U,[U]:{...R[U],host:E,platform:localStorage.getItem(`termdock:computer-platform:${e}`)||R[U].platform,protocol:localStorage.getItem(`termdock:computer-protocol:${e}`)||"vnc",port:localStorage.getItem(`termdock:computer-rdp-port:${e}`)||"3389"}}),A.current++}}catch{}O||(k.current=R),N.current=h.configured?JSON.stringify(R):"",f(k.current),p(!0),d(h.configured?"saved":"saving"),P(Array.isArray(h.credentialKeys)?h.credentialKeys.filter(E=>typeof E=="string"):[]),T(h.credentialError?"error":"idle")}).catch(()=>{!D.signal.aborted&&w===a.current&&d("error")}),()=>{++a.current,D.abort();for(const h of C.current)h.abort();C.current.clear()}},[e,s]);const H=o.useCallback(()=>{if(b.current)return b.current;if(!u)return Promise.resolve(!1);const w=a.current,D=(async()=>{for(;N.current!==JSON.stringify(k.current);){const h=JSON.stringify(k.current),R=new AbortController;C.current.add(R),d("saving");try{if(!(await fetch("/api/computer/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:h,signal:R.signal})).ok)throw new Error("PREFERENCES_SAVE_FAILED");if(w!==a.current)return!1;N.current=h}catch{return w===a.current&&d("error"),!1}finally{C.current.delete(R)}}return w===a.current&&d("saved"),!0})();return b.current=D,D.finally(()=>{b.current===D&&(b.current=null)}),D},[u]);o.useEffect(()=>{if(!u||N.current===JSON.stringify(c))return;const w=setTimeout(()=>{H()},300);return()=>clearTimeout(w)},[u,c,H]);const q=o.useCallback(async(w,D,h)=>{const R=a.current,O=new AbortController;w!=="use"&&T("saving");try{if(!await H()||R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");C.current.add(O);const E=await fetch(`/api/computer/credentials/${w}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:D,...w==="save"?{password:h}:{}}),signal:O.signal});if(R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");if(!E.ok)throw new Error(w==="use"&&E.status===404?"COMPUTER_CREDENTIALS_MISSING":"COMPUTER_CREDENTIALS_FAILED");const ne=await E.json();if(R!==a.current)throw new Error("COMPUTER_CREDENTIALS_FAILED");const U=gt(D);if(w==="save"&&P(ae=>[...new Set([...ae,U])]),w==="forget"&&P(ae=>ae.filter(pe=>pe!==U)),w==="use"&&(typeof ne.password!="string"||!ne.password))throw new Error("COMPUTER_CREDENTIALS_MISSING");return T("idle"),ne.password}catch(E){throw R===a.current&&!O.signal.aborted&&T("error"),E}finally{C.current.delete(O)}},[H]);return{preferences:c,change:K,loaded:u,saveState:x,flush:H,credentialKeys:g,loginState:W,credentialRequest:q,retry:()=>u?void H():v(w=>w+1)}}class $t{binaryType="arraybuffer";protocol="";CONNECTING=0;OPEN=1;CLOSING=2;CLOSED=3;onopen=null;onmessage=null;onerror=null;onclose=null;socket;get readyState(){return this.socket.readyState}constructor(c,f){this.socket=St(`/api/computer/ws?host=${encodeURIComponent(c)}`),this.socket.onopen=u=>this.onopen?.(u),this.socket.onerror=u=>this.onerror?.(u),this.socket.onclose=u=>{(u.code!==1e3||u.reason)&&f(u.reason||"COMPUTER_DISCONNECTED"),this.onclose?.(u)},this.socket.onmessage=u=>{try{const p=JSON.parse(u.data);if(p.type!=="data"||typeof p.data!="string"||!Number.isSafeInteger(p.seq))throw new Error("Invalid VNC record");const x=Uint8Array.from(atob(p.data),d=>d.charCodeAt(0));this.onmessage?.(new MessageEvent("message",{data:x.buffer})),this.socket.readyState===1&&this.socket.send(JSON.stringify({type:"ack",seq:p.seq}))}catch{f("COMPUTER_INVALID_MESSAGE"),this.close(),this.onclose?.(new CloseEvent("close",{code:4400}))}}}send(c){const f=ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c);for(let u=0;u<f.length;u+=32*1024){const p=f.subarray(u,u+32768);let x="";for(const d of p)x+=String.fromCharCode(d);this.socket.send(JSON.stringify({type:"data",data:btoa(x)}))}}close(){this.socket.close()}}function Ut(e){return e==="mac"||e==="linux"||e==="windows"}function Vt(e){const c=e==="mac"?[65513,"MetaLeft"]:[65507,"ControlLeft"],f=e==="mac"?c:[65515,"MetaLeft"];return{escape:[[65307,"Escape"]],enter:[[65293,"Enter"]],backspace:[[65288,"Backspace"]],tab:[e==="mac"?c:[65513,"AltLeft"],[65289,"Tab"]],search:e==="mac"?[f,[32,"Space"]]:[f],copy:[c,[99,"KeyC"]],paste:[c,[118,"KeyV"]],up:[[65362,"ArrowUp"]],down:[[65364,"ArrowDown"]],left:[[65361,"ArrowLeft"]],right:[[65363,"ArrowRight"]]}}function Ht(e){const c=e;return{size:()=>({width:c._fbWidth,height:c._fbHeight}),surface:()=>c._canvas,send:(f,u,p)=>{const x=c._display.scale,d=(f-c._display.absX(0))*x,s=(u-c._display.absY(0))*x;c._mousePos={x:d,y:s},c._mouseMoveTimer!==null&&clearTimeout(c._mouseMoveTimer),c._mouseMoveTimer=null,c._mouseButtonMask=p,c._mouseLastMoveTime=Date.now(),c._sendMouse(d,s,p)}}}const bt="termdock:computer-touch-mode:v1";function Bt(){try{const e=localStorage.getItem(bt);if(e==="trackpad"||e==="direct")return e}catch{}return navigator.maxTouchPoints>0&&window.matchMedia("(any-pointer: coarse)").matches?"trackpad":"direct"}function Kt(e){try{localStorage.setItem(bt,e)}catch{}}const Yt=8,Xt=300,Wt=450,He=18,Ce=(e,c)=>Math.max(0,Math.min(e,Math.max(0,c-1)));function qt(e,c,f,u,p={}){const x=new AbortController,d=new Map;let s=0,v=0,g=!1,P=!1,W=!1,T=!1,k=0,A=1,a=0,N=0,b,C=!1,K=!0,H=!0,q,w=!1;const D=()=>{const n=c.size(),l=u.current??={x:n.width/2,y:n.height/2};return l.x=Ce(l.x,n.width),l.y=Ce(l.y,n.height),l};let h;const R=()=>{const n=c.size();if((!h||h.width!==n.width||h.height!==n.height)&&(H=!0),!H&&h)return h;const l=c.surface(),S=e.getBoundingClientRect(),m=l.getBoundingClientRect(),y=[];for(let L=l.parentElement;L&&L!==e;L=L.parentElement){const j=getComputedStyle(L),$=/auto|scroll/.test(j.overflowX)?Math.max(0,L.scrollWidth-L.clientWidth):0,Ae=/auto|scroll/.test(j.overflowY)?Math.max(0,L.scrollHeight-L.clientHeight):0;if(!$&&!Ae)continue;const xe=L.getBoundingClientRect();y.push({element:L,left:xe.left-S.left,top:xe.top-S.top,right:xe.right-S.left,bottom:xe.bottom-S.top,maxX:$,maxY:Ae})}return h={...n,left:m.left-S.left,top:m.top-S.top,scaleX:n.width&&m.width?m.width/n.width:1,scaleY:n.height&&m.height?m.height/n.height:1,viewportWidth:S.width,viewportHeight:S.height,clientLeft:S.left,clientTop:S.top,scrollers:y},H=!1,h},O=()=>{const n=R(),l=D();if(!n.width||!n.height||!K||T||p.mode==="direct"||p.viewOnly){f.hidden=!0;return}let S=n.left+l.x*n.scaleX,m=n.top+l.y*n.scaleY;for(const y of n.scrollers){if(y.maxX){const L=y.element.scrollLeft,j=S<y.left+20?S-y.left-20:S>y.right-20?S-y.right+20:0,$=Math.max(0,Math.min(y.maxX,L+j));L!==$&&(y.element.scrollLeft=$,S-=$-L,n.left-=$-L)}if(y.maxY){const L=y.element.scrollTop,j=m<y.top+20?m-y.top-20:m>y.bottom-20?m-y.bottom+20:0,$=Math.max(0,Math.min(y.maxY,L+j));L!==$&&(y.element.scrollTop=$,m-=$-L,n.top-=$-L)}}f.hidden=S<0||m<0||S>=n.viewportWidth||m>=n.viewportHeight,f.style.transform=`translate3d(${S}px, ${m}px, 0)`},E=(n=N)=>{if(p.viewOnly)return;const l=D();c.send(Math.round(l.x),Math.round(l.y),n)},ne=()=>{b=void 0,O(),C&&(C=!1,E());let n=0;for(;Math.abs(a)>=He&&n++<8;){const l=a>0?16:8;E(l),E(0),a-=Math.sign(a)*He}},U=()=>{w||(b??=requestAnimationFrame(ne))},ae=()=>{b!==void 0&&(cancelAnimationFrame(b),ne())},pe=()=>{clearTimeout(q),ae(),N&&(N=0,E())},fe=n=>{n.cancelable&&n.preventDefault(),n.stopImmediatePropagation()},je=()=>[...d.values()].reduce((n,l)=>n+l.y,0)/d.size,he=()=>{const[n,l]=[...d.values()];return{distance:Math.hypot(n.x-l.x,n.y-l.y),x:(n.x+l.x)/2,y:(n.y+l.y)/2}},Z=n=>{const l=R();u.current={x:Ce((n.clientX-l.clientLeft-l.left)/l.scaleX,l.width),y:Ce((n.clientY-l.clientTop-l.top)/l.scaleY,l.height)}},ke=n=>{if(!(n.pointerType!=="touch"&&n.pointerType!=="pen")){fe(n),K=!0,U(),d.size||(s=performance.now(),v=0,g=!1,P=!1,W=!1,T=!1,a=0,p.mode==="direct"&&Z(n)),d.set(n.pointerId,{x:n.clientX,y:n.clientY,startX:n.clientX,startY:n.clientY}),v=Math.max(v,d.size);try{e.setPointerCapture(n.pointerId)}catch{}clearTimeout(q),d.size===1&&v===1?q=setTimeout(()=>{!w&&d.size===1&&!g&&!P&&(N=1,E())},Wt):(pe(),W=!0,d.size===2&&(k=he().distance,A=p.zoom?.get()??1))}},ie=n=>{if(n.pointerType==="mouse"){const j=R();u.current={x:Ce((n.clientX-j.clientLeft-j.left)/j.scaleX,j.width),y:Ce((n.clientY-j.clientTop-j.top)/j.scaleY,j.height)},K=!1,f.hidden=!0;return}const l=d.get(n.pointerId);if(!l)return;fe(n);const S=je(),m=d.size===2?he():void 0,y=n.clientX-l.x,L=n.clientY-l.y;if(l.x=n.clientX,l.y=n.clientY,Math.hypot(l.x-l.startX,l.y-l.startY)>Yt&&(g=!0,clearTimeout(q)),d.size===2&&!P){const j=he();if(p.zoom&&k>0&&(T||Math.abs(j.distance/k-1)>.06)){T=!0,g=!0,a=0,p.zoom.set(A*j.distance/k,j),H=!0,m&&p.zoom.pan(j.x-m.x,j.y-m.y),U();return}if(p.mode==="direct"&&p.zoom&&p.zoom.get()>1&&m){g=!0,p.zoom.pan(j.x-m.x,j.y-m.y),H=!0,U();return}a+=S-je(),Math.abs(a)>=He&&(g=!0,U())}else if(d.size===1&&!W&&!P){if(p.mode==="direct"){Z(n),g&&(N=1),C=!0,U();return}const j=D(),$=R();j.x+=y/$.scaleX,j.y+=L/$.scaleY,D(),C=!0,U()}},Y=n=>{if(!d.has(n.pointerId))return;fe(n);const l=N!==0;n.type!=="pointerup"&&(P=!0),pe(),d.delete(n.pointerId);try{e.hasPointerCapture(n.pointerId)&&e.releasePointerCapture(n.pointerId)}catch{}d.size||(a=0,!P&&!l&&!g&&v<=2&&performance.now()-s<=Xt&&(p.mode!=="direct"||v===1)&&(E(v===2?4:1),E(0)))},_=()=>{P=!0,pe();const n=[...d.keys()];d.clear(),a=0;for(const l of n)try{e.hasPointerCapture(l)&&e.releasePointerCapture(l)}catch{}},B={capture:!0,passive:!1,signal:x.signal};e.addEventListener("pointerdown",ke,B),e.addEventListener("pointermove",ie,B),e.addEventListener("pointerup",Y,B),e.addEventListener("pointercancel",Y,B),e.addEventListener("lostpointercapture",Y,B);for(const n of["touchstart","touchmove","touchend","touchcancel","contextmenu"])e.addEventListener(n,fe,B);const G=()=>{H=!0,U()};e.addEventListener("scroll",G,{capture:!0,signal:x.signal}),window.addEventListener("blur",_,{signal:x.signal});const J=()=>{document.hidden&&_()};document.addEventListener("visibilitychange",J,{signal:x.signal});const Ne=new ResizeObserver(G);return Ne.observe(e),Ne.observe(c.surface()),O(),()=>{w||(w=!0,x.abort(),_(),Ne.disconnect(),f.hidden=!0)}}function Zt(e,c){e=Math.max(1,e||1280),c=Math.max(1,c||800);const f=Math.max(1,640/e,480/c);return{width:Math.max(640,Math.min(2560,Math.round(e*f))),height:Math.max(480,Math.min(1600,Math.round(c*f)))}}const Be="​",Gt={Enter:"enter",Backspace:"backspace",Delete:"delete",Tab:"tab",ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"};function Jt({sendText:e,sendKey:c,inputRef:f,onFocusChange:u}){const{t:p}=xt(),x=o.useRef(null),d=o.useRef(!1),s=o.useRef(null),v=f??x,g=o.useRef({sendText:e,sendKey:c});g.current={sendText:e,sendKey:c};const[P,W]=o.useState(!1),T=()=>{v.current&&(v.current.value=Be,v.current.setSelectionRange(1,1)),W(!1)},k=()=>{const a=(v.current?.value||"").replace(/^\u200b/,"");a&&g.current.sendText(a),T()},A=()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),k()};return o.useLayoutEffect(()=>{const a=v.current;a.value=Be,a.setSelectionRange(1,1),a.focus({preventScroll:!0});const N=b=>{if(d.current||b.isComposing)return;const C=b.inputType==="deleteContentBackward"?"backspace":b.inputType==="deleteContentForward"?"delete":["insertLineBreak","insertParagraph"].includes(b.inputType)?"enter":null;if(!C)return;b.preventDefault();const K=C==="enter"&&s.current!==null;A(),K||g.current.sendKey(C)};return a.addEventListener("beforeinput",N),()=>{a.removeEventListener("beforeinput",N),s.current!==null&&cancelAnimationFrame(s.current)}},[]),t.jsxs("div",{className:"relative shrink-0 border-t border-border bg-surface px-3 py-2",children:[!P&&t.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-2 left-6 flex items-center text-sm text-muted-foreground",children:p("computer.keyboardPlaceholder")}),t.jsx("input",{ref:v,className:"min-h-11 w-full rounded-md border border-border bg-background px-3 text-base outline-none focus:border-primary","aria-label":p("computer.keyboardInput"),autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",spellCheck:!1,inputMode:"text",enterKeyHint:"enter",maxLength:1025,defaultValue:Be,onChange:a=>{if(W(!!a.target.value.replace(/^\u200b/,"")),d.current||a.nativeEvent.isComposing||s.current!==null)return;a.nativeEvent.inputType==="deleteContentBackward"&&!a.target.value?(g.current.sendKey("backspace"),T()):k()},onCompositionStart:()=>{s.current!==null&&A(),d.current=!0},onCompositionEnd:()=>{d.current=!1,s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,k()})},onFocus:()=>u?.(!0),onBlur:()=>{!d.current&&s.current!==null&&A(),u?.(!1)},onKeyDown:a=>{if(d.current||a.nativeEvent.isComposing||a.keyCode===229)return;const N=Gt[a.key];N&&(a.preventDefault(),A(),g.current.sendKey(N))}})]})}function Qt(e){let c=[],f=null;const u=new Map,p=()=>{f=null,c.splice(0,32).forEach(x=>{e(x),x[2]?u.set(x[0],x):u.delete(x[0])}),c.length&&(f=requestAnimationFrame(p))};return{send(x){c.push(...x),f===null&&p()},clear(){f!==null&&cancelAnimationFrame(f),f=null,c=[];const x=[...u.values()].reverse();u.clear();for(const[d,s]of x)try{e([d,s,!1])}catch{}}}}const er=e=>Math.max(1,Math.min(8,Number.isFinite(e)?e:1));function tr(e,c){let f=1;const u="viewportZoom"in e,p=e,x=()=>u?e.pointerTarget.surface():p._canvas,d=()=>u?e.viewportScroller:p._screen,s=u?void 0:p._updateScale;return s&&(p._updateScale=function(){s.call(p),p._display.scale*=f}),{get:()=>f,set(v,g){const P=er(v),W=x(),T=d(),k=W.getBoundingClientRect(),A=T.getBoundingClientRect(),a=g??{x:A.left+A.width/2,y:A.top+A.height/2},N={x:(a.x-k.left)/(k.width||1),y:(a.y-k.top)/(k.height||1)};f=P,u?e.viewportZoom=f:p._updateScale();const b=W.getBoundingClientRect();T.scrollLeft+=b.left+N.x*b.width-a.x,T.scrollTop+=b.top+N.y*b.height-a.y,f===1&&(T.scrollLeft=0,T.scrollTop=0),c(f)},pan(v,g){const P=d();P.scrollLeft-=v,P.scrollTop-=g},dispose(){s&&(p._updateScale=s)}}}const ce="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-border px-2.5 text-xs hover:bg-surface-2 disabled:opacity-40",me="min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm outline-none focus:border-primary";function Ie(e){return/API_NOT_ALLOWED|AUTHORIZATION|revoked|PAIRING/.test(e)?"computer.permission":e.includes("RDP_BACKEND_UNAVAILABLE")?"computer.rdpBackendUnavailable":e.includes("RDP_CERTIFICATE")?"computer.rdpCertificate":e.includes("CREDENTIALS_MISSING")?"computer.loginExpired":e.includes("CREDENTIALS_FAILED")?"computer.loginSaveFailed":e.includes("AUTH_FAILED")?"computer.authFailed":e.includes("RDP_FAILED")?"computer.rdpFailed":e.includes("SCREEN_SHARING_OFF")?"computer.sharingOff":e.includes("PRIVATE_HOST_ONLY")?"computer.privateOnly":e.includes("INVALID_HOST")?"computer.invalidHost":e.includes("TIMEOUT")?"computer.timeout":e.includes("UNREACHABLE")?"computer.unreachable":e.includes("DISCONNECTED")?"computer.disconnected":"computer.failed"}function rr(){const{t:e}=xt(),[c,f]=o.useState(()=>Me()?.targetPeerId??""),[u,p]=o.useState(null),{preferences:x,change:d,loaded:s,saveState:v,flush:g,retry:P,credentialKeys:W,loginState:T,credentialRequest:k}=Ft(c),A=x.target==="local",a=x[x.target],{host:N,platform:b,protocol:C,port:K,domain:H,ignoreCert:q,username:w}=a,D=C==="rdp"&&u?.rdpAvailable===!1,{viewOnly:h,fit:R}=x,O=a.rememberLogin&&W.includes(gt(a)),E=r=>d(i=>({...i,[i.target]:{...i[i.target],...r}})),ne=r=>E({username:r}),U=r=>E({domain:r}),ae=r=>{E({ignoreCert:r}),g()},pe=r=>E({port:r}),fe=r=>{r&&(le.current(),Le.clear(),y(null)),d(i=>({...i,viewOnly:r})),g()},[je,he]=o.useState(!1),Z=Vt(b),ke=b==="mac"?"⌘V":"Ctrl+V",[ie,Y]=o.useState(""),[_,B]=o.useState("idle"),[G,J]=o.useState(null),[Ne,n]=o.useState(""),[l,S]=o.useState(!1),[m,y]=o.useState(null),L=o.useRef(null),[j,$]=o.useState(!1),[Ae,xe]=o.useState(!1),Ye=o.useRef(0),[Q,yt]=o.useState(()=>navigator.maxTouchPoints>0||window.innerWidth<=640);o.useEffect(()=>{const r=()=>yt(navigator.maxTouchPoints>0||window.innerWidth<=640);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]);const Re=m==="keyboard"&&j&&(!Q||!window.visualViewport||Ae),[Ee,Xe]=o.useState(1),ee=o.useRef(null),De=o.useRef(null),[_e,We]=o.useState(""),[vt,Se]=o.useState(!1),[wt,Ct]=o.useState(!1),[oe,jt]=o.useState(Bt),qe=o.useRef(null),Ze=o.useRef(null),le=o.useRef(()=>{}),[Ge,kt]=o.useState(Ue),ve=o.useRef(!1),ue=o.useRef(""),Je=o.useRef(()=>{}),Qe=o.useRef(null),ze=o.useRef(null),ge=o.useMemo(()=>{const r=document.createElement("div");return r.className="h-full w-full min-h-0 overflow-hidden",r},[]),F=o.useRef(null),Le=o.useMemo(()=>Qt(([r,i,I])=>F.current?.sendKey(r,i,I)),[]),Oe=o.useRef(null),se=o.useRef(0),Fe=o.useRef(void 0),te=o.useCallback(()=>{le.current(),ee.current?.dispose(),ee.current=null,Le.clear(),Ze.current=null,se.current++,clearTimeout(Fe.current);const r=F.current;F.current=null,r?.disconnect(),Oe.current?.close(),Oe.current=null,ge.replaceChildren()},[ge,Le]);o.useLayoutEffect(()=>(ze.current?.appendChild(ge),()=>{ge.remove()}),[ge,l]),o.useEffect(()=>()=>te(),[te]),o.useEffect(()=>{const r=()=>{const i=Ue();kt(i),!i&&(ve.current=!1,ue.current="",te(),B("idle"),Y(""),S(!1),y(null))};return window.addEventListener(at,r),()=>window.removeEventListener(at,r)},[te]),o.useEffect(()=>{const r=()=>f(Me()?.targetPeerId??"");return window.addEventListener(it,r),()=>window.removeEventListener(it,r)},[]),o.useEffect(()=>{te(),ve.current=!1,ue.current="",B("idle"),J(null),Y(""),p(null),S(!1),y(null),he(!1),n(""),We(""),Se(!1);const r=new AbortController;return fetch("/api/computer/status",{signal:r.signal}).then(async i=>{if(!i.ok)throw new Error(i.status===403?"API_NOT_ALLOWED":"COMPUTER_FAILED");return await i.json()}).then(i=>{r.signal.aborted||p(i)}).catch(i=>{r.signal.aborted||J(Ie(String(i)))}),()=>{r.abort(),te()}},[c,te]),o.useEffect(()=>{F.current&&(F.current.viewOnly=h)},[h]),o.useEffect(()=>{F.current&&(F.current.scaleViewport=R)},[R]),o.useEffect(()=>{F.current&&"pauseResize"in F.current&&(F.current.pauseResize=!!m)},[m]),o.useEffect(()=>{const r=F.current;r&&("keyboardActive"in r?r.keyboardActive=m==="keyboard":r.focusOnClick=m!=="keyboard")},[m]);const et=r=>{r===A||X||!s||(Y(""),J(null),d(i=>({...i,target:r?"local":"remote"})),g())},tt=()=>{ve.current=!0,ue.current="",te(),B("idle"),Y(""),S(!1),y(null),Se(!1)},rt=async r=>{if(r?.preventDefault(),D)return;if(ve.current=!0,_==="credentials"&&F.current&&"sendCredentials"in F.current){ue.current=ie,F.current.sendCredentials({username:w,password:ie}),B("connecting");return}if(!Ue()||!s||!ie&&!O)return;g(),te(),J(null),n(""),B("connecting"),Se(!1);const i=se.current,I=z=>{i===se.current&&(te(),B("error"),J(z),y(null),ue.current="",(z==="computer.authFailed"||z==="computer.permission"||z==="computer.loginExpired")&&Y(""),O&&(z==="computer.authFailed"||z==="computer.loginExpired")&&k("forget",a).catch(()=>{}))};Fe.current=setTimeout(()=>I("computer.timeout"),6e4);try{let z=ie||await k("use",a);if(i!==se.current)return;ue.current=z||"";let V;if(C==="rdp"){const{RdpSession:re}=await lt(async()=>{const{RdpSession:$e}=await import("./rdpSession-BshIobdj.js");return{RdpSession:$e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));if(i!==se.current)return;const ye=window.innerWidth<=640,de=De.current?.getBoundingClientRect(),Te=Zt(ye?window.innerWidth:de?.width||1280,Math.max(1,(ye?window.innerHeight:de?.height||800)-100));V=new re(ge,{host:N.trim(),port:Number(K),username:w.trim(),password:z||"",domain:H.trim(),ignoreCert:q,...Te},$e=>I(Ie($e)))}else{const{default:re}=await lt(async()=>{const{default:Te}=await import("./rfb-CxsXsMUX.js");return{default:Te}},[]);if(i!==se.current)return;const ye=new $t(N.trim(),Te=>I(Ie(Te)));Oe.current=ye;const de=new re(ge,ye,{shared:!0,credentials:{username:w.trim()||void 0,password:z}});de.background="var(--chrome-bg)",de.resizeSession=!1,de.qualityLevel=6,de.compressionLevel=2,V=de}z=void 0,F.current=V,V.scaleViewport=R,V.viewOnly=h,V.addEventListener("connect",()=>{if(i!==se.current)return;clearTimeout(Fe.current),B("connected"),Y(""),window.innerWidth<=640&&(document.activeElement?.blur?.(),S(!0));const re=ue.current;ue.current="",a.rememberLogin&&re&&k("save",a,re).catch(()=>{})}),V.addEventListener("credentialsrequired",re=>{if(i!==se.current)return;const ye=re.detail.types;Ct(ye.includes("username")),B("credentials")}),V.addEventListener("securityfailure",()=>I("computer.authFailed")),V.addEventListener("disconnect",()=>I("computer.disconnected")),V.addEventListener("desktopname",re=>{i===se.current&&n(re.detail.name)})}catch(z){I(Ie(String(z)))}},be=r=>{!F.current||_!=="connected"||h||Le.send([...r.map(([I,z])=>[I,z,!0]),...[...r].reverse().map(([I,z])=>[I,z,!1])])},M=_==="connected",X=_==="connecting"||_==="credentials";o.useEffect(()=>{const r=F.current;if(!M||!r||!("viewportZoom"in r)&&!("_display"in r))return;const i=tr(r,Xe);return ee.current=i,Xe(1),()=>{i.dispose(),ee.current===i&&(ee.current=null)}},[M]),o.useEffect(()=>{const r=F.current,i=ze.current,I=qe.current;if(!M||m&&m!=="keyboard"||oe!=="trackpad"&&!(navigator.maxTouchPoints>0)||!r||!i||!I)return;const z="pointerTarget"in r?r.pointerTarget:Ht(r),V=qt(i,z,I,Ze,{mode:oe,zoom:ee.current??void 0,viewOnly:h});return le.current=V,()=>{V(),le.current===V&&(le.current=()=>{})}},[M,h,oe,l,m]);const nt=r=>{r!==oe&&(le.current(),jt(r),Kt(r))};Je.current=()=>{rt()},o.useEffect(()=>{Ge&&s&&u&&!D&&x.autoConnect&&O&&_==="idle"&&!ve.current&&Je.current()},[Ge,s,u,D,x.autoConnect,O,_]);const ot=()=>{ve.current=!0,k("forget",a).catch(()=>{})},we=r=>{if(r==="keyboard"){if(m==="keyboard"&&!Re){L.current?.blur(),L.current?.focus({preventScroll:!0});return}le.current(),Ye.current=window.visualViewport?.height??window.innerHeight,ut.flushSync(()=>{$(!1),xe(!1),y(i=>i===r?null:r)})}else le.current(),y(i=>i===r?null:r)},Nt=()=>{ee.current?.set(1),d(r=>({...r,fit:!0})),g()},Et=r=>{if(!F.current||h)return;const i=[];for(const I of r){const z=I.codePointAt(0),V=I===`
3
3
  `?65293:I===" "?65289:z<256?z:16777216|z;i.push([V,null,!0],[V,null,!1])}Le.send(i)};o.useEffect(()=>{if(!M||m!=="keyboard"&&m!=="clipboard"||!window.visualViewport)return;const r=window.visualViewport,i=De.current,I=()=>{m==="keyboard"&&xe(j&&Ye.current-r.height>100),l&&i&&r.height>=160&&(i.style.height=`${r.height}px`,i.style.top=`${r.offsetTop}px`)};return I(),r.addEventListener("resize",I),r.addEventListener("scroll",I),()=>{r.removeEventListener("resize",I),r.removeEventListener("scroll",I),i&&(i.style.height="",i.style.top="")}},[M,m,l,j]);const st=t.jsxs("div",{className:"flex shrink-0 items-center text-xs",role:"group","aria-label":e("computer.desktopZoom"),title:Q?e("computer.pinchHint"):void 0,children:[t.jsx("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center","aria-label":e("computer.zoomOut"),disabled:Ee<=1,onPointerDown:r=>r.preventDefault(),onClick:()=>ee.current?.set(Ee/1.25),children:t.jsx(Ot,{size:16})}),t.jsxs("button",{type:"button",className:"min-h-11 min-w-11","aria-label":e("computer.resetZoom"),onPointerDown:r=>r.preventDefault(),onClick:Nt,children:[Math.round(Ee*100),"%"]}),t.jsx("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center","aria-label":e("computer.zoomIn"),disabled:Ee>=8,onPointerDown:r=>r.preventDefault(),onClick:()=>ee.current?.set(Ee*1.25),children:t.jsx(Dt,{size:16})}),Q&&t.jsx("span",{className:"hidden pr-2 text-[10px] text-muted-foreground sm:inline",children:e("computer.pinchHint")})]}),ct=t.jsxs("div",{ref:De,className:`flex min-h-0 flex-col bg-surface text-foreground ${l?"fixed inset-0 z-modal-panel h-dvh pb-[env(safe-area-inset-bottom)] pt-[env(safe-area-inset-top)]":"relative h-full"}`,role:l?"dialog":void 0,"aria-modal":l||void 0,"aria-label":e("computer.title"),onKeyDown:r=>{r.stopPropagation(),r.key==="Escape"&&!r.nativeEvent.isComposing&&m&&(r.preventDefault(),y(null))},onKeyUp:r=>r.stopPropagation(),children:[t.jsxs("div",{className:"relative z-30 flex min-h-12 shrink-0 items-center gap-2 border-b border-border bg-surface px-3",children:[l&&t.jsx("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center",onClick:()=>{S(!1),y(null)},"aria-label":e("computer.exitFullscreen"),children:t.jsx(At,{size:20})}),t.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:M&&(Ne||(A?u?.hostname||Me()?.serviceName:N))||e("computer.title")}),M&&t.jsx("span",{className:"text-[11px] text-primary",children:e("computer.connected")}),M&&T==="error"&&t.jsx("span",{role:"alert",className:"text-[11px] text-destructive",children:e("computer.loginSaveFailed")}),M&&v==="saving"&&t.jsx("span",{role:"status","aria-label":e("computer.settingsSaving"),title:e("computer.settingsSaving"),children:t.jsx(dt,{size:12,className:"animate-spin text-muted-foreground"})}),M&&v==="error"&&t.jsxs("button",{type:"button",className:ce,title:e("computer.settingsSaveFailed"),"aria-label":e("computer.settingsSaveFailed"),onClick:P,children:["! ",e("computer.retry")]}),X&&t.jsxs("button",{type:"button",className:ce,onClick:tt,children:[t.jsx(mt,{size:14}),e("computer.cancel")]}),M&&!Q&&m==="keyboard"&&t.jsx("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center",onClick:()=>we("keyboard"),"aria-label":e("computer.keyboard"),"aria-pressed":Re,children:t.jsx(Ve,{size:18})}),M&&!Q&&t.jsx("button",{type:"button",className:`flex min-h-11 min-w-11 items-center justify-center rounded-md ${m==="clipboard"?"bg-surface-2 text-primary":""}`,disabled:h,onClick:()=>we("clipboard"),"aria-label":e("computer.clipboardTool"),title:e("computer.clipboardTool"),"aria-pressed":m==="clipboard",children:t.jsx(pt,{size:18})}),M&&!l&&t.jsxs("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center gap-1 text-xs",onClick:()=>S(!0),"aria-label":e("computer.fullscreen"),children:[t.jsx(Rt,{size:16}),e("computer.expand")]}),M&&t.jsx("button",{type:"button",className:"flex min-h-11 min-w-11 items-center justify-center",onClick:()=>we("tools"),"aria-label":e("computer.tools"),"aria-expanded":m==="tools",children:t.jsx(It,{size:18})})]}),!M&&t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-6",children:t.jsxs("div",{className:"mx-auto w-full max-w-md",children:[t.jsxs("form",{className:"space-y-3",onSubmit:r=>{rt(r)},"aria-busy":_==="connecting",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-1 rounded-lg bg-background p-1",role:"group","aria-label":e("computer.target"),children:[t.jsx("button",{type:"button",className:`min-h-11 rounded-md px-3 text-sm font-medium ${A?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface"}`,"aria-pressed":A,disabled:X||!u||!s,onClick:()=>et(!0),children:e("computer.thisComputer")}),t.jsx("button",{type:"button",className:`min-h-11 rounded-md px-3 text-sm font-medium ${A?"text-muted-foreground hover:bg-surface":"bg-surface-2 text-foreground"}`,"aria-pressed":!A,disabled:X||!s,onClick:()=>et(!1),children:e("computer.otherComputer")})]}),A?t.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",role:"status",children:u?e("computer.localService",{name:Me()?.serviceName||u.hostname}):e("computer.loading")}):t.jsxs("label",{className:"block space-y-1 text-xs",children:[t.jsx("span",{children:e("computer.host")}),t.jsx("input",{className:me,value:N,disabled:X||!s,onChange:r=>{E({host:r.target.value,domain:"",ignoreCert:!1}),Y(""),J(null)},placeholder:e("computer.hostPlaceholder"),onBlur:()=>{g()},autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,required:!0,maxLength:253})]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[b==="mac"?"macOS":b==="linux"?"Ubuntu / Linux":"Windows"," · ",C.toUpperCase()," · ",C==="rdp"?K||"3389":"5900",h?` · ${e("computer.viewOnly")}`:""]}),t.jsxs("label",{className:"block space-y-1 text-xs",children:[t.jsx("span",{children:e(C==="rdp"?"computer.rdpUsername":"computer.username")}),t.jsx("input",{className:me,value:w,disabled:_==="connecting"||!s,onChange:r=>ne(r.target.value),onBlur:()=>{g()},autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",required:C==="rdp"||_==="credentials"&&wt,maxLength:255})]}),t.jsxs("label",{className:"block space-y-1 text-xs",children:[t.jsx("span",{children:e("computer.password")}),t.jsx("input",{className:me,type:"password",value:ie,disabled:_==="connecting"||!s,onChange:r=>Y(r.target.value),placeholder:O&&_!=="credentials"?e("computer.savedPassword"):void 0,autoComplete:"new-password",required:!O||_==="credentials",maxLength:1024})]}),t.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:e(C==="rdp"?"computer.rdpLoginHint":"computer.vncLoginHint")}),t.jsxs("div",{className:"flex min-h-11 items-center justify-between gap-2 text-xs",children:[t.jsxs("label",{className:"flex min-h-11 items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:a.rememberLogin,disabled:X||!s||T==="saving",onChange:r=>{const i=r.target.checked;E({rememberLogin:i}),!i&&O?k("forget",{...a,rememberLogin:i}).catch(()=>{}):g()}}),e("computer.rememberLogin")]}),O&&t.jsx("button",{type:"button",className:"min-h-11 text-muted-foreground underline",disabled:X||T==="saving",onClick:ot,children:e("computer.forgetLogin")})]}),T==="error"&&!G&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:e("computer.loginSaveFailed")}),D&&t.jsxs("div",{role:"status",className:"space-y-1 text-xs leading-relaxed text-muted-foreground",children:[t.jsx("p",{children:e("computer.rdpBackendUnavailable")}),t.jsx("p",{children:e("computer.rdpBackendRecovery")})]}),_==="credentials"&&t.jsx("p",{className:"text-xs text-primary",children:e("computer.credentials")}),G&&t.jsxs("div",{role:"alert",className:"rounded-md bg-surface-2 p-3 text-xs leading-relaxed text-destructive",children:[e(G),G==="computer.rdpCertificate"&&t.jsxs("label",{className:"mt-1 flex min-h-11 items-center gap-2 text-foreground",children:[t.jsx("input",{type:"checkbox",checked:q,onChange:r=>ae(r.target.checked)}),e("computer.trustCertificateHere")]}),_==="error"&&G!=="computer.rdpCertificate"&&t.jsx("button",{type:"button",className:"mt-1 block min-h-9 text-foreground underline",onClick:()=>{he(!0),requestAnimationFrame(()=>Qe.current?.scrollIntoView?.({block:"nearest",behavior:"smooth"}))},children:e("computer.checkSettings")})]}),t.jsxs("button",{type:"submit",className:"inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-40",disabled:!s||D||_==="connecting"||T==="saving"||A&&!u||!N.trim()||!ie&&(!O||_==="credentials")||C==="rdp"&&(!w.trim()||!Number.isInteger(Number(K))||Number(K)<1||Number(K)>65535),children:[_==="connecting"&&t.jsx(dt,{size:16,className:"animate-spin"}),e(_==="connecting"?"computer.connecting":_==="credentials"?"computer.authenticate":_==="error"?"computer.retryConnect":"computer.connect")]}),t.jsxs("details",{ref:Qe,className:"border-b border-border text-xs",open:je,onToggle:r=>he(r.currentTarget.open),children:[t.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center justify-between text-muted-foreground",children:[t.jsx("span",{children:e("computer.advanced")}),t.jsx("span",{"aria-hidden":"true",children:je?"−":"+"})]}),t.jsxs("div",{className:"space-y-3 pb-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("label",{className:"block space-y-1",children:[t.jsx("span",{children:e("computer.platform")}),t.jsxs("select",{className:me,value:b,disabled:X||!s,onChange:r=>{Ut(r.target.value)&&E({platform:r.target.value,protocol:r.target.value==="mac"?"vnc":"rdp",ignoreCert:!1}),Y(""),g()},children:[t.jsx("option",{value:"mac",children:"macOS"}),t.jsx("option",{value:"linux",children:"Ubuntu / Linux"}),t.jsx("option",{value:"windows",children:"Windows"})]})]}),t.jsxs("label",{className:"block space-y-1",children:[t.jsx("span",{children:e("computer.protocol")}),t.jsxs("select",{className:me,value:C,disabled:X||!s,onChange:r=>{E({protocol:r.target.value==="rdp"?"rdp":"vnc"}),Y(""),J(null),g()},children:[t.jsx("option",{value:"rdp",children:"RDP"}),t.jsx("option",{value:"vnc",children:"VNC"})]})]})]}),C==="rdp"&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"block space-y-1",children:[t.jsx("span",{children:e("computer.port")}),t.jsx("input",{className:me,type:"number",min:1,max:65535,step:1,value:K,disabled:X||!s,onBlur:()=>{g()},onChange:r=>pe(r.target.value)})]}),t.jsxs("label",{className:"block space-y-1",children:[t.jsx("span",{children:e("computer.domain")}),t.jsx("input",{className:me,value:H,disabled:X||!s,onBlur:()=>{g()},onChange:r=>U(r.target.value),autoComplete:"off",maxLength:255})]}),t.jsxs("label",{className:"flex min-h-11 items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:q,disabled:X||!s,onChange:r=>ae(r.target.checked)}),e("computer.trustCertificate")]})]}),t.jsxs("label",{className:"flex min-h-11 items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:h,disabled:X||!s,onChange:r=>fe(r.target.checked)}),e("computer.viewOnly")]}),t.jsxs("label",{className:"flex min-h-11 items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:x.autoConnect,disabled:X||!s,onChange:r=>{d(i=>({...i,autoConnect:r.target.checked})),g()}}),e("computer.autoConnect")]})]})]})]}),t.jsxs("p",{role:"status",className:"mt-2 text-[11px] leading-relaxed text-muted-foreground",children:[e(v==="saved"?"computer.settingsSaved":v==="error"?s?"computer.settingsSaveFailed":"computer.settingsLoadFailed":v==="loading"?"computer.settingsLoading":"computer.settingsSaving"),v==="error"&&t.jsx("button",{type:"button",className:"ml-2 min-h-9 text-primary underline",onClick:P,children:e("computer.retry")})]}),t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"flex min-h-11 cursor-pointer items-center text-muted-foreground",children:e("computer.setup")}),t.jsxs("ol",{className:"ml-4 list-decimal space-y-2 pt-2 leading-relaxed text-muted-foreground",children:[t.jsx("li",{children:e(C==="rdp"?b==="linux"?"computer.rdpLinuxStep1":"computer.rdpStep1":b==="mac"?"computer.step1":b==="linux"?"computer.linuxStep1":"computer.windowsStep1")}),t.jsx("li",{children:e(C==="rdp"?"computer.rdpStep2":b==="mac"?"computer.step2":b==="linux"?"computer.linuxStep2":"computer.windowsStep2")}),t.jsx("li",{children:e("computer.step3")})]}),C==="vnc"&&b==="linux"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:e("computer.linuxCommandHint")}),t.jsx("pre",{className:"mt-2 overflow-x-auto rounded-md bg-background p-2 text-[11px]",children:t.jsx("code",{children:`sudo apt install x11vnc
4
4
  x11vnc -storepasswd
5
5
  x11vnc -display "$DISPLAY" -auth guess -localhost -usepw -forever -shared -rfbport 5900`})}),t.jsx("p",{className:"mt-2 leading-relaxed text-muted-foreground",children:e("computer.linuxProtocolHint")})]}),t.jsx("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:e(C==="rdp"?"computer.rdpNetworkHint":"computer.networkHint")})]})]})}),M&&m==="tools"&&t.jsx("button",{type:"button",className:`absolute inset-x-0 ${Q?"bottom-14":"bottom-0"} top-12 z-20 bg-background/40`,"aria-label":e("computer.returnToDesktop"),onClick:()=>y(null)}),M&&t.jsxs("div",{hidden:m!=="tools",className:`${m==="tools"?"flex":"hidden"} absolute inset-x-3 top-14 z-30 max-h-[calc(100%-7rem)] flex-wrap items-center gap-3 overflow-y-auto rounded-lg border border-border bg-surface px-4 py-3 text-xs shadow-lg [&_button]:min-h-11 [&_select]:min-h-11 [&_label]:min-h-11`,role:"region","aria-label":e("computer.tools"),children:[t.jsxs("div",{className:"flex w-full items-center justify-between",children:[t.jsx("span",{className:"font-medium",children:e("computer.tools")}),t.jsx("button",{type:"button",className:"flex min-w-11 items-center justify-center","aria-label":e("computer.closeTools"),onClick:()=>y(null),children:t.jsx(Tt,{size:18})})]}),Q&&t.jsx("div",{className:"flex w-full items-center gap-2",children:t.jsx("div",{className:"inline-flex rounded-md bg-background p-0.5",role:"group","aria-label":e("computer.touchMode"),children:["trackpad","direct"].map(r=>t.jsx("button",{type:"button",className:`min-h-9 rounded px-3 text-xs ${oe===r?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface"}`,"aria-pressed":oe===r,onClick:()=>nt(r),children:e(r==="trackpad"?"computer.trackpadMode":"computer.directTouchMode")},r))})}),!Q&&t.jsxs(t.Fragment,{children:[st,t.jsxs("button",{type:"button",className:ce,disabled:h,onClick:()=>we("keyboard"),children:[t.jsx(Ve,{size:14}),e("computer.keyboard")]})]}),t.jsxs("label",{className:"flex min-h-9 items-center gap-1.5",children:[t.jsx("input",{type:"checkbox",checked:h,onChange:r=>fe(r.target.checked)}),e("computer.viewOnly")]}),t.jsx("button",{type:"button",className:ce,onClick:()=>{ee.current?.set(1),d(r=>({...r,fit:!r.fit})),g()},children:e(R?"computer.actualSize":"computer.fit")}),t.jsxs("select",{className:`${ce} min-w-0 bg-surface`,"aria-label":e("computer.shortcuts"),value:"",disabled:h,onChange:r=>{be(Z[r.target.value]??[])},children:[t.jsx("option",{value:"",disabled:!0,children:e("computer.shortcuts")}),t.jsxs("option",{value:"tab",children:[b==="mac"?"⌘ Tab":"Alt+Tab"," · ",e("computer.switchApps")]}),t.jsxs("option",{value:"search",children:[b==="mac"?"⌘ Space":"Super / Win"," · ",e(b==="mac"?"computer.spotlight":"computer.systemSearch")]}),t.jsx("option",{value:"copy",children:b==="mac"?"⌘C":"Ctrl+C"}),t.jsx("option",{value:"paste",children:ke}),t.jsx("option",{value:"escape",children:"Esc"}),t.jsx("option",{value:"enter",children:"Enter"}),t.jsx("option",{value:"backspace",children:"⌫"}),t.jsx("option",{value:"up",children:"↑"}),t.jsx("option",{value:"down",children:"↓"}),t.jsx("option",{value:"left",children:"←"}),t.jsx("option",{value:"right",children:"→"})]}),t.jsxs("div",{className:"flex w-full items-center justify-between border-t border-border pt-2",children:[O&&t.jsx("button",{type:"button",className:ce,disabled:T==="saving",onClick:ot,children:e("computer.forgetLogin")}),t.jsxs("button",{type:"button",className:`${ce} ml-auto text-destructive`,onClick:tt,children:[t.jsx(mt,{size:14}),e("computer.disconnect")]})]})]}),t.jsx("div",{ref:ze,"data-sidebar-gesture-ignore":"",className:`relative z-10 min-h-0 flex-1 overflow-hidden bg-[var(--chrome-bg)] ${M?"":"hidden"}`,onMouseDownCapture:r=>{m==="keyboard"&&r.preventDefault()},style:{touchAction:M?"none":void 0},"aria-label":e("computer.remoteTitle"),children:M&&t.jsx("div",{ref:qe,hidden:!0,"aria-hidden":"true",className:"pointer-events-none absolute left-0 top-0 z-20 h-5 w-5 will-change-transform",children:t.jsx(ft,{size:20,strokeWidth:2,className:"fill-background text-primary drop-shadow"})})}),t.jsx("div",{hidden:m!=="tools",children:M&&Q&&!h&&t.jsx("p",{className:"shrink-0 border-t border-border px-2 py-1 text-[10px] leading-relaxed text-muted-foreground",children:e(oe==="trackpad"?"computer.trackpadHint":"computer.directTouchHint")})}),M&&m==="keyboard"&&!h&&t.jsxs(t.Fragment,{children:[t.jsx(Jt,{inputRef:L,onFocusChange:$,sendText:Et,sendKey:r=>be(r==="tab"?[[65289,"Tab"]]:r==="delete"?[[65535,"Delete"]]:Z[r])}),t.jsx("div",{className:"grid shrink-0 grid-cols-6 gap-1 bg-surface px-1",role:"group","aria-label":e("computer.keyboardNavigation"),children:["escape","left","down","up","right","selectAll"].map(r=>t.jsx("button",{type:"button",className:"min-h-11 rounded-md text-sm hover:bg-surface-2","aria-label":e(`computer.key${r[0].toUpperCase()}${r.slice(1)}`),onPointerDown:i=>i.preventDefault(),onClick:()=>be(r==="selectAll"?[...Z.copy.slice(0,1),[97,"KeyA"]]:Z[r]),children:{escape:"Esc",left:"←",down:"↓",up:"↑",right:"→",selectAll:b==="mac"?"⌘A":"Ctrl+A"}[r]},r))})]}),M&&m==="clipboard"&&!h&&t.jsxs("form",{className:"shrink-0 space-y-2 border-t border-border p-3",onSubmit:r=>{if(r.preventDefault(),!(!_e||!F.current))try{F.current.clipboardPasteFrom(_e),Se(!0)}catch{J("computer.clipboardFailed")}},children:[t.jsx("textarea",{className:`${me} min-w-0 resize-none py-2 text-base`,rows:2,"aria-label":e("computer.clipboard"),placeholder:e("computer.clipboardPlaceholder"),value:_e,onChange:r=>{We(r.target.value),Se(!1)},maxLength:16384}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"submit",className:`${ce} min-h-11 flex-1`,disabled:!_e,children:e("computer.clipboard")}),t.jsx("button",{type:"button",className:`${ce} min-h-11`,onClick:()=>be(Z.paste),children:ke})]}),t.jsx("p",{role:"status",className:"text-[10px] leading-relaxed text-muted-foreground",children:vt?e("computer.clipboardSent"):e("computer.clipboardHint",{shortcut:ke})}),G&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:e(G)})]}),M&&Q&&t.jsxs("div",{className:"relative z-30 flex shrink-0 items-center border-t border-border bg-surface px-1 py-1 text-[11px]",children:[t.jsxs("div",{className:`grid min-w-0 flex-1 ${m==="keyboard"?"grid-cols-5":"grid-cols-3"}`,children:[t.jsxs("button",{type:"button",className:`flex min-h-11 flex-col items-center justify-center gap-0.5 rounded-md ${Re?"bg-surface-2 text-primary":""}`,disabled:h,onClick:()=>we("keyboard"),"aria-pressed":Re,children:[t.jsx(Ve,{size:18}),e("computer.keyboard")]}),t.jsxs("button",{type:"button",className:`flex min-h-11 flex-col items-center justify-center gap-0.5 rounded-md ${m==="clipboard"?"bg-surface-2 text-primary":""}`,disabled:h,onClick:()=>we("clipboard"),"aria-pressed":m==="clipboard",children:[t.jsx(pt,{size:18}),e("computer.clipboardTool")]}),m==="keyboard"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"min-h-11 rounded-md text-sm",onPointerDown:r=>r.preventDefault(),onClick:()=>be([[65289,"Tab"]]),children:"Tab"}),t.jsx("button",{type:"button",className:"min-h-11 rounded-md text-lg",onPointerDown:r=>r.preventDefault(),onClick:()=>be(Z.backspace),children:"⌫"}),t.jsx("button",{type:"button",className:"min-h-11 rounded-md text-lg",onPointerDown:r=>r.preventDefault(),onClick:()=>be(Z.enter),children:"↵"})]}):t.jsx(t.Fragment,{children:t.jsxs("button",{type:"button",className:"flex min-h-11 flex-col items-center justify-center gap-0.5 rounded-md",disabled:h,onClick:()=>nt(oe==="trackpad"?"direct":"trackpad"),"aria-label":e("computer.switchTouchMode"),children:[t.jsx(ft,{size:18}),e(oe==="trackpad"?"computer.trackpadMode":"computer.directTouchMode")]})})]}),st]})]});return l?ut.createPortal(ct,document.body):ct}const lr=Object.freeze(Object.defineProperty({__proto__:null,default:rr},Symbol.toStringTag,{value:"Module"}));export{lr as C,Zt as c};
@@ -1 +1 @@
1
- import{by as t}from"./app-CfqF7_nh.js";import{C as s}from"./ChangeWalkthroughPanel-B64j3i8o.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./sparkles-C9ShmGPf.js";import"./triangle-alert-i_L8ws6U.js";const e="/tmp/termdock-dag-playground",i={version:1,id:"dag-playground",repoRoot:e,workspaceRoot:e,title:"改动解释升级为可点击导览",summary:"这是一页免登录 playground,用真实 ChangeWalkthroughPanel 调 DAG 的节点、边、label 和密度。",generatedBy:"dag-playground",injectedAt:Date.now(),highlights:[{what:"先看总览,再看链路",effect:"读者不用先进入 diff,也能理解整批改动目的。",tag:"理解"},{what:"多条链路直接画出来",effect:"分支、汇合、验证路径不再靠 next 文本猜。",tag:"链路"},{what:"点击节点跳回证据",effect:"导览和真实 diff 之间形成闭环。",tag:"导航"}],nodes:[{id:"export",title:"导出 section 级 diff",kind:"source",business:"CLI 把 hunk 拆成多个连续改动 section,并为每个 section 生成稳定 fingerprint。这里故意写长一点,用来验证 DAG 节点是否会按照真实文本高度撑开,而不是被固定高度裁掉。",anchor:{repoRoot:e,filePath:"src/server/cli.ts",hunkIndex:0,sectionIndex:0}},{id:"prompt",title:"约束 AI 输出",kind:"process",business:"提示词要求先写总览,再逐 section 生成解释。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/RightSidebar.tsx",hunkIndex:0}},{id:"schema",title:"校验导览结构",kind:"process",business:"检查节点、边和锚点字段是否完整。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:0}},{id:"fallback",title:"补齐兼容字段",kind:"process",business:"旧版结果缺字段时生成稳定回退值。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:1}},{id:"store",title:"保存整批导览结构",kind:"process",business:"服务端把 walkthrough 作为一等数据持久化。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:0}},{id:"api",title:"前端读取总览",kind:"api",business:"一次请求拿到 records 和 walkthroughs。",anchor:{repoRoot:e,filePath:"src/lib/terminal/api.ts",hunkIndex:0}},{id:"panel",title:"渲染 DAG 导览",kind:"ui",business:"用节点和边表达实现链路,节点可点击。节点内容可能是一两句话,也可能包含较长的业务解释;布局需要先测量 DOM 高度,再重新计算每一行节点的 y 坐标和连线端点。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/ChangeWalkthroughPanel.tsx",hunkIndex:0}},{id:"jump",title:"跳回真实 diff",kind:"ui",business:"点击节点后定位到文件、hunk 或 section。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/RightSidebar.tsx",hunkIndex:1}},{id:"section",title:"贴近改动展示解释",kind:"ui",business:"section 解释跟在对应 diff 块后面,而不是堆在 hunk 顶部。这个节点也故意写得更长,用来观察右侧分支和下方验证节点的连线是否会避让变高后的卡片。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/DiffViewer.tsx",hunkIndex:0,sectionIndex:1}},{id:"verify",title:"验证导出和注入",kind:"test",business:"跑 lint、install、health、资源检查和注入自测。"}],edges:[{from:"export",to:"prompt",label:"提供输入",desc:"sectionFingerprint 让 AI 可以稳定引用。"},{from:"export",to:"schema",label:"结构校验",desc:"先确认输入可以稳定落库。"},{from:"export",to:"fallback",label:"兼容旧数据",desc:"为历史记录补齐必要字段。"},{from:"prompt",to:"store",label:"注入",desc:"AI payload 写回本地服务。"},{from:"schema",to:"store",label:"通过后保存",desc:"合法结构进入存储层。"},{from:"fallback",to:"store",label:"归一化后保存",desc:"兼容数据与新数据走同一链路。"},{from:"store",to:"api",label:"读取",desc:"浏览器从服务端拿到导览。"},{from:"api",to:"panel",label:"渲染",desc:"结构化数据变成导览图。"},{from:"panel",to:"jump",label:"点击",desc:"节点驱动 diff 定位。"},{from:"jump",to:"section",label:"定位",desc:"落到对应 section 解释。"},{from:"export",to:"verify",label:"验证",desc:"导出结构要覆盖 tracked/untracked。"},{from:"section",to:"verify",label:"回归",desc:"确认展示位置和交互。"}],sections:[],risks:[{title:"边和 label 不能遮住节点主体。"},{title:"窄侧栏下横向滚动要可控。"}],checks:["在 360px、560px、900px 宽度下截图检查。","确认边的箭头、label 背板和节点层级清楚。","确认节点点击区域和 hover 状态可感知。"]};function p(){return t.jsx("div",{className:"min-h-screen bg-background p-5 text-foreground","data-dag-playground":!0,children:t.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[t.jsxs("div",{className:"mb-3",children:[t.jsx("h1",{className:"text-sm font-semibold",children:"DAG Playground"}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Auth-free playground for tuning the real ChangeWalkthroughPanel."})]}),t.jsxs("div",{className:"grid gap-4 lg:grid-cols-[360px_minmax(0,1fr)]",children:[t.jsx("div",{className:"min-w-0",children:t.jsx(s,{walkthroughs:[i],repoRoot:e,onNavigate:o=>{console.info("[DagPlayground] navigate",o)}})}),t.jsx("div",{className:"min-w-0",children:t.jsx(s,{walkthroughs:[i],repoRoot:e,onNavigate:o=>{console.info("[DagPlayground] navigate",o)}})})]})]})})}export{p as DagPlayground};
1
+ import{bH as t}from"./app-DCFOZi_L.js";import{C as s}from"./ChangeWalkthroughPanel-CKIG8diY.js";import"./react-XDCjal2T.js";import"./dnd-BCFAPC0L.js";import"./terminal-C7X98Amf.js";import"./sparkles-CDonlwGu.js";import"./triangle-alert-BgErMO2V.js";const e="/tmp/termdock-dag-playground",i={version:1,id:"dag-playground",repoRoot:e,workspaceRoot:e,title:"改动解释升级为可点击导览",summary:"这是一页免登录 playground,用真实 ChangeWalkthroughPanel 调 DAG 的节点、边、label 和密度。",generatedBy:"dag-playground",injectedAt:Date.now(),highlights:[{what:"先看总览,再看链路",effect:"读者不用先进入 diff,也能理解整批改动目的。",tag:"理解"},{what:"多条链路直接画出来",effect:"分支、汇合、验证路径不再靠 next 文本猜。",tag:"链路"},{what:"点击节点跳回证据",effect:"导览和真实 diff 之间形成闭环。",tag:"导航"}],nodes:[{id:"export",title:"导出 section 级 diff",kind:"source",business:"CLI 把 hunk 拆成多个连续改动 section,并为每个 section 生成稳定 fingerprint。这里故意写长一点,用来验证 DAG 节点是否会按照真实文本高度撑开,而不是被固定高度裁掉。",anchor:{repoRoot:e,filePath:"src/server/cli.ts",hunkIndex:0,sectionIndex:0}},{id:"prompt",title:"约束 AI 输出",kind:"process",business:"提示词要求先写总览,再逐 section 生成解释。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/RightSidebar.tsx",hunkIndex:0}},{id:"schema",title:"校验导览结构",kind:"process",business:"检查节点、边和锚点字段是否完整。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:0}},{id:"fallback",title:"补齐兼容字段",kind:"process",business:"旧版结果缺字段时生成稳定回退值。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:1}},{id:"store",title:"保存整批导览结构",kind:"process",business:"服务端把 walkthrough 作为一等数据持久化。",anchor:{repoRoot:e,filePath:"src/server/utils/changeAuditStore.ts",hunkIndex:0}},{id:"api",title:"前端读取总览",kind:"api",business:"一次请求拿到 records 和 walkthroughs。",anchor:{repoRoot:e,filePath:"src/lib/terminal/api.ts",hunkIndex:0}},{id:"panel",title:"渲染 DAG 导览",kind:"ui",business:"用节点和边表达实现链路,节点可点击。节点内容可能是一两句话,也可能包含较长的业务解释;布局需要先测量 DOM 高度,再重新计算每一行节点的 y 坐标和连线端点。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/ChangeWalkthroughPanel.tsx",hunkIndex:0}},{id:"jump",title:"跳回真实 diff",kind:"ui",business:"点击节点后定位到文件、hunk 或 section。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/RightSidebar.tsx",hunkIndex:1}},{id:"section",title:"贴近改动展示解释",kind:"ui",business:"section 解释跟在对应 diff 块后面,而不是堆在 hunk 顶部。这个节点也故意写得更长,用来观察右侧分支和下方验证节点的连线是否会避让变高后的卡片。",anchor:{repoRoot:e,filePath:"src/lib/components/sidebar/DiffViewer.tsx",hunkIndex:0,sectionIndex:1}},{id:"verify",title:"验证导出和注入",kind:"test",business:"跑 lint、install、health、资源检查和注入自测。"}],edges:[{from:"export",to:"prompt",label:"提供输入",desc:"sectionFingerprint 让 AI 可以稳定引用。"},{from:"export",to:"schema",label:"结构校验",desc:"先确认输入可以稳定落库。"},{from:"export",to:"fallback",label:"兼容旧数据",desc:"为历史记录补齐必要字段。"},{from:"prompt",to:"store",label:"注入",desc:"AI payload 写回本地服务。"},{from:"schema",to:"store",label:"通过后保存",desc:"合法结构进入存储层。"},{from:"fallback",to:"store",label:"归一化后保存",desc:"兼容数据与新数据走同一链路。"},{from:"store",to:"api",label:"读取",desc:"浏览器从服务端拿到导览。"},{from:"api",to:"panel",label:"渲染",desc:"结构化数据变成导览图。"},{from:"panel",to:"jump",label:"点击",desc:"节点驱动 diff 定位。"},{from:"jump",to:"section",label:"定位",desc:"落到对应 section 解释。"},{from:"export",to:"verify",label:"验证",desc:"导出结构要覆盖 tracked/untracked。"},{from:"section",to:"verify",label:"回归",desc:"确认展示位置和交互。"}],sections:[],risks:[{title:"边和 label 不能遮住节点主体。"},{title:"窄侧栏下横向滚动要可控。"}],checks:["在 360px、560px、900px 宽度下截图检查。","确认边的箭头、label 背板和节点层级清楚。","确认节点点击区域和 hover 状态可感知。"]};function p(){return t.jsx("div",{className:"min-h-screen bg-background p-5 text-foreground","data-dag-playground":!0,children:t.jsxs("div",{className:"mx-auto max-w-[72rem]",children:[t.jsxs("div",{className:"mb-3",children:[t.jsx("h1",{className:"text-sm font-semibold",children:"DAG Playground"}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Auth-free playground for tuning the real ChangeWalkthroughPanel."})]}),t.jsxs("div",{className:"grid gap-4 lg:grid-cols-[360px_minmax(0,1fr)]",children:[t.jsx("div",{className:"min-w-0",children:t.jsx(s,{walkthroughs:[i],repoRoot:e,onNavigate:o=>{console.info("[DagPlayground] navigate",o)}})}),t.jsx("div",{className:"min-w-0",children:t.jsx(s,{walkthroughs:[i],repoRoot:e,onNavigate:o=>{console.info("[DagPlayground] navigate",o)}})})]})]})})}export{p as DagPlayground};
@@ -1,4 +1,4 @@
1
- import{by as e}from"./app-CfqF7_nh.js";import{b as a}from"./dnd-BCFAPC0L.js";import{c as M,S as _,D as T}from"./DiffViewer-C-utC5Ga.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./referenceLongPress-BEMsP11a.js";const w=`diff --git a/CommentGap.kt b/CommentGap.kt
1
+ import{bH as e}from"./app-DCFOZi_L.js";import{b as a}from"./dnd-BCFAPC0L.js";import{c as M,S as _,D as T}from"./DiffViewer-RT-p-ZBo.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./referenceLongPress-DBJnfFHa.js";const w=`diff --git a/CommentGap.kt b/CommentGap.kt
2
2
  --- a/CommentGap.kt
3
3
  +++ b/CommentGap.kt
4
4
  @@ -1,4 +1,4 @@
@@ -452,4 +452,4 @@ new file mode 100644
452
452
  +++ b/Second.ts
453
453
  @@ -0,0 +1,2 @@
454
454
  +export const second = true;
455
- +announce(second);`}};function v(){if(typeof window>"u")return"kotlin";const r=new URLSearchParams(window.location.search).get("fixture");return r&&r in p?r:"kotlin"}function k(){return typeof window>"u"?"unified":new URLSearchParams(window.location.search).get("view")==="split"?"split":"unified"}function S(){if(typeof window>"u")return"words";const i=new URLSearchParams(window.location.search).get("inline");return i==="none"||i==="chars"||i==="words"?i:"words"}function y(){return typeof window>"u"?!0:new URLSearchParams(window.location.search).get("wrap")!=="off"}function C(){if(typeof window>"u")return"default";const i=new URLSearchParams(window.location.search).get("whitespace");return i==="ignore"||i==="trim"||i==="ignore-blank-lines"?i:"default"}function H(){const[i,r]=a.useState(()=>v()),[d,c]=a.useState(()=>k()),[m,I]=a.useState(()=>M()),[f,g]=a.useState(()=>S()),[u,h]=a.useState(()=>C()),[l,b]=a.useState(()=>y()),[x,N]=a.useState(null),s=p[i],R=a.useMemo(()=>Object.entries(p),[]),o=d==="split"&&!m?"unified":d;return a.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const t=window.matchMedia(_),n=()=>I(t.matches);return n(),t.addEventListener?.("change",n),()=>t.removeEventListener?.("change",n)},[]),a.useEffect(()=>{if(typeof window>"u")return;let t=window.location.search;const n=()=>{window.location.search!==t&&(t=window.location.search,r(v()),c(k()),g(S()),b(y()),h(C()))};window.addEventListener("popstate",n),window.addEventListener("pageshow",n),window.addEventListener("focus",n);const L=window.setInterval(n,250);return()=>{window.removeEventListener("popstate",n),window.removeEventListener("pageshow",n),window.removeEventListener("focus",n),window.clearInterval(L)}},[]),e.jsx("div",{className:"min-h-screen bg-background-subtle text-foreground","data-diff-lab":!0,"data-diff-lab-fixture":i,"data-diff-lab-view":o,"data-diff-lab-requested-view":d,"data-diff-lab-inline":f,"data-diff-lab-whitespace":u,"data-diff-lab-wrap":l?"on":"off",children:e.jsxs("div",{className:"mx-auto flex min-h-screen max-w-[1180px] flex-col px-4 py-4",children:[e.jsxs("header",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 border-b border-border/20 pb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Diff Lab"}),e.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Fixed fixtures for iterating diff rendering without app auth, PWA state, or live Git data."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("select",{value:i,onChange:t=>r(t.target.value),"aria-label":"Fixture",className:"h-8 rounded-md border border-border/30 bg-surface px-2 text-xs text-foreground outline-none",children:R.map(([t,n])=>e.jsx("option",{value:t,children:n.label},t))}),e.jsxs("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:[e.jsx("button",{type:"button",onClick:()=>c("unified"),"aria-pressed":o==="unified",className:`rounded-full px-3 text-xs font-semibold ${o==="unified"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Unified"}),e.jsx("button",{type:"button",onClick:()=>c("split"),disabled:!m,"aria-pressed":o==="split",className:`rounded-full px-3 text-xs font-semibold ${o==="split"?"bg-surface-elevated text-foreground":"text-muted-foreground"} disabled:cursor-not-allowed disabled:opacity-40`,children:"Split"})]}),e.jsx("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:["none","words","chars"].map(t=>e.jsx("button",{type:"button",onClick:()=>g(t),className:`rounded-full px-3 text-xs font-semibold ${f===t?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:t},t))}),e.jsxs("select",{"aria-label":"Inline whitespace",value:u,onChange:t=>h(t.target.value),className:"h-8 rounded-md bg-surface-2 px-2 text-xs text-foreground",children:[e.jsx("option",{value:"default",children:"Compare whitespace"}),e.jsx("option",{value:"trim",children:"Ignore trailing spaces"}),e.jsx("option",{value:"ignore",children:"Ignore whitespace"})]}),e.jsxs("button",{type:"button",onClick:()=>b(t=>!t),className:`h-8 rounded-full px-3 text-xs font-semibold ${l?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground"}`,children:["Wrap ",l?"on":"off"]})]})]}),e.jsx("main",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border/20 bg-surface",children:e.jsx(T,{onInsertDiffReference:(t,n)=>N({label:t,text:n}),filePath:s.path,repoRoot:"/tmp/termdock-diff-lab",changedFile:{path:s.path,absolutePath:`/tmp/termdock-diff-lab/${s.path}`,repoRoot:"/tmp/termdock-diff-lab",status:"modified",staged:!1,unstaged:!0,untracked:!1,tracked:!0,canStage:!1,canUnstage:!1,canStash:!1,canRestoreWorktree:!1},diffOverride:s.diff,diffOptions:{whitespace:u},oldSourceOverride:s.oldSource,active:!0,wrap:l,embedded:new URLSearchParams(window.location.search).get("embedded")==="1",viewType:o,inlineMode:f})}),e.jsxs("section",{className:"mt-3 rounded-lg border border-border/20 bg-surface p-3",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Inserted reference"}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-foreground","data-diff-lab-inserted-label":!0,children:x?.label??""}),e.jsx("pre",{className:"mt-1 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded border border-border/20 bg-surface-2 p-2 font-mono text-[11px] text-foreground","data-diff-lab-inserted":!0,children:x?.text??""})]})]})})}export{p as DIFF_FIXTURES,H as DiffLab};
455
+ +announce(second);`}};function v(){if(typeof window>"u")return"kotlin";const r=new URLSearchParams(window.location.search).get("fixture");return r&&r in p?r:"kotlin"}function k(){return typeof window>"u"?"unified":new URLSearchParams(window.location.search).get("view")==="split"?"split":"unified"}function S(){if(typeof window>"u")return"words";const i=new URLSearchParams(window.location.search).get("inline");return i==="none"||i==="chars"||i==="words"?i:"words"}function y(){return typeof window>"u"?!0:new URLSearchParams(window.location.search).get("wrap")!=="off"}function C(){if(typeof window>"u")return"default";const i=new URLSearchParams(window.location.search).get("whitespace");return i==="ignore"||i==="trim"||i==="ignore-blank-lines"?i:"default"}function P(){const[i,r]=a.useState(()=>v()),[d,c]=a.useState(()=>k()),[m,I]=a.useState(()=>M()),[f,g]=a.useState(()=>S()),[u,h]=a.useState(()=>C()),[l,b]=a.useState(()=>y()),[x,N]=a.useState(null),s=p[i],R=a.useMemo(()=>Object.entries(p),[]),o=d==="split"&&!m?"unified":d;return a.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const t=window.matchMedia(_),n=()=>I(t.matches);return n(),t.addEventListener?.("change",n),()=>t.removeEventListener?.("change",n)},[]),a.useEffect(()=>{if(typeof window>"u")return;let t=window.location.search;const n=()=>{window.location.search!==t&&(t=window.location.search,r(v()),c(k()),g(S()),b(y()),h(C()))};window.addEventListener("popstate",n),window.addEventListener("pageshow",n),window.addEventListener("focus",n);const L=window.setInterval(n,250);return()=>{window.removeEventListener("popstate",n),window.removeEventListener("pageshow",n),window.removeEventListener("focus",n),window.clearInterval(L)}},[]),e.jsx("div",{className:"min-h-screen bg-background-subtle text-foreground","data-diff-lab":!0,"data-diff-lab-fixture":i,"data-diff-lab-view":o,"data-diff-lab-requested-view":d,"data-diff-lab-inline":f,"data-diff-lab-whitespace":u,"data-diff-lab-wrap":l?"on":"off",children:e.jsxs("div",{className:"mx-auto flex min-h-screen max-w-[1180px] flex-col px-4 py-4",children:[e.jsxs("header",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 border-b border-border/20 pb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Diff Lab"}),e.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Fixed fixtures for iterating diff rendering without app auth, PWA state, or live Git data."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("select",{value:i,onChange:t=>r(t.target.value),"aria-label":"Fixture",className:"h-8 rounded-md border border-border/30 bg-surface px-2 text-xs text-foreground outline-none",children:R.map(([t,n])=>e.jsx("option",{value:t,children:n.label},t))}),e.jsxs("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:[e.jsx("button",{type:"button",onClick:()=>c("unified"),"aria-pressed":o==="unified",className:`rounded-full px-3 text-xs font-semibold ${o==="unified"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Unified"}),e.jsx("button",{type:"button",onClick:()=>c("split"),disabled:!m,"aria-pressed":o==="split",className:`rounded-full px-3 text-xs font-semibold ${o==="split"?"bg-surface-elevated text-foreground":"text-muted-foreground"} disabled:cursor-not-allowed disabled:opacity-40`,children:"Split"})]}),e.jsx("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:["none","words","chars"].map(t=>e.jsx("button",{type:"button",onClick:()=>g(t),className:`rounded-full px-3 text-xs font-semibold ${f===t?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:t},t))}),e.jsxs("select",{"aria-label":"Inline whitespace",value:u,onChange:t=>h(t.target.value),className:"h-8 rounded-md bg-surface-2 px-2 text-xs text-foreground",children:[e.jsx("option",{value:"default",children:"Compare whitespace"}),e.jsx("option",{value:"trim",children:"Ignore trailing spaces"}),e.jsx("option",{value:"ignore",children:"Ignore whitespace"})]}),e.jsxs("button",{type:"button",onClick:()=>b(t=>!t),className:`h-8 rounded-full px-3 text-xs font-semibold ${l?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground"}`,children:["Wrap ",l?"on":"off"]})]})]}),e.jsx("main",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border/20 bg-surface",children:e.jsx(T,{onInsertDiffReference:(t,n)=>N({label:t,text:n}),filePath:s.path,repoRoot:"/tmp/termdock-diff-lab",changedFile:{path:s.path,absolutePath:`/tmp/termdock-diff-lab/${s.path}`,repoRoot:"/tmp/termdock-diff-lab",status:"modified",staged:!1,unstaged:!0,untracked:!1,tracked:!0,canStage:!1,canUnstage:!1,canStash:!1,canRestoreWorktree:!1},diffOverride:s.diff,diffOptions:{whitespace:u},oldSourceOverride:s.oldSource,active:!0,wrap:l,embedded:new URLSearchParams(window.location.search).get("embedded")==="1",viewType:o,inlineMode:f})}),e.jsxs("section",{className:"mt-3 rounded-lg border border-border/20 bg-surface p-3",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Inserted reference"}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-foreground","data-diff-lab-inserted-label":!0,children:x?.label??""}),e.jsx("pre",{className:"mt-1 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded border border-border/20 bg-surface-2 p-2 font-mono text-[11px] text-foreground","data-diff-lab-inserted":!0,children:x?.text??""})]})]})})}export{p as DIFF_FIXTURES,P as DiffLab};
@@ -1 +1 @@
1
- import{ag as Ye,by as r,e as dt,d as ft,da as ht,dp as mt,av as pt,a as xt,dn as gt,bT as vt,X as yt}from"./app-CfqF7_nh.js";import{b as o,r as Je}from"./dnd-BCFAPC0L.js";import{h as Ze,F as bt,b as wt,c as Ke}from"./gestureArbiter-Cczz34oI.js";import{S as et}from"./sparkles-C9ShmGPf.js";import{D as kt,i as Rt}from"./DiffViewer-C-utC5Ga.js";const jt=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Nt=Ye("list-tree",jt);const Mt=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Tt=Ye("list",Mt);function tt({selected:t,depth:n=0,title:c,leading:m,children:h,trailing:i,role:b,tabIndex:x,ariaExpanded:g,onClick:f,onKeyDown:y,onPointerDown:z,onPointerUp:T,onPointerCancel:F,dataAttributes:B}){return r.jsxs("div",{role:b,tabIndex:x,"aria-expanded":g,title:c,onClick:f,onKeyDown:y,onPointerDown:z,onPointerUp:T,onPointerCancel:F,...B,className:`group flex w-full cursor-pointer items-center gap-1 rounded px-2 py-1.5 text-left text-[13px] transition active:scale-[0.99] ${t?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,style:{paddingLeft:`${n*14+8}px`},children:[r.jsx("span",{className:"flex min-w-[14px] shrink-0 items-center justify-center text-muted-foreground/80",children:m}),r.jsx("span",{className:"min-w-0 flex-1",children:h}),i]})}function rt(t){return t.path.replace(/^\/+/,"")}function Dt(t){if(t.displayName!==void 0||t.displayDir!==void 0)return{name:t.displayName||t.path,dir:t.displayDir||""};const n=t.path.split("/").filter(Boolean);return{name:n.pop()||t.path,dir:n.join("/")}}function nt(t,n){const c=new Map,m=(i,b,x,g)=>{const f=i.get(b);if(f)return f;const y={path:x,name:b,childCount:0,directories:[],files:[]};return i.set(b,y),g?.directories.push(y),y};for(const i of t){const b=n(i).split("/").filter(Boolean);if(b.length<=1)continue;let x=c,g=null,f="";for(const y of b.slice(0,-1)){f=f?`${f}/${y}`:y;const z=m(x,y,f,g);g=z,x=new Map(z.directories.map(T=>[T.name,T]))}g?.files.push(i)}const h=i=>{const b=i.directories.map(h).sort((g,f)=>g.name.localeCompare(f.name)),x=i.files.sort((g,f)=>g.path.localeCompare(f.path));return{...i,directories:b,files:x,childCount:b.reduce((g,f)=>g+f.childCount,0)+x.length}};return Array.from(c.values()).map(h).sort((i,b)=>i.name.localeCompare(b.name))}function Pe(t,n,c=0){const m=n.selectedKey===t.key||n.selectedKey===t.path||n.selectedKey===t.absolutePath,h=Dt(t);return r.jsx(tt,{selected:m,role:"button",tabIndex:0,title:t.title??t.absolutePath??t.path,onClick:()=>{Ze()||n.onSelectFile(t)},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),n.onSelectFile(t))},leading:n.renderLeading(t),depth:c,trailing:n.renderTrailing?.(t),dataAttributes:{"data-diff-selection-path":t.key,"data-diff-file-path":t.path,"data-diff-absolute-path":t.absolutePath??"","data-diff-status":t.status},children:r.jsxs("span",{className:"select-text","data-sidebar-selectable":!0,children:[r.jsx("span",{className:`block truncate leading-snug ${m?"font-medium":""}`,children:h.name}),n.mode!=="tree"&&h.dir&&r.jsx("span",{className:"block truncate text-[10px] text-muted-foreground/75",children:h.dir}),n.renderSubtitle?.(t)]})},t.key)}function st(t,n,c,m,h){let i=t;const b=[t.name];for(;i.files.length===0&&i.directories.length===1;)i=i.directories[0],b.push(i.name);const x=b.join("/"),g=`${n}:${i.path}`,f=c.collapsedDirectoryKeys.has(g);return r.jsxs("div",{className:"space-y-px",children:[r.jsx(tt,{role:"button",tabIndex:0,onClick:()=>{Ze()||c.onToggleDirectory(g)},onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),c.onToggleDirectory(g))},ariaExpanded:!f,depth:m,title:i.path,leading:f?r.jsx(dt,{size:13}):r.jsx(ft,{size:13}),trailing:r.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[r.jsx("span",{className:"shrink-0 rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground/60 transition group-hover:text-muted-foreground",children:i.childCount}),c.renderDirectoryTrailing?.(i.path,h)]}),children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[r.jsx(bt,{size:14,className:"shrink-0 text-[color:var(--folder)]"}),r.jsx("span",{className:"min-w-0 flex-1 truncate leading-snug select-text","data-sidebar-selectable":!0,children:x})]})}),!f&&r.jsxs("div",{className:"space-y-px",children:[i.directories.map(y=>st(y,n,c,m+1,h)),i.files.length>0&&r.jsx("div",{className:"space-y-px",children:i.files.map(y=>Pe(y,c,m+1))})]})]},g)}function St(t,n){const c=n.getFileTreePath??rt,m=t.files.filter(i=>c(i).split("/").filter(Boolean).length<=1),h=nt(t.files,c);return r.jsxs("div",{className:"space-y-px",children:[h.map(i=>st(i,t.key,n,0,t)),m.length>0&&r.jsx("div",{className:"space-y-px",children:m.map(i=>Pe(i,n))})]})}function It(t,n=rt){const c=[],m=i=>{for(const b of i.directories)m(b);c.push(...i.files)};for(const i of nt(t,n))m(i);const h=new Set(c.map(i=>i.key));return c.push(...t.filter(i=>!h.has(i.key))),c}function Et(t){return r.jsx("div",{className:t.mode==="tree"?"space-y-px pt-1":"space-y-2",children:t.groups.map(n=>{const c=!!n.header,m=!!n.collapsed;return r.jsxs("section",{className:c?"overflow-hidden rounded-lg border border-border/15 bg-surface/60":"",children:[n.header,!m&&r.jsx("div",{className:t.mode==="tree"?c?"space-y-px bg-surface/60 p-1":"space-y-px":c?"space-y-px bg-surface/60 p-1.5":"space-y-px",children:t.mode==="tree"?St(n,t):n.files.map(h=>Pe(h,t))})]},n.key)})})}const Ce="termdock:diff-review:list-width:v1",Ct=120,He=320,qe=220,Ft=560;function _t(t){return typeof t=="number"&&Number.isFinite(t)}function Ue(t,n){const c=Math.max(qe,n-360),m=Math.min(Ft,c);return Math.min(m,Math.max(qe,t))}function At(){return vt(Ce,_t)??He}function zt({list:t,detail:n,mobile:c,mobileListHeader:m,mobileDetailHeader:h,desktopListHeader:i,backLabel:b,onMobileSlideChange:x,externalSwiperRef:g,desktopLayout:f="split",onDetailScroll:y,desktopSidePanel:z,desktopListClassName:T,detailOwnsScroll:F=!1}){const{t:B}=ht(),P=o.useRef(null),q=o.useRef(null),I=o.useRef(null),[U,$]=o.useState(At);o.useEffect(()=>{if(c||f!=="split")return;const p=q.current;p&&$(j=>Ue(j,p.clientWidth))},[f,c]);const ae=o.useCallback(p=>{c||f!=="split"||(p.preventDefault(),I.current={startX:p.clientX,startWidth:U,pointerId:p.pointerId},p.currentTarget.setPointerCapture(p.pointerId))},[f,U,c]),ue=o.useCallback(p=>{const j=I.current;if(!j||j.pointerId!==p.pointerId)return;const D=q.current?.clientWidth??window.innerWidth,_=Ue(j.startWidth+p.clientX-j.startX,D);$(_),mt(Ce,_,Ct)},[]),ie=o.useCallback(p=>{const j=I.current;if(!(!j||j.pointerId!==p.pointerId)){I.current=null,pt(Ce);try{p.currentTarget.releasePointerCapture(p.pointerId)}catch{}}},[]);if(c){const p=()=>{const v=P.current;v&&v.slideTo(1)},j=()=>{const v=P.current;v&&v.slideTo(0)},D=typeof t=="function"?t({slideToDetail:p}):t,_=typeof h=="function"?h({slideToList:j,slideToDetail:p}):h;return r.jsxs(wt,{className:"h-full min-h-0 w-full",slidesPerView:1,resistanceRatio:.45,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:".swiper-no-swiping",allowTouchMove:!1,touchAngle:75,touchStartPreventDefault:!1,onSwiper:v=>{P.current=v,g&&(g.current=v)},onSlideChange:v=>{x?.(v.activeIndex)},children:[r.jsx(Ke,{className:"h-full min-h-0",children:r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[m&&r.jsx("div",{className:"shrink-0 border-b border-border/15 px-3 py-2",children:m}),r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:D})]})}),r.jsx(Ke,{className:"h-full min-h-0",children:r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[r.jsx("div",{className:"shrink-0 border-b border-border/15 px-3 py-2",children:_??r.jsxs("button",{type:"button",onClick:j,className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-surface-2 px-3 text-xs font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:[r.jsx(xt,{size:14}),b]})}),r.jsx("div",{className:F?"min-h-0 flex-1 overflow-hidden":"termdock-diff-stream-scroller min-h-0 flex-1 overflow-y-auto overscroll-contain",onScroll:F?void 0:v=>y?.(v.currentTarget),children:n})]})})]})}const W=typeof t=="function"?t({slideToDetail:()=>{}}):t;return f==="stacked"?F?r.jsxs("div",{className:"termdock-native-select min-h-0 flex-1 overflow-hidden px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W,r.jsx("div",{className:"mt-3 h-[calc(100%-3rem)] min-h-0 overflow-hidden rounded-xl border border-border/15 bg-surface",children:n})]}):r.jsxs("div",{className:"termdock-native-select termdock-diff-stream-scroller min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",onScroll:p=>y?.(p.currentTarget),children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W,r.jsx("div",{className:"mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface",children:n})]}):r.jsxs("div",{ref:q,className:"flex h-full min-h-0 overflow-hidden",children:[z,r.jsxs("div",{className:T??"shrink-0 overflow-y-auto overscroll-contain border-r border-border/15 bg-surface",style:{width:U},children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W]}),r.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":B("diffViewer.resizeNavigation"),title:B("diffViewer.resizeNavigation"),className:"group relative z-10 w-2 shrink-0 cursor-col-resize touch-none border-r border-border/15 bg-surface",onPointerDown:ae,onPointerMove:ue,onPointerUp:ie,onPointerCancel:ie,onDoubleClick:()=>{$(He),gt(Ce,He)},children:r.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border/30 transition group-hover:bg-primary/60"})}),r.jsx("div",{className:F?"min-w-0 flex-1 overflow-hidden":"termdock-diff-stream-scroller min-w-0 flex-1 overflow-y-auto overscroll-contain",onScroll:F?void 0:p=>y?.(p.currentTarget),children:n})]})}function Lt({mode:t,onModeChange:n,showAi:c=!1}){return r.jsxs("div",{className:"inline-flex h-7 shrink-0 overflow-hidden rounded-md bg-surface-2 p-0.5",children:[r.jsx("button",{type:"button",onClick:()=>n("list"),"aria-pressed":t==="list",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="list"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(Tt,{size:13})}),r.jsx("button",{type:"button",onClick:()=>n("tree"),"aria-pressed":t==="tree",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="tree"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(Nt,{size:13})}),c&&r.jsx("button",{type:"button",onClick:()=>n("ai"),"aria-pressed":t==="ai",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="ai"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(et,{size:13})})]})}function Ht({groups:t,mode:n,onModeChange:c,selectedKey:m,collapsedDirectoryKeys:h,onToggleDirectory:i,onSelectFile:b,renderLeading:x,renderTrailing:g,renderDirectoryTrailing:f,renderSubtitle:y,detail:z,mobile:T,backLabel:F,compact:B=!1,emptyContent:P,listPrefix:q,aiContent:I,listContainerClassName:U="px-2 py-2",detailContainerClassName:$="termdock-native-select termdock-diff-stream-scroller min-h-0",renderListHeader:ae,renderMobileDetailHeader:ue,externalSwiperRef:ie,onMobileSlideChange:W,slideToDetailOnMobile:p=!0,desktopLayout:j="split",onDetailScroll:D,desktopSidePanel:_,desktopListClassName:v,detailOwnsScroll:ee}){const[V,O]=o.useState(!1);o.useEffect(()=>{if(!V)return;const A=L=>{L.key==="Escape"&&O(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[V]);const de=r.jsx(Lt,{mode:n,onModeChange:c,showAi:!!I}),pe=n==="tree"?"tree":"list",xe=ae?ae(de):r.jsx("div",{className:"flex justify-end",children:de}),ge=t.some(A=>A.files.length>0),te=r.jsx(zt,{mobile:V?!1:T,backLabel:F,externalSwiperRef:ie,onMobileSlideChange:W,desktopLayout:V?"split":j,onDetailScroll:D,desktopSidePanel:_,desktopListClassName:v,detailOwnsScroll:ee,mobileListHeader:T?xe:void 0,desktopListHeader:T?void 0:xe,mobileDetailHeader:ue,list:({slideToDetail:A})=>r.jsx("div",{className:U,children:n==="ai"?typeof I=="function"?I({slideToDetail:A,fullscreen:V,toggleFullscreen:()=>O(L=>!L)}):I??P:r.jsxs(r.Fragment,{children:[q,ge?r.jsx(Et,{groups:t,selectedKey:m,mode:pe,mobile:T,compact:B,collapsedDirectoryKeys:h,onToggleDirectory:i,onSelectFile:L=>{b(L),T&&p&&window.requestAnimationFrame(A)},renderLeading:x,renderTrailing:g,renderDirectoryTrailing:f,renderSubtitle:y}):P]})}),detail:r.jsx("div",{className:ee?"h-full min-h-0":$,children:z})});return!V||typeof document>"u"?te:Je.createPortal(r.jsxs("div",{className:"fixed inset-0 z-modal-panel flex min-h-0 flex-col bg-surface text-foreground",children:[r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(et,{size:15,className:"shrink-0 text-primary"}),r.jsx("span",{className:"truncate text-[12px] font-semibold",children:"DAG Review"}),r.jsx("span",{className:"hidden text-[10px] text-muted-foreground sm:inline",children:"Select a step to inspect its exact change"})]}),r.jsx("button",{type:"button",onClick:()=>O(!1),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground active:scale-95",title:"Exit full-screen DAG review (Esc)","aria-label":"Exit full-screen DAG review",children:r.jsx(yt,{size:16})})]}),r.jsx("div",{className:"min-h-0 flex-1",children:te})]}),document.body)}const Pt=96,ze=44;function Wt({file:t,repoRoot:n,selectionPath:c,displayName:m,displayDir:h,selected:i,activePane:b,visible:x,reusableContent:g=!1,estimatedHeight:f,lightweight:y=!1,wrap:z,viewType:T,inlineMode:F,diffOptions:B,reloadKey:P=0,auditRecords:q,diffOverride:I,oldSourceRef:U,preparedDiff:$,renderBadge:ae,onInsertDiffReference:ue,onHunkGitAction:ie,previewReverts:W,onReferenceCopied:p,insertedReferenceKey:j,copiedReferenceKey:D,onClearAuditRecord:_,onContentReady:v,onHeightChange:ee}){const V=o.useRef(null),O=o.useRef(null),de=o.useRef(null),[pe,xe]=o.useState(null),ge=o.useRef(64),te=o.useRef(f??104),A=o.useRef(null),L=o.useRef(null),Q=o.useRef(!1),le=o.useRef(!1),E=o.useRef(null),[re,je]=o.useState(!1),[Ne,Se]=o.useState(!1),ve=t.absolutePath||(n?`${n}/${t.path}`:t.path),N=o.useCallback(()=>{le.current||(le.current=!0,Se(!0),v?.(c))},[v,c]);o.useLayoutEffect(()=>{if(!(I!==void 0&&x&&le.current))return Q.current=!1,le.current=!1,A.current=null,L.current=null,E.current!==null&&(window.clearTimeout(E.current),E.current=null),je(!1),Se(!1),()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)}},[I,$,P,g,x]),o.useLayoutEffect(()=>{const X=A.current;!re||X===null||Math.abs((f??104)-X)>=1||(A.current=null,N())},[N,f,re]),o.useLayoutEffect(()=>{if(!x||!re)return;const X=de.current;if(!X)return;const ye=()=>{if(!Q.current)return;const Y=X.firstElementChild;if(!Y)return;const K=Math.ceil(Math.max(Y.getBoundingClientRect().height,Y.scrollHeight,64)),he=ge.current;if(K>0&&he!==K&&(ge.current=K,xe(K)),!V.current)return;const C=O.current?.getBoundingClientRect().height??ze,se=Math.ceil(C+K+1);se<=0||L.current===se||(L.current=se,E.current!==null&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{if(E.current=null,!Q.current)return;const H=L.current;if(H===null)return;const S=te.current;if(le.current){te.current=H,Math.abs(S-H)>=1&&ee?.(c,S,H),v?.(c);return}if(A.current=H,Math.abs(S-H)<1||!ee){te.current=H,A.current=null,N();return}te.current=H,ee(c,S,H)},Pt))};if(ye(),typeof ResizeObserver>"u")return;const fe=new ResizeObserver(ye);return fe.observe(X),X.firstElementChild&&fe.observe(X.firstElementChild),O.current&&fe.observe(O.current),()=>fe.disconnect()},[N,v,ee,c,re,x,z,T,F]);const G=x&&!Ne;return r.jsxs("div",{ref:V,"data-diff-stream-item":c,"data-diff-selection-path":c,"data-diff-file-path":t.path,"data-diff-absolute-path":ve,className:`scroll-mt-3 border-b border-border/15 last:border-b-0 ${G||!x?"overflow-hidden":""} ${i?"bg-surface-elevated/35":""}`,style:x?G?{height:f??104}:void 0:{height:f??104},children:[r.jsxs("div",{ref:O,"data-diff-stream-header":!0,className:`sticky top-0 z-10 flex min-w-0 items-center gap-2 border-b border-border/15 px-3 py-2 ${i?"bg-surface-elevated":"bg-surface"}`,children:[ae(t.status),r.jsxs("div",{className:"min-w-0 flex-1",title:ve,children:[r.jsx("div",{className:"truncate text-xs font-semibold text-foreground",children:m}),h&&r.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:h})]})]}),r.jsxs("div",{ref:de,className:"relative","data-diff-stream-body":!0,style:x?{minHeight:Ne?64:Math.max(pe??64,(f??104)-ze)}:{height:Math.max(pe??64,(f??104)-ze)},children:[x?r.jsx(kt,{active:b,repoRoot:n,filePath:t.path,referenceFilePath:ve,changedFile:t,wrap:z,viewType:T,inlineMode:F,diffOptions:B,reloadKey:P,embedded:!0,lightweight:y,auditRecords:q,diffOverride:I,oldSourceRef:U,preparedDiff:$,onClearAuditRecord:_,onContentReady:()=>{if(g){Q.current=!0,je(!0),N();return}Q.current||(Q.current=!0,je(!0))},onInsertDiffReference:ue,onHunkGitAction:ie,previewReverts:W,onReferenceCopied:p,insertedReferenceKey:j,copiedReferenceKey:D}):r.jsx("div",{className:"flex h-full min-h-16 items-center justify-center bg-surface px-3 py-4 text-center text-xs text-muted-foreground",children:t.path}),x&&re&&!Ne&&r.jsx("div",{"data-diff-measuring-overlay":!0,className:"absolute inset-0 z-20 bg-surface"})]})]})}const Oe=8,Le=1600,Qe=104,Bt=1e3,Re=new Map;function $t(t,n){for(Re.delete(t),Re.set(t,n);Re.size>Bt;){const c=Re.keys().next().value;if(c===void 0)break;Re.delete(c)}}function Vt(t,n){return!!(t&&t.diffOverride===n.diffOverride&&t.oldSourceRef===n.oldSourceRef&&t.reloadKey===n.reloadKey&&t.wrap===n.wrap&&t.viewType===n.viewType&&t.inlineMode===n.inlineMode&&t.algorithm===n.algorithm&&t.whitespace===n.whitespace&&t.context===n.context)}const Gt={added:{label:"A",className:"text-[color:var(--diff-insert-strong)]",title:"Added"},modified:{label:"M",className:"text-[color:var(--diff-hunk-accent)]",title:"Modified"},deleted:{label:"D",className:"text-[color:var(--diff-delete-strong)]",title:"Deleted"},renamed:{label:"R",className:"text-muted-foreground",title:"Renamed"},copied:{label:"C",className:"text-[color:var(--diff-insert-strong)]",title:"Copied"},untracked:{label:"U",className:"text-[color:var(--diff-insert-strong)]",title:"Untracked (new file)"},conflicted:{label:"!",className:"text-destructive",title:"Conflicted"},unknown:{label:"?",className:"text-muted-foreground",title:"Unknown"}};function Zt({status:t}){const n=Gt[t]??{label:"?",className:"text-muted-foreground",title:t};return r.jsx("span",{className:`w-4 shrink-0 text-center text-[10px] font-mono font-bold ${n.className}`,title:n.title,children:n.label})}function er(t,n){return n?{key:n,nonce:t.nonce+1}:t}function tr({files:t,groups:n,selectedKey:c,onSelectFile:m,mode:h,onModeChange:i,collapsedDirectoryKeys:b,onToggleDirectory:x,renderLeading:g,renderTrailing:f,renderDirectoryTrailing:y,renderSubtitle:z,renderStreamBadge:T,onInsertDiffReference:F,onHunkGitAction:B,onReferenceCopied:P,insertedReferenceKey:q,copiedReferenceKey:I,onClearAuditRecord:U,mobile:$,backLabel:ae,compact:ue,desktopLayout:ie,wrap:W,diffViewType:p,inlineMode:j,diffOptions:D,activePane:_,reloadKey:v=0,renderListHeader:ee,renderMobileDetailHeader:V,emptyContent:O,listPrefix:de,aiContent:pe,listContainerClassName:xe,detailContainerClassName:ge,desktopSidePanel:te,desktopListClassName:A,onDetailScroll:L,initialDetailScrollTop:Q,preserveScrollOnUpdate:le=!1,scrollToKey:E,scrollToKeyNonce:re=0,externalSwiperRef:je,onMobileSlideChange:Ne,slideToDetailOnMobile:Se}){const ve=o.useMemo(()=>e=>c===e.key||c===e.path||c===e.absolutePath,[c]),N=o.useMemo(()=>{const e=new Map;for(const a of t)e.set(a.key,a),a.path&&e.set(a.path,a),a.absolutePath&&e.set(a.absolutePath,a);const s=[],l=new Set;for(const a of n){const d=h==="tree"?It(a.files):a.files;for(const w of d){const u=e.get(w.key);!u||l.has(u.key)||(s.push(u),l.add(u.key))}}for(const a of t)l.has(a.key)||s.push(a);return s},[t,n,h]),G=o.useRef(null),X=o.useRef(null),ye=o.useRef(null),fe=o.useRef(v),Y=o.useRef(0),K=o.useRef(null),he=o.useRef(new Map(Re)),ne=o.useRef({key:null,top:0}),C=o.useRef(new Set),se=o.useRef(new Map),H=o.useRef(new Map),S=o.useRef(null),We=o.useRef(()=>{}),Me=o.useRef([]),me=o.useRef(new Map),Be=o.useRef({tops:[],heights:[],bottom:0}),[Ie,ot]=o.useState(()=>new Set),[ct,at]=o.useState(0),[J,be]=o.useState({top:0,height:0}),Te=o.useMemo(()=>N.map(e=>e.key),[N]),Ee=Te.join("");H.current=o.useMemo(()=>new Map(N.map(e=>[e.key,{diffOverride:e.diffOverride,oldSourceRef:e.oldSourceRef,reloadKey:v,wrap:W,viewType:p,inlineMode:j,algorithm:D?.algorithm,whitespace:D?.whitespace,context:D?.context}])),[N,v,W,p,j,D?.algorithm,D?.whitespace,D?.context]),Me.current=Te,me.current=o.useMemo(()=>new Map(Te.map((e,s)=>[e,s])),[Te]);const k=o.useMemo(()=>{const e=Te.map(a=>he.current.get(a)??Qe),s=new Array(e.length);for(let a=0;a<e.length;a+=1)s[a]=a===0?0:s[a-1]+e[a-1];const l=e.length>0?s[e.length-1]+e[e.length-1]:0;return{tops:s,heights:e,bottom:l}},[ct,Ee]);Be.current=k;const oe=o.useMemo(()=>E?N.find(e=>E===e.key||E===e.path||E===e.absolutePath)?.key??null:null,[N,E]),Fe=o.useMemo(()=>c?N.find(e=>c===e.key||c===e.path||c===e.absolutePath)?.key??null:null,[N,c]),De=o.useMemo(()=>{const e=k.tops.length;if(e===0)return-1;let s=0,l=e;for(;s<l;){const a=Math.floor((s+l)/2);k.tops[a]<=J.top+1?s=a+1:l=a}return Math.min(e-1,Math.max(0,s-1))},[k.tops,J.top]),ce=o.useCallback(e=>{C.current=e,ot(e)},[]),$e=o.useMemo(()=>{const e=J.top-Le,s=J.top+J.height+Le,l=new Set;let a=0,d=k.tops.length;for(;a<d;){const u=Math.floor((a+d)/2);k.tops[u]<=e?a=u+1:d=u}const w=Math.max(0,a-1);for(let u=w;u<k.tops.length;u+=1){const R=k.tops[u];if(R>s)break;R+k.heights[u]>=e&&R<=s&&l.add(u)}for(let u=De-1;u<=De+1;u+=1)u>=0&&u<k.tops.length&&l.add(u);for(const u of Ie){const R=me.current.get(u);R!==void 0&&l.add(R)}return Array.from(l).sort((u,R)=>u-R)},[k,J,Ie,De]),_e=o.useCallback(()=>{if(!_||S.current)return;const e=Me.current;if(e.length===0)return;const s=ne.current.key,l=Math.min(e.length-1,(s!==null?me.current.get(s):void 0)??Math.max(0,De)),a=u=>Math.abs((me.current.get(u)??0)-l),d=[];C.current.has(e[l])||d.push(e[l]);for(let u=1;u<=Oe;u+=1){const R=l+u,M=l-u;R<e.length&&!C.current.has(e[R])&&d.push(e[R]),M>=0&&!C.current.has(e[M])&&d.push(e[M])}const w=d[0];if(w){if(C.current.size>=Oe){const u=a(w),R=Array.from(C.current).filter(Z=>Z!==S.current).sort((Z,ke)=>a(ke)-a(Z))[0];if(!R||a(R)<=u)return;const M=new Set(C.current);M.delete(R),ce(M)}S.current=w,ce(new Set(C.current).add(w))}},[_,ce,De]);We.current=_e;const we=o.useCallback(e=>{if(C.current.has(e))return;const s=S.current;if(s&&s!==e){const l=new Set(C.current);l.delete(s),ce(l),S.current=null}S.current=e,ce(new Set(C.current).add(e))},[ce]),Ve=o.useCallback(e=>{if(!C.current.has(e))return;const s=H.current.get(e);s&&se.current.set(e,s),S.current===e&&(S.current=null),window.requestAnimationFrame(()=>We.current())},[]),Ge=o.useCallback((e,s,l)=>{if(Math.abs(l-s)<1)return;const a=he.current.get(e);a!==void 0&&Math.abs(a-l)<1||(he.current.set(e,l),$t(e,l),at(d=>d+1))},[]);o.useLayoutEffect(()=>{if(fe.current!==v){fe.current=v;for(const e of N){if(e.diffOverride!==void 0)continue;const s=qt(e.path,e.repoRoot);Rt(s,e.repoRoot??void 0,D)}}},[N,D,v]),o.useLayoutEffect(()=>{const e=G.current;if(!e)return;const s=()=>{const a=Math.max(0,Math.ceil(e.clientHeight));if(a===0)return;const d=e.scrollTop;be(w=>w.height===a&&w.top===d?w:{top:d,height:a})};if(s(),typeof ResizeObserver>"u")return;const l=new ResizeObserver(s);return l.observe(e),()=>l.disconnect()},[$]),o.useEffect(()=>{_&&Fe&&we(Fe)},[_,we,Fe]),o.useEffect(()=>{const e=new Set(Me.current);for(const s of Array.from(he.current.keys()))e.has(s)||he.current.delete(s);for(const s of Array.from(C.current))if(!e.has(s)){const l=new Set(C.current);l.delete(s),ce(l)}for(const s of Array.from(se.current.keys()))e.has(s)||se.current.delete(s);if(S.current&&!e.has(S.current)&&(S.current=null),N.length===0){S.current=null,se.current.clear(),ce(new Set);return}_e()},[N.length,Ee,_e,$e,ce]);const Xe=o.useCallback(e=>{G.current=e;const s=Y.current,l=e.scrollTop;Y.current=l;const a=d=>{const w=Be.current,u=Me.current;let R=0,M=w.tops.length;for(;R<M;){const Ae=Math.floor((R+M)/2);w.tops[Ae]<=d+1?R=Ae+1:M=Ae}const Z=Math.min(u.length-1,Math.max(0,R-1)),ke=u[Z]??null;ne.current={key:ke,top:w.tops[Z]??0},ke&&we(ke)};Math.abs(l-s)>=Le?(Je.flushSync(()=>{be({top:l,height:e.clientHeight})}),a(l)):K.current===null&&(K.current=window.requestAnimationFrame(()=>{K.current=null;const d=G.current;if(d){const w=d.scrollTop;be({top:w,height:d.clientHeight}),a(w)}})),L?.(e)},[L,we]);o.useEffect(()=>()=>{K.current!==null&&window.cancelAnimationFrame(K.current)},[]),o.useLayoutEffect(()=>{const e=G.current;if(!e)return;const s=ne.current;if(s.key===null)return;const l=me.current.get(s.key);if(l===void 0)return;const a=(k.tops[l]??s.top)-s.top;if(Math.abs(a)<1)return;const d=e.scrollTop+a;Y.current=d,be(w=>({top:d,height:w.height})),typeof e.scrollTo=="function"?e.scrollTo({top:d,behavior:"instant"}):e.scrollTop=d},[k]),o.useLayoutEffect(()=>{const e=Me.current,s=k.tops;if(e.length===0){ne.current={key:null,top:0};return}const l=Y.current,a=l+(G.current?.clientHeight??J.height),d=ne.current;if(d.key!==null){const M=me.current.get(d.key);if(M!==void 0){const Z=s[M]??0;if(Z+(k.heights[M]??Qe)>l&&Z<a){ne.current={key:d.key,top:Z};return}}}let w=0,u=s.length;for(;w<u;){const M=Math.floor((w+u)/2);s[M]<=l+1?w=M+1:u=M}const R=Math.min(s.length-1,Math.max(0,w-1));ne.current={key:e[R]??null,top:s[R]??0}}),o.useLayoutEffect(()=>{if(!oe)return;const e=X.current;if(e?.key===oe&&e.nonce===re)return;const s=me.current.get(oe);if(s===void 0)return;we(oe),ne.current={key:oe,top:k.tops[s]??0};const l=G.current;if(!l||l.clientHeight===0||J.height!==l.clientHeight)return;X.current={key:oe,nonce:re};const a=k.tops[s]??0;typeof l.scrollTo=="function"?l.scrollTo({top:a,behavior:"instant"}):l.scrollTop=a;const d=l.scrollTop;Y.current=d,be({top:d,height:l.clientHeight})},[k,J.height,we,oe,re]),o.useLayoutEffect(()=>{if(Q===void 0||oe)return;const e=Ee;if(ye.current===e||le&&ye.current!==null)return;const s=G.current;if(!s)return;ye.current=e;const l=Math.max(0,k.bottom-s.clientHeight),a=Math.min(Math.max(0,Q),l);typeof s.scrollTo=="function"?s.scrollTo({top:a,behavior:"instant"}):s.scrollTop=a;const d=s.scrollTop;Y.current=d,be({top:d,height:s.clientHeight})},[k.bottom,Q,Ee,le,oe]);const it=o.useCallback((e,s)=>{const l=ve(e),a=H.current.get(e.key),d=a!==void 0&&Vt(se.current.get(e.key),a);return r.jsx(Xt,{item:e,repoRoot:e.repoRoot,selectionPath:e.key,displayName:e.displayName,displayDir:e.displayDir,selected:l,activePane:_,visible:Ie.has(e.key),reusableContent:d,estimatedHeight:s,lightweight:!1,wrap:W,viewType:p,inlineMode:j,diffOptions:D,reloadKey:v,auditRecords:e.auditRecords,diffOverride:e.diffOverride,oldSourceRef:e.oldSourceRef,renderStreamBadge:T,onInsertDiffReference:e.onInsertDiffReference??F,onHunkGitAction:e.onHunkGitAction??B,previewReverts:e.previewReverts,onReferenceCopied:P,insertedReferenceKey:q,copiedReferenceKey:I,onClearAuditRecord:U,onContentReady:Ve,onHeightChange:Ge})},[_,I,D,p,Ve,Ge,j,q,ve,Ie,U,B,F,P,v,T,W]),lt=r.jsx("div",{"data-diff-stream-content":!0,"data-diff-stream-canvas":!0,className:"termdock-diff-stream relative overflow-clip bg-surface will-change-transform",style:{height:Math.max(k.bottom,(k.tops.at(-1)??0)+J.height)},children:$e.map(e=>{const s=N[e];return s?r.jsx("div",{"data-diff-canvas-slot":s.key,className:"absolute inset-x-0",style:{top:k.tops[e]},children:it(s,k.heights[e])},s.key):null})}),ut=r.jsx("div",{ref:G,className:"termdock-diff-stream termdock-diff-stream-scroller h-full max-h-full min-h-0 overflow-y-auto overscroll-contain bg-surface [overflow-anchor:none]",onScroll:e=>Xe(e.currentTarget),children:lt});return r.jsx(Ht,{groups:n,mode:h,onModeChange:i,selectedKey:c,collapsedDirectoryKeys:b,onToggleDirectory:x,onSelectFile:m,renderLeading:g,renderTrailing:f,renderDirectoryTrailing:y,renderSubtitle:z,detail:ut,mobile:$,backLabel:ae,compact:ue,emptyContent:O,listPrefix:de,aiContent:pe,listContainerClassName:xe,detailContainerClassName:ge,renderListHeader:ee,renderMobileDetailHeader:V,externalSwiperRef:je,onMobileSlideChange:Ne,slideToDetailOnMobile:Se,desktopLayout:ie,onDetailScroll:Xe,desktopSidePanel:te,desktopListClassName:A,detailOwnsScroll:!0})}const Xt=o.memo(function({item:n,renderStreamBadge:c,...m}){return r.jsx(Wt,{...m,file:Kt(n),renderBadge:h=>c(h,n)})});function Kt(t){return{path:t.path,oldPath:t.oldPath,absolutePath:t.absolutePath,status:t.status}}function qt(t,n){if(t)return n&&t.startsWith(`${n}/`)?t.slice(n.length+1):t}export{Zt as C,tr as D,Nt as L,It as f,er as n};
1
+ import{ai as Ye,bH as r,f as dt,e as ft,dr as ht,dF as mt,az as pt,a as xt,dE as gt,c1 as vt,X as yt}from"./app-DCFOZi_L.js";import{b as o,r as Je}from"./dnd-BCFAPC0L.js";import{h as Ze,F as bt,b as wt,c as Ke}from"./gestureArbiter-B26W6rS7.js";import{S as et}from"./sparkles-CDonlwGu.js";import{D as kt,i as Rt}from"./DiffViewer-RT-p-ZBo.js";const jt=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Nt=Ye("list-tree",jt);const Mt=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Tt=Ye("list",Mt);function tt({selected:t,depth:n=0,title:c,leading:m,children:h,trailing:i,role:b,tabIndex:x,ariaExpanded:g,onClick:f,onKeyDown:y,onPointerDown:z,onPointerUp:T,onPointerCancel:F,dataAttributes:B}){return r.jsxs("div",{role:b,tabIndex:x,"aria-expanded":g,title:c,onClick:f,onKeyDown:y,onPointerDown:z,onPointerUp:T,onPointerCancel:F,...B,className:`group flex w-full cursor-pointer items-center gap-1 rounded px-2 py-1.5 text-left text-[13px] transition active:scale-[0.99] ${t?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,style:{paddingLeft:`${n*14+8}px`},children:[r.jsx("span",{className:"flex min-w-[14px] shrink-0 items-center justify-center text-muted-foreground/80",children:m}),r.jsx("span",{className:"min-w-0 flex-1",children:h}),i]})}function rt(t){return t.path.replace(/^\/+/,"")}function Dt(t){if(t.displayName!==void 0||t.displayDir!==void 0)return{name:t.displayName||t.path,dir:t.displayDir||""};const n=t.path.split("/").filter(Boolean);return{name:n.pop()||t.path,dir:n.join("/")}}function nt(t,n){const c=new Map,m=(i,b,x,g)=>{const f=i.get(b);if(f)return f;const y={path:x,name:b,childCount:0,directories:[],files:[]};return i.set(b,y),g?.directories.push(y),y};for(const i of t){const b=n(i).split("/").filter(Boolean);if(b.length<=1)continue;let x=c,g=null,f="";for(const y of b.slice(0,-1)){f=f?`${f}/${y}`:y;const z=m(x,y,f,g);g=z,x=new Map(z.directories.map(T=>[T.name,T]))}g?.files.push(i)}const h=i=>{const b=i.directories.map(h).sort((g,f)=>g.name.localeCompare(f.name)),x=i.files.sort((g,f)=>g.path.localeCompare(f.path));return{...i,directories:b,files:x,childCount:b.reduce((g,f)=>g+f.childCount,0)+x.length}};return Array.from(c.values()).map(h).sort((i,b)=>i.name.localeCompare(b.name))}function Pe(t,n,c=0){const m=n.selectedKey===t.key||n.selectedKey===t.path||n.selectedKey===t.absolutePath,h=Dt(t);return r.jsx(tt,{selected:m,role:"button",tabIndex:0,title:t.title??t.absolutePath??t.path,onClick:()=>{Ze()||n.onSelectFile(t)},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),n.onSelectFile(t))},leading:n.renderLeading(t),depth:c,trailing:n.renderTrailing?.(t),dataAttributes:{"data-diff-selection-path":t.key,"data-diff-file-path":t.path,"data-diff-absolute-path":t.absolutePath??"","data-diff-status":t.status},children:r.jsxs("span",{className:"select-text","data-sidebar-selectable":!0,children:[r.jsx("span",{className:`block truncate leading-snug ${m?"font-medium":""}`,children:h.name}),n.mode!=="tree"&&h.dir&&r.jsx("span",{className:"block truncate text-[10px] text-muted-foreground/75",children:h.dir}),n.renderSubtitle?.(t)]})},t.key)}function st(t,n,c,m,h){let i=t;const b=[t.name];for(;i.files.length===0&&i.directories.length===1;)i=i.directories[0],b.push(i.name);const x=b.join("/"),g=`${n}:${i.path}`,f=c.collapsedDirectoryKeys.has(g);return r.jsxs("div",{className:"space-y-px",children:[r.jsx(tt,{role:"button",tabIndex:0,onClick:()=>{Ze()||c.onToggleDirectory(g)},onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),c.onToggleDirectory(g))},ariaExpanded:!f,depth:m,title:i.path,leading:f?r.jsx(dt,{size:13}):r.jsx(ft,{size:13}),trailing:r.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[r.jsx("span",{className:"shrink-0 rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground/60 transition group-hover:text-muted-foreground",children:i.childCount}),c.renderDirectoryTrailing?.(i.path,h)]}),children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[r.jsx(bt,{size:14,className:"shrink-0 text-[color:var(--folder)]"}),r.jsx("span",{className:"min-w-0 flex-1 truncate leading-snug select-text","data-sidebar-selectable":!0,children:x})]})}),!f&&r.jsxs("div",{className:"space-y-px",children:[i.directories.map(y=>st(y,n,c,m+1,h)),i.files.length>0&&r.jsx("div",{className:"space-y-px",children:i.files.map(y=>Pe(y,c,m+1))})]})]},g)}function St(t,n){const c=n.getFileTreePath??rt,m=t.files.filter(i=>c(i).split("/").filter(Boolean).length<=1),h=nt(t.files,c);return r.jsxs("div",{className:"space-y-px",children:[h.map(i=>st(i,t.key,n,0,t)),m.length>0&&r.jsx("div",{className:"space-y-px",children:m.map(i=>Pe(i,n))})]})}function It(t,n=rt){const c=[],m=i=>{for(const b of i.directories)m(b);c.push(...i.files)};for(const i of nt(t,n))m(i);const h=new Set(c.map(i=>i.key));return c.push(...t.filter(i=>!h.has(i.key))),c}function Et(t){return r.jsx("div",{className:t.mode==="tree"?"space-y-px pt-1":"space-y-2",children:t.groups.map(n=>{const c=!!n.header,m=!!n.collapsed;return r.jsxs("section",{className:c?"overflow-hidden rounded-lg border border-border/15 bg-surface/60":"",children:[n.header,!m&&r.jsx("div",{className:t.mode==="tree"?c?"space-y-px bg-surface/60 p-1":"space-y-px":c?"space-y-px bg-surface/60 p-1.5":"space-y-px",children:t.mode==="tree"?St(n,t):n.files.map(h=>Pe(h,t))})]},n.key)})})}const Ce="termdock:diff-review:list-width:v1",Ct=120,He=320,qe=220,Ft=560;function _t(t){return typeof t=="number"&&Number.isFinite(t)}function Ue(t,n){const c=Math.max(qe,n-360),m=Math.min(Ft,c);return Math.min(m,Math.max(qe,t))}function At(){return vt(Ce,_t)??He}function zt({list:t,detail:n,mobile:c,mobileListHeader:m,mobileDetailHeader:h,desktopListHeader:i,backLabel:b,onMobileSlideChange:x,externalSwiperRef:g,desktopLayout:f="split",onDetailScroll:y,desktopSidePanel:z,desktopListClassName:T,detailOwnsScroll:F=!1}){const{t:B}=ht(),P=o.useRef(null),q=o.useRef(null),I=o.useRef(null),[U,$]=o.useState(At);o.useEffect(()=>{if(c||f!=="split")return;const p=q.current;p&&$(j=>Ue(j,p.clientWidth))},[f,c]);const ae=o.useCallback(p=>{c||f!=="split"||(p.preventDefault(),I.current={startX:p.clientX,startWidth:U,pointerId:p.pointerId},p.currentTarget.setPointerCapture(p.pointerId))},[f,U,c]),ue=o.useCallback(p=>{const j=I.current;if(!j||j.pointerId!==p.pointerId)return;const D=q.current?.clientWidth??window.innerWidth,_=Ue(j.startWidth+p.clientX-j.startX,D);$(_),mt(Ce,_,Ct)},[]),ie=o.useCallback(p=>{const j=I.current;if(!(!j||j.pointerId!==p.pointerId)){I.current=null,pt(Ce);try{p.currentTarget.releasePointerCapture(p.pointerId)}catch{}}},[]);if(c){const p=()=>{const v=P.current;v&&v.slideTo(1)},j=()=>{const v=P.current;v&&v.slideTo(0)},D=typeof t=="function"?t({slideToDetail:p}):t,_=typeof h=="function"?h({slideToList:j,slideToDetail:p}):h;return r.jsxs(wt,{className:"h-full min-h-0 w-full",slidesPerView:1,resistanceRatio:.45,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:".swiper-no-swiping",allowTouchMove:!1,touchAngle:75,touchStartPreventDefault:!1,onSwiper:v=>{P.current=v,g&&(g.current=v)},onSlideChange:v=>{x?.(v.activeIndex)},children:[r.jsx(Ke,{className:"h-full min-h-0",children:r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[m&&r.jsx("div",{className:"shrink-0 border-b border-border/15 px-3 py-2",children:m}),r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:D})]})}),r.jsx(Ke,{className:"h-full min-h-0",children:r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[r.jsx("div",{className:"shrink-0 border-b border-border/15 px-3 py-2",children:_??r.jsxs("button",{type:"button",onClick:j,className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-surface-2 px-3 text-xs font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:[r.jsx(xt,{size:14}),b]})}),r.jsx("div",{className:F?"min-h-0 flex-1 overflow-hidden":"termdock-diff-stream-scroller min-h-0 flex-1 overflow-y-auto overscroll-contain",onScroll:F?void 0:v=>y?.(v.currentTarget),children:n})]})})]})}const W=typeof t=="function"?t({slideToDetail:()=>{}}):t;return f==="stacked"?F?r.jsxs("div",{className:"termdock-native-select min-h-0 flex-1 overflow-hidden px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W,r.jsx("div",{className:"mt-3 h-[calc(100%-3rem)] min-h-0 overflow-hidden rounded-xl border border-border/15 bg-surface",children:n})]}):r.jsxs("div",{className:"termdock-native-select termdock-diff-stream-scroller min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",onScroll:p=>y?.(p.currentTarget),children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W,r.jsx("div",{className:"mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface",children:n})]}):r.jsxs("div",{ref:q,className:"flex h-full min-h-0 overflow-hidden",children:[z,r.jsxs("div",{className:T??"shrink-0 overflow-y-auto overscroll-contain border-r border-border/15 bg-surface",style:{width:U},children:[i&&r.jsx("div",{className:"sticky top-0 z-10 border-b border-border/15 bg-surface px-2 py-2",children:i}),W]}),r.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":B("diffViewer.resizeNavigation"),title:B("diffViewer.resizeNavigation"),className:"group relative z-10 w-2 shrink-0 cursor-col-resize touch-none border-r border-border/15 bg-surface",onPointerDown:ae,onPointerMove:ue,onPointerUp:ie,onPointerCancel:ie,onDoubleClick:()=>{$(He),gt(Ce,He)},children:r.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border/30 transition group-hover:bg-primary/60"})}),r.jsx("div",{className:F?"min-w-0 flex-1 overflow-hidden":"termdock-diff-stream-scroller min-w-0 flex-1 overflow-y-auto overscroll-contain",onScroll:F?void 0:p=>y?.(p.currentTarget),children:n})]})}function Lt({mode:t,onModeChange:n,showAi:c=!1}){return r.jsxs("div",{className:"inline-flex h-7 shrink-0 overflow-hidden rounded-md bg-surface-2 p-0.5",children:[r.jsx("button",{type:"button",onClick:()=>n("list"),"aria-pressed":t==="list",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="list"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(Tt,{size:13})}),r.jsx("button",{type:"button",onClick:()=>n("tree"),"aria-pressed":t==="tree",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="tree"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(Nt,{size:13})}),c&&r.jsx("button",{type:"button",onClick:()=>n("ai"),"aria-pressed":t==="ai",className:`inline-flex h-6 w-7 items-center justify-center rounded-md transition active:scale-95 ${t==="ai"?"bg-surface-elevated text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.jsx(et,{size:13})})]})}function Ht({groups:t,mode:n,onModeChange:c,selectedKey:m,collapsedDirectoryKeys:h,onToggleDirectory:i,onSelectFile:b,renderLeading:x,renderTrailing:g,renderDirectoryTrailing:f,renderSubtitle:y,detail:z,mobile:T,backLabel:F,compact:B=!1,emptyContent:P,listPrefix:q,aiContent:I,listContainerClassName:U="px-2 py-2",detailContainerClassName:$="termdock-native-select termdock-diff-stream-scroller min-h-0",renderListHeader:ae,renderMobileDetailHeader:ue,externalSwiperRef:ie,onMobileSlideChange:W,slideToDetailOnMobile:p=!0,desktopLayout:j="split",onDetailScroll:D,desktopSidePanel:_,desktopListClassName:v,detailOwnsScroll:ee}){const[V,O]=o.useState(!1);o.useEffect(()=>{if(!V)return;const A=L=>{L.key==="Escape"&&O(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[V]);const de=r.jsx(Lt,{mode:n,onModeChange:c,showAi:!!I}),pe=n==="tree"?"tree":"list",xe=ae?ae(de):r.jsx("div",{className:"flex justify-end",children:de}),ge=t.some(A=>A.files.length>0),te=r.jsx(zt,{mobile:V?!1:T,backLabel:F,externalSwiperRef:ie,onMobileSlideChange:W,desktopLayout:V?"split":j,onDetailScroll:D,desktopSidePanel:_,desktopListClassName:v,detailOwnsScroll:ee,mobileListHeader:T?xe:void 0,desktopListHeader:T?void 0:xe,mobileDetailHeader:ue,list:({slideToDetail:A})=>r.jsx("div",{className:U,children:n==="ai"?typeof I=="function"?I({slideToDetail:A,fullscreen:V,toggleFullscreen:()=>O(L=>!L)}):I??P:r.jsxs(r.Fragment,{children:[q,ge?r.jsx(Et,{groups:t,selectedKey:m,mode:pe,mobile:T,compact:B,collapsedDirectoryKeys:h,onToggleDirectory:i,onSelectFile:L=>{b(L),T&&p&&window.requestAnimationFrame(A)},renderLeading:x,renderTrailing:g,renderDirectoryTrailing:f,renderSubtitle:y}):P]})}),detail:r.jsx("div",{className:ee?"h-full min-h-0":$,children:z})});return!V||typeof document>"u"?te:Je.createPortal(r.jsxs("div",{className:"fixed inset-0 z-modal-panel flex min-h-0 flex-col bg-surface text-foreground",children:[r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(et,{size:15,className:"shrink-0 text-primary"}),r.jsx("span",{className:"truncate text-[12px] font-semibold",children:"DAG Review"}),r.jsx("span",{className:"hidden text-[10px] text-muted-foreground sm:inline",children:"Select a step to inspect its exact change"})]}),r.jsx("button",{type:"button",onClick:()=>O(!1),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground active:scale-95",title:"Exit full-screen DAG review (Esc)","aria-label":"Exit full-screen DAG review",children:r.jsx(yt,{size:16})})]}),r.jsx("div",{className:"min-h-0 flex-1",children:te})]}),document.body)}const Pt=96,ze=44;function Wt({file:t,repoRoot:n,selectionPath:c,displayName:m,displayDir:h,selected:i,activePane:b,visible:x,reusableContent:g=!1,estimatedHeight:f,lightweight:y=!1,wrap:z,viewType:T,inlineMode:F,diffOptions:B,reloadKey:P=0,auditRecords:q,diffOverride:I,oldSourceRef:U,preparedDiff:$,renderBadge:ae,onInsertDiffReference:ue,onHunkGitAction:ie,previewReverts:W,onReferenceCopied:p,insertedReferenceKey:j,copiedReferenceKey:D,onClearAuditRecord:_,onContentReady:v,onHeightChange:ee}){const V=o.useRef(null),O=o.useRef(null),de=o.useRef(null),[pe,xe]=o.useState(null),ge=o.useRef(64),te=o.useRef(f??104),A=o.useRef(null),L=o.useRef(null),Q=o.useRef(!1),le=o.useRef(!1),E=o.useRef(null),[re,je]=o.useState(!1),[Ne,Se]=o.useState(!1),ve=t.absolutePath||(n?`${n}/${t.path}`:t.path),N=o.useCallback(()=>{le.current||(le.current=!0,Se(!0),v?.(c))},[v,c]);o.useLayoutEffect(()=>{if(!(I!==void 0&&x&&le.current))return Q.current=!1,le.current=!1,A.current=null,L.current=null,E.current!==null&&(window.clearTimeout(E.current),E.current=null),je(!1),Se(!1),()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)}},[I,$,P,g,x]),o.useLayoutEffect(()=>{const X=A.current;!re||X===null||Math.abs((f??104)-X)>=1||(A.current=null,N())},[N,f,re]),o.useLayoutEffect(()=>{if(!x||!re)return;const X=de.current;if(!X)return;const ye=()=>{if(!Q.current)return;const Y=X.firstElementChild;if(!Y)return;const K=Math.ceil(Math.max(Y.getBoundingClientRect().height,Y.scrollHeight,64)),he=ge.current;if(K>0&&he!==K&&(ge.current=K,xe(K)),!V.current)return;const C=O.current?.getBoundingClientRect().height??ze,se=Math.ceil(C+K+1);se<=0||L.current===se||(L.current=se,E.current!==null&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{if(E.current=null,!Q.current)return;const H=L.current;if(H===null)return;const S=te.current;if(le.current){te.current=H,Math.abs(S-H)>=1&&ee?.(c,S,H),v?.(c);return}if(A.current=H,Math.abs(S-H)<1||!ee){te.current=H,A.current=null,N();return}te.current=H,ee(c,S,H)},Pt))};if(ye(),typeof ResizeObserver>"u")return;const fe=new ResizeObserver(ye);return fe.observe(X),X.firstElementChild&&fe.observe(X.firstElementChild),O.current&&fe.observe(O.current),()=>fe.disconnect()},[N,v,ee,c,re,x,z,T,F]);const G=x&&!Ne;return r.jsxs("div",{ref:V,"data-diff-stream-item":c,"data-diff-selection-path":c,"data-diff-file-path":t.path,"data-diff-absolute-path":ve,className:`scroll-mt-3 border-b border-border/15 last:border-b-0 ${G||!x?"overflow-hidden":""} ${i?"bg-surface-elevated/35":""}`,style:x?G?{height:f??104}:void 0:{height:f??104},children:[r.jsxs("div",{ref:O,"data-diff-stream-header":!0,className:`sticky top-0 z-10 flex min-w-0 items-center gap-2 border-b border-border/15 px-3 py-2 ${i?"bg-surface-elevated":"bg-surface"}`,children:[ae(t.status),r.jsxs("div",{className:"min-w-0 flex-1",title:ve,children:[r.jsx("div",{className:"truncate text-xs font-semibold text-foreground",children:m}),h&&r.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:h})]})]}),r.jsxs("div",{ref:de,className:"relative","data-diff-stream-body":!0,style:x?{minHeight:Ne?64:Math.max(pe??64,(f??104)-ze)}:{height:Math.max(pe??64,(f??104)-ze)},children:[x?r.jsx(kt,{active:b,repoRoot:n,filePath:t.path,referenceFilePath:ve,changedFile:t,wrap:z,viewType:T,inlineMode:F,diffOptions:B,reloadKey:P,embedded:!0,lightweight:y,auditRecords:q,diffOverride:I,oldSourceRef:U,preparedDiff:$,onClearAuditRecord:_,onContentReady:()=>{if(g){Q.current=!0,je(!0),N();return}Q.current||(Q.current=!0,je(!0))},onInsertDiffReference:ue,onHunkGitAction:ie,previewReverts:W,onReferenceCopied:p,insertedReferenceKey:j,copiedReferenceKey:D}):r.jsx("div",{className:"flex h-full min-h-16 items-center justify-center bg-surface px-3 py-4 text-center text-xs text-muted-foreground",children:t.path}),x&&re&&!Ne&&r.jsx("div",{"data-diff-measuring-overlay":!0,className:"absolute inset-0 z-20 bg-surface"})]})]})}const Oe=8,Le=1600,Qe=104,Bt=1e3,Re=new Map;function $t(t,n){for(Re.delete(t),Re.set(t,n);Re.size>Bt;){const c=Re.keys().next().value;if(c===void 0)break;Re.delete(c)}}function Vt(t,n){return!!(t&&t.diffOverride===n.diffOverride&&t.oldSourceRef===n.oldSourceRef&&t.reloadKey===n.reloadKey&&t.wrap===n.wrap&&t.viewType===n.viewType&&t.inlineMode===n.inlineMode&&t.algorithm===n.algorithm&&t.whitespace===n.whitespace&&t.context===n.context)}const Gt={added:{label:"A",className:"text-[color:var(--diff-insert-strong)]",title:"Added"},modified:{label:"M",className:"text-[color:var(--diff-hunk-accent)]",title:"Modified"},deleted:{label:"D",className:"text-[color:var(--diff-delete-strong)]",title:"Deleted"},renamed:{label:"R",className:"text-muted-foreground",title:"Renamed"},copied:{label:"C",className:"text-[color:var(--diff-insert-strong)]",title:"Copied"},untracked:{label:"U",className:"text-[color:var(--diff-insert-strong)]",title:"Untracked (new file)"},conflicted:{label:"!",className:"text-destructive",title:"Conflicted"},unknown:{label:"?",className:"text-muted-foreground",title:"Unknown"}};function Zt({status:t}){const n=Gt[t]??{label:"?",className:"text-muted-foreground",title:t};return r.jsx("span",{className:`w-4 shrink-0 text-center text-[10px] font-mono font-bold ${n.className}`,title:n.title,children:n.label})}function er(t,n){return n?{key:n,nonce:t.nonce+1}:t}function tr({files:t,groups:n,selectedKey:c,onSelectFile:m,mode:h,onModeChange:i,collapsedDirectoryKeys:b,onToggleDirectory:x,renderLeading:g,renderTrailing:f,renderDirectoryTrailing:y,renderSubtitle:z,renderStreamBadge:T,onInsertDiffReference:F,onHunkGitAction:B,onReferenceCopied:P,insertedReferenceKey:q,copiedReferenceKey:I,onClearAuditRecord:U,mobile:$,backLabel:ae,compact:ue,desktopLayout:ie,wrap:W,diffViewType:p,inlineMode:j,diffOptions:D,activePane:_,reloadKey:v=0,renderListHeader:ee,renderMobileDetailHeader:V,emptyContent:O,listPrefix:de,aiContent:pe,listContainerClassName:xe,detailContainerClassName:ge,desktopSidePanel:te,desktopListClassName:A,onDetailScroll:L,initialDetailScrollTop:Q,preserveScrollOnUpdate:le=!1,scrollToKey:E,scrollToKeyNonce:re=0,externalSwiperRef:je,onMobileSlideChange:Ne,slideToDetailOnMobile:Se}){const ve=o.useMemo(()=>e=>c===e.key||c===e.path||c===e.absolutePath,[c]),N=o.useMemo(()=>{const e=new Map;for(const a of t)e.set(a.key,a),a.path&&e.set(a.path,a),a.absolutePath&&e.set(a.absolutePath,a);const s=[],l=new Set;for(const a of n){const d=h==="tree"?It(a.files):a.files;for(const w of d){const u=e.get(w.key);!u||l.has(u.key)||(s.push(u),l.add(u.key))}}for(const a of t)l.has(a.key)||s.push(a);return s},[t,n,h]),G=o.useRef(null),X=o.useRef(null),ye=o.useRef(null),fe=o.useRef(v),Y=o.useRef(0),K=o.useRef(null),he=o.useRef(new Map(Re)),ne=o.useRef({key:null,top:0}),C=o.useRef(new Set),se=o.useRef(new Map),H=o.useRef(new Map),S=o.useRef(null),We=o.useRef(()=>{}),Me=o.useRef([]),me=o.useRef(new Map),Be=o.useRef({tops:[],heights:[],bottom:0}),[Ie,ot]=o.useState(()=>new Set),[ct,at]=o.useState(0),[J,be]=o.useState({top:0,height:0}),Te=o.useMemo(()=>N.map(e=>e.key),[N]),Ee=Te.join("");H.current=o.useMemo(()=>new Map(N.map(e=>[e.key,{diffOverride:e.diffOverride,oldSourceRef:e.oldSourceRef,reloadKey:v,wrap:W,viewType:p,inlineMode:j,algorithm:D?.algorithm,whitespace:D?.whitespace,context:D?.context}])),[N,v,W,p,j,D?.algorithm,D?.whitespace,D?.context]),Me.current=Te,me.current=o.useMemo(()=>new Map(Te.map((e,s)=>[e,s])),[Te]);const k=o.useMemo(()=>{const e=Te.map(a=>he.current.get(a)??Qe),s=new Array(e.length);for(let a=0;a<e.length;a+=1)s[a]=a===0?0:s[a-1]+e[a-1];const l=e.length>0?s[e.length-1]+e[e.length-1]:0;return{tops:s,heights:e,bottom:l}},[ct,Ee]);Be.current=k;const oe=o.useMemo(()=>E?N.find(e=>E===e.key||E===e.path||E===e.absolutePath)?.key??null:null,[N,E]),Fe=o.useMemo(()=>c?N.find(e=>c===e.key||c===e.path||c===e.absolutePath)?.key??null:null,[N,c]),De=o.useMemo(()=>{const e=k.tops.length;if(e===0)return-1;let s=0,l=e;for(;s<l;){const a=Math.floor((s+l)/2);k.tops[a]<=J.top+1?s=a+1:l=a}return Math.min(e-1,Math.max(0,s-1))},[k.tops,J.top]),ce=o.useCallback(e=>{C.current=e,ot(e)},[]),$e=o.useMemo(()=>{const e=J.top-Le,s=J.top+J.height+Le,l=new Set;let a=0,d=k.tops.length;for(;a<d;){const u=Math.floor((a+d)/2);k.tops[u]<=e?a=u+1:d=u}const w=Math.max(0,a-1);for(let u=w;u<k.tops.length;u+=1){const R=k.tops[u];if(R>s)break;R+k.heights[u]>=e&&R<=s&&l.add(u)}for(let u=De-1;u<=De+1;u+=1)u>=0&&u<k.tops.length&&l.add(u);for(const u of Ie){const R=me.current.get(u);R!==void 0&&l.add(R)}return Array.from(l).sort((u,R)=>u-R)},[k,J,Ie,De]),_e=o.useCallback(()=>{if(!_||S.current)return;const e=Me.current;if(e.length===0)return;const s=ne.current.key,l=Math.min(e.length-1,(s!==null?me.current.get(s):void 0)??Math.max(0,De)),a=u=>Math.abs((me.current.get(u)??0)-l),d=[];C.current.has(e[l])||d.push(e[l]);for(let u=1;u<=Oe;u+=1){const R=l+u,M=l-u;R<e.length&&!C.current.has(e[R])&&d.push(e[R]),M>=0&&!C.current.has(e[M])&&d.push(e[M])}const w=d[0];if(w){if(C.current.size>=Oe){const u=a(w),R=Array.from(C.current).filter(Z=>Z!==S.current).sort((Z,ke)=>a(ke)-a(Z))[0];if(!R||a(R)<=u)return;const M=new Set(C.current);M.delete(R),ce(M)}S.current=w,ce(new Set(C.current).add(w))}},[_,ce,De]);We.current=_e;const we=o.useCallback(e=>{if(C.current.has(e))return;const s=S.current;if(s&&s!==e){const l=new Set(C.current);l.delete(s),ce(l),S.current=null}S.current=e,ce(new Set(C.current).add(e))},[ce]),Ve=o.useCallback(e=>{if(!C.current.has(e))return;const s=H.current.get(e);s&&se.current.set(e,s),S.current===e&&(S.current=null),window.requestAnimationFrame(()=>We.current())},[]),Ge=o.useCallback((e,s,l)=>{if(Math.abs(l-s)<1)return;const a=he.current.get(e);a!==void 0&&Math.abs(a-l)<1||(he.current.set(e,l),$t(e,l),at(d=>d+1))},[]);o.useLayoutEffect(()=>{if(fe.current!==v){fe.current=v;for(const e of N){if(e.diffOverride!==void 0)continue;const s=qt(e.path,e.repoRoot);Rt(s,e.repoRoot??void 0,D)}}},[N,D,v]),o.useLayoutEffect(()=>{const e=G.current;if(!e)return;const s=()=>{const a=Math.max(0,Math.ceil(e.clientHeight));if(a===0)return;const d=e.scrollTop;be(w=>w.height===a&&w.top===d?w:{top:d,height:a})};if(s(),typeof ResizeObserver>"u")return;const l=new ResizeObserver(s);return l.observe(e),()=>l.disconnect()},[$]),o.useEffect(()=>{_&&Fe&&we(Fe)},[_,we,Fe]),o.useEffect(()=>{const e=new Set(Me.current);for(const s of Array.from(he.current.keys()))e.has(s)||he.current.delete(s);for(const s of Array.from(C.current))if(!e.has(s)){const l=new Set(C.current);l.delete(s),ce(l)}for(const s of Array.from(se.current.keys()))e.has(s)||se.current.delete(s);if(S.current&&!e.has(S.current)&&(S.current=null),N.length===0){S.current=null,se.current.clear(),ce(new Set);return}_e()},[N.length,Ee,_e,$e,ce]);const Xe=o.useCallback(e=>{G.current=e;const s=Y.current,l=e.scrollTop;Y.current=l;const a=d=>{const w=Be.current,u=Me.current;let R=0,M=w.tops.length;for(;R<M;){const Ae=Math.floor((R+M)/2);w.tops[Ae]<=d+1?R=Ae+1:M=Ae}const Z=Math.min(u.length-1,Math.max(0,R-1)),ke=u[Z]??null;ne.current={key:ke,top:w.tops[Z]??0},ke&&we(ke)};Math.abs(l-s)>=Le?(Je.flushSync(()=>{be({top:l,height:e.clientHeight})}),a(l)):K.current===null&&(K.current=window.requestAnimationFrame(()=>{K.current=null;const d=G.current;if(d){const w=d.scrollTop;be({top:w,height:d.clientHeight}),a(w)}})),L?.(e)},[L,we]);o.useEffect(()=>()=>{K.current!==null&&window.cancelAnimationFrame(K.current)},[]),o.useLayoutEffect(()=>{const e=G.current;if(!e)return;const s=ne.current;if(s.key===null)return;const l=me.current.get(s.key);if(l===void 0)return;const a=(k.tops[l]??s.top)-s.top;if(Math.abs(a)<1)return;const d=e.scrollTop+a;Y.current=d,be(w=>({top:d,height:w.height})),typeof e.scrollTo=="function"?e.scrollTo({top:d,behavior:"instant"}):e.scrollTop=d},[k]),o.useLayoutEffect(()=>{const e=Me.current,s=k.tops;if(e.length===0){ne.current={key:null,top:0};return}const l=Y.current,a=l+(G.current?.clientHeight??J.height),d=ne.current;if(d.key!==null){const M=me.current.get(d.key);if(M!==void 0){const Z=s[M]??0;if(Z+(k.heights[M]??Qe)>l&&Z<a){ne.current={key:d.key,top:Z};return}}}let w=0,u=s.length;for(;w<u;){const M=Math.floor((w+u)/2);s[M]<=l+1?w=M+1:u=M}const R=Math.min(s.length-1,Math.max(0,w-1));ne.current={key:e[R]??null,top:s[R]??0}}),o.useLayoutEffect(()=>{if(!oe)return;const e=X.current;if(e?.key===oe&&e.nonce===re)return;const s=me.current.get(oe);if(s===void 0)return;we(oe),ne.current={key:oe,top:k.tops[s]??0};const l=G.current;if(!l||l.clientHeight===0||J.height!==l.clientHeight)return;X.current={key:oe,nonce:re};const a=k.tops[s]??0;typeof l.scrollTo=="function"?l.scrollTo({top:a,behavior:"instant"}):l.scrollTop=a;const d=l.scrollTop;Y.current=d,be({top:d,height:l.clientHeight})},[k,J.height,we,oe,re]),o.useLayoutEffect(()=>{if(Q===void 0||oe)return;const e=Ee;if(ye.current===e||le&&ye.current!==null)return;const s=G.current;if(!s)return;ye.current=e;const l=Math.max(0,k.bottom-s.clientHeight),a=Math.min(Math.max(0,Q),l);typeof s.scrollTo=="function"?s.scrollTo({top:a,behavior:"instant"}):s.scrollTop=a;const d=s.scrollTop;Y.current=d,be({top:d,height:s.clientHeight})},[k.bottom,Q,Ee,le,oe]);const it=o.useCallback((e,s)=>{const l=ve(e),a=H.current.get(e.key),d=a!==void 0&&Vt(se.current.get(e.key),a);return r.jsx(Xt,{item:e,repoRoot:e.repoRoot,selectionPath:e.key,displayName:e.displayName,displayDir:e.displayDir,selected:l,activePane:_,visible:Ie.has(e.key),reusableContent:d,estimatedHeight:s,lightweight:!1,wrap:W,viewType:p,inlineMode:j,diffOptions:D,reloadKey:v,auditRecords:e.auditRecords,diffOverride:e.diffOverride,oldSourceRef:e.oldSourceRef,renderStreamBadge:T,onInsertDiffReference:e.onInsertDiffReference??F,onHunkGitAction:e.onHunkGitAction??B,previewReverts:e.previewReverts,onReferenceCopied:P,insertedReferenceKey:q,copiedReferenceKey:I,onClearAuditRecord:U,onContentReady:Ve,onHeightChange:Ge})},[_,I,D,p,Ve,Ge,j,q,ve,Ie,U,B,F,P,v,T,W]),lt=r.jsx("div",{"data-diff-stream-content":!0,"data-diff-stream-canvas":!0,className:"termdock-diff-stream relative overflow-clip bg-surface will-change-transform",style:{height:Math.max(k.bottom,(k.tops.at(-1)??0)+J.height)},children:$e.map(e=>{const s=N[e];return s?r.jsx("div",{"data-diff-canvas-slot":s.key,className:"absolute inset-x-0",style:{top:k.tops[e]},children:it(s,k.heights[e])},s.key):null})}),ut=r.jsx("div",{ref:G,className:"termdock-diff-stream termdock-diff-stream-scroller h-full max-h-full min-h-0 overflow-y-auto overscroll-contain bg-surface [overflow-anchor:none]",onScroll:e=>Xe(e.currentTarget),children:lt});return r.jsx(Ht,{groups:n,mode:h,onModeChange:i,selectedKey:c,collapsedDirectoryKeys:b,onToggleDirectory:x,onSelectFile:m,renderLeading:g,renderTrailing:f,renderDirectoryTrailing:y,renderSubtitle:z,detail:ut,mobile:$,backLabel:ae,compact:ue,emptyContent:O,listPrefix:de,aiContent:pe,listContainerClassName:xe,detailContainerClassName:ge,renderListHeader:ee,renderMobileDetailHeader:V,externalSwiperRef:je,onMobileSlideChange:Ne,slideToDetailOnMobile:Se,desktopLayout:ie,onDetailScroll:Xe,desktopSidePanel:te,desktopListClassName:A,detailOwnsScroll:!0})}const Xt=o.memo(function({item:n,renderStreamBadge:c,...m}){return r.jsx(Wt,{...m,file:Kt(n),renderBadge:h=>c(h,n)})});function Kt(t){return{path:t.path,oldPath:t.oldPath,absolutePath:t.absolutePath,status:t.status}}function qt(t,n){if(t)return n&&t.startsWith(`${n}/`)?t.slice(n.length+1):t}export{Zt as C,tr as D,Nt as L,It as f,er as n};
@@ -1,2 +1,2 @@
1
- import{by as i}from"./app-CfqF7_nh.js";import{b as n}from"./dnd-BCFAPC0L.js";import{D as I}from"./DiffReview-Wfck3RIS.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./gestureArbiter-Cczz34oI.js";import"./sparkles-C9ShmGPf.js";import"./DiffViewer-C-utC5Ga.js";import"./referenceLongPress-BEMsP11a.js";const x=40,b="/tmp/termdock-diff-review-lab";function S(r,c,l=!1){const d=[`diff --git a/${r} b/${r}`,`--- a/${r}`,`+++ b/${r}`,`@@ -1,${c} +1,${c} @@`];for(let t=0;t<c;t+=1)t%5===0&&d.push(`-const removed_${t} = ${t};`),t%3===0&&d.push(`+const added_${t} = ${t} * 2;`),d.push(` context line ${t} in ${r}${l?" long content for repeated wrap and resize checks".repeat(10):""}`);return d.join(`
1
+ import{bH as i}from"./app-DCFOZi_L.js";import{b as n}from"./dnd-BCFAPC0L.js";import{D as I}from"./DiffReview-5ERdwz1C.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./gestureArbiter-B26W6rS7.js";import"./sparkles-CDonlwGu.js";import"./DiffViewer-RT-p-ZBo.js";import"./referenceLongPress-DBJnfFHa.js";const x=40,b="/tmp/termdock-diff-review-lab";function S(r,c,l=!1){const d=[`diff --git a/${r} b/${r}`,`--- a/${r}`,`+++ b/${r}`,`@@ -1,${c} +1,${c} @@`];for(let t=0;t<c;t+=1)t%5===0&&d.push(`-const removed_${t} = ${t};`),t%3===0&&d.push(`+const added_${t} = ${t} * 2;`),d.push(` context line ${t} in ${r}${l?" long content for repeated wrap and resize checks".repeat(10):""}`);return d.join(`
2
2
  `)}function T(r,c,l){return Array.from({length:x},(d,t)=>{const f=6+t*7%60,a=`src/module${String(t).padStart(2,"0")}/File${t}.ts`,m=`${b}/${a}`,w=S(a,f,l),o=S(a,1,l);return{key:m,path:a,absolutePath:m,status:"modified",repoRoot:b,displayName:`File${t}.ts`,displayDir:`src/module${String(t).padStart(2,"0")} · ${f} lines`,diffOverride:!c||r.has(t)?w:o,auditRecords:[]}})}function B(){const[r,c]=n.useState(()=>new URLSearchParams(window.location.search).get("wrap")!=="off"),[l,d]=n.useState(()=>new URLSearchParams(window.location.search).get("view")==="split"),t=n.useMemo(()=>new URLSearchParams(window.location.search).get("long")==="1",[]),f=n.useMemo(()=>{if(typeof window>"u")return 0;const e=new URLSearchParams(window.location.search).get("delay"),s=e===null?0:Number.parseInt(e,10);return Number.isInteger(s)&&s>0?s:0},[]),a=f>0,[m,w]=n.useState(()=>new Set);n.useEffect(()=>{if(!a)return;const e=Array.from({length:x},(s,u)=>window.setTimeout(()=>{w(M=>{const g=new Set(M);return g.add(u),g})},f+u*20));return()=>e.forEach(s=>window.clearTimeout(s))},[a,f]);const o=n.useMemo(()=>T(m,a,t),[m,a,t]),k=n.useMemo(()=>[{key:"mock-repo",root:b,label:"diff-review-lab",files:o.map(e=>({key:e.key,path:e.path,absolutePath:e.absolutePath,displayName:e.displayName,displayDir:e.displayDir,status:e.status}))}],[o]),p=n.useMemo(()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search).get("select");if(e===null)return null;const s=Number.parseInt(e,10);return Number.isInteger(s)&&s>=0&&s<o.length?s:null},[o.length]),[h,$]=n.useState(()=>p!==null?o[p].key:null),[y,R]=n.useState(()=>({key:p!==null?o[p].key:null,nonce:p!==null?1:0})),[N,v]=n.useState("list"),[D,j]=n.useState(new Set),[L,P]=n.useState(p!==null?1:0);return i.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground","data-diff-review-lab":!0,children:[i.jsxs("div",{className:"shrink-0 border-b border-border/20 px-3 py-2 text-xs text-muted-foreground",children:[i.jsxs("button",{type:"button",className:"mr-2 rounded bg-surface-2 px-2 py-1",onClick:()=>c(e=>!e),"aria-pressed":r,children:["Wrap ",r?"on":"off"]}),i.jsx("button",{type:"button",className:"mr-2 rounded bg-surface-2 px-2 py-1",onClick:()=>d(e=>!e),"aria-pressed":l,children:l?"Split":"Unified"}),"DiffReview Lab · ",o.length," mock files · selected: ",i.jsx("span",{"data-lab-selected":!0,children:h??"none"})," · slide ",L]}),i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(I,{mobile:!0,backLabel:"Back",files:o,groups:k,selectedKey:h,scrollToKey:y.key,scrollToKeyNonce:y.nonce,mode:N,onModeChange:e=>{e!=="ai"&&v(e)},collapsedDirectoryKeys:D,onToggleDirectory:e=>j(s=>{const u=new Set(s);return u.has(e)?u.delete(e):u.add(e),u}),onSelectFile:e=>{$(e.key),R(s=>({key:e.key,nonce:s.nonce+1}))},onMobileSlideChange:P,renderLeading:()=>null,renderStreamBadge:e=>i.jsx("span",{className:"text-[10px] text-muted-foreground",children:e}),wrap:r,diffViewType:l?"split":"unified",activePane:!0})})]})}export{B as DiffReviewLab};