ryco-cli 0.1.3 → 0.1.4

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 (467) hide show
  1. package/dist/{AzureDevOpsSourceControlProvider-X7_C5qAM.cjs → AzureDevOpsSourceControlProvider-BEDcpXP2.cjs} +29 -19
  2. package/dist/{AzureDevOpsSourceControlProvider-CwvdH4Ll.mjs → AzureDevOpsSourceControlProvider-CajSnvPV.mjs} +14 -4
  3. package/dist/{BitbucketSourceControlProvider-3IhNThuu.cjs → BitbucketSourceControlProvider-Ca-sxPgI.cjs} +29 -19
  4. package/dist/{BitbucketSourceControlProvider-Y3LxnPYV.mjs → BitbucketSourceControlProvider-Ryxef3zA.mjs} +14 -4
  5. package/dist/{BunPTY-6EA-iDZJ.mjs → BunPTY-B_vjRZN4.mjs} +2 -4
  6. package/dist/{BunPTY-CyqsuAMZ.cjs → BunPTY-BclzAOxp.cjs} +2 -4
  7. package/dist/{ClaudeDriver-CiWSk1E1.cjs → ClaudeDriver-CxOmXtj3.cjs} +196 -185
  8. package/dist/{ClaudeDriver-Cmqo9lqD.mjs → ClaudeDriver-oGrpXzWa.mjs} +166 -156
  9. package/dist/{CodexDriver-D73klBUb.cjs → CodexDriver-C1I8AGHl.cjs} +114 -50
  10. package/dist/{CodexDriver-BRsJm8XU.mjs → CodexDriver-DbICyzcH.mjs} +83 -20
  11. package/dist/{CodexTextGeneration-jbe9qfEM.cjs → CodexTextGeneration-Cr97QFv_.cjs} +18 -18
  12. package/dist/{CodexTextGeneration-Bg0r8k7C.mjs → CodexTextGeneration-DV3LOkTX.mjs} +6 -6
  13. package/dist/{CopilotDriver-DvDa-7-c.mjs → CopilotDriver-Dt6azZQI.mjs} +13 -19
  14. package/dist/{CopilotDriver-tZdF91om.cjs → CopilotDriver-GUpzG61v.cjs} +31 -37
  15. package/dist/{CursorDriver-C6dq_Wr6.mjs → CursorDriver-C3gFClL-.mjs} +195 -273
  16. package/dist/{CursorDriver-BVJV7yyE.cjs → CursorDriver-lhvplGt8.cjs} +239 -316
  17. package/dist/{ForgejoSourceControlProvider-DYtCJSSP.cjs → ForgejoSourceControlProvider-2PTEgbVl.cjs} +29 -19
  18. package/dist/{ForgejoSourceControlProvider-C9T3-pOt.mjs → ForgejoSourceControlProvider-DTVWs_CM.mjs} +14 -4
  19. package/dist/{GitHubSourceControlProvider-BmSffLFQ.mjs → GitHubSourceControlProvider-BJmqP2K1.mjs} +40 -8
  20. package/dist/{GitHubSourceControlProvider-DIbRPFFf.cjs → GitHubSourceControlProvider-Beu-58zB.cjs} +54 -22
  21. package/dist/{GitLabSourceControlProvider-BdLuuH3g.cjs → GitLabSourceControlProvider-CCHBNnen.cjs} +29 -19
  22. package/dist/{GitLabSourceControlProvider-DTZ_rx8U.mjs → GitLabSourceControlProvider-CWnF37fR.mjs} +14 -4
  23. package/dist/Metrics-BCOc3Ml2.mjs +356 -0
  24. package/dist/Metrics-DNOriWhP.cjs +634 -0
  25. package/dist/{NodePTY-Dg0g4rID.mjs → NodePTY-_u3kQLvd.mjs} +2 -4
  26. package/dist/{NodePTY-U7qcu5qQ.cjs → NodePTY-keGvFYk9.cjs} +2 -4
  27. package/dist/{NodeSqliteClient-CPd53X2R.mjs → NodeSqliteClient-BXy61fAd.mjs} +2 -4
  28. package/dist/{NodeSqliteClient-UlhLLRBA.cjs → NodeSqliteClient-homCO8-6.cjs} +16 -18
  29. package/dist/{OpenCodeDriver-DN5bRb9Z.mjs → OpenCodeDriver-Cja8fkzJ.mjs} +10 -13
  30. package/dist/{OpenCodeDriver-D79_QFoB.cjs → OpenCodeDriver-i2DXhUaw.cjs} +32 -34
  31. package/dist/{ProjectCustomSystemPrompt-9Bf13ScV.cjs → ProjectCustomSystemPrompt-B8SUlNGa.cjs} +11 -13
  32. package/dist/{ProjectCustomSystemPrompt-QmzOdzXf.mjs → ProjectCustomSystemPrompt-CS1nulhL.mjs} +1 -2
  33. package/dist/{ProviderDriver-DJK4EOeA.cjs → ProviderDriver--rNeAi3B.cjs} +6 -8
  34. package/dist/{ProviderDriver-CkHnmP8q.mjs → ProviderDriver-kCV60GKk.mjs} +1 -2
  35. package/dist/SourceControlProviderDiscoveryCatalog-DoDSpZoa.mjs +569 -0
  36. package/dist/SourceControlProviderDiscoveryCatalog-DyPSXqm_.cjs +676 -0
  37. package/dist/bin.cjs +2254 -8987
  38. package/dist/bin.d.cts +2 -0
  39. package/dist/bin.d.mts +2 -0
  40. package/dist/bin.mjs +1430 -8099
  41. package/dist/chunk-jM1PLTSZ.cjs +30 -0
  42. package/dist/client/assets/AnimatedHeight-DCd3-Wey.js +1 -0
  43. package/dist/client/assets/AppearanceSettings-pPltzbuu.js +1 -0
  44. package/dist/client/assets/BranchToolbar.logic-BUrYeNec.js +1 -0
  45. package/dist/client/assets/ChatRightPanel-Cy2c02Dt.js +188 -0
  46. package/dist/client/assets/ChatThreadRouteView-C93RPP7s.js +1 -0
  47. package/dist/client/assets/CommandPaletteDialog-D6t0Mkkl.js +1 -0
  48. package/dist/client/assets/CompositeRoot-C5GNdZws.js +1 -0
  49. package/dist/client/assets/ConnectionsSettings-qYzLbX7_.js +1 -0
  50. package/dist/client/assets/DialogHandle-C1Oxda1b.js +1 -0
  51. package/dist/client/assets/DialogRoot-BCS_qKVO.js +1 -0
  52. package/dist/client/assets/DialogTitle-R_4ZQbHx.js +1 -0
  53. package/dist/client/assets/DialogTrigger-ChuIKLi7.js +1 -0
  54. package/dist/client/assets/DialogViewport-Dq_9hdYC.js +1 -0
  55. package/dist/client/assets/DraftChatThreadRouteView-BwDNEWLP.js +1 -0
  56. package/dist/client/assets/JetBrainsIcons-CZi1rQn9.js +1 -0
  57. package/dist/client/assets/KeybindingsSettings-CEqFMcaP.js +7 -0
  58. package/dist/client/assets/McpServersSettings-Co1o7_0g.js +6 -0
  59. package/dist/client/assets/NoActiveThreadState-5VSVCJBv.js +1 -0
  60. package/dist/client/assets/OpinionatedPluginsSettings-BnDPa2E2.js +1 -0
  61. package/dist/client/assets/ProjectFavicon-CtqYuFQF.js +1 -0
  62. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-Dqh8LlGG.js +1 -0
  63. package/dist/client/assets/ProvidersSettingsPanel-BwDIEOF4.js +1 -0
  64. package/dist/client/assets/QueryClientProvider-B5z3RyQ9.js +1 -0
  65. package/dist/client/assets/RedactedSensitiveText-Ddxd4ZX9.js +1 -0
  66. package/dist/client/assets/RootAppShell-CThrOBqP.js +12 -0
  67. package/dist/client/assets/SettingsDialog-C-vm2P1q.js +2 -0
  68. package/dist/client/assets/SourceControlSettings-oK-xLUFA.js +1 -0
  69. package/dist/client/assets/ThreadStatusIndicators-6ASnD4_d.js +1 -0
  70. package/dist/client/assets/ThreadTerminalDrawer-BrP-ENHg.css +1 -0
  71. package/dist/client/assets/ThreadTerminalDrawer-BxuSy2xD.js +38 -0
  72. package/dist/client/assets/ThreadWorkspacePanel-C3S7Fjib.js +166 -0
  73. package/dist/client/assets/alert-dialog-BwCq7-J2.js +1 -0
  74. package/dist/client/assets/{angular-html-s8mFfHxJ.js → angular-html-BjMPwewj.js} +1 -1
  75. package/dist/client/assets/{angular-ts-qPgEQREa.js → angular-ts-DueL15Nu.js} +1 -1
  76. package/dist/client/assets/{apl-Bk41I3U1.js → apl-BgVy_tIs.js} +1 -1
  77. package/dist/client/assets/arrow-up-DUD3DBES.js +1 -0
  78. package/dist/client/assets/{astro-ClwGnYhy.js → astro-CWd6v_kU.js} +1 -1
  79. package/dist/client/assets/{blade-D8d2x7Cj.js → blade-C1itW3Xj.js} +1 -1
  80. package/dist/client/assets/{bsl-DJJjEj3G.js → bsl-BkkzgIyY.js} +1 -1
  81. package/dist/client/assets/{c-C7LLcxwo.js → c-BerOGYIx.js} +1 -1
  82. package/dist/client/assets/{cairo-D0DvaGhb.js → cairo-DLTphjLi.js} +1 -1
  83. package/dist/client/assets/chatThreadActions-DHwgLZQX.js +1 -0
  84. package/dist/client/assets/clamp-Bj3CMoU0.js +1 -0
  85. package/dist/client/assets/{cobol-BFmBEDT2.js → cobol-C_rkq165.js} +1 -1
  86. package/dist/client/assets/codexUsageLimits-Mjd2rHmE.js +1 -0
  87. package/dist/client/assets/{coffee-C6xKBntv.js → coffee-DX2eriSb.js} +1 -1
  88. package/dist/client/assets/commandPaletteStore-oFMPKPmp.js +1 -0
  89. package/dist/client/assets/{compiler-runtime-BF315rzL.js → compiler-runtime-BNrXlsa1.js} +1 -1
  90. package/dist/client/assets/composerDraftStore-DTMZbmmF.js +21 -0
  91. package/dist/client/assets/{cpp-CVDdGIJL.js → cpp-DN_S3YzL.js} +1 -1
  92. package/dist/client/assets/{crystal-C8hrz-Ed.js → crystal-DX_yIzv-.js} +1 -1
  93. package/dist/client/assets/{css-Bq4IaKl1.js → css-CcrQR6FS.js} +1 -1
  94. package/dist/client/assets/desktopUpdateReactQuery-DdRc1zr8.js +2 -0
  95. package/dist/client/assets/download-DchCbuiJ.js +1 -0
  96. package/dist/client/assets/draft-input-Byd_iP54.js +1 -0
  97. package/dist/client/assets/{edge-M0lvKmK0.js → edge-D6QhZ796.js} +1 -1
  98. package/dist/client/assets/{elixir-Z_A63tjC.js → elixir-DMd9329w.js} +1 -1
  99. package/dist/client/assets/{elm-CSUyuYJg.js → elm-ClOR9TU8.js} +1 -1
  100. package/dist/client/assets/empty-CFWSIvUd.js +1 -0
  101. package/dist/client/assets/environmentApi-4U60qRO5.js +1 -0
  102. package/dist/client/assets/{erb-DrEx0jBQ.js → erb-HraKpeAP.js} +1 -1
  103. package/dist/client/assets/{erlang-CJBKhF6J.js → erlang-Cphh6RMH.js} +1 -1
  104. package/dist/client/assets/folder-open-CuS_UI1W.js +1 -0
  105. package/dist/client/assets/{fortran-fixed-form-BKSuIOW4.js → fortran-fixed-form-DEKoE2YW.js} +1 -1
  106. package/dist/client/assets/{fsharp-U9gZ5YOh.js → fsharp-D13ZGOAj.js} +1 -1
  107. package/dist/client/assets/{gdresource-DoBd66sG.js → gdresource-C0sCabJj.js} +1 -1
  108. package/dist/client/assets/{git-commit-Db7dtED7.js → git-commit-BSykSTBG.js} +1 -1
  109. package/dist/client/assets/{git-rebase-QypkBr98.js → git-rebase-7x6VaRfM.js} +1 -1
  110. package/dist/client/assets/{glimmer-js-NOqtI1Rk.js → glimmer-js-Bs66SSVv.js} +1 -1
  111. package/dist/client/assets/{glimmer-ts-BeU4NlYB.js → glimmer-ts-C-1005ee.js} +1 -1
  112. package/dist/client/assets/{glsl-BkDxwNg4.js → glsl-ClknhvHk.js} +1 -1
  113. package/dist/client/assets/{graphql-BuqaMepw.js → graphql-BJK35HL6.js} +1 -1
  114. package/dist/client/assets/group-BlyMND_M.js +1 -0
  115. package/dist/client/assets/{hack-C01X66u7.js → hack-DTKnRaIz.js} +1 -1
  116. package/dist/client/assets/{haml-6AVURMsW.js → haml-v1Ae09NK.js} +1 -1
  117. package/dist/client/assets/{handlebars-CQt0otqg.js → handlebars-DvtPw9yK.js} +1 -1
  118. package/dist/client/assets/hostedPairing-DAdvNuk3.js +1 -0
  119. package/dist/client/assets/{html-B9GCfMM1.js → html-Ckes0w7-.js} +1 -1
  120. package/dist/client/assets/{html-derivative-Choar9BD.js → html-derivative-CjYqXu8c.js} +1 -1
  121. package/dist/client/assets/{http-DvFNkpiH.js → http-DgyAR01B.js} +1 -1
  122. package/dist/client/assets/{hurl-BSVy9O8n.js → hurl-BSy4XrZM.js} +1 -1
  123. package/dist/client/assets/{hxml-BcCIYlZp.js → hxml-B0Qn7Nwc.js} +1 -1
  124. package/dist/client/assets/{index-B215HMv1.js → index-R0mA-hZk.js} +2 -2
  125. package/dist/client/assets/input-BQQgfZzY.js +1 -0
  126. package/dist/client/assets/{java-DYU2LKAe.js → java-BRs8BbUU.js} +1 -1
  127. package/dist/client/assets/{javascript-CqMUgcTv.js → javascript-CCh9h5HS.js} +1 -1
  128. package/dist/client/assets/{jinja-DZIBHWGb.js → jinja-D1OtL_yO.js} +1 -1
  129. package/dist/client/assets/{jison-1dZyCIA-.js → jison-D_fWb18i.js} +1 -1
  130. package/dist/client/assets/{json-By08Hh8g.js → json-Bs_SRPeT.js} +1 -1
  131. package/dist/client/assets/{jsx-D-zBxh5E.js → jsx-Btew4WFJ.js} +1 -1
  132. package/dist/client/assets/{julia-D4DyCD9m.js → julia-BKIxRKg2.js} +1 -1
  133. package/dist/client/assets/{just-t1DYRM-F.js → just-CSkhc6Nt.js} +1 -1
  134. package/dist/client/assets/kbd-Dgp27U1W.js +1 -0
  135. package/dist/client/assets/keybindings-BIa18Wmf.js +1 -0
  136. package/dist/client/assets/keyboard-BQYTddoX.js +1 -0
  137. package/dist/client/assets/{latex-WQQP2pth.js → latex-DrurJw6z.js} +1 -1
  138. package/dist/client/assets/{liquid-D0Ghr7un.js → liquid-DLZ2kGK1.js} +1 -1
  139. package/dist/client/assets/{lua-r3xGOG0a.js → lua-BNdhJiqB.js} +1 -1
  140. package/dist/client/assets/main-Da7Z4Ig1.css +2 -0
  141. package/dist/client/assets/main-YXLWCEbb.js +9 -0
  142. package/dist/client/assets/{marko-wk9TVjCS.js → marko-B3eJkbnP.js} +1 -1
  143. package/dist/client/assets/{mdc-BRMVGNjb.js → mdc-Dz2y1zK2.js} +1 -1
  144. package/dist/client/assets/modelPickerOpenState-BJxsqvdg.js +1 -0
  145. package/dist/client/assets/mutation-B8SILYi_.js +1 -0
  146. package/dist/client/assets/{nextflow-D0nv53RF.js → nextflow-Bbiyy34d.js} +1 -1
  147. package/dist/client/assets/{nginx-D968CCNX.js → nginx-BazusZwe.js} +1 -1
  148. package/dist/client/assets/{nim-CRCwl258.js → nim-jwqEnSmK.js} +1 -1
  149. package/dist/client/assets/{perl-29yJp9Uu.js → perl-BwoWHrup.js} +1 -1
  150. package/dist/client/assets/{php-Cemz192H.js → php-DmODFjdr.js} +1 -1
  151. package/dist/client/assets/plus-F__wNuW-.js +1 -0
  152. package/dist/client/assets/primary-CSkhdakK.js +1 -0
  153. package/dist/client/assets/providerDriverMeta-BIPPb2w0.js +1 -0
  154. package/dist/client/assets/providerIconUtils-C54pAs0t.js +46 -0
  155. package/dist/client/assets/{pug-B2ZE7aeX.js → pug-JR1tLpbP.js} +1 -1
  156. package/dist/client/assets/{qml-jG3DrKD9.js → qml-CrcLSvXM.js} +1 -1
  157. package/dist/client/assets/{r-D3sEfBW5.js → r-B4G19rTw.js} +1 -1
  158. package/dist/client/assets/{razor-Beauj9_g.js → razor-Vr7Dkano.js} +1 -1
  159. package/dist/client/assets/react-CjD7iThp.js +16 -0
  160. package/dist/client/assets/react-PSPkXoKo.js +1 -0
  161. package/dist/client/assets/refresh-cw-DFCVsvMH.js +1 -0
  162. package/dist/client/assets/{regexp-DJB-0KGI.js → regexp-mkyOQxyI.js} +1 -1
  163. package/dist/client/assets/resolveAriaLabelledBy-CdSYKkwq.js +1 -0
  164. package/dist/client/assets/rightPanelRouteSearch-DweDTgju.js +1 -0
  165. package/dist/client/assets/{rst-D9Thij-7.js → rst-CMlIIAT6.js} +1 -1
  166. package/dist/client/assets/{ruby-BriTZmlZ.js → ruby-DeHylo3G.js} +1 -1
  167. package/dist/client/assets/{sas-Cp_miaeX.js → sas-DITAP7FM.js} +1 -1
  168. package/dist/client/assets/scroll-area-CZPNMSSG.js +1 -0
  169. package/dist/client/assets/{scss-DpivEdne.js → scss-DPGO9NvD.js} +1 -1
  170. package/dist/client/assets/separator-ZLn_GZKy.js +1 -0
  171. package/dist/client/assets/server-B7ETA5io.js +1 -0
  172. package/dist/client/assets/session-logic-DOD1qizY.js +4 -0
  173. package/dist/client/assets/settingsDialogStore-DJNXaaZ-.js +1 -0
  174. package/dist/client/assets/settingsLayout-BaSDLd6v.js +1 -0
  175. package/dist/client/assets/{shaderlab-DJPIU-BM.js → shaderlab-TOUzSsQk.js} +1 -1
  176. package/dist/client/assets/{shellscript-CM8oTE2e.js → shellscript-Ctrwjmrg.js} +1 -1
  177. package/dist/client/assets/{shellsession-Cbvx0Scr.js → shellsession-CVFkOqvv.js} +1 -1
  178. package/dist/client/assets/sidebar-VWf4R998.js +1 -0
  179. package/dist/client/assets/skeleton-IoKKnfW9.js +1 -0
  180. package/dist/client/assets/{soy-4R-idkhG.js → soy-DGJ8Y2bl.js} +1 -1
  181. package/dist/client/assets/{sparql-Zqzk9CwD.js → sparql-D_iOobhT.js} +1 -1
  182. package/dist/client/assets/{sql-sKjBShS8.js → sql-u97rfsUo.js} +1 -1
  183. package/dist/client/assets/{stata-DLIq7jHS.js → stata-DWI7UlWE.js} +1 -1
  184. package/dist/client/assets/storeSelectors-BL-4Ncd3.js +1 -0
  185. package/dist/client/assets/{surrealql-CRX8IwBN.js → surrealql-BUWsplpt.js} +1 -1
  186. package/dist/client/assets/{svelte-Dvrysi6X.js → svelte-CQXFJOFl.js} +1 -1
  187. package/dist/client/assets/{templ-RcP_-Nu-.js → templ-CA7lFfrq.js} +1 -1
  188. package/dist/client/assets/{tex-B8a5_DIi.js → tex-DAVBEZhF.js} +1 -1
  189. package/dist/client/assets/threadRoutes-a4QytG8s.js +1 -0
  190. package/dist/client/assets/threadSelectionStore-CgsIp6vR.js +1 -0
  191. package/dist/client/assets/toast-L2eWWYjv.js +1 -0
  192. package/dist/client/assets/toggle-group-D7mEwQCR.js +1 -0
  193. package/dist/client/assets/toggle-oOk0T_MY.js +1 -0
  194. package/dist/client/assets/trash-2-D0zhbiNO.js +1 -0
  195. package/dist/client/assets/{ts-tags-BG0VzqyM.js → ts-tags-cqyzSw6V.js} +1 -1
  196. package/dist/client/assets/{tsx-D4f8_1wY.js → tsx-aOZK_XWL.js} +1 -1
  197. package/dist/client/assets/{twig-DxlRBqRW.js → twig-RScZCD0T.js} +1 -1
  198. package/dist/client/assets/{typescript-C32OH5Jk.js → typescript-6eFuNBLU.js} +1 -1
  199. package/dist/client/assets/useHandleNewThread-DVTiX8Lz.js +1 -0
  200. package/dist/client/assets/useLabelableId-yw8wMwvn.js +1 -0
  201. package/dist/client/assets/useNavigate-CvKQXZa7.js +1 -0
  202. package/dist/client/assets/useTheme-C7Ji7x06.js +1 -0
  203. package/dist/client/assets/vscode-icons-C1r6bNpj.js +1 -0
  204. package/dist/client/assets/{vue-5RtgVZcg.js → vue-DVoN9ARa.js} +1 -1
  205. package/dist/client/assets/{vue-html-Dd-LXYnz.js → vue-html-BnZS_Ahq.js} +1 -1
  206. package/dist/client/assets/{vue-vine-BKz6iXyu.js → vue-vine-B0I6Y_6P.js} +1 -1
  207. package/dist/client/assets/{worker-rFBLi4xK.js → worker-B_h_pwVO.js} +5 -5
  208. package/dist/client/assets/wrench-DzrU49ry.js +1 -0
  209. package/dist/client/assets/x-BQzUKGMv.js +1 -0
  210. package/dist/client/assets/{xml-DXQJVDNT.js → xml-Dvs5bvzt.js} +1 -1
  211. package/dist/client/assets/{xsl-ByvM9IQh.js → xsl-CuljSg_9.js} +1 -1
  212. package/dist/client/assets/{yaml-CCq_gfp4.js → yaml-orq9hzxs.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/collectUint8StreamText-CgTEDbi7.cjs +7106 -0
  215. package/dist/collectUint8StreamText-Cgz3T1YG.mjs +6028 -0
  216. package/dist/{makeManagedServerProvider-B3DH-AMf.mjs → makeManagedServerProvider-D43I_B9P.mjs} +7 -10
  217. package/dist/{makeManagedServerProvider-DVrBJ3h3.cjs → makeManagedServerProvider-DRMA8nAp.cjs} +77 -79
  218. package/dist/sourceControl-iWG-m4wE.mjs +207 -0
  219. package/dist/sourceControl-x2t62T8h.cjs +230 -0
  220. package/dist/{sourceControlContextFormatter-CO5cScmF.cjs → sourceControlContextFormatter-BDZqn-4T.cjs} +6 -8
  221. package/dist/{sourceControlContextFormatter-DpXEEmAm.mjs → sourceControlContextFormatter-DEwpnVAH.mjs} +1 -2
  222. package/package.json +5 -3
  223. package/dist/client/assets/ChangedFilesTree-B4W17bLf.js +0 -1
  224. package/dist/client/assets/DiffPanel-C9_pKXWU.js +0 -75
  225. package/dist/client/assets/DiffPanelShell-BmfxFBmp.js +0 -167
  226. package/dist/client/assets/DiffWorkerPoolProvider-B2FLS8eo.js +0 -1
  227. package/dist/client/assets/PreviewPanel-Z0IDMiKg.js +0 -30
  228. package/dist/client/assets/RootAppShell-qLlEOcIH.js +0 -24
  229. package/dist/client/assets/alert-D2R5HNlM.js +0 -1
  230. package/dist/client/assets/composerHandleContext-CkHnb2_F.js +0 -46
  231. package/dist/client/assets/hostedPairing-D299g9iL.js +0 -1
  232. package/dist/client/assets/main-DOCL-gXt.js +0 -66
  233. package/dist/client/assets/main-DhO2tDKo.css +0 -1
  234. package/dist/client/assets/pathEntry-DCmCWUeG.js +0 -1
  235. package/dist/client/assets/primary-BKkx6aqv.js +0 -16
  236. package/dist/client/assets/react-CYzKIDNi.js +0 -1
  237. package/dist/client/assets/refresh-cw-BpZqiP_0.js +0 -1
  238. package/dist/client/assets/runtime-QfzvF0Vn.js +0 -1
  239. package/dist/client/assets/separator-CXZK6vFp.js +0 -4
  240. package/dist/client/assets/text-wrap-CnmG6WhR.js +0 -62
  241. package/dist/client/assets/toggle-BfBpNkCG.js +0 -1
  242. package/dist/client/assets/toggle-group-Dp1gg0mX.js +0 -1
  243. package/dist/client/assets/useSettings-BLDkflD_.js +0 -21
  244. package/dist/client/assets/useTheme-BHTjVtp9.js +0 -1
  245. package/dist/client/assets/useTheme-EFHXLM5e.js +0 -1
  246. package/dist/client/assets/vscode-icons-Ciu6Pjk4.js +0 -1
  247. /package/dist/client/assets/{abap-Vg0cj5d8.js → abap-CLvhMVsD.js} +0 -0
  248. /package/dist/client/assets/{actionscript-3-BV1RXWL1.js → actionscript-3--17pq3dv.js} +0 -0
  249. /package/dist/client/assets/{ada-Ce_Xk3Sp.js → ada-C5qYipkI.js} +0 -0
  250. /package/dist/client/assets/{andromeeda-DJewj201.js → andromeeda-vGVdxbeo.js} +0 -0
  251. /package/dist/client/assets/{apache-BbDgM_LY.js → apache-U0d_L8uA.js} +0 -0
  252. /package/dist/client/assets/{apex-Z4y334SR.js → apex-CGTLDQj6.js} +0 -0
  253. /package/dist/client/assets/{applescript-CLDQZ5Zp.js → applescript-CCn79oCD.js} +0 -0
  254. /package/dist/client/assets/{ara-DwFb8Z32.js → ara-4CJ0cIlV.js} +0 -0
  255. /package/dist/client/assets/{asciidoc-ByVQW3u3.js → asciidoc-DE70LPWp.js} +0 -0
  256. /package/dist/client/assets/{asm-CqqqWovZ.js → asm-Cmm7eHzH.js} +0 -0
  257. /package/dist/client/assets/{aurora-x-B9BHU0bK.js → aurora-x-CDeNXAV0.js} +0 -0
  258. /package/dist/client/assets/{awk-L5v-cuCL.js → awk-BWXHIvNe.js} +0 -0
  259. /package/dist/client/assets/{ayu-dark-YQNfFJx2.js → ayu-dark-DluEY0Gj.js} +0 -0
  260. /package/dist/client/assets/{ayu-light-_9Blof0L.js → ayu-light-C3h-C4tm.js} +0 -0
  261. /package/dist/client/assets/{ayu-mirage-ywKZgCHT.js → ayu-mirage-Bqwy1Gya.js} +0 -0
  262. /package/dist/client/assets/{ballerina-Dgg2a6zg.js → ballerina-B7ZEbQpA.js} +0 -0
  263. /package/dist/client/assets/{bat-wLloRoua.js → bat-Bo4NYOV-.js} +0 -0
  264. /package/dist/client/assets/{beancount-BCSJrVVf.js → beancount-D-usSTwE.js} +0 -0
  265. /package/dist/client/assets/{berry-DJXUHylF.js → berry-DKpUyyne.js} +0 -0
  266. /package/dist/client/assets/{bibtex-C6hGKKRT.js → bibtex-Ci_nEsc7.js} +0 -0
  267. /package/dist/client/assets/{bicep-RsAVk7ms.js → bicep-CUHmPFLl.js} +0 -0
  268. /package/dist/client/assets/{bird2-DTRIpKsA.js → bird2-C2hNVINV.js} +0 -0
  269. /package/dist/client/assets/{c3-DhlmE_oa.js → c3-CnJL0r0V.js} +0 -0
  270. /package/dist/client/assets/{cadence-gm_AXdjh.js → cadence-CQ2zXKGN.js} +0 -0
  271. /package/dist/client/assets/{catppuccin-frappe-CRaK-OXp.js → catppuccin-frappe-3VR1Za6u.js} +0 -0
  272. /package/dist/client/assets/{catppuccin-latte-CekmIWzD.js → catppuccin-latte-DwIHMF0Q.js} +0 -0
  273. /package/dist/client/assets/{catppuccin-macchiato-Pgs1_ylq.js → catppuccin-macchiato-DYnBP6_5.js} +0 -0
  274. /package/dist/client/assets/{catppuccin-mocha-CVFrnEg2.js → catppuccin-mocha-DYhrFGRu.js} +0 -0
  275. /package/dist/client/assets/{clarity-_nV8rm3T.js → clarity-SemFz856.js} +0 -0
  276. /package/dist/client/assets/{clojure-Dsywsvl2.js → clojure-DqKBuwfJ.js} +0 -0
  277. /package/dist/client/assets/{cmake-DoZviRk-.js → cmake-Bj61d0ZC.js} +0 -0
  278. /package/dist/client/assets/{codeowners-LcUICwIC.js → codeowners-C8r90Shi.js} +0 -0
  279. /package/dist/client/assets/{codeql-C0tRiarJ.js → codeql-oeQT6MSM.js} +0 -0
  280. /package/dist/client/assets/{common-lisp-BQXePP3H.js → common-lisp-Cv5bFMCO.js} +0 -0
  281. /package/dist/client/assets/{coq-DWR2ZlCV.js → coq-BrsZFFmf.js} +0 -0
  282. /package/dist/client/assets/{csharp-BpO6pU8h.js → csharp-Ct8U2NOr.js} +0 -0
  283. /package/dist/client/assets/{csv-guZ1Hczt.js → csv-Dx-8-gkx.js} +0 -0
  284. /package/dist/client/assets/{cue-DVp9_WvV.js → cue-CE9AQfxI.js} +0 -0
  285. /package/dist/client/assets/{cypher-3MHH4pYW.js → cypher-ClKdZ_lG.js} +0 -0
  286. /package/dist/client/assets/{d-CIAu_RLS.js → d-qD-0Kul2.js} +0 -0
  287. /package/dist/client/assets/{dark-plus-D6YuWbv0.js → dark-plus-Cs2F2srj.js} +0 -0
  288. /package/dist/client/assets/{dart-DYuQ6kUW.js → dart-DkHntEIa.js} +0 -0
  289. /package/dist/client/assets/{dax-BBIUHzFG.js → dax-BkyTk9wS.js} +0 -0
  290. /package/dist/client/assets/{desktop-i7Pu8H5c.js → desktop-Dlh5hvp9.js} +0 -0
  291. /package/dist/client/assets/{diff-BOMu6KnT.js → diff-woXpYk--.js} +0 -0
  292. /package/dist/client/assets/{docker-Jl7Opeg9.js → docker-IyjqRm3v.js} +0 -0
  293. /package/dist/client/assets/{dotenv-DNMkRfS9.js → dotenv-_5a1GRtc.js} +0 -0
  294. /package/dist/client/assets/{dracula-BRuhgxZx.js → dracula-BHWKrbxM.js} +0 -0
  295. /package/dist/client/assets/{dracula-soft-Bh-3NXEk.js → dracula-soft-5eyTD99u.js} +0 -0
  296. /package/dist/client/assets/{dream-maker-XsE3rknm.js → dream-maker-DW3nJb8Q.js} +0 -0
  297. /package/dist/client/assets/{emacs-lisp-DILRoF5l.js → emacs-lisp-C9PiwqqW.js} +0 -0
  298. /package/dist/client/assets/{everforest-dark-TN28LCtO.js → everforest-dark-sB-x3p7T.js} +0 -0
  299. /package/dist/client/assets/{everforest-light-Bie4zQAp.js → everforest-light-Df2xbC6M.js} +0 -0
  300. /package/dist/client/assets/{fennel-C5HmIS3y.js → fennel-DQxkIbk2.js} +0 -0
  301. /package/dist/client/assets/{fish-BLa94bES.js → fish-BJitypiv.js} +0 -0
  302. /package/dist/client/assets/{fluent-Dz5wDZec.js → fluent-C03EYrpw.js} +0 -0
  303. /package/dist/client/assets/{fortran-free-form-Dhgntk66.js → fortran-free-form-CYNrtFtB.js} +0 -0
  304. /package/dist/client/assets/{gdscript-cU6-22QG.js → gdscript-Cp2uCuqX.js} +0 -0
  305. /package/dist/client/assets/{gdshader-D10o9T_4.js → gdshader-CBce3t8t.js} +0 -0
  306. /package/dist/client/assets/{genie-BxoMb50b.js → genie-CV2tkWYe.js} +0 -0
  307. /package/dist/client/assets/{gherkin-B2lz9HMr.js → gherkin-DExj1W_8.js} +0 -0
  308. /package/dist/client/assets/{github-dark-D5NDXfHf.js → github-dark-C-LZuMrd.js} +0 -0
  309. /package/dist/client/assets/{github-dark-default-Bo_3g1lT.js → github-dark-default-DXG-b-1a.js} +0 -0
  310. /package/dist/client/assets/{github-dark-dimmed-BQUS-1Ln.js → github-dark-dimmed-Bx1FflLF.js} +0 -0
  311. /package/dist/client/assets/{github-dark-high-contrast-DIHLvRoS.js → github-dark-high-contrast-B_tTalzw.js} +0 -0
  312. /package/dist/client/assets/{github-light-Bw4sXpzB.js → github-light-EUqPIrTm.js} +0 -0
  313. /package/dist/client/assets/{github-light-default-B8bmeZPd.js → github-light-default-BXViO-2h.js} +0 -0
  314. /package/dist/client/assets/{github-light-high-contrast-CJI8nAIV.js → github-light-high-contrast-B68TUdTA.js} +0 -0
  315. /package/dist/client/assets/{gleam-9zwoUsHJ.js → gleam-CSRkHgEL.js} +0 -0
  316. /package/dist/client/assets/{gn-DLF2G5Ru.js → gn-ilITqXS6.js} +0 -0
  317. /package/dist/client/assets/{gnuplot-Bcm3DAiA.js → gnuplot-7GGW24-e.js} +0 -0
  318. /package/dist/client/assets/{go-CPlmKKFp.js → go-BJwz_mda.js} +0 -0
  319. /package/dist/client/assets/{groovy-Dg2VIq5p.js → groovy-CacY0gHj.js} +0 -0
  320. /package/dist/client/assets/{gruvbox-dark-hard-BzHG1YMb.js → gruvbox-dark-hard-C820rvS2.js} +0 -0
  321. /package/dist/client/assets/{gruvbox-dark-medium-C9UQOvAR.js → gruvbox-dark-medium-BPjhmG05.js} +0 -0
  322. /package/dist/client/assets/{gruvbox-dark-soft-xgYmK4Rn.js → gruvbox-dark-soft-MrdJrrXF.js} +0 -0
  323. /package/dist/client/assets/{gruvbox-light-hard-DxvMP-zF.js → gruvbox-light-hard-BC_s9l72.js} +0 -0
  324. /package/dist/client/assets/{gruvbox-light-medium-SxCJk4ze.js → gruvbox-light-medium-BAWPOn9u.js} +0 -0
  325. /package/dist/client/assets/{gruvbox-light-soft-B9XTNyng.js → gruvbox-light-soft-BSMLrYjP.js} +0 -0
  326. /package/dist/client/assets/{haskell-Cf52ssWB.js → haskell-D8IpX4py.js} +0 -0
  327. /package/dist/client/assets/{haxe-BiaDi9Ls.js → haxe-OTjmBuCE.js} +0 -0
  328. /package/dist/client/assets/{hcl-Dcb9DqV1.js → hcl-Dh228itO.js} +0 -0
  329. /package/dist/client/assets/{hjson-LjA2UJVG.js → hjson-CxZEssPk.js} +0 -0
  330. /package/dist/client/assets/{hlsl-Bdu4H644.js → hlsl-Cvrh5tZx.js} +0 -0
  331. /package/dist/client/assets/{horizon-DfLB6K3K.js → horizon-CE9ld1lL.js} +0 -0
  332. /package/dist/client/assets/{horizon-bright-BRcOD00n.js → horizon-bright-Br1oVSNq.js} +0 -0
  333. /package/dist/client/assets/{houston-pGeyqiDN.js → houston-CsvMBhTu.js} +0 -0
  334. /package/dist/client/assets/{hy-CAzVaHwm.js → hy-CZbG8q4J.js} +0 -0
  335. /package/dist/client/assets/{imba-CtP12ZBI.js → imba-DsUTQ-LC.js} +0 -0
  336. /package/dist/client/assets/{ini-DyaqLXx3.js → ini-B5eOa1yu.js} +0 -0
  337. /package/dist/client/assets/{json5-pkfxH3eL.js → json5-BR5RXkoi.js} +0 -0
  338. /package/dist/client/assets/{jsonc-D_yIvXTo.js → jsonc-CYpm1nAK.js} +0 -0
  339. /package/dist/client/assets/{jsonl-Cyj0VVep.js → jsonl-CmCQp5Yx.js} +0 -0
  340. /package/dist/client/assets/{jsonnet-CQ7ol0Ju.js → jsonnet-CJTPZ8u_.js} +0 -0
  341. /package/dist/client/assets/{jssm-MbQThoOI.js → jssm-DXw9l8Rf.js} +0 -0
  342. /package/dist/client/assets/{kanagawa-dragon-WzYJN5gB.js → kanagawa-dragon-CXtmUGW6.js} +0 -0
  343. /package/dist/client/assets/{kanagawa-lotus-rRmvCTTT.js → kanagawa-lotus-BN08jTvb.js} +0 -0
  344. /package/dist/client/assets/{kanagawa-wave-DLXZ_HFW.js → kanagawa-wave-CTweb8Dz.js} +0 -0
  345. /package/dist/client/assets/{kdl-MlO6iUnG.js → kdl-CsD5j6eV.js} +0 -0
  346. /package/dist/client/assets/{kotlin-Dugiuyzo.js → kotlin-DhhofPvG.js} +0 -0
  347. /package/dist/client/assets/{kusto-6Zx2e4iM.js → kusto-BUv0MjJC.js} +0 -0
  348. /package/dist/client/assets/{laserwave-Bms40fEM.js → laserwave-C_8bwKvT.js} +0 -0
  349. /package/dist/client/assets/{lean-BeI6HXzS.js → lean-CewbzKMR.js} +0 -0
  350. /package/dist/client/assets/{less-CgPeGWAa.js → less-DVTAwKKz.js} +0 -0
  351. /package/dist/client/assets/{light-plus-j7rlQ_-d.js → light-plus-DVQuIRkW.js} +0 -0
  352. /package/dist/client/assets/{llvm-Dw0AsrHc.js → llvm-Cm23YOpf.js} +0 -0
  353. /package/dist/client/assets/{log-9mP7MLA7.js → log-BNLmms1o.js} +0 -0
  354. /package/dist/client/assets/{logo-CEB74EGf.js → logo-Cluzi2Zq.js} +0 -0
  355. /package/dist/client/assets/{luau-C4m3ZsP4.js → luau-CNKltnaQ.js} +0 -0
  356. /package/dist/client/assets/{make-D05QTRNX.js → make-Dixweg8N.js} +0 -0
  357. /package/dist/client/assets/{markdown-UoFBNZst.js → markdown-BYOwaDjH.js} +0 -0
  358. /package/dist/client/assets/{material-theme-BLisqalJ.js → material-theme-Bm3Qr25_.js} +0 -0
  359. /package/dist/client/assets/{material-theme-darker-CMDfuiQ2.js → material-theme-darker-2IIEA8gg.js} +0 -0
  360. /package/dist/client/assets/{material-theme-lighter-CxAafT95.js → material-theme-lighter-uhdI0v04.js} +0 -0
  361. /package/dist/client/assets/{material-theme-ocean-B4-TfnzS.js → material-theme-ocean-CHQ94UKr.js} +0 -0
  362. /package/dist/client/assets/{material-theme-palenight-BiO5TPm2.js → material-theme-palenight-B5W6OYN7.js} +0 -0
  363. /package/dist/client/assets/{matlab-B1JUCa3X.js → matlab-D7qyCx1q.js} +0 -0
  364. /package/dist/client/assets/{mdx-5iivKtUB.js → mdx-DQZ5AkYe.js} +0 -0
  365. /package/dist/client/assets/{mermaid-e-18nCBH.js → mermaid-Bk4SNUv9.js} +0 -0
  366. /package/dist/client/assets/{min-dark-CwF0fYNT.js → min-dark-BSWPekZh.js} +0 -0
  367. /package/dist/client/assets/{min-light-DbuMCP1T.js → min-light-DDpmG2fV.js} +0 -0
  368. /package/dist/client/assets/{mipsasm-DcTRWKSO.js → mipsasm-BMqwQI7S.js} +0 -0
  369. /package/dist/client/assets/{mojo-DTlMyvmX.js → mojo-BgCJLMeH.js} +0 -0
  370. /package/dist/client/assets/{monokai-ShOh_SLr.js → monokai-CdkpiU2Y.js} +0 -0
  371. /package/dist/client/assets/{moonbit-Clq4Da-i.js → moonbit-CaWjb8XO.js} +0 -0
  372. /package/dist/client/assets/{move-Bl5q_pwm.js → move-B1IS1UjX.js} +0 -0
  373. /package/dist/client/assets/{narrat-CBsmOEAI.js → narrat-_X_XdTYD.js} +0 -0
  374. /package/dist/client/assets/{nextflow-groovy-aMR1iPI_.js → nextflow-groovy-Dc_ddanL.js} +0 -0
  375. /package/dist/client/assets/{night-owl-yTEb_Wwb.js → night-owl-DhmEMT88.js} +0 -0
  376. /package/dist/client/assets/{night-owl-light-huKGrUNo.js → night-owl-light-eJ-hLW7d.js} +0 -0
  377. /package/dist/client/assets/{nix-Cp796_WQ.js → nix-IvuFDN5E.js} +0 -0
  378. /package/dist/client/assets/{nord-DcX-wPJc.js → nord-Cb4Vim4T.js} +0 -0
  379. /package/dist/client/assets/{nushell-BfyhU0X_.js → nushell-DcLAeLz5.js} +0 -0
  380. /package/dist/client/assets/{objective-c-B4uJcreS.js → objective-c-D1A_Heim.js} +0 -0
  381. /package/dist/client/assets/{objective-cpp-jpQjhWST.js → objective-cpp-BsSzOQcm.js} +0 -0
  382. /package/dist/client/assets/{ocaml-Bd4ZvQW_.js → ocaml-O90oeIOV.js} +0 -0
  383. /package/dist/client/assets/{odin-CrrB9RSu.js → odin-B1RWQWA5.js} +0 -0
  384. /package/dist/client/assets/{one-dark-pro-CkQTfcfR.js → one-dark-pro-CLwyXe_n.js} +0 -0
  385. /package/dist/client/assets/{one-light-DThLWCfa.js → one-light-D7Lr4KcI.js} +0 -0
  386. /package/dist/client/assets/{openscad-D3TTqx3L.js → openscad-BUDT5pXO.js} +0 -0
  387. /package/dist/client/assets/{pairingUrl-BDy1QCMe.js → pairingUrl-rQM9kSGT.js} +0 -0
  388. /package/dist/client/assets/{pascal-DWfvzseC.js → pascal-4ZHwLPI5.js} +0 -0
  389. /package/dist/client/assets/{pierre-dark-DvfVJVsW.js → pierre-dark-PhHPzmGe.js} +0 -0
  390. /package/dist/client/assets/{pierre-light-B0eN5zia.js → pierre-light-DN22GkGi.js} +0 -0
  391. /package/dist/client/assets/{pkl-DdTB5XmH.js → pkl-ot-7Btpt.js} +0 -0
  392. /package/dist/client/assets/{plastic-B7VrxlmD.js → plastic-DQwYfKfQ.js} +0 -0
  393. /package/dist/client/assets/{plsql-BqXKIIPU.js → plsql-DGHpHOYJ.js} +0 -0
  394. /package/dist/client/assets/{po-C5lHU9KQ.js → po-BiJDBrnU.js} +0 -0
  395. /package/dist/client/assets/{poimandres-3PFzcj5x.js → poimandres-DRFjx7u4.js} +0 -0
  396. /package/dist/client/assets/{polar-C6NB-8j6.js → polar-C7UOKdEL.js} +0 -0
  397. /package/dist/client/assets/{postcss-vtVbFW0L.js → postcss-BXeXVLqQ.js} +0 -0
  398. /package/dist/client/assets/{powerquery-hquWt5c6.js → powerquery-DNMTfnFr.js} +0 -0
  399. /package/dist/client/assets/{powershell-CQ330hRP.js → powershell-DshXNtvi.js} +0 -0
  400. /package/dist/client/assets/{prisma-BQON8_gf.js → prisma-BsRQq5mF.js} +0 -0
  401. /package/dist/client/assets/{prolog-0b9P4dbF.js → prolog-iXnhIJG7.js} +0 -0
  402. /package/dist/client/assets/{proto-CLvr77Vf.js → proto-DB4EqR-F.js} +0 -0
  403. /package/dist/client/assets/{puppet-BT0t2Kuu.js → puppet-CDv2pdJW.js} +0 -0
  404. /package/dist/client/assets/{purescript-DkMvIExr.js → purescript-9MfHhQsQ.js} +0 -0
  405. /package/dist/client/assets/{python-wd06zWQV.js → python-gzcpVVnB.js} +0 -0
  406. /package/dist/client/assets/{qmldir-llhyId5r.js → qmldir-DCQb3MpD.js} +0 -0
  407. /package/dist/client/assets/{qss-CVMsEoHp.js → qss-Fe1Jh2GI.js} +0 -0
  408. /package/dist/client/assets/{racket-DBMp3jda.js → racket-DcIDlBhZ.js} +0 -0
  409. /package/dist/client/assets/{raku-BRxsLZ2S.js → raku-B3gFvitq.js} +0 -0
  410. /package/dist/client/assets/{red-qaVQBZPK.js → red-CJ3rzSJv.js} +0 -0
  411. /package/dist/client/assets/{reg-BDyfNUUq.js → reg-CRGYupPL.js} +0 -0
  412. /package/dist/client/assets/{rel-DdGqSVEp.js → rel-BtDbiS_P.js} +0 -0
  413. /package/dist/client/assets/{riscv-DV28q7Fg.js → riscv-Ckw8ddFX.js} +0 -0
  414. /package/dist/client/assets/{ron-CY4nyhYH.js → ron-VUp2lXgN.js} +0 -0
  415. /package/dist/client/assets/{rose-pine-CxNAz5gp.js → rose-pine-BthvhNj6.js} +0 -0
  416. /package/dist/client/assets/{rose-pine-dawn-xFu_N-rV.js → rose-pine-dawn-Dg85fqjY.js} +0 -0
  417. /package/dist/client/assets/{rose-pine-moon-DK-HvE6Y.js → rose-pine-moon-hon4tzzS.js} +0 -0
  418. /package/dist/client/assets/{rosmsg-K2kzuYs8.js → rosmsg-CAekHB0j.js} +0 -0
  419. /package/dist/client/assets/{rust-DZfNSAHN.js → rust-Cfkwpbl8.js} +0 -0
  420. /package/dist/client/assets/{sass-DIGpNETF.js → sass-DXrisJhu.js} +0 -0
  421. /package/dist/client/assets/{scala-Dm4xFcTl.js → scala-DKOlJaKm.js} +0 -0
  422. /package/dist/client/assets/{scheme-Dyo1jQfP.js → scheme-DQCgrYNe.js} +0 -0
  423. /package/dist/client/assets/{sdbl-C0HF5Szh.js → sdbl-bTVj8UrX.js} +0 -0
  424. /package/dist/client/assets/{slack-dark-jzjOs3ob.js → slack-dark-DnToyrRv.js} +0 -0
  425. /package/dist/client/assets/{slack-ochin-CrJIbU0m.js → slack-ochin-B2OO5cIa.js} +0 -0
  426. /package/dist/client/assets/{smalltalk-DD30vTCS.js → smalltalk-B16xEiuN.js} +0 -0
  427. /package/dist/client/assets/{snazzy-light-DWAW_zRS.js → snazzy-light-4G7pJPwS.js} +0 -0
  428. /package/dist/client/assets/{solarized-dark-QfOoX52e.js → solarized-dark-DV17i1UV.js} +0 -0
  429. /package/dist/client/assets/{solarized-light-3Q8bP0PY.js → solarized-light-DSh2HLQt.js} +0 -0
  430. /package/dist/client/assets/{solidity-DEXV1iYf.js → solidity-CKzVLygQ.js} +0 -0
  431. /package/dist/client/assets/{splunk-D3yrvsJB.js → splunk-BC2Px7Mm.js} +0 -0
  432. /package/dist/client/assets/{ssh-config-DJbT8CNv.js → ssh-config-BgfXC-Er.js} +0 -0
  433. /package/dist/client/assets/{stylus-D7yuZo8M.js → stylus-B6D30XZt.js} +0 -0
  434. /package/dist/client/assets/{swift-Dcka7tnA.js → swift-DonLKvLd.js} +0 -0
  435. /package/dist/client/assets/{synthwave-84-Cp0uE3e0.js → synthwave-84-nFMaYfgc.js} +0 -0
  436. /package/dist/client/assets/{system-verilog-0hmR2xuR.js → system-verilog-DJ5XKQeo.js} +0 -0
  437. /package/dist/client/assets/{systemd-JaNPzh8j.js → systemd-BxMlprV5.js} +0 -0
  438. /package/dist/client/assets/{talonscript-BPHMb4jr.js → talonscript-CohzipZa.js} +0 -0
  439. /package/dist/client/assets/{tasl-D07ubp53.js → tasl-DMoTqEGO.js} +0 -0
  440. /package/dist/client/assets/{tcl-DRL4sBMb.js → tcl-CZd0xW_V.js} +0 -0
  441. /package/dist/client/assets/{terraform-C8KioG9C.js → terraform-DswuEJGm.js} +0 -0
  442. /package/dist/client/assets/{tokyo-night-sVj4Hc0t.js → tokyo-night-oM2G3aXe.js} +0 -0
  443. /package/dist/client/assets/{toml-DOSf8MYV.js → toml-CcmNWLt0.js} +0 -0
  444. /package/dist/client/assets/{tsv-BpjyUJlf.js → tsv-sltzmVWM.js} +0 -0
  445. /package/dist/client/assets/{turtle-x_g5g_iY.js → turtle-ByJddavk.js} +0 -0
  446. /package/dist/client/assets/{typespec-Dfd73-vI.js → typespec-B88KGewJ.js} +0 -0
  447. /package/dist/client/assets/{typst-Dlb0aZU4.js → typst-DI99ib-x.js} +0 -0
  448. /package/dist/client/assets/{v-v-fvjFiX.js → v-DETTlOr0.js} +0 -0
  449. /package/dist/client/assets/{vala-D9-xQ00Z.js → vala-zf12oZj6.js} +0 -0
  450. /package/dist/client/assets/{vb-BReSiWNQ.js → vb-Djn5o6TS.js} +0 -0
  451. /package/dist/client/assets/{verilog-DfyNqRJD.js → verilog-CiiDBU1e.js} +0 -0
  452. /package/dist/client/assets/{vesper-Bv60RWju.js → vesper-D5bVUKB1.js} +0 -0
  453. /package/dist/client/assets/{vhdl-DbQyuq9g.js → vhdl-BroJfC0k.js} +0 -0
  454. /package/dist/client/assets/{viml-DhThL36t.js → viml-DvXPmvsu.js} +0 -0
  455. /package/dist/client/assets/{vitesse-black-CThrVPkw.js → vitesse-black-fwtXNY1n.js} +0 -0
  456. /package/dist/client/assets/{vitesse-dark-BrahNcrX.js → vitesse-dark-BZCL-v6S.js} +0 -0
  457. /package/dist/client/assets/{vitesse-light-BCKYomrh.js → vitesse-light-VbXTXTou.js} +0 -0
  458. /package/dist/client/assets/{vyper-e4AwrcSk.js → vyper-CgoNMtux.js} +0 -0
  459. /package/dist/client/assets/{wasm-Cia-w-S9.js → wasm-BnjxR4X6.js} +0 -0
  460. /package/dist/client/assets/{wasm-B1MrEdvT.js → wasm-ByWQv1Qj.js} +0 -0
  461. /package/dist/client/assets/{wenyan-CrxLlNlW.js → wenyan-C8pVoKbM.js} +0 -0
  462. /package/dist/client/assets/{wgsl-BpsXvExJ.js → wgsl-BsKzXJz4.js} +0 -0
  463. /package/dist/client/assets/{wikitext-C6XIgJ_Z.js → wikitext-ClFFjSW2.js} +0 -0
  464. /package/dist/client/assets/{wit-DkjXKZxQ.js → wit-DdvCle-K.js} +0 -0
  465. /package/dist/client/assets/{wolfram--3zV4S15.js → wolfram-DLL8P-h_.js} +0 -0
  466. /package/dist/client/assets/{zenscript-BLGtygmo.js → zenscript-BnlCZFoB.js} +0 -0
  467. /package/dist/client/assets/{zig-CaWWBKRf.js → zig-CMLA9XwU.js} +0 -0
@@ -0,0 +1,230 @@
1
+ #!/usr/bin/env node
2
+
3
+ //#region ../../packages/shared/src/sourceControl.ts
4
+ const GITHUB_CHANGE_REQUEST_PRESENTATION = {
5
+ icon: "github",
6
+ providerName: "GitHub",
7
+ shortName: "PR",
8
+ longName: "pull request",
9
+ pluralLongName: "pull requests",
10
+ providerLongName: "GitHub pull request",
11
+ checkoutCommandExample: "gh pr checkout 123",
12
+ urlExample: "https://github.com/owner/repo/pull/42"
13
+ };
14
+ const GITLAB_CHANGE_REQUEST_PRESENTATION = {
15
+ icon: "gitlab",
16
+ providerName: "GitLab",
17
+ shortName: "MR",
18
+ longName: "merge request",
19
+ pluralLongName: "merge requests",
20
+ providerLongName: "GitLab merge request",
21
+ checkoutCommandExample: "glab mr checkout 123",
22
+ urlExample: "https://gitlab.com/group/project/-/merge_requests/42"
23
+ };
24
+ const FORGEJO_CHANGE_REQUEST_PRESENTATION = {
25
+ icon: "forgejo",
26
+ providerName: "Forgejo",
27
+ shortName: "PR",
28
+ longName: "pull request",
29
+ pluralLongName: "pull requests",
30
+ providerLongName: "Forgejo pull request",
31
+ urlExample: "https://codeberg.org/owner/repo/pulls/42"
32
+ };
33
+ const AZURE_DEVOPS_CHANGE_REQUEST_PRESENTATION = {
34
+ icon: "azure-devops",
35
+ providerName: "Azure DevOps",
36
+ shortName: "PR",
37
+ longName: "pull request",
38
+ pluralLongName: "pull requests",
39
+ providerLongName: "Azure DevOps pull request",
40
+ checkoutCommandExample: "az repos pr checkout --id 123",
41
+ urlExample: "https://dev.azure.com/org/project/_git/repo/pullrequest/42"
42
+ };
43
+ const BITBUCKET_CHANGE_REQUEST_PRESENTATION = {
44
+ icon: "bitbucket",
45
+ providerName: "Bitbucket",
46
+ shortName: "PR",
47
+ longName: "pull request",
48
+ pluralLongName: "pull requests",
49
+ providerLongName: "Bitbucket pull request",
50
+ urlExample: "https://bitbucket.org/workspace/repo/pull-requests/42"
51
+ };
52
+ const GENERIC_CHANGE_REQUEST_PRESENTATION = {
53
+ icon: "change-request",
54
+ providerName: "source control",
55
+ shortName: "change request",
56
+ longName: "change request",
57
+ pluralLongName: "change requests",
58
+ providerLongName: "change request",
59
+ urlExample: "#42"
60
+ };
61
+ function resolveChangeRequestPresentation(provider) {
62
+ switch (provider?.kind) {
63
+ case "github":
64
+ case void 0: return GITHUB_CHANGE_REQUEST_PRESENTATION;
65
+ case "gitlab": return GITLAB_CHANGE_REQUEST_PRESENTATION;
66
+ case "forgejo": return FORGEJO_CHANGE_REQUEST_PRESENTATION;
67
+ case "azure-devops": return AZURE_DEVOPS_CHANGE_REQUEST_PRESENTATION;
68
+ case "bitbucket": return BITBUCKET_CHANGE_REQUEST_PRESENTATION;
69
+ case "unknown": return GENERIC_CHANGE_REQUEST_PRESENTATION;
70
+ }
71
+ }
72
+ function resolveChangeRequestPresentationForKind(kind) {
73
+ return resolveChangeRequestPresentation({
74
+ kind,
75
+ name: "",
76
+ baseUrl: ""
77
+ });
78
+ }
79
+ function getChangeRequestTerminologyForKind(kind) {
80
+ const presentation = resolveChangeRequestPresentationForKind(kind);
81
+ return {
82
+ shortLabel: presentation.shortName,
83
+ singular: presentation.longName
84
+ };
85
+ }
86
+ function normalizeLogin(value) {
87
+ const trimmed = value?.trim() ?? "";
88
+ return trimmed.length > 0 ? trimmed.toLowerCase() : null;
89
+ }
90
+ function normalizeAuthorAssociation(value) {
91
+ const trimmed = value?.trim() ?? "";
92
+ return trimmed.length > 0 ? trimmed.toUpperCase() : null;
93
+ }
94
+ function isOwnerAssociation(association) {
95
+ return association === "OWNER";
96
+ }
97
+ function isMaintainerAssociation(association) {
98
+ return association === "MEMBER" || association === "COLLABORATOR";
99
+ }
100
+ function classifySourceControlCommentAuthorRole(input) {
101
+ const commentAuthor = normalizeLogin(input.commentAuthor);
102
+ const itemAuthor = normalizeLogin(input.itemAuthor);
103
+ const repositoryOwner = normalizeLogin(input.repositoryOwner);
104
+ const authorAssociation = normalizeAuthorAssociation(input.authorAssociation);
105
+ const isOriginalAuthor = commentAuthor !== null && itemAuthor !== null && commentAuthor === itemAuthor;
106
+ const isRepositoryOwner = isOwnerAssociation(authorAssociation) || commentAuthor !== null && repositoryOwner !== null && commentAuthor === repositoryOwner;
107
+ const isRepositoryMaintainer = isMaintainerAssociation(authorAssociation);
108
+ return {
109
+ primary: isOriginalAuthor ? "author" : isRepositoryOwner ? "owner" : isRepositoryMaintainer ? "maintainer" : "participant",
110
+ isOriginalAuthor,
111
+ isRepositoryOwner,
112
+ isRepositoryMaintainer
113
+ };
114
+ }
115
+ /**
116
+ * Best-effort parse of the owner/login segment from GitHub issue, pull request,
117
+ * or repository URLs such as `https://github.com/owner/repo/issues/42`.
118
+ */
119
+ function parseGitHubRepositoryOwnerFromUrl(url) {
120
+ const trimmed = url?.trim() ?? "";
121
+ if (trimmed.length === 0) return null;
122
+ try {
123
+ const segments = new URL(trimmed).pathname.split("/").filter((segment) => segment.length > 0);
124
+ const owner = segments[0]?.trim() ?? "";
125
+ const repo = segments[1]?.trim() ?? "";
126
+ return owner.length > 0 && repo.length > 0 ? owner : null;
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ function parseRemoteHost(remoteUrl) {
132
+ const trimmed = remoteUrl.trim();
133
+ if (trimmed.length === 0) return null;
134
+ if (trimmed.startsWith("git@")) {
135
+ const hostWithPath = trimmed.slice(4);
136
+ const separatorIndex = hostWithPath.search(/[:/]/);
137
+ if (separatorIndex <= 0) return null;
138
+ return hostWithPath.slice(0, separatorIndex).toLowerCase();
139
+ }
140
+ try {
141
+ return new URL(trimmed).host.toLowerCase();
142
+ } catch {
143
+ return null;
144
+ }
145
+ }
146
+ function parseHostName(host) {
147
+ try {
148
+ return new URL(`https://${host}`).hostname.toLowerCase();
149
+ } catch {
150
+ return host.replace(/:\d+$/u, "").toLowerCase();
151
+ }
152
+ }
153
+ function toBaseUrl(host) {
154
+ return `https://${host}`;
155
+ }
156
+ function isGitHubHost(host) {
157
+ return host === "github.com" || host.includes("github");
158
+ }
159
+ function isGitLabHost(host) {
160
+ return host === "gitlab.com" || host.includes("gitlab");
161
+ }
162
+ function isForgejoHost(host) {
163
+ return host === "codeberg.org" || host === "code.forgejo.org" || host.includes("forgejo");
164
+ }
165
+ function isAzureDevOpsHost(host) {
166
+ return host === "dev.azure.com" || host.endsWith(".visualstudio.com");
167
+ }
168
+ function isBitbucketHost(host) {
169
+ return host === "bitbucket.org" || host.includes("bitbucket");
170
+ }
171
+ function detectSourceControlProviderFromRemoteUrl(remoteUrl) {
172
+ const host = parseRemoteHost(remoteUrl);
173
+ if (!host) return null;
174
+ const hostname = parseHostName(host);
175
+ if (isGitHubHost(hostname)) return {
176
+ kind: "github",
177
+ name: hostname === "github.com" ? "GitHub" : "GitHub Self-Hosted",
178
+ baseUrl: toBaseUrl(host)
179
+ };
180
+ if (isGitLabHost(hostname)) return {
181
+ kind: "gitlab",
182
+ name: hostname === "gitlab.com" ? "GitLab" : "GitLab Self-Hosted",
183
+ baseUrl: toBaseUrl(host)
184
+ };
185
+ if (isForgejoHost(hostname)) return {
186
+ kind: "forgejo",
187
+ name: hostname === "codeberg.org" ? "Codeberg" : "Forgejo",
188
+ baseUrl: toBaseUrl(host)
189
+ };
190
+ if (isAzureDevOpsHost(hostname)) return {
191
+ kind: "azure-devops",
192
+ name: "Azure DevOps",
193
+ baseUrl: toBaseUrl(host)
194
+ };
195
+ if (isBitbucketHost(hostname)) return {
196
+ kind: "bitbucket",
197
+ name: hostname === "bitbucket.org" ? "Bitbucket" : "Bitbucket Self-Hosted",
198
+ baseUrl: toBaseUrl(host)
199
+ };
200
+ return {
201
+ kind: "unknown",
202
+ name: host,
203
+ baseUrl: toBaseUrl(host)
204
+ };
205
+ }
206
+ //#endregion
207
+ Object.defineProperty(exports, "classifySourceControlCommentAuthorRole", {
208
+ enumerable: true,
209
+ get: function() {
210
+ return classifySourceControlCommentAuthorRole;
211
+ }
212
+ });
213
+ Object.defineProperty(exports, "detectSourceControlProviderFromRemoteUrl", {
214
+ enumerable: true,
215
+ get: function() {
216
+ return detectSourceControlProviderFromRemoteUrl;
217
+ }
218
+ });
219
+ Object.defineProperty(exports, "getChangeRequestTerminologyForKind", {
220
+ enumerable: true,
221
+ get: function() {
222
+ return getChangeRequestTerminologyForKind;
223
+ }
224
+ });
225
+ Object.defineProperty(exports, "parseGitHubRepositoryOwnerFromUrl", {
226
+ enumerable: true,
227
+ get: function() {
228
+ return parseGitHubRepositoryOwnerFromUrl;
229
+ }
230
+ });
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
-
4
3
  //#region ../../packages/shared/src/sourceControlContextFormatter.ts
5
4
  function formatComment(comment) {
6
5
  const ts = typeof comment.createdAt === "object" && comment.createdAt !== null && "toJSON" in comment.createdAt ? comment.createdAt.toJSON() : String(comment.createdAt);
@@ -53,11 +52,10 @@ function formatSourceControlContextsForAgent(contexts) {
53
52
  return formatChangeRequestSection(ctx.detail);
54
53
  }).join("\n\n")}`;
55
54
  }
56
-
57
55
  //#endregion
58
- Object.defineProperty(exports, 'formatSourceControlContextsForAgent', {
59
- enumerable: true,
60
- get: function () {
61
- return formatSourceControlContextsForAgent;
62
- }
63
- });
56
+ Object.defineProperty(exports, "formatSourceControlContextsForAgent", {
57
+ enumerable: true,
58
+ get: function() {
59
+ return formatSourceControlContextsForAgent;
60
+ }
61
+ });
@@ -52,6 +52,5 @@ function formatSourceControlContextsForAgent(contexts) {
52
52
  return formatChangeRequestSection(ctx.detail);
53
53
  }).join("\n\n")}`;
54
54
  }
55
-
56
55
  //#endregion
57
- export { formatSourceControlContextsForAgent as t };
56
+ export { formatSourceControlContextsForAgent as t };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "ryco": "dist/bin.mjs"
10
10
  },
11
11
  "type": "module",
12
- "version": "0.1.3",
12
+ "version": "0.1.4",
13
13
  "engines": {
14
14
  "node": "^22.16 || ^23.11 || >=24.10"
15
15
  },
@@ -18,7 +18,8 @@
18
18
  "README.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@anthropic-ai/claude-agent-sdk": "^0.2.111",
21
+ "@anthropic-ai/claude-agent-sdk": "^0.3.159",
22
+ "@anthropic-ai/sdk": "^0.100.1",
22
23
  "@effect/platform-bun": "4.0.0-beta.59",
23
24
  "@effect/platform-node": "4.0.0-beta.59",
24
25
  "@effect/sql-sqlite-bun": "4.0.0-beta.59",
@@ -38,6 +39,7 @@
38
39
  "@effect/sql-sqlite-bun": "4.0.0-beta.59",
39
40
  "@effect/vitest": "4.0.0-beta.59",
40
41
  "effect": "4.0.0-beta.59",
41
- "vite": "^8.0.0"
42
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.24",
43
+ "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.24"
42
44
  }
43
45
  }
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-CYzKIDNi.js";import{t as n}from"./index-B215HMv1.js";import{d as r}from"./toggle-BfBpNkCG.js";import{Da as i,as as a}from"./useSettings-BLDkflD_.js";import{c as o,l as s,s as c}from"./alert-D2R5HNlM.js";import{t as l}from"./compiler-runtime-BF315rzL.js";function u(e){return e===`1`||e===1||e===!0}function d(e){let{preview:t,...n}=e;return n}function f(e){let{diff:t,diffTurnId:n,diffFilePath:r,...i}=d(e);return{...i,diff:void 0,diffTurnId:void 0,diffFilePath:void 0,preview:`1`}}function p(e){let t=u(e.preview)?`1`:void 0;return t?{preview:t}:{}}var m={numeric:!0,sensitivity:`base`};function h(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(e=>e.length>0)}function g(e,t){return e.name.localeCompare(t.name,void 0,m)}function _(e){return!(`additions`in e)||typeof e.additions!=`number`||!(`deletions`in e)||typeof e.deletions!=`number`?null:{additions:e.additions,deletions:e.deletions}}function v(e){let t=e.children.map(e=>e.kind===`directory`?v(e):e),n={...e,children:t};for(;n.children.length===1&&n.children[0]?.kind===`directory`;){let e=n.children[0];n={kind:`directory`,name:`${n.name}/${e.name}`,path:e.path,stat:e.stat,children:e.children}}return n}function y(e){let t=Array.from(e.directories.values()).toSorted(g).map(e=>({kind:`directory`,name:e.name,path:e.path,stat:{additions:e.stat.additions,deletions:e.stat.deletions},children:y(e)})).map(e=>v(e)),n=e.files.toSorted(g);return[...t,...n]}function b(e){return e.reduce((e,t)=>{let n=_(t);return n?{additions:e.additions+n.additions,deletions:e.deletions+n.deletions}:e},{additions:0,deletions:0})}function x(e){let t={name:``,path:``,stat:{additions:0,deletions:0},directories:new Map,files:[]};for(let n of e){let e=h(n.path);if(e.length===0)continue;let r=n.kind===`directory`,i=_(n),a=[t],o=t;for(let t of r?e:e.slice(0,-1)){let e=o.path?`${o.path}/${t}`:t,n=o.directories.get(t);if(n)o=n;else{let n={name:t,path:e,stat:{additions:0,deletions:0},directories:new Map,files:[]};o.directories.set(t,n),o=n}a.push(o)}if(!r){let t=e.join(`/`),n=e.at(-1);if(!n)continue;o.files.push({kind:`file`,name:n,path:t,stat:i})}if(i)for(let e of a)e.stat.additions+=i.additions,e.stat.deletions+=i.deletions}return y(t)}var S=l(),C=e(t(),1),w=a();function T(e){return e.additions>0||e.deletions>0}var E=(0,C.memo)(function(e){let t=(0,S.c)(14),{additions:n,deletions:r,showParentheses:i}=e,a=i===void 0?!1:i,o;t[0]===a?o=t[1]:(o=a&&(0,w.jsx)(`span`,{className:`text-muted-foreground/70`,children:`(`}),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,n]}),t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(`span`,{className:`mx-0.5 text-muted-foreground/70`,children:`/`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,w.jsxs)(`span`,{className:`text-destructive`,children:[`-`,r]}),t[5]=r,t[6]=l);let u;t[7]===a?u=t[8]:(u=a&&(0,w.jsx)(`span`,{className:`text-muted-foreground/70`,children:`)`}),t[7]=a,t[8]=u);let d;return t[9]!==o||t[10]!==s||t[11]!==l||t[12]!==u?(d=(0,w.jsxs)(w.Fragment,{children:[o,s,c,l,u]}),t[9]=o,t[10]=s,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}),D=null,O=null;function k(){return D?Promise.resolve(D):(O??=n(()=>import(`./vscode-icons-Ciu6Pjk4.js`).then(e=>(D=e.getVscodeIconUrlForEntry,D)),[]).catch(e=>{throw O=null,e}),O)}function A(e,t,n){let r=(0,S.c)(9),i;r[0]!==t||r[1]!==e||r[2]!==n?(i=()=>D?D(e,t,n):null,r[0]=t,r[1]=e,r[2]=n,r[3]=i):i=r[3];let[a,o]=(0,C.useState)(i),s,c;return r[4]!==t||r[5]!==e||r[6]!==n?(s=()=>{if(D){o(D(e,t,n));return}let r=!1;return o(null),k().then(i=>{r||o(i(e,t,n))}).catch(()=>{r||o(null)}),()=>{r=!0}},c=[t,e,n],r[4]=t,r[5]=e,r[6]=n,r[7]=s,r[8]=c):(s=r[7],c=r[8]),(0,C.useEffect)(s,c),a}var j=(0,C.memo)(function(e){let t=(0,S.c)(11),[n,r]=(0,C.useState)(null),a=A(e.pathValue,e.kind,e.theme);if(!a||a!==null&&n===a){let n;return t[0]!==e.className||t[1]!==e.kind?(n=e.kind===`directory`?(0,w.jsx)(c,{className:i(`size-4 text-muted-foreground/80`,e.className)}):(0,w.jsx)(s,{className:i(`size-4 text-muted-foreground/80`,e.className)}),t[0]=e.className,t[1]=e.kind,t[2]=n):n=t[2],n}let o;t[3]===e.className?o=t[4]:(o=i(`size-4 shrink-0`,e.className),t[3]=e.className,t[4]=o);let l;t[5]===a?l=t[6]:(l=()=>r(a),t[5]=a,t[6]=l);let u;return t[7]!==a||t[8]!==o||t[9]!==l?(u=(0,w.jsx)(`img`,{src:a,alt:``,"aria-hidden":`true`,className:o,loading:`lazy`,onError:l}),t[7]=a,t[8]=o,t[9]=l,t[10]=u):u=t[10],u}),M={},N=(0,C.memo)(function(e){let{files:t,allDirectoriesExpanded:n,onSelectFile:a,resolvedTheme:s,selectedFilePath:l=null,showStats:u=!0}=e,d=(0,C.useMemo)(()=>x(t),[t]),f=(0,C.useMemo)(()=>P(d).join(`\0`),[d]),p=`${n?`expanded`:`collapsed`}\u0000${f}`,[m,h]=(0,C.useState)(()=>({key:p,overrides:{}})),g=m.key===p?m.overrides:M,_=(0,C.useCallback)(e=>{h(t=>{let r=t.key===p?t.overrides:{};return{key:p,overrides:{...r,[e]:!(r[e]??n)}}})},[n,p]),v=(e,t)=>{let d=8+t*14;if(e.kind===`directory`){let a=g[e.path]??n;return(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`button`,{type:`button`,"data-scroll-anchor-ignore":!0,className:`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80`,style:{paddingLeft:`${d}px`},onClick:()=>_(e.path),children:[(0,w.jsx)(r,{"aria-hidden":`true`,className:i(`size-3.5 shrink-0 text-muted-foreground/70 transition-transform`,a&&`rotate-90`)}),a?(0,w.jsx)(c,{className:`size-3.5 shrink-0 text-muted-foreground/75`}):(0,w.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground/75`}),(0,w.jsx)(`span`,{"data-tree-label":!0,className:`truncate font-mono text-[11px] text-muted-foreground/90 group-hover/tree-row:text-foreground/90`,children:e.name}),u&&T(e.stat)&&(0,w.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,w.jsx)(E,{additions:e.stat.additions,deletions:e.stat.deletions})})]}),a&&(0,w.jsx)(`div`,{className:`space-y-0.5`,children:e.children.map(e=>v(e,t+1))})]},`dir:${e.path}`)}return(0,w.jsxs)(`button`,{type:`button`,className:i(`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80`,l===e.path&&`bg-accent text-accent-foreground hover:bg-accent`),style:{paddingLeft:`${d}px`},onClick:()=>a(e.path),children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,w.jsx)(j,{pathValue:e.path,kind:`file`,theme:s,className:`size-3.5 text-muted-foreground/70`}),(0,w.jsx)(`span`,{"data-tree-label":!0,className:i(`truncate font-mono text-[11px] text-muted-foreground/80 group-hover/tree-row:text-foreground/90`,l===e.path&&`text-accent-foreground`),children:e.name}),u&&e.stat&&(0,w.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,w.jsx)(E,{additions:e.stat.additions,deletions:e.stat.deletions})})]},`file:${e.path}`)};return(0,w.jsx)(`div`,{className:`space-y-0.5`,children:d.map(e=>v(e,0))})});function P(e){let t=[];for(let n of e)n.kind===`directory`&&(t.push(n.path),t.push(...P(n.children)));return t}export{b as a,d as c,T as i,j as n,f as o,E as r,p as s,N as t};
@@ -1,75 +0,0 @@
1
- import{i as e,t}from"./react-CYzKIDNi.js";import{$ as n,A as r,B as i,D as a,E as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,P as g,Q as _,R as v,S as y,U as b,V as x,W as S,X as C,Y as w,Z as T,c as E,d as D,et as O,f as k,g as A,h as j,i as M,j as N,m as P,n as ee,nt as F,o as te,p as I,q as L,r as ne,s as re,x as R,z as ie}from"./DiffPanelShell-BmfxFBmp.js";import{A as z,C as B,D as ae,E as oe,M as se,N as ce,O as le,S as V,T as ue,_ as de,a as fe,b as pe,c as H,d as me,f as U,g as W,h as he,i as G,j as K,k as q,l as ge,m as _e,n as ve,o as ye,p as be,r as xe,s as Se,t as Ce,u as we,v as J,w as Te,x as Ee,y as De}from"./text-wrap-CnmG6WhR.js";import{M as Oe,a as ke,d as Ae,f as je,o as Me,u as Ne}from"./toggle-BfBpNkCG.js";import{$o as Pe,Da as Y,Vt as Fe,Xt as Ie,Zo as Le,a as Re,as as ze,kt as Be,n as Ve,u as He}from"./useSettings-BLDkflD_.js";import{A as Ue,D as We,M as Ge,N as Ke,R as qe,j as Je,p as Ye,s as Xe}from"./separator-CXZK6vFp.js";import{Mo as Ze}from"./primary-BKkx6aqv.js";import{a as Qe,d as $e,f as et,l as tt,p as nt,t as rt}from"./DiffWorkerPoolProvider-B2FLS8eo.js";import"./compiler-runtime-BF315rzL.js";import{n as it}from"./useTheme-EFHXLM5e.js";import{n as at,t as ot}from"./toggle-group-Dp1gg0mX.js";var st=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function ct(e){return g({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function lt(e){return g({tagName:`div`,children:[g({tagName:`span`,children:[u(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function ut(e){return g({tagName:`div`,children:[s({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function X({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(g({tagName:`div`,children:[u(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(ut(`up`)),s++),o||(e.push(ut(`down`)),s++)):(e.push(ut(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(g({tagName:`div`,children:[g({tagName:`span`,children:[u(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(g({tagName:`div`,children:[u(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(g({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(g({tagName:`slot`,properties:{name:i}})),g({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function dt(e,t){return`hunk-separator-${e}-${t}`}function ft(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function pt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var mt=-1,ht=class{__id=`diff-hunks-renderer:${++mt}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:l},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=q(e.theme??l)?o():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&(this.renderCache=void 0),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??i}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t===`change`?{gutterLineType:e===`deletions`?`change-deletion`:`change-addition`}:{gutterLineType:t}}createAnnotationElement(e){return ae(e)}getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:u=100,hunkSeparators:d=`line-info`,lineDiffType:f=`word-alt`,maxLineDiffLength:p=1e3,overflow:m=`scroll`,theme:h=l,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,useTokenTransformer:v=!1,useCSSClasses:y=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:u,hunkSeparators:d,lineDiffType:f,maxLineDiffLength:p,overflow:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,useTokenTransformer:v,useCSSClasses:y}}async initializeHighlighter(){return this.highlighter=await a(Te(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getDiffResultCache(e);n!=null&&!j(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!D(e),options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result??this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??y(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:Ee(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||e!==n.diff||!j(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff,t=x){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),i=this.workerManager?.getDiffResultCache(e);i!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...i});let{options:a,forceRender:o}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&(e!==this.renderCache.diff||!le(this.renderCache.renderRange,t)))&&(this.renderCache.diff=e,this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,pt(t)||n?!0:this.expandedHunks,r),this.renderCache.renderRange=t),t.totalLines>0&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??y(e.name);let t=this.highlighter!=null&&q(a.theme),n=this.highlighter!=null&&z(this.computedLang);if(this.highlighter!=null&&t&&(o||!this.renderCache.highlighted&&n||this.renderCache.result==null)){let{result:t,options:r}=this.renderDiffWithHighlighter(e,this.highlighter,!n);this.renderCache={diff:e,options:r,highlighted:n,result:t,renderRange:void 0}}(!t||!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=x){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return ue({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){this.computedLang=e.lang??y(e.name);let t=this.highlighter!=null&&q(this.options.theme??l),n=this.highlighter!=null&&z(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:k(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;let r=!this.renderCache.highlighted||!j(this.renderCache.options,n)||this.renderCache.diff!==e;this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let d=a===`unified`,f=[],p=[],g=[],_=[],{additionLines:v,deletionLines:y}=n,b={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:p,unifiedContentAST:g,unifiedGutterAST:h(),deletionsGutterAST:h(),additionsGutterAST:h(),expansionLineCount:c,hunkData:_,incrementRowCount(e=1){b.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:b.unifiedGutterAST.children.push(t);break;case`deletions`:b.deletionsGutterAST.children.push(t);break;case`additions`:b.additionsGutterAST.children.push(t);break}}},x=St(e),S={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(b.pushToGutter(`additions`,N(void 0,`buffer`,this.size)),f?.push(ct(this.size))):(b.pushToGutter(`deletions`,N(void 0,`buffer`,this.size)),p?.push(ct(this.size))),this.size=0,this.side=void 0}}},C=(e,t,n,r,i)=>{b.pushToGutter(e,m(t,n,r,i))};function w(e){S.flush(),a===`unified`?bt(`unified`,e,b):(bt(`deletions`,e,b),bt(`additions`,e,b))}I({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&S.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=a===`unified`?d:l,p={type:c,hunkIndex:t,lineIndex:f,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(p);n?.before!=null&&_t(n.before,b);let r=s==null?void 0:y[s.lineIndex],i=o==null?void 0:v[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});C(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=xt(r,u.contentProperties)):i=xt(i,u.contentProperties),yt({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,f),createAnnotationElement:e=>this.createAnnotationElement(e),context:b}),n?.after!=null&&_t(n.after,b)}else{let n=this.getSplitInjectedRowsForLine?.(p);n?.before!=null&&vt(n.before,b,S);let r=s==null?void 0:y[s.lineIndex],i=o==null?void 0:v[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(d!=null){if(S.side!=null&&S.side!==d)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);S.side=d,S.increment()}let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,f);if(m!=null&&S.size>0&&S.flush(),s!=null){let e=xt(r,a.contentProperties);C(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=xt(i,u.contentProperties);C(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}yt({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:b}),n?.after!=null&&vt(n.after,b,S)}let m=s?.noEOFCR??!1,h=o?.noEOFCR??!1;if(h||m){if(m){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(b.unifiedContentAST.push(lt(e)),b.pushToGutter(`unified`,N(e,`metadata`,1))):(b.deletionsContentAST.push(lt(e)),b.pushToGutter(`deletions`,N(e,`metadata`,1)),h||(b.pushToGutter(`additions`,N(void 0,`buffer`,1)),b.additionsContentAST.push(ct(1))))}if(h){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(b.unifiedContentAST.push(lt(e)),b.pushToGutter(`unified`,N(e,`metadata`,1))):(b.additionsContentAST.push(lt(e)),b.pushToGutter(`additions`,N(e,`metadata`,1)),m||(b.pushToGutter(`deletions`,N(void 0,`buffer`,1)),b.deletionsContentAST.push(ct(1))))}b.incrementRowCount(1)}i>0&&u!==`simple`&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:x,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),b.incrementRowCount(1)}}),a===`split`&&S.flush();let T=Math.max(ft(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),E=t.bufferBefore>0||t.bufferAfter>0,D=!d&&e.type!==`deleted`,O=!d&&e.type!==`new`,k=b.rowCount>0||E;f=D&&k?f:void 0,p=O&&k?p:void 0,g=d&&k?g:void 0;let A=this.createPreElement(p!=null&&f!=null,T);return{unifiedGutterAST:d&&k?b.unifiedGutterAST.children:void 0,unifiedContentAST:g,deletionsGutterAST:O&&k?b.deletionsGutterAST.children:void 0,deletionsContentAST:p,additionsGutterAST:D&&k?b.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:_,preNode:A,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:T,rowCount:b.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=h(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,V(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(g({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(g({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(g({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return r(this.renderFullAST(e,t))}renderPartialHTML(e,t){return r(t==null?e:g({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(B(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(B(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t}=this.getOptionsWithDefaults();return oe({fileOrDiff:e,mode:t})}};function gt(e){return`${e} unmodified line${e>1?`s`:``}`}function _t(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function vt(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function yt({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,N(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,N(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,N(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function bt(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,X({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(X({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,X({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(X({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=dt(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,X({type:c.hunkSeparators,content:gt(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(X({type:c.hunkSeparators,content:gt(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function xt(e,t){return e==null||e.type!==`element`||t==null?e:{...e,properties:{...e.properties,...t}}}function St(e){let t=e.hunks.at(-1);if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),r=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==r)throw Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${r}) for ${e.name}`);return Math.min(n,r)}function Ct(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function wt(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function Tt(e){let t=e[0];if(t!==`+`&&t!==`-`&&t!==` `&&t!==`\\`){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}let n=e.substring(1);return{line:n===``?`
2
- `:n,type:t===` `?`context`:t===`\\`?`metadata`:t===`+`?`addition`:`deletion`}}function Et(e,t,n=!1){let r=w.test(e),i=e.split(r?w:F),a,o=[];for(let e of i){if(r&&!w.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!F.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=Dt(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function Dt(e,{cacheKey:t,isGitDiff:r=w.test(e),oldFile:i,newFile:a,throwOnError:o=!1}={}){let s=0,c=e.split(d),l,u=i==null||a==null,m=0,h=0;for(let e of c){let c=e.split(O),d=c.shift();if(d==null){if(o)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let g=d.match(_),v=0,y=0;if(g==null||l==null){if(l!=null){if(o)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}l={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:u,additionLines:!u&&i!=null&&a!=null?a.contents.split(O):[],deletionLines:!u&&i!=null&&a!=null?i.contents.split(O):[],cacheKey:t},l.additionLines.length===1&&a?.contents===``&&(l.additionLines.length=0),l.deletionLines.length===1&&i?.contents===``&&(l.deletionLines.length=0),c.unshift(d);for(let e of c){let t=e.match(r?L:f);if(e.startsWith(`diff --git`)){let[,,t,,n]=e.trim().match(p)??[];l.name=n.trim(),t!==n&&(l.prevName=t.trim())}else if(t!=null){let[,e,n]=t;e===`---`&&n!==`/dev/null`?(l.prevName=n.trim(),l.name=n.trim()):e===`+++`&&n!==`/dev/null`&&(l.name=n.trim())}else if(r){if(e.startsWith(`new mode `)&&(l.mode=e.replace(`new mode`,``).trim()),e.startsWith(`old mode `)&&(l.prevMode=e.replace(`old mode`,``).trim()),e.startsWith(`new file mode`)&&(l.type=`new`,l.mode=e.replace(`new file mode`,``).trim()),e.startsWith(`deleted file mode`)&&(l.type=`deleted`,l.mode=e.replace(`deleted file mode`,``).trim()),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?l.type=`rename-pure`:l.type=`rename-changed`),e.startsWith(`index `)){let[,t,r,i]=e.trim().match(n)??[];t!=null&&(l.prevObjectId=t),r!=null&&(l.newObjectId=r),i!=null&&(l.mode=i)}e.startsWith(`rename from `)&&(l.prevName=e.replace(`rename from `,``).trim()),e.startsWith(`rename to `)&&(l.name=e.replace(`rename to `,``).trim())}}continue}let b,x;for(;c.length>0&&(c[c.length-1]===`
3
- `||c[c.length-1]===`\r`||c[c.length-1]===`\r
4
- `||c[c.length-1]===``);)c.pop();let S=parseInt(g[3]),C=parseInt(g[1]);m=u?m:C-1,h=u?h:S-1;let w={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(g[4]??`1`),additionStart:S,additionLines:v,deletionCount:parseInt(g[2]??`1`),deletionStart:C,deletionLines:y,deletionLineIndex:m,additionLineIndex:h,hunkContent:[],hunkContext:g[5],hunkSpecs:d,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(w.additionCount)||isNaN(w.deletionCount)||isNaN(w.additionStart)||isNaN(w.deletionStart)){if(o)throw Error(`parsePatchContent: invalid hunk metadata`);console.error(`parsePatchContent: invalid hunk metadata`,w);continue}for(let e of c){let t=Tt(e);if(t==null){console.error(`processFile: invalid rawLine:`,e);continue}let{type:n,line:r}=t;if(n===`addition`)(b==null||b.type!==`change`)&&(b=kt(`change`,m,h),w.hunkContent.push(b)),h++,u&&l.additionLines.push(r),b.additions++,v++,x=`addition`;else if(n===`deletion`)(b==null||b.type!==`change`)&&(b=kt(`change`,m,h),w.hunkContent.push(b)),m++,u&&l.deletionLines.push(r),b.deletions++,y++,x=`deletion`;else if(n===`context`)(b==null||b.type!==`context`)&&(b=kt(`context`,m,h),w.hunkContent.push(b)),h++,m++,u&&(l.deletionLines.push(r),l.additionLines.push(r)),b.lines++,x=`context`;else if(n===`metadata`&&b!=null){if(b.type===`context`?(w.noEOFCRAdditions=!0,w.noEOFCRDeletions=!0):x===`deletion`?w.noEOFCRDeletions=!0:x===`addition`&&(w.noEOFCRAdditions=!0),u&&(x===`addition`||x===`context`)){let e=l.additionLines.length-1;e>=0&&(l.additionLines[e]=R(l.additionLines[e]))}if(u&&(x===`deletion`||x===`context`)){let e=l.deletionLines.length-1;e>=0&&(l.deletionLines[e]=R(l.deletionLines[e]))}}}w.additionLines=v,w.deletionLines=y,w.collapsedBefore=Math.max(w.additionStart-1-s,0),l.hunks.push(w),s=w.additionStart+w.additionCount-1;for(let e of w.hunkContent)e.type===`context`?(w.splitLineCount+=e.lines,w.unifiedLineCount+=e.lines):(w.splitLineCount+=Math.max(e.additions,e.deletions),w.unifiedLineCount+=e.deletions+e.additions);w.splitLineStart=l.splitLineCount+w.collapsedBefore,w.unifiedLineStart=l.unifiedLineCount+w.collapsedBefore,l.splitLineCount+=w.collapsedBefore+w.splitLineCount,l.unifiedLineCount+=w.collapsedBefore+w.unifiedLineCount}if(l!=null){if(l.hunks.length>0&&!u&&l.additionLines.length>0&&l.deletionLines.length>0){let e=l.hunks[l.hunks.length-1],t=e.additionStart+e.additionCount-1,n=l.additionLines.length,r=Math.max(n-t,0);l.splitLineCount+=r,l.unifiedLineCount+=r}return r||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type=`rename-changed`:l.type=`rename-pure`:(i==null||i.contents===``)&&a!=null&&a.contents!==``?l.type=`new`:i!=null&&i.contents!==``&&(a==null||a.contents===``)&&(l.type=`deleted`)),l.type!==`rename-pure`&&l.type!==`rename-changed`&&(l.prevName=void 0),l}}function Ot(e,t,n=!1){let r=[];for(let i of e.split(v))try{r.push(Et(i,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function kt(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function At(e,t,n,r=!1){let i=Dt(P(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var jt=-1,Mt=class{static LoadedCustomComponent=!0;__id=`file-diff:${++jt}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:l},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new K,this.scrollSyncManager=new st,this.interactionManager=new se(`diff`,ce(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return{...e,headerRenderMode:e.renderCustomHeader==null?`default`:`custom`,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators}}createHunksRenderer(e){return new ht(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions(ce(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),!(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=``),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML=``,this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),Ft(this.pre,Nt({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||It(this.headerElement,Pt({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){U(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){let{diffStyle:i=`split`,overflow:a=`scroll`}=this.options;this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?At(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,a===`wrap`),a===`scroll`&&i===`split`&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,preventEmit:i=!1,lineAnnotations:a,fileContainer:o,containerWrapper:s,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:u=!1}=this.options,d=u?void 0:l,f=e!=null&&t!=null&&(!A(e,this.deletionFile)||!A(t,this.additionFile)),p=n!=null&&n!==this.fileDiff,m=a!=null&&(a.length>0||this.lineAnnotations.length>0)?a!==this.lineAnnotations:!1;if(!u&&le(d,this.renderRange)&&!r&&!m&&(n!=null&&n===this.fileDiff||n==null&&!f))return!1;let{renderRange:h}=this;if(this.renderRange=d,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&f&&(p=!0,this.fileDiff=At(e,t,this.options.parseDiffOptions)):this.fileDiff=n,a!=null&&this.setLineAnnotations(a),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:g=`split`,disableErrorHandling:_=!1,disableFileHeader:v=!1,overflow:y=`scroll`,themeType:b=`system`}=this.options;if(v&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,s),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,c);e!=null&&this.applyThemeState(o,e.themeStyles,b,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,o),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(_)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(r,m,f||p)&&this.applyPartialRender({previousRenderRange:h,renderRange:d}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,d);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(o,t.themeStyles,b,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,o),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,d),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,y===`wrap`),y===`scroll`&&g===`split`?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(_)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}emitPostRender(){this.fileContainer!=null&&this.options.onPostRender?.(this.fileContainer,this)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!wt(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${B(r)}`,a=this.annotationCache.get(i);if(a==null||!Ct(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:J(B(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=de();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let n=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(`diffs-container`),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=pe;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,i=r(e);if(i!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=i;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:a,renderHeaderPrefix:o,renderHeaderMetadata:s}=this.options;if(a!=null){let e=a(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ie,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let c=o?.(n)??void 0,l=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,T,c),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,C,l),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=W(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=he(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n;this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a||(this.themeCSSStyle=we({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:_e(t,a)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{themeStyles:t,themeType:a,baseThemeType:r})}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=be({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=be({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=be({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Lt(t[0]),i=Lt(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||t==null){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};De(u,this.appliedPreAttributes)||(me(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML=``,n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let r=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.innerHTML=``,r.appendChild(this.errorWrapper);let i=document.createElement(`div`);i.dataset.errorMessage=``,i.innerText=e.message,this.errorWrapper.appendChild(i);let a=document.createElement(`pre`);a.dataset.errorStack=``,a.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Nt({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Pt({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Ft(e,t,n=!1){return!n&&e==null&&t}function It(e,t,n=!1){return e==null&&t&&!n}function Lt(e){if(!(e==null||e.type!==`element`))return e.children??[]}function Rt({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function zt(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Bt(n,e.startContentIndex)}}function Bt(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function Vt(e,t){let n={...b,...t};return n.hunkSeparatorHeight=Ht(e,t?.hunkSeparatorHeight),n}function Ht(e,t){if(t!=null)return t;switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var Ut=-1,Wt=class extends Mt{__id=`little-virtualized-file-diff:${++Ut}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;isSetup=!1;virtualizer;constructor(e,t,n,r,i=!1){super(e,r,i);let{hunkSeparators:a=`line-info`}=this.options;this.virtualizer=t,this.metrics=Vt(typeof a==`function`?`custom`:a,n)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(e==null)return;let t=this.options.diffStyle,n=this.options.overflow,r=this.options.collapsed;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow||r!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e=`scroll`}=this.options;if(this.fileContainer!=null&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.fileContainer==null||this.fileDiff==null){this.height=0;return}if(e===`scroll`&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1,r=t===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(let e of r){if(e==null)continue;let r=e.children[1];if(r instanceof HTMLElement)for(let e of r.children){if(!(e instanceof HTMLElement))continue;let r=e.dataset.lineIndex;if(r==null)continue;let i=Kt(r,t),a=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in e.nextElementSibling.dataset||`noNewline`in e.nextElementSibling.dataset)&&(`noNewline`in e.nextElementSibling.dataset&&(o=!0),a+=e.nextElementSibling.getBoundingClientRect().height);let s=this.getLineHeight(i,o);a!==s&&(n=!0,a===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,a))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),this.isSetup=!1,super.cleanUp()}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)};setVisibility(e){this.fileContainer!=null&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=this.height===0;if(this.height=0,this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1,hunkSeparators:a=`line-info`}=this.options,{diffHeaderHeight:o,fileGap:s,hunkSeparatorHeight:c}=this.metrics,l=this.getDiffStyle(),u=a!==`simple`&&a!==`metadata`&&a!==`line-info-basic`?s:0;if(t?a!==`simple`&&a!==`metadata`&&(this.height+=s):this.height+=o,!r&&(I({diff:this.fileDiff,diffStyle:l,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:r,additionLine:i})=>{let o=i==null?r.splitLineIndex:i.splitLineIndex,s=i==null?r.unifiedLineIndex:i.unifiedLineIndex,d=(i?.noEOFCR??!1)||(r?.noEOFCR??!1);t>0&&(e>0&&(this.height+=u),this.height+=c+u),this.height+=this.getLineHeight(l===`split`?o:s,d),n>0&&a!==`simple`&&(this.height+=u+c)}}),this.fileDiff.hunks.length>0&&(this.height+=s),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...i}={}){let{isSetup:a}=this;if(this.fileDiff??=r??(t!=null&&n!=null?At(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(a?this.top??=this.virtualizer.getOffsetInScrollContainer(e):(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height),this.isSetup=!0),!this.isVisible)return this.renderPlaceholder(this.height);let o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top,o);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:s,oldFile:t,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??`split`}getExpandedRegion(e,t,n){if(n<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(t),o=Math.min(Math.max(a.fromStart,0),n),s=Math.min(Math.max(a.fromEnd,0),n),c=o+s,l=c>=n;return{fromStart:o,fromEnd:s,collapsedLines:Math.max(n-c,0),renderAll:l}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}for(let[r,i]of e.hunks.entries()){let a=t===`split`?i.splitLineCount:i.unifiedLineCount;n+=a;let o=Math.max(i.collapsedBefore,0),{fromStart:s,fromEnd:c,renderAll:l}=this.getExpandedRegion(e.isPartial,r,o);o>0&&(n+=l?o:s+c)}let r=e.hunks.at(-1);if(r!=null&&Gt(e)){let t=e.additionLines.length-(r.additionLineIndex+r.additionCount),i=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&t!==i)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${i}) for ${e.name}`);let a=Math.min(t,i);if(r!=null&&a>0){let{fromStart:t,renderAll:r}=this.getExpandedRegion(e.isPartial,e.hunks.length,a);n+=r?a:t}}return n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1,hunkSeparators:s=`line-info`}=this.options,{diffHeaderHeight:c,fileGap:l,hunkLineCount:u,hunkSeparatorHeight:d,lineHeight:f}=this.metrics,p=this.getDiffStyle(),m=this.height,h=this.getExpandedLineCount(e,p),g=i?l:c;if(t<n-m||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};if(h<=u||e.hunks.length===0)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};let _=Math.ceil(Math.max(r-n,0)/f),v=Math.ceil(_/u)*u+u,y=v/u,b=y,x=[],S=(n+r)/2,C=s===`simple`||s===`metadata`||s===`line-info-basic`?0:l,w=t+g,T=0,E,D,O;if(I({diff:e,diffStyle:p,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,collapsedBefore:i,collapsedAfter:a,deletionLine:o,additionLine:c})=>{let l=c==null?o.splitLineIndex:c.splitLineIndex,f=c==null?o.unifiedLineIndex:c.unifiedLineIndex,m=(c?.noEOFCR??!1)||(o?.noEOFCR??!1),h=i>0?d+C+(e>0?C:0):0;e===0&&s===`simple`&&(h=0),w+=h;let _=T%u===0;if(_&&(x.push(w-(t+g+h)),O!=null)){if(O<=0)return!0;O--}let v=this.getLineHeight(p===`split`?l:f,m),y=Math.floor(T/u);return w>n-v&&w<r&&(E??=y),D==null&&w+v>S&&(D=y),O==null&&w>=r&&_&&(O=b),T++,w+=v,a>0&&s!==`simple`&&(w+=d+C),!1}}),E==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};let k=x.length;D??=E;let A=Math.round(D-y/2),j=Math.max(0,k-y),M=Math.max(0,Math.min(A,j)),N=M*u,P=A<0?v+A*u:v,ee=x[M]??0,F=M+P/u;return{startingLine:N,totalLines:P,bufferBefore:ee,bufferAfter:F<x.length?m-g-x[F]-l:m-(w-t)-l}}};function Gt(e){let t=e.hunks.at(-1);return t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0?!1:t.additionLineIndex+t.additionCount<e.additionLines.length||t.deletionLineIndex+t.deletionCount<e.deletionLines.length}function Kt(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}var Z=ze();function qt({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderHoverUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=o??s,p=n?.(e),m=r?.(e),h=i?.(e);return(0,Z.jsxs)(Z.Fragment,{children:[p==null?(0,Z.jsxs)(Z.Fragment,{children:[m!=null&&(0,Z.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,Z.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,Z.jsx)(`div`,{slot:ie,children:p}),a!=null&&l?.map((e,t)=>(0,Z.jsx)(`div`,{slot:B(e),children:a(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Jt(t,e);return(0,Z.jsx)(`div`,{slot:n,style:Se,children:c(t,d)},n)}),f!=null&&(0,Z.jsx)(`div`,{slot:`gutter-utility-slot`,style:ye,children:f(u)})]})}function Jt(e,t){let n=zt(e,t);return n==null?void 0:Rt({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var Q=e(t(),1),Yt=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function Xt({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c}){let l=G(),u=(0,Q.useContext)(E),d=(0,Q.useRef)(null),f=ve(r=>{if(r!=null){if(d.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);l==null?d.current=new Mt(Zt({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c?void 0:u,!0):d.current=new Wt(Zt({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),l,a,c?void 0:u,!0),d.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(d.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);d.current.cleanUp(),d.current=null}});return Yt(()=>{let{current:i}=d;if(i==null)return;let a=Zt({hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c=!ge(i.options,a);i.setOptions(a),i.render({forceRender:c,fileDiff:e,lineAnnotations:n}),r!==void 0&&i.setSelectedLines(r)}),{ref:f,getHoveredLine:(0,Q.useCallback)(()=>d.current?.getHoveredLine(),[])}}function Zt({options:e,hasCustomHeader:t,hasGutterRenderUtility:n}){return n||t?{...e,renderCustomHeader:t?H:void 0,renderGutterUtility:n?H:void 0}:e}function Qt({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderGutterUtility:f,renderHoverUtility:p,disableWorkerPool:m=!1}){let{ref:h,getHoveredLine:g}=Xt({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:f!=null||p!=null,hasCustomHeader:l!=null,disableWorkerPool:m});return(0,Z.jsx)(S,{ref:h,className:a,style:o,children:fe(qt({fileDiff:e,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderAnnotation:c,renderGutterUtility:f,lineAnnotations:r,renderHoverUtility:p,getHoveredLine:g}),s)})}var $t=Pe(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),en=Pe(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),tn=Pe(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]);function nn(e){let t=e.name??e.prevName??``;return t.startsWith(`a/`)||t.startsWith(`b/`)?t.slice(2):t}function rn(e,t=!1){let n=e.trim();return t?n:n.toLowerCase()}function $(e,t){t.text!==void 0&&e.push({fileIndex:t.fileIndex,field:t.field,text:t.text,normalizedText:t.text.toLowerCase(),...t.lineIndex===void 0?{}:{lineIndex:t.lineIndex},...t.unifiedLineIndex===void 0?{}:{unifiedLineIndex:t.unifiedLineIndex},...t.splitLineIndex===void 0?{}:{splitLineIndex:t.splitLineIndex}})}function an(e,t,n){t.additionLines.forEach((t,r)=>{$(e,{fileIndex:n,field:`addition`,lineIndex:r,text:t})}),t.deletionLines.forEach((t,r)=>{$(e,{fileIndex:n,field:`deletion`,lineIndex:r,text:t})})}function on(e,t,n){if(!t.hunks||t.hunks.length===0)return!1;for(let r of t.hunks){let i=r.unifiedLineStart,a=r.splitLineStart;for(let o of r.hunkContent){if(o.type===`context`){for(let r=0;r<o.lines;r+=1){let s=o.additionLineIndex+r,c=o.deletionLineIndex+r;$(e,{fileIndex:n,field:`context`,lineIndex:s,unifiedLineIndex:i+r,splitLineIndex:a+r,text:t.additionLines[s]??t.deletionLines[c]})}i+=o.lines,a+=o.lines;continue}for(let r=0;r<o.deletions;r+=1){let s=o.deletionLineIndex+r;$(e,{fileIndex:n,field:`deletion`,lineIndex:s,unifiedLineIndex:i+r,splitLineIndex:a+r,text:t.deletionLines[s]})}for(let r=0;r<o.additions;r+=1){let s=o.additionLineIndex+r;$(e,{fileIndex:n,field:`addition`,lineIndex:s,unifiedLineIndex:i+o.deletions+r,splitLineIndex:a+r,text:t.additionLines[s]})}i+=o.deletions+o.additions,a+=Math.max(o.deletions,o.additions)}}return!0}function sn(e){let t=[];return e.forEach((e,n)=>{$(t,{text:nn(e),fileIndex:n,field:`path`}),e.prevName&&$(t,{text:nn({name:e.prevName}),fileIndex:n,field:`previousPath`}),on(t,e,n)||an(t,e,n)}),{records:t}}function cn(e){let t=e.caseSensitive?e.record.text:e.record.normalizedText,n=[],r=0;for(;;){let i=t.indexOf(e.needle,r);if(i===-1)return n;let a=i+e.needle.length;n.push({fileIndex:e.record.fileIndex,field:e.record.field,...e.record.lineIndex===void 0?{}:{lineIndex:e.record.lineIndex},...e.record.unifiedLineIndex===void 0?{}:{unifiedLineIndex:e.record.unifiedLineIndex},...e.record.splitLineIndex===void 0?{}:{splitLineIndex:e.record.splitLineIndex},start:i,end:a}),r=a>i?a:i+1}}function ln(e){return!Array.isArray(e)}function un(e,t,n){let r=n?.caseSensitive??!1,i=rn(t,r);if(!i)return[];let a=ln(e)?e:sn(e),o=[];for(let e of a.records)o.push(...cn({record:e,needle:i,caseSensitive:r}));return o}function dn(e){return[...new Set(e.map(e=>e.fileIndex))]}function fn(e){let t=new Map;for(let n of e){let e=t.get(n.fileIndex);e?e.push(n):t.set(n.fileIndex,[n])}return t}function pn(e,t,n){return t<=0?0:(e+n+t)%t}function mn(e,t){return e.field===`path`||e.field===`previousPath`?null:(t===`split`?e.splitLineIndex:e.unifiedLineIndex)??e.lineIndex??null}function hn(e){return e===`addition`||e===`deletion`||e===`context`}function gn(e){if(!e)return null;let[t,n]=e.split(`,`),r=Number.parseInt(t??``,10);if(!Number.isFinite(r))return null;let i=Number.parseInt(n??``,10);return{stacked:r,split:Number.isFinite(i)?i:r}}function _n(e,t){if(!hn(e.field)||mn(e,t.renderMode)!==(t.renderMode===`split`?t.lineIndexes.split:t.lineIndexes.stacked))return!1;switch(e.field){case`addition`:return t.lineType===`change-addition`||t.lineType===`addition`;case`deletion`:return t.lineType===`change-deletion`||t.lineType===`deletion`;case`context`:return t.lineType===`context`||t.lineType===`context-expanded`}}function vn(e){let t=e.cwd?Qe(e.filePath,e.cwd):e.filePath;return typeof e.lineNumber==`number`?`${t}:${e.lineNumber}`:t}var yn=`
5
- [data-diffs-header],
6
- [data-diff],
7
- [data-file],
8
- [data-error-wrapper],
9
- [data-virtualizer-buffer] {
10
- --diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
11
- --diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
12
- --diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
13
- --diffs-token-light-bg: transparent;
14
- --diffs-token-dark-bg: transparent;
15
-
16
- --diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
17
- --diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
18
- --diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
19
- --diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
20
-
21
- --diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
22
- --diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
23
- --diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
24
- --diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
25
-
26
- --diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
27
- --diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
28
- --diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
29
- --diffs-bg-deletion-emphasis-override: color-mix(
30
- in srgb,
31
- var(--background) 80%,
32
- var(--destructive)
33
- );
34
-
35
- background-color: var(--diffs-bg) !important;
36
- }
37
-
38
- [data-file-info] {
39
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
40
- border-block-color: var(--border) !important;
41
- color: var(--foreground) !important;
42
- }
43
-
44
- [data-diffs-header] {
45
- position: sticky !important;
46
- top: 0;
47
- z-index: 4;
48
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
49
- border-bottom: 1px solid var(--border) !important;
50
- }
51
-
52
- [data-title] {
53
- cursor: pointer;
54
- transition:
55
- color 120ms ease,
56
- text-decoration-color 120ms ease;
57
- text-decoration: underline;
58
- text-decoration-color: transparent;
59
- text-underline-offset: 2px;
60
- }
61
-
62
- [data-title]:hover {
63
- color: color-mix(in srgb, var(--foreground) 84%, var(--primary)) !important;
64
- text-decoration-color: currentColor;
65
- }
66
-
67
- [data-interactive-line-numbers] [data-line-number-content] {
68
- cursor: pointer;
69
- }
70
-
71
- ::highlight(s3-diff-search-match) {
72
- background-color: color-mix(in srgb, var(--warning) 60%, transparent);
73
- color: var(--foreground);
74
- }
75
- `;function bn(e,t=`diff-panel`){if(!e)return null;let n=e.trim();if(n.length===0)return null;try{let e=Ot(n,M(n,t)).flatMap(e=>e.files);return e.length>0?{kind:`files`,files:e}:{kind:`raw`,text:n,reason:`Unsupported diff format. Showing raw patch.`}}catch{return{kind:`raw`,text:n,reason:`Failed to parse patch. Showing raw patch.`}}}function xn(e){return nn(e)}function Sn(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}var Cn=`s3-diff-search-match`,wn=150,Tn=80,En=1600;function Dn(){return typeof CSS<`u`&&CSS.highlights!==void 0&&globalThis.Highlight!==void 0}function On(e,t,n=En){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();return r.bottom>=i.top-n&&r.top<=i.bottom+n&&r.right>=i.left-n&&r.left<=i.right+n}function kn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){let t=e.parentElement;return t&&t.closest(`[data-line-number-content]`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=n.nextNode(),i=0;for(;r;){let e=r,a=i+e.data.length;t.push({node:e,start:i,end:a}),i=a,r=n.nextNode()}return{offsets:t,textLength:i}}function An(e,t,n){for(let r of e)if(!(t<r.start||t>r.end)&&!(t===r.end&&n===`start`))return{node:r.node,offset:t-r.start};return null}function jn(e,t,n){let{offsets:r,textLength:i}=kn(e);if(r.length===0||t.start<0||t.end>i||t.start>=t.end)return;let a=An(r,t.start,`start`),o=An(r,t.end,`end`);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n.push(s)}function Mn(e){let t=gn(e.lineIndexAttr);return t?e.matches.filter(n=>_n(n,{renderMode:e.renderMode,lineIndexes:t,lineType:e.lineType})):[]}function Nn(e){if(mn(e.match,e.renderMode)===null)return null;let t=e.fileElement.querySelectorAll(`diffs-container`);for(let n of t){let t=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of t??[]){let t=gn(n.getAttribute(`data-line-index`));if(t&&_n(e.match,{renderMode:e.renderMode,lineIndexes:t,lineType:n.getAttribute(`data-line-type`)}))return n}}return null}function Pn(e){let t=[],n=e.rootElement.querySelectorAll(`[data-diff-file-index]`);for(let r of n){if(!On(r,e.viewportElement))continue;let n=r.dataset.diffFileIndex,i=n?Number.parseInt(n,10):NaN;if(!Number.isFinite(i))continue;let a=e.matchesByFileIndex.get(i);if(!a||a.length===0)continue;let o=r.querySelectorAll(`diffs-container`);for(let n of o){let r=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of r??[]){if(!On(n,e.viewportElement))continue;let r=Mn({matches:a,renderMode:e.renderMode,lineIndexAttr:n.getAttribute(`data-line-index`),lineType:n.getAttribute(`data-line-type`)});for(let e of r)jn(n,e,t)}}}return t}function Fn(e){switch(e.type){case`new`:return`text-[var(--diffs-addition-base)]`;case`deleted`:return`text-[var(--diffs-deletion-base)]`;case`change`:case`rename-pure`:case`rename-changed`:return`text-[var(--diffs-modified-base)]`;default:return`text-muted-foreground/80`}}function In({mode:e=`inline`}){Xe(`DiffPanel`);let t=Ke(),{resolvedTheme:n}=it(),r=Ve(),[i,a]=(0,Q.useState)(`stacked`),[o,s]=(0,Q.useState)(r.diffWordWrap),[c,l]=(0,Q.useState)(r.diffIgnoreWhitespace),[u,d]=(0,Q.useState)(()=>new Set),[f,p]=(0,Q.useState)(``),[m]=qe(f,{wait:wn}),h=f.trim().length===0?``:m,[g,_]=(0,Q.useState)(0),v=(0,Q.useRef)(null),y=(0,Q.useRef)(null),b=(0,Q.useRef)(null),x=(0,Q.useRef)(!1),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1),E=je({strict:!1,select:e=>Me(e)}),D=re({strict:!1,select:e=>$e(e)}),O=D.diff===`1`,k=E?.threadId??null,A=Fe((0,Q.useMemo)(()=>Ne(E),[E])),j=A?.projectId??null,M=Fe(e=>A&&j?Be(e,{environmentId:A.environmentId,projectId:j}):void 0),N=A?.worktreePath??M?.cwd,P=He({environmentId:A?.environmentId??null,cwd:N??null}).data?.isRepo??!0,{turnDiffSummaries:F,inferredCheckpointTurnCountByTurnId:I}=tt(A),L=(0,Q.useMemo)(()=>[...F].toSorted((e,t)=>{let n=e.checkpointTurnCount??I[e.turnId]??0,r=t.checkpointTurnCount??I[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[I,F]),R=D.diffTurnId??null,ie=R===null?null:D.diffFilePath??null,z=R===null?void 0:L.find(e=>e.turnId===R)??L[0],B=z&&(z.checkpointTurnCount??I[z.turnId]),ae=(0,Q.useMemo)(()=>typeof B==`number`?{fromTurnCount:Math.max(0,B-1),toTurnCount:B}:null,[B]),oe=(0,Q.useMemo)(()=>{let e=L.map(e=>e.checkpointTurnCount??I[e.turnId]).filter(e=>typeof e==`number`);if(e.length===0)return;let t=Math.max(...e);return t>0?t:void 0},[I,L]),se=(0,Q.useMemo)(()=>!z&&typeof oe==`number`?{fromTurnCount:0,toTurnCount:oe}:null,[oe,z]),ce=z?ae:se,le=(0,Q.useMemo)(()=>z||L.length===0?null:`conversation:${L.map(e=>e.turnId).join(`,`)}`,[L,z]),V=Oe(Ie({environmentId:A?.environmentId??null,threadId:k,fromTurnCount:ce?.fromTurnCount??null,toTurnCount:ce?.toTurnCount??null,ignoreWhitespace:c,cacheScope:z?`turn:${z.turnId}`:le,enabled:P})),ue=z?V.data?.diff:void 0,de=z?void 0:V.data?.diff,fe=V.isLoading,pe=V.error instanceof Error?V.error.message:V.error?`Failed to load checkpoint diff.`:null,H=z?ue:de,me=typeof H==`string`&&H.trim().length===0,U=(0,Q.useMemo)(()=>bn(H,`diff-panel:${n}`),[n,H]),W=(0,Q.useMemo)(()=>!U||U.kind!==`files`?[]:U.files.toSorted((e,t)=>xn(e).localeCompare(xn(t),void 0,{numeric:!0,sensitivity:`base`})),[U]),he=(0,Q.useMemo)(()=>sn(W),[W]),G=(0,Q.useMemo)(()=>rn(h),[h]),K=(0,Q.useMemo)(()=>un(he,h),[he,h]),q=(0,Q.useMemo)(()=>fn(K),[K]),ge=(0,Q.useMemo)(()=>W.map((e,t)=>({fileDiff:e,fileIndex:t})),[W]),_e=(0,Q.useMemo)(()=>G?dn(K).map(e=>({fileDiff:W[e],fileIndex:e})):ge,[K,G,ge,W]);(0,Q.useEffect)(()=>{_(0)},[G,W]),(0,Q.useEffect)(()=>{_(e=>K.length===0?0:Math.min(e,K.length-1))},[K.length]);let ve=(0,Q.useCallback)(e=>{if(K.length===0)return;let t=pn(g,K.length,e);_(t);let n=K[t],r=y.current;if(!n||!r)return;let a=r.querySelector(`[data-diff-file-index="${n.fileIndex}"]`);if(!a)return;let o=Nn({fileElement:a,match:n,renderMode:i});(o??a).scrollIntoView({block:`center`,behavior:`smooth`}),!o&&mn(n,i)!==null&&window.requestAnimationFrame(()=>{Nn({fileElement:a,match:n,renderMode:i})?.scrollIntoView({block:`center`,behavior:`smooth`})})},[g,i,K]);(0,Q.useEffect)(()=>{if(!Dn())return;let e=CSS.highlights,t=y.current;if(!t||!G||K.length===0){e.delete(Cn);return}let n=0,r=0,a=new Map,o=t.querySelector(`.diff-render-surface`)??t.querySelector(`[data-virtualizer]`)??t,s=()=>{n=0,l();let r=Pn({rootElement:t,viewportElement:o,matchesByFileIndex:q,renderMode:i});if(r.length===0){e.delete(Cn);return}e.set(Cn,new Highlight(...r))},c=()=>{n!==0||r!==0||(r=window.setTimeout(()=>{r=0,n=window.requestAnimationFrame(s)},Tn))},l=()=>{let e=t.querySelectorAll(`[data-diff-file-index]`);for(let t of e){if(!On(t,o))continue;let e=t.querySelectorAll(`diffs-container`);for(let t of e){let e=t.shadowRoot;if(!e||a.has(e))continue;let n=new MutationObserver(c);n.observe(e,{childList:!0,subtree:!0}),a.set(e,n)}}},u=new MutationObserver(c);u.observe(t,{childList:!0,subtree:!0}),o.addEventListener(`scroll`,c,{passive:!0});let d=new ResizeObserver(c);return d.observe(o),c(),()=>{u.disconnect(),o.removeEventListener(`scroll`,c),d.disconnect();for(let e of a.values())e.disconnect();a.clear(),r!==0&&window.clearTimeout(r),n!==0&&window.cancelAnimationFrame(n),e.delete(Cn)}},[i,K.length,q,G]),(0,Q.useEffect)(()=>{if(W.length===0){d(e=>e.size===0?e:new Set);return}let e=new Set(W.map(Sn));d(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})},[W]),(0,Q.useEffect)(()=>{O&&!x.current&&(s(r.diffWordWrap),l(r.diffIgnoreWhitespace),p(``)),x.current=O},[O,r.diffIgnoreWhitespace,r.diffWordWrap]),(0,Q.useEffect)(()=>{p(``)},[R]),(0,Q.useEffect)(()=>{!ie||!y.current||Array.from(y.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===ie)?.scrollIntoView({block:`nearest`})},[ie,W]);let ye=(0,Q.useCallback)((e,t)=>{let n=Re();n&&We(n,vn({cwd:N,filePath:e,lineNumber:t})).catch(e=>{console.warn(`Failed to open diff in editor.`,e)})},[N]),be=(0,Q.useCallback)(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Se=e=>{A&&t({to:`/$environmentId/$threadId`,params:ke(Ze(A.environmentId,A.id)),search:t=>({...et(t),diff:`1`,diffTurnId:e})})},we=()=>{A&&t({to:`/$environmentId/$threadId`,params:ke(Ze(A.environmentId,A.id)),search:e=>({...et(e),diff:`1`})})},J=(0,Q.useCallback)(()=>{let e=b.current;if(!e){C(!1),T(!1);return}let t=Math.max(0,e.scrollWidth-e.clientWidth);C(e.scrollLeft>4),T(e.scrollLeft<t-4)},[]),Te=(0,Q.useCallback)(e=>{let t=b.current;t&&t.scrollBy({left:e,behavior:`smooth`})},[]),Ee=(0,Q.useCallback)(e=>{let t=b.current;t&&(t.scrollWidth<=t.clientWidth+1||Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),t.scrollBy({left:e.deltaY,behavior:`auto`})))},[]);return(0,Q.useEffect)(()=>{let e=b.current;if(!e)return;let t=window.requestAnimationFrame(()=>J()),n=()=>J();e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>J());return r.observe(e),()=>{window.cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),r.disconnect()}},[J]),(0,Q.useEffect)(()=>{let e=window.requestAnimationFrame(()=>J());return()=>{window.cancelAnimationFrame(e)}},[L,R,J]),(0,Q.useEffect)(()=>{let e=b.current;e&&e.querySelector(`[data-turn-chip-selected='true']`)?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},[z?.turnId,R]),(0,Z.jsx)(ne,{mode:e,header:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[(0,Z.jsx)(`button`,{type:`button`,className:Y(`absolute left-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,S?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Te(-180),disabled:!S,"aria-label":`Scroll turn list left`,children:(0,Z.jsx)(nt,{className:`size-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,className:Y(`absolute right-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,w?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Te(180),disabled:!w,"aria-label":`Scroll turn list right`,children:(0,Z.jsx)(Ae,{className:`size-3.5`})}),(0,Z.jsxs)(`div`,{ref:b,className:`turn-chip-strip flex gap-1 overflow-x-auto px-8 py-0.5`,style:S||w?{maskImage:`linear-gradient(to right, ${S?`transparent 24px, black 72px`:`black`}, ${w?`black calc(100% - 72px), transparent calc(100% - 24px)`:`black`})`}:void 0,onWheel:Ee,children:[(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:we,"data-turn-chip-selected":R===null,children:(0,Z.jsx)(`div`,{className:Y(`rounded-md border px-2 py-1 text-left transition-colors`,R===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,Z.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`})})}),L.map(e=>(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:()=>Se(e.turnId),title:e.turnId,"data-turn-chip-selected":e.turnId===z?.turnId,children:(0,Z.jsx)(`div`,{className:Y(`rounded-md border px-2 py-1 text-left transition-colors`,e.turnId===z?.turnId?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn`,` `,e.checkpointTurnCount??I[e.turnId]??`?`]}),(0,Z.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:Ye(e.completedAt,r.timestampFormat)})]})})},e.turnId))]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[(0,Z.jsxs)(at,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[i],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&a(t)},children:[(0,Z.jsx)(ot,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,Z.jsx)(tn,{className:`size-3`})}),(0,Z.jsx)(ot,{"aria-label":`Split diff view`,value:`split`,children:(0,Z.jsx)($t,{className:`size-3`})})]}),(0,Z.jsx)(ot,{"aria-label":o?`Disable diff line wrapping`:`Enable diff line wrapping`,title:o?`Disable line wrapping`:`Enable line wrapping`,variant:`outline`,size:`xs`,pressed:o,onPressedChange:e=>{s(!!e)},children:(0,Z.jsx)(Ce,{className:`size-3`})}),(0,Z.jsx)(ot,{"aria-label":c?`Show whitespace changes`:`Hide whitespace changes`,title:c?`Show whitespace changes`:`Hide whitespace changes`,variant:`outline`,size:`xs`,pressed:c,onPressedChange:e=>{l(!!e)},children:(0,Z.jsx)(en,{className:`size-3`})})]})]}),children:A?P?L.length===0?(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)(`div`,{ref:y,className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[pe&&!U&&(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:pe})}),U?U.kind===`files`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/50 bg-card/40 px-2.5 py-1.5 [-webkit-app-region:no-drag]`,children:[(0,Z.jsx)(Je,{className:`size-3.5 shrink-0 text-muted-foreground/70`}),(0,Z.jsx)(`input`,{ref:v,type:`text`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){p(``),e.currentTarget.blur();return}e.key===`Enter`&&G&&(e.preventDefault(),ve(e.shiftKey?-1:1))},placeholder:`Search files or hunks...`,"aria-label":`Search diff`,className:`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none placeholder:text-muted-foreground/55`}),G&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-muted-foreground/70`,children:[K.length===0?0:g+1,` of`,` `,K.length]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>ve(-1),disabled:K.length===0,className:`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,"aria-label":`Previous match`,title:`Previous match (Shift+Enter)`,children:(0,Z.jsx)(Ge,{className:`size-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>ve(1),disabled:K.length===0,className:`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,"aria-label":`Next match`,title:`Next match (Enter)`,children:(0,Z.jsx)(Le,{className:`size-3.5`})})]})]}),f&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{p(``),v.current?.focus()},className:`inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground`,"aria-label":`Clear search`,title:`Clear search`,children:(0,Z.jsx)(Ue,{className:`size-3`})})]}),_e.length===0?(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,Z.jsxs)(`p`,{children:[`No files match “`,f,`”.`]})}):(0,Z.jsx)(xe,{className:`diff-render-surface min-h-0 flex-1 overflow-auto px-2 pb-2`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:_e.map(({fileDiff:e,fileIndex:t})=>{let r=xn(e),a=Sn(e),s=`${a}:${n}`,c=u.has(a);return(0,Z.jsx)(`div`,{"data-diff-file-path":r,"data-diff-file-index":t,className:`diff-render-file group/diff-file mb-2 rounded-md first:mt-2 last:mb-0`,onClickCapture:e=>{(e.nativeEvent.composedPath?.()??[]).some(e=>e instanceof Element?e.hasAttribute(`data-title`):!1)&&ye(r)},children:(0,Z.jsx)(Qt,{fileDiff:e,renderHeaderPrefix:()=>(0,Z.jsx)(`button`,{type:`button`,className:Y(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,Fn(e)),"aria-label":c?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!c,title:c?`Expand diff`:`Collapse diff`,onClick:e=>{e.stopPropagation(),be(a)},children:c?(0,Z.jsx)(Ae,{className:`size-4`}):(0,Z.jsx)(Le,{className:`size-4`})}),options:{collapsed:c,diffStyle:i===`split`?`split`:`unified`,lineDiffType:`none`,overflow:o?`wrap`:`scroll`,theme:te(n),themeType:n,unsafeCSS:yn,lineHoverHighlight:`number`,onLineNumberClick:({lineNumber:e})=>{ye(r,e)}}})},s)})})]}):(0,Z.jsx)(`div`,{className:`flex-1 overflow-auto p-2`,children:(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:U.reason}),(0,Z.jsx)(`pre`,{className:Y(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,o?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:U.text})]})}):fe?(0,Z.jsx)(ee,{label:`Loading checkpoint diff...`}):(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,Z.jsx)(`p`,{children:me?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{rt as DiffWorkerPoolProvider,In as default};