@p4code/cli 0.9.23 → 0.9.24

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 (195) hide show
  1. package/dist/{TraceDiagnostics-DY_cYrzB.mjs → TraceDiagnostics-Dk5M3WAT.mjs} +2 -2
  2. package/dist/bin.mjs +1 -1
  3. package/dist/{binCli-Bou3rWgW.mjs → binCli-CBzw8eZx.mjs} +5 -5
  4. package/dist/client/.vite/manifest.json +1106 -1106
  5. package/dist/client/assets/{2NI2N5EU-B3GKfpTJ.js → 2NI2N5EU-Dz1H18lO.js} +2 -2
  6. package/dist/client/assets/{4UO7MD6I-D1jV-2l8.js → 4UO7MD6I-DxZW-JIQ.js} +2 -2
  7. package/dist/client/assets/{5B3SVYGG-CiUCamIk.js → 5B3SVYGG-Cl2owg_V.js} +2 -2
  8. package/dist/client/assets/{5GK6JWQ2-t3RHg90Y.js → 5GK6JWQ2-A0G_mE3E.js} +2 -2
  9. package/dist/client/assets/{5N7A7DKN-QVdNnUVu.js → 5N7A7DKN-Bd00cghV.js} +2 -2
  10. package/dist/client/assets/{5OC2THR4-CxE7bwzV.js → 5OC2THR4-ytZLjDMp.js} +2 -2
  11. package/dist/client/assets/{5S6HY5KT-msIIAX0G.js → 5S6HY5KT-XbqbgHxv.js} +2 -2
  12. package/dist/client/assets/{6IMQ5BUJ-BzYnQ5qg.js → 6IMQ5BUJ-BtndAY2_.js} +2 -2
  13. package/dist/client/assets/{6OLKWJ4F-AQyY5TLk.js → 6OLKWJ4F-DNXmh00R.js} +2 -2
  14. package/dist/client/assets/{74OO7NKP-CCpQBxNH.js → 74OO7NKP-DbprmlDc.js} +2 -2
  15. package/dist/client/assets/{75O6YZUN-D3WwLu8s.js → 75O6YZUN-DZ_5zRwt.js} +2 -2
  16. package/dist/client/assets/{77XECAW3-C6PMMrkh.js → 77XECAW3-CgSkQSMJ.js} +2 -2
  17. package/dist/client/assets/{ABYRPUBD-BmXVPnuD.js → ABYRPUBD-ucE-F8EO.js} +2 -2
  18. package/dist/client/assets/{AuthSurfaceShell-DDT8iJWE.js → AuthSurfaceShell-DqI-KrrY.js} +2 -2
  19. package/dist/client/assets/{BB2UYUI2-C_DXRsEF.js → BB2UYUI2-CXw0vAgW.js} +2 -2
  20. package/dist/client/assets/{BUM34MOA-sLk4tJuF.js → BUM34MOA-DBHGisGU.js} +2 -2
  21. package/dist/client/assets/{CEQABKGZ-DsLeCUfk.js → CEQABKGZ-MGn88wbo.js} +2 -2
  22. package/dist/client/assets/{CXAC5362-6czpP5mH.js → CXAC5362-C1Fk1A6g.js} +2 -2
  23. package/dist/client/assets/{ChatGptUsageButton-BElkMe1K.js → ChatGptUsageButton-_JZfpkEi.js} +2 -2
  24. package/dist/client/assets/{ChatMarkdown-pRUIhpGi.js → ChatMarkdown-DO_2fTqM.js} +5 -5
  25. package/dist/client/assets/{CodexSetupSection.logic-3MrEmFzD.js → CodexSetupSection.logic-B8uhmM78.js} +2 -2
  26. package/dist/client/assets/{CommandBlock-DUs3JB3r.js → CommandBlock-BJ2nHWe_.js} +2 -2
  27. package/dist/client/assets/{ConnectAgentSurface-BG30oBmC.js → ConnectAgentSurface-kcWh3f_f.js} +2 -2
  28. package/dist/client/assets/{DRLTVNUE-CAWKPVio.js → DRLTVNUE-CmpBRyx_.js} +2 -2
  29. package/dist/client/assets/{DYY6UVD2-HB9mYAbb.js → DYY6UVD2-rvY-xhxe.js} +2 -2
  30. package/dist/client/assets/{DevicePanel-BAT6BS-V.js → DevicePanel-Bkrn90hU.js} +2 -2
  31. package/dist/client/assets/{DeviceSetup-ClD1wdY1.js → DeviceSetup-BQvNWMm0.js} +2 -2
  32. package/dist/client/assets/{DiffCommentAnnotation-BjI2rZNS.js → DiffCommentAnnotation-eHSeIufV.js} +2 -2
  33. package/dist/client/assets/{DiffFileTree-C6VB4VCo.js → DiffFileTree-opfyNeFz.js} +2 -2
  34. package/dist/client/assets/{DiffPanel-pkAdnqL7.js → DiffPanel-C4ySgbUg.js} +2 -2
  35. package/dist/client/assets/{DiffWorkerPoolProvider-CPwS1D4h.js → DiffWorkerPoolProvider-BwOTmWKP.js} +2 -2
  36. package/dist/client/assets/{EmbeddedDesign-DOevokgh.js → EmbeddedDesign-BW5Rcxmc.js} +4 -4
  37. package/dist/client/assets/{FNOVOB4O-BkKBPKb-.js → FNOVOB4O-B8vuCGFt.js} +2 -2
  38. package/dist/client/assets/{FileDiff-CdxU7jjH.js → FileDiff-CZk9prBc.js} +2 -2
  39. package/dist/client/assets/{FilePreviewPanel-Bz8HETIa.js → FilePreviewPanel-BcCGkQ__.js} +2 -2
  40. package/dist/client/assets/{FoldedSettingsSection-IyrJlpO8.js → FoldedSettingsSection-COBhgfnb.js} +2 -2
  41. package/dist/client/assets/{HDGCDEEZ-BW-K6GhK.js → HDGCDEEZ-DRcTM9ws.js} +2 -2
  42. package/dist/client/assets/{HSJLKHB7-B8h6fviS.js → HSJLKHB7-Dh4X6CJ4.js} +2 -2
  43. package/dist/client/assets/{IntervalSecondsField-BaJ1qNX-.js → IntervalSecondsField-D0j2uU5s.js} +2 -2
  44. package/dist/client/assets/JZOYTAAL-BCzM9Qh2.js +1 -0
  45. package/dist/client/assets/{K3MD6TGW-BTpBxr8x.js → K3MD6TGW-uz2CK9vb.js} +2 -2
  46. package/dist/client/assets/{K7RP3OMA-DcsmGbRM.js → K7RP3OMA-uWbuKqQP.js} +2 -2
  47. package/dist/client/assets/{LHDIQX7Q-NOcjEUQY.js → LHDIQX7Q-BaUgpa7I.js} +2 -2
  48. package/dist/client/assets/{LUXOKEGN-BWJqFZst.js → LUXOKEGN-C-Usmwyz.js} +2 -2
  49. package/dist/client/assets/{LinkMachineSelect-Dp6FC1LE.js → LinkMachineSelect-CB99X8v3.js} +2 -2
  50. package/dist/client/assets/{MathTypeset-DHPwWtff.js → MathTypeset-Dv2b-uiV.js} +2 -2
  51. package/dist/client/assets/{ModelLiveLayer-D3x6mJFP.js → ModelLiveLayer-DIrV--mW.js} +3 -3
  52. package/dist/client/assets/{N3JZAHOW-oDX5VWgR.js → N3JZAHOW-CLD7n6Za.js} +2 -2
  53. package/dist/client/assets/{NUIALGQ3-DbqxE7KO.js → NUIALGQ3-CVI_F8c-.js} +2 -2
  54. package/dist/client/assets/{NoProjectsHero-Dk-rv5RI.js → NoProjectsHero-CAoW0Xej.js} +2 -2
  55. package/dist/client/assets/{O65XPQGZ-Cys4qXjc.js → O65XPQGZ-g6xpsO0r.js} +2 -2
  56. package/dist/client/assets/{O7XIQ6OM-aLdTRbRJ.js → O7XIQ6OM-CBkPdCIB.js} +2 -2
  57. package/dist/client/assets/{OFQON5FD-DpC8rm9Y.js → OFQON5FD-DpM-bsDn.js} +2 -2
  58. package/dist/client/assets/{P4ConnectAccountPages-C-GbG9lk.js → P4ConnectAccountPages-CCjWOetO.js} +2 -2
  59. package/dist/client/assets/{P4ConnectSidebarSignIn-DepXmk4f.js → P4ConnectSidebarSignIn-CfEPRRB6.js} +2 -2
  60. package/dist/client/assets/{PJQHF43J-CUbFewuD.js → PJQHF43J-Sp1j42CR.js} +2 -2
  61. package/dist/client/assets/{PanelLayoutControls-CKWjLO_e.js → PanelLayoutControls-CcdUv-ij.js} +4 -4
  62. package/dist/client/assets/{PierreEntryIcon-CVKV5qfT.js → PierreEntryIcon-vf9Z0_eJ.js} +2 -2
  63. package/dist/client/assets/{PreviewPanel-B-ty1_ZL.js → PreviewPanel-DIVx5x1H.js} +2 -2
  64. package/dist/client/assets/{ProjectDefaultsSettings-vF_5kxVM.js → ProjectDefaultsSettings-TlEARfjk.js} +2 -2
  65. package/dist/client/assets/{ProjectFavicon-BEsCcLjN.js → ProjectFavicon-Dd4p_a9n.js} +3 -3
  66. package/dist/client/assets/{ProjectIconPickerDialog-D1_gSlWW.js → ProjectIconPickerDialog-D5UkwTkD.js} +2 -2
  67. package/dist/client/assets/{ProviderAuthTerminal-cNp7I_XV.js → ProviderAuthTerminal-Cw2WcQr1.js} +2 -2
  68. package/dist/client/assets/{ProviderModelPicker-CCCH-TiQ.js → ProviderModelPicker-rRVcFLyP.js} +2 -2
  69. package/dist/client/assets/{ProviderSettingsForm-CV7sAQy3.js → ProviderSettingsForm-DaeugImp.js} +2 -2
  70. package/dist/client/assets/{PullRequestCodeTab-DjChxC-1.js → PullRequestCodeTab-DdfQeIIl.js} +2 -2
  71. package/dist/client/assets/{RHNBAITX-CEZ1jYAC.js → RHNBAITX-DQfv99hf.js} +2 -2
  72. package/dist/client/assets/{ReadOnlySourcePreview-Dw9TzXZ2.js → ReadOnlySourcePreview-Vvv9UVOM.js} +2 -2
  73. package/dist/client/assets/{RenderErrorBoundary-Dbb6Gs8P.js → RenderErrorBoundary-4-dgp9K8.js} +2 -2
  74. package/dist/client/assets/{SLD4V6NK-BXmFkBHB.js → SLD4V6NK-BKBt5rH4.js} +2 -2
  75. package/dist/client/assets/{ScheduledTasksSettings-TjoGUXvC.js → ScheduledTasksSettings-Dbz9TZ6o.js} +2 -2
  76. package/dist/client/assets/{ScopedSwitch-C8qSHRkU.js → ScopedSwitch-D1e9m-dH.js} +2 -2
  77. package/dist/client/assets/{SelfImproveSettingsSection-BhUO-XvV.js → SelfImproveSettingsSection-WXBG9l_4.js} +2 -2
  78. package/dist/client/assets/{SettingsPanels-DFPZUI9O.js → SettingsPanels-BEtJwC6n.js} +2 -2
  79. package/dist/client/assets/{SettingsPanels.logic-5bLleFhd.js → SettingsPanels.logic-y95n8OOO.js} +2 -2
  80. package/dist/client/assets/{SettingsScopeNotice-VgBZL2zg.js → SettingsScopeNotice-DE1t1kw-.js} +2 -2
  81. package/dist/client/assets/{SidebarStageBackdrop-DvPzZM_j.js → SidebarStageBackdrop-CYLpofvt.js} +2 -2
  82. package/dist/client/assets/{T3PCR2KE-bp9TnTiq.js → T3PCR2KE-BryFgp5Q.js} +2 -2
  83. package/dist/client/assets/{TKWO2OVW-Cyskzdq0.js → TKWO2OVW-DcRjYaVG.js} +2 -2
  84. package/dist/client/assets/{TSHNXIZL-Dp3os6bG.js → TSHNXIZL-hAylFob1.js} +2 -2
  85. package/dist/client/assets/{ThemeEditorPanel-B1RklhEA.js → ThemeEditorPanel-DeGNehj1.js} +2 -2
  86. package/dist/client/assets/{ThreadDetailsItemsMenu-BOMU-3M3.js → ThreadDetailsItemsMenu-D0mfEKtW.js} +4 -4
  87. package/dist/client/assets/{ThreadTerminalDrawer-BmwBVDGv.js → ThreadTerminalDrawer-B77-xYz_.js} +2 -2
  88. package/dist/client/assets/{UQJE5E4I-DDRoojS_.js → UQJE5E4I-BfaZIz58.js} +2 -2
  89. package/dist/client/assets/{USNYFO5S-BvyU-aXY.js → USNYFO5S-jOq8Kcgw.js} +2 -2
  90. package/dist/client/assets/{Virtualizer-DFzJCTxQ.js → Virtualizer-B3FSTwJv.js} +2 -2
  91. package/dist/client/assets/{WEVWDWVA-DTuHUaDF.js → WEVWDWVA-1T3GTRY3.js} +2 -2
  92. package/dist/client/assets/{X5RFHQXM-D9IKIoIk.js → X5RFHQXM-CaiE8-NB.js} +2 -2
  93. package/dist/client/assets/{X62E3GBT-BBXkOa6O.js → X62E3GBT-CKnjYZvp.js} +2 -2
  94. package/dist/client/assets/{XBNEOJTC-D743Jp_H.js → XBNEOJTC-DF-d22o-.js} +2 -2
  95. package/dist/client/assets/{YHV2MVVZ-DZBsjjLM.js → YHV2MVVZ-VSj4WI2u.js} +2 -2
  96. package/dist/client/assets/{YURCZMG2-ByezMSr0.js → YURCZMG2-C9wxlavt.js} +2 -2
  97. package/dist/client/assets/{YVG2LODB-DrsC56GM.js → YVG2LODB-JRtigNQC.js} +2 -2
  98. package/dist/client/assets/{_chat-BrgTPEvH.js → _chat-BA5cbHxE.js} +5 -5
  99. package/dist/client/assets/{_chat.design-CgGDbdSU.js → _chat.design-DxTdYmIe.js} +2 -2
  100. package/dist/client/assets/{_chat.index-BjAR62fj.js → _chat.index-CNIRuBqG.js} +2 -2
  101. package/dist/client/assets/{_chat.new-SjhrzHWl.js → _chat.new-Bw2VR60x.js} +2 -2
  102. package/dist/client/assets/{_chat.pull-requests-BixugchU.js → _chat.pull-requests-C6rdgLS9.js} +2 -2
  103. package/dist/client/assets/{assetUrls-Bn1N9LX7.js → assetUrls-BMizLezw.js} +2 -2
  104. package/dist/client/assets/{assets-Lf7mgwY7.js → assets-DT0KoRIr.js} +2 -2
  105. package/dist/client/assets/{browserHistoryStore-Ciy-Cygo.js → browserHistoryStore-xnY5QhfE.js} +2 -2
  106. package/dist/client/assets/{browserLinkTarget-DKVi8qup.js → browserLinkTarget-CH-4nkAf.js} +2 -2
  107. package/dist/client/assets/{connect-C605Zs89.js → connect-BflmwHyv.js} +2 -2
  108. package/dist/client/assets/connect-agent-AVHGyda5.js +2 -0
  109. package/dist/client/assets/{design-BNHLz8I2.js → design-B_bv-H7n.js} +2 -2
  110. package/dist/client/assets/{device-CwiofvsD.js → device-i4SkE05R.js} +2 -2
  111. package/dist/client/assets/{diffRendering-DJnBG6ZN.js → diffRendering-B7lkQ5_O.js} +2 -2
  112. package/dist/client/assets/{dist-D1XCsn7e.js → dist-BvS7KgJD.js} +2 -2
  113. package/dist/client/assets/{duoViewer-CQpxZewd.js → duoViewer-DbnFva5H.js} +2 -2
  114. package/dist/client/assets/{dynamic-DHrzmb9Z.js → dynamic-DmVpEfW3.js} +2 -2
  115. package/dist/client/assets/{embeddedScripts-D7WC0N_7.js → embeddedScripts-D0-ABFFC.js} +2 -2
  116. package/dist/client/assets/{entities-CjoTQlW3.js → entities-JWl3bvMT.js} +2 -2
  117. package/dist/client/assets/{fileLinks-BZkPwsEY.js → fileLinks-Y3tOmcmb.js} +2 -2
  118. package/dist/client/assets/{fileTreeExpansion-DHPBKDpm.js → fileTreeExpansion-Bp5eLBXI.js} +2 -2
  119. package/dist/client/assets/{getDiffFileInput-D-dpZLfC.js → getDiffFileInput-CKgGUEGl.js} +2 -2
  120. package/dist/client/assets/{index-Cq59P2HC.js → index-DQKD4Lk2.js} +3 -3
  121. package/dist/client/assets/{lazy-BH4rgIwO.js → lazy-C5ansoaW.js} +4 -4
  122. package/dist/client/assets/{linkedPrompt-BTa8Gs9-.js → linkedPrompt-CwNmoWmu.js} +2 -2
  123. package/dist/client/assets/{main-xhw8F2iL.js → main-43D2LVmx.js} +7 -7
  124. package/dist/client/assets/{mediaReference-B7ym_1-U.js → mediaReference-Bh7Pydqp.js} +2 -2
  125. package/dist/client/assets/{mediaSource-GtWYcfeZ.js → mediaSource-Do7lCSv7.js} +2 -2
  126. package/dist/client/assets/{modelScene-uWeIf_CC.js → modelScene-D8CdQkcp.js} +2 -2
  127. package/dist/client/assets/{onboarding-CxDppAGc.js → onboarding-BG6FdUUU.js} +2 -2
  128. package/dist/client/assets/{openFileInPreview-MLuDI8fu.js → openFileInPreview-BaemzSTr.js} +2 -2
  129. package/dist/client/assets/{p4ProjectFile-DlnfrOnm.js → p4ProjectFile-O_tvpvNW.js} +2 -2
  130. package/dist/client/assets/{pair-BJWvIdrD.js → pair-BNIczJXa.js} +2 -2
  131. package/dist/client/assets/{phoneViewer-OFK_ThS_.js → phoneViewer-CqawjVDW.js} +2 -2
  132. package/dist/client/assets/{pierre-icons-BYPQj09G.js → pierre-icons-BfZ11Q2h.js} +2 -2
  133. package/dist/client/assets/{preview-CxFR-vue.js → preview-Dd9kGZBH.js} +2 -2
  134. package/dist/client/assets/{primary-CCmKskNP.js → primary-CDuW5QwW.js} +2 -2
  135. package/dist/client/assets/{primaryCloudLinkState-DDs0gJOh.js → primaryCloudLinkState-BONYlcei.js} +2 -2
  136. package/dist/client/assets/{projectFilesQueryState-DzjMtjuq.js → projectFilesQueryState-Ck4wjfaq.js} +2 -2
  137. package/dist/client/assets/{projectScriptEditor-C2NTRQLs.js → projectScriptEditor-DgVU8tRa.js} +2 -2
  138. package/dist/client/assets/{providerSkills-gNPMp_MW.js → providerSkills-Dfc0PY_E.js} +2 -2
  139. package/dist/client/assets/{pullRequestDetail.logic-BZNLZTdt.js → pullRequestDetail.logic-Dy7e4vh2.js} +2 -2
  140. package/dist/client/assets/{pullRequests-DAMVEVGR.js → pullRequests-BSjV3BBU.js} +2 -2
  141. package/dist/client/assets/{queries-ckipBW-f.js → queries-BQAICaPF.js} +2 -2
  142. package/dist/client/assets/{relay-BLgoNhyd.js → relay-Ceq0htTl.js} +2 -2
  143. package/dist/client/assets/{relayFailureReason-COnjzJFI.js → relayFailureReason-DfHD60Z_.js} +2 -2
  144. package/dist/client/assets/{renderScheduler-BCOEl9SF.js → renderScheduler-BGJGU9W9.js} +2 -2
  145. package/dist/client/assets/{runtime-CbYvES7U.js → runtime-vb0YwEUc.js} +3 -3
  146. package/dist/client/assets/{scheduledTasksSettings.logic-DBMDVdjk.js → scheduledTasksSettings.logic-h-rZbNI3.js} +2 -2
  147. package/dist/client/assets/{server-CEMcTnD1.js → server-Bw1ZPPkk.js} +2 -2
  148. package/dist/client/assets/{session-Ces3Ebxl.js → session-YEQs2e4k.js} +2 -2
  149. package/dist/client/assets/{session-logic-DoE1Q_f_.js → session-logic-BOQRidTa.js} +2 -2
  150. package/dist/client/assets/{settings-DfyN3nPg.js → settings-Dj9xov5g.js} +2 -2
  151. package/dist/client/assets/{settings.appearance-DKdqiS33.js → settings.appearance-BFkpCG_N.js} +2 -2
  152. package/dist/client/assets/settings.archived-D96oQP2t.js +2 -0
  153. package/dist/client/assets/{settings.computer-use-B9Lvx9ml.js → settings.computer-use-Bi6Yznts.js} +2 -2
  154. package/dist/client/assets/{settings.connections-CeVMC9_Q.js → settings.connections-C7OGFqf1.js} +2 -2
  155. package/dist/client/assets/{settings.data-controls-C50d8Y1p.js → settings.data-controls-CMPajamk.js} +2 -2
  156. package/dist/client/assets/{settings.decisions-IKWdsPJP.js → settings.decisions-BaYWexvw.js} +2 -2
  157. package/dist/client/assets/{settings.designs-DYK1fORq.js → settings.designs-t7-jewWy.js} +2 -2
  158. package/dist/client/assets/{settings.diagnostics-DDQ_8Jca.js → settings.diagnostics-qkp4kADk.js} +2 -2
  159. package/dist/client/assets/{settings.general-c8Ls4Mz6.js → settings.general-BqeVFfxZ.js} +2 -2
  160. package/dist/client/assets/{settings.integrations-Bx78DSgB.js → settings.integrations-CYmWtYZT.js} +2 -2
  161. package/dist/client/assets/{settings.keybindings-CBhgDtMa.js → settings.keybindings-Rdl8b88k.js} +2 -2
  162. package/dist/client/assets/{settings.open-source-licenses-CgHCMsAt.js → settings.open-source-licenses-C-Brz8iy.js} +2 -2
  163. package/dist/client/assets/{settings.plugins-1AVunwAZ.js → settings.plugins-DAvzBYum.js} +2 -2
  164. package/dist/client/assets/{settings.projects-voo-H787.js → settings.projects-BTKNVvto.js} +3 -3
  165. package/dist/client/assets/{settings.providers-BWjGRXNt.js → settings.providers-r89DCT90.js} +3 -3
  166. package/dist/client/assets/{settings.scheduled-tasks-czvZRhu8.js → settings.scheduled-tasks-Da_-twWT.js} +2 -2
  167. package/dist/client/assets/{settings.secrets-B4BGlz80.js → settings.secrets-B_ZY_xsv.js} +2 -2
  168. package/dist/client/assets/{settings.snap-shot-d8VTC1Lv.js → settings.snap-shot-lnIAMmUa.js} +2 -2
  169. package/dist/client/assets/{settings.source-control-Df0azAck.js → settings.source-control-BIPVuyIo.js} +2 -2
  170. package/dist/client/assets/{settings.storage-CAwfhCbA.js → settings.storage-vvoP_prr.js} +2 -2
  171. package/dist/client/assets/{settingsLayout-D5Mded9h.js → settingsLayout-DaKDuaST.js} +2 -2
  172. package/dist/client/assets/{sidebarProjectGrouping-Dt_irkWm.js → sidebarProjectGrouping-xYoX3lLq.js} +2 -2
  173. package/dist/client/assets/{sourceControl-CgxDQG5w.js → sourceControl-gh0Nj17P.js} +2 -2
  174. package/dist/client/assets/{sourceControlClients-Bg3Of7DX.js → sourceControlClients-C3cHOUoL.js} +2 -2
  175. package/dist/client/assets/{terminal-links-C2FjxVhS.js → terminal-links-CxLXIwP1.js} +2 -2
  176. package/dist/client/assets/{terminalSessions-DBYKcIE6.js → terminalSessions-CXGA3pch.js} +2 -2
  177. package/dist/client/assets/{uiStateStore-B25zCY_s.js → uiStateStore-JOwhQqDV.js} +2 -2
  178. package/dist/client/assets/{usage-DdBC08dx.js → usage-Blib8u_-.js} +2 -2
  179. package/dist/client/assets/{use-atom-command-DWabKYXN.js → use-atom-command-DkmE-pw9.js} +2 -2
  180. package/dist/client/assets/{useHandleNewThread-DTgcUVdd.js → useHandleNewThread-C1YHLGL_.js} +2 -2
  181. package/dist/client/assets/{useP4ConnectAuthPrompt-DKYJHISj.js → useP4ConnectAuthPrompt-4l_tJOsn.js} +2 -2
  182. package/dist/client/assets/{usePullRequestActions-BGugTe1S.js → usePullRequestActions-DtDOHLgX.js} +2 -2
  183. package/dist/client/assets/{useScopedModelAvailability-LgMepA3M.js → useScopedModelAvailability-B-vTMNh_.js} +2 -2
  184. package/dist/client/assets/{useSettings-hYzrsDTp.js → useSettings-Dp27sUML.js} +2 -2
  185. package/dist/client/assets/{vcsRefInvalidation-C5gDWck3.js → vcsRefInvalidation-DU1ipBl9.js} +2 -2
  186. package/dist/client/assets/{welcome-CQrdWD2c.js → welcome-CmsT2lJW.js} +2 -2
  187. package/dist/client/index.html +1 -1
  188. package/dist/{preview-C_kKbIjf.mjs → preview-iNdhUsAa.mjs} +2 -2
  189. package/dist/{runtimeLayer-DQ7pD9BT.mjs → runtimeLayer-CZ8Ru7Ia.mjs} +20 -12
  190. package/dist/{runtimeLayer-Go0xTEaW.mjs → runtimeLayer-hDhX2kHB.mjs} +1 -1
  191. package/dist/{server-DQ0wuuLG.mjs → server-qfCj2NpU.mjs} +4 -4
  192. package/package.json +1 -1
  193. package/dist/client/assets/JZOYTAAL-DbSUKTwO.js +0 -1
  194. package/dist/client/assets/connect-agent-Cy1G_UzI.js +0 -2
  195. package/dist/client/assets/settings.archived-DDSjJTCo.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ol as i,mr as a,t as o}from"./utils-BVnIIHXP.js";import{la as s}from"./src-DHn7yNZx.js";import{f as c,u as l,y as u}from"./TooltipProvider-DQ0TF9NB.js";import{t as d}from"./spinner-m1uNq_wW.js";import{i as f,n as p}from"./session-Ces3Ebxl.js";import{t as m}from"./use-atom-command-DWabKYXN.js";import{n as h}from"./dialog-DFlZvvht.js";import{t as g}from"./device-CwiofvsD.js";import{Do as _,Eo as v,No as y,To as b,ko as ee}from"./main-xhw8F2iL.js";var x=n(),S=e(t(),1),C=e(r(),1);function w(e){let t=(0,x.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,S.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,C.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,C.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,C.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,C.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,C.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var T=e=>e===`ios`?`iOS`:`Android`,E=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,D=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,O=e=>[`ios`,`android`].filter(t=>e?.status===`ready`&&(e.incompletePlatforms?.includes(t)||t===`android`&&e.androidDiscoveryIncomplete===!0)),k=e=>Object.values(e.hostStatuses).some(e=>O(e).includes(`android`));function A(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function j(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&k(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${T(t)} support was not detected.`};let a=i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`);if(a.length>0&&!n)return a.some(n=>e.hostStatuses[n.id]?.incompletePlatforms?.includes(t))?{ready:!1,message:`No ${T(t)} devices were listed because device discovery reported a problem.`}:{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let o=i.every(e=>e.kind!==`local`)?i[0]:void 0,s=o?` on ${o.label}`:``;return{ready:!0,message:o?.kind===`eas`?`${o.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${s}.`:`The Android SDK and Emulator are available${s}.`}}function M(e){let t=(0,x.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,S.useState)(null),[d,T]=(0,S.useState)(0),O=e.state.hostStatus!==`disabled`,k;t[1]===e.state?k=t[2]:(k=A(e.state),t[1]=e.state,t[2]=k);let{ready:j,busy:M}=k,N;t[3]===e.state.hosts?N=t[4]:(N=e.state.hosts.some(te),t[3]=e.state.hosts,t[4]=N);let I=N,L,R;t[5]!==O||t[6]!==c||t[7]!==e.environmentId?(L=()=>{O&&c({environmentId:e.environmentId,input:{}})},R=[O,c,e.environmentId],t[5]=O,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,S.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==M||t[15]!==l||t[16]!==d?(H=e=>M||l!==null||e>d,t[14]=M,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,C.jsx)(v,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,C.jsx)(ee,{steps:V,currentStep:d,onStepChange:T,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,C.jsx)(w,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==M||t[25]!==n||t[26]!==O||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,C.jsx)(y,{checked:O,disabled:!n||M||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,C.jsx)(P,{state:e.state,pending:l===`hub`||M&&l!==`agent`})]}):null,t[24]=M,t[25]=n,t[26]=O,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==M||t[33]!==O||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&O&&I?(0,C.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,C.jsx)(ne,{state:e.state,checking:l===`check`,disabled:!O||M||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=M,t[33]=O,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==M||t[42]!==n||t[43]!==O||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,C.jsx)(y,{checked:e.state.agentAccessEnabled,disabled:!n||!O||M||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,C.jsx)(F,{state:e.state,pending:l===`agent`}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=M,t[42]=n,t[43]=O,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,C.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,C.jsxs)(_,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==M||t[59]!==l||t[60]!==d?(X=d===0?(0,C.jsx)(h,{render:(0,C.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,C.jsx)(a,{variant:`outline`,disabled:M||l!==null,onClick:()=>T(d-1),children:`Back`}),t[58]=M,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==j||t[65]!==d||t[66]!==B?(Z=d<2?(0,C.jsx)(a,{disabled:!j||l!==null,onClick:()=>T(d+1),children:`Continue`}):(0,C.jsx)(a,{disabled:!n||!j||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=j,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,C.jsxs)(b,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,C.jsxs)(C.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function te(e){return e.kind===`local`&&!e.platforms.some(N)}function N(e){return e.available}function P(e){let t=(0,x.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!A(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,C.jsx)(d,{size:`xs`}):(0,C.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function ne(e){let t=(0,x.c)(20),n;t[0]===e.state?n=t[1]:(n=j(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,C.jsx)(L,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=j(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,C.jsx)(L,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,C.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,C.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function F(e){let t=(0,x.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,C.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&A(e.state).ready&&e.state.hosts.some(I)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,C.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function I(e){return e.agentDeviceInstalled}function L(e){let t=(0,x.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,C.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,C.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,C.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,C.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{D as a,O as c,w as d,L as i,k as l,P as n,E as o,M as r,A as s,F as t,j as u};
2
- //# sourceMappingURL=DeviceSetup-ClD1wdY1.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ol as i,mr as a,t as o}from"./utils-BVnIIHXP.js";import{la as s}from"./src-DHn7yNZx.js";import{f as c,u as l,y as u}from"./TooltipProvider-DQ0TF9NB.js";import{t as d}from"./spinner-m1uNq_wW.js";import{i as f,n as p}from"./session-YEQs2e4k.js";import{t as m}from"./use-atom-command-DkmE-pw9.js";import{n as h}from"./dialog-DFlZvvht.js";import{t as g}from"./device-i4SkE05R.js";import{Do as _,Eo as v,No as y,To as b,ko as ee}from"./main-43D2LVmx.js";var x=n(),S=e(t(),1),C=e(r(),1);function w(e){let t=(0,x.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,S.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,C.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,C.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,C.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,C.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,C.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var T=e=>e===`ios`?`iOS`:`Android`,E=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,D=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,O=e=>[`ios`,`android`].filter(t=>e?.status===`ready`&&(e.incompletePlatforms?.includes(t)||t===`android`&&e.androidDiscoveryIncomplete===!0)),k=e=>Object.values(e.hostStatuses).some(e=>O(e).includes(`android`));function A(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function j(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&k(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${T(t)} support was not detected.`};let a=i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`);if(a.length>0&&!n)return a.some(n=>e.hostStatuses[n.id]?.incompletePlatforms?.includes(t))?{ready:!1,message:`No ${T(t)} devices were listed because device discovery reported a problem.`}:{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let o=i.every(e=>e.kind!==`local`)?i[0]:void 0,s=o?` on ${o.label}`:``;return{ready:!0,message:o?.kind===`eas`?`${o.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${s}.`:`The Android SDK and Emulator are available${s}.`}}function M(e){let t=(0,x.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,S.useState)(null),[d,T]=(0,S.useState)(0),O=e.state.hostStatus!==`disabled`,k;t[1]===e.state?k=t[2]:(k=A(e.state),t[1]=e.state,t[2]=k);let{ready:j,busy:M}=k,N;t[3]===e.state.hosts?N=t[4]:(N=e.state.hosts.some(te),t[3]=e.state.hosts,t[4]=N);let I=N,L,R;t[5]!==O||t[6]!==c||t[7]!==e.environmentId?(L=()=>{O&&c({environmentId:e.environmentId,input:{}})},R=[O,c,e.environmentId],t[5]=O,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,S.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==M||t[15]!==l||t[16]!==d?(H=e=>M||l!==null||e>d,t[14]=M,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,C.jsx)(v,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,C.jsx)(ee,{steps:V,currentStep:d,onStepChange:T,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,C.jsx)(w,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==M||t[25]!==n||t[26]!==O||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,C.jsx)(y,{checked:O,disabled:!n||M||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,C.jsx)(P,{state:e.state,pending:l===`hub`||M&&l!==`agent`})]}):null,t[24]=M,t[25]=n,t[26]=O,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==M||t[33]!==O||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&O&&I?(0,C.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,C.jsx)(ne,{state:e.state,checking:l===`check`,disabled:!O||M||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=M,t[33]=O,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==M||t[42]!==n||t[43]!==O||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,C.jsx)(y,{checked:e.state.agentAccessEnabled,disabled:!n||!O||M||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,C.jsx)(F,{state:e.state,pending:l===`agent`}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=M,t[42]=n,t[43]=O,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,C.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,C.jsxs)(_,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==M||t[59]!==l||t[60]!==d?(X=d===0?(0,C.jsx)(h,{render:(0,C.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,C.jsx)(a,{variant:`outline`,disabled:M||l!==null,onClick:()=>T(d-1),children:`Back`}),t[58]=M,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==j||t[65]!==d||t[66]!==B?(Z=d<2?(0,C.jsx)(a,{disabled:!j||l!==null,onClick:()=>T(d+1),children:`Continue`}):(0,C.jsx)(a,{disabled:!n||!j||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=j,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,C.jsxs)(b,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,C.jsxs)(C.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function te(e){return e.kind===`local`&&!e.platforms.some(N)}function N(e){return e.available}function P(e){let t=(0,x.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!A(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,C.jsx)(d,{size:`xs`}):(0,C.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function ne(e){let t=(0,x.c)(20),n;t[0]===e.state?n=t[1]:(n=j(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,C.jsx)(L,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=j(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,C.jsx)(L,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,C.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,C.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function F(e){let t=(0,x.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,C.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&A(e.state).ready&&e.state.hosts.some(I)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,C.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function I(e){return e.agentDeviceInstalled}function L(e){let t=(0,x.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,C.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,C.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,C.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,C.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{D as a,O as c,w as d,L as i,k as l,P as n,E as o,M as r,A as s,F as t,j as u};
2
+ //# sourceMappingURL=DeviceSetup-BQvNWMm0.js.map
@@ -1,4 +1,4 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{hd as i,mr as a,zf as o}from"./utils-BVnIIHXP.js";import{w as s}from"./Virtualizer-DFzJCTxQ.js";import{o as c}from"./DiffWorkerPoolProvider-CPwS1D4h.js";import{t as l}from"./textarea-xZYMC9X5.js";function u({metaKey:e,ctrlKey:t},n=s()){return n?e&&!t:t&&!e}function d(e){if(s()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(u(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}var f=new WeakMap,p=h([{bindings:{Tab:`indent`,"shift+Tab":`outdent`,"cmdOrCtrl+[":`indentLess`,"cmdOrCtrl+]":`indentMore`,"cmdOrCtrl+z":`undo`,"cmdOrCtrl+shift+z":`redo`,"cmdOrCtrl+a":`selectAll`,"cmdOrCtrl+d":`findNextMatch`,"cmdOrCtrl+f":`openSearchPanel`,"cmdOrCtrl+alt+f":`openSearchReplacePanel`,"alt+ArrowUp":`moveLineUp`,"alt+ArrowDown":`moveLineDown`,"shift+alt+ArrowUp":`copyLineUp`,"shift+alt+ArrowDown":`copyLineDown`,Escape:`simplifySelection`,"cmdOrCtrl+Enter":`insertBlankLine`,"cmdOrCtrl+/":`toggleComment`,"shift+alt+a":`toggleBlockComment`,"cmdOrCtrl+Home":`moveCursorToDocStart`,"cmdOrCtrl+End":`moveCursorToDocEnd`,"cmdOrCtrl+shift+Home":`expandSelectionDocStart`,"cmdOrCtrl+shift+End":`expandSelectionDocEnd`}},{platform:`mac`,bindings:{"ctrl+k":`deleteHardLineForward`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`,"cmd+ArrowUp":`moveCursorToDocStart`,"cmd+ArrowDown":`moveCursorToDocEnd`,"cmd+shift+ArrowUp":`expandSelectionDocStart`,"cmd+shift+ArrowDown":`expandSelectionDocEnd`}},{platform:`windows`,bindings:{"ctrl+y":`redo`}},{platform:`linux`,bindings:{"ctrl+y":`redo`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`}}]),m={Backquote:"`",Minus:`-`,Equal:`=`,Comma:`,`,Period:`.`,Slash:`/`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Space:`Space`};function h(e){let t=f.get(e);if(t===void 0){t={mac:new Map,windows:new Map,linux:new Map};for(let n of e)for(let e of Object.keys(n.bindings)){let r=n.bindings[e];if(r===void 0)continue;let i=e.split(`+`),a=i.pop();for(let e of[`mac`,`windows`,`linux`]){if(n.platform!==void 0&&n.platform!==e)continue;let o=0;for(let t of i)t===`alt`?o|=1:t===`ctrl`?o|=2:t===`cmd`?o|=4:t===`shift`?o|=8:t===`cmdOrCtrl`&&(o|=e===`mac`?4:2);let s=t[e].get(o);s===void 0&&(s=new Map,t[e].set(o,s)),s.set(a,r)}}f.set(e,t)}return t}function g(e,t,n=s()){let r=e.key===` `?`Space`:e.key.length===1?e.key.toLowerCase():e.key,i=e.code??``,a=i.startsWith(`Key`)&&i.length===4?i.slice(3).toLowerCase():i.startsWith(`Digit`)&&i.length===6?i.slice(5):m[i],o=n?`mac`:globalThis.navigator?.platform.includes(`Linux`)===!0?`linux`:`windows`,c=+!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);if(t!==void 0){let e=h(t)[o].get(c),n=e?.get(r)??(a===void 0?void 0:e?.get(a));if(n!==void 0)return n}let l=p[o].get(c);return l?.get(r)??(a===void 0?void 0:l?.get(a))}function _(e,t=s()){if(!e.altKey&&u(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var v=1e5,y=10,b=13,x=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,S=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},C=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=c(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===y||r===b)&&(r===b&&e.charCodeAt(n+1)===y&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},w=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!N(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!N(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},T=class{#e;#t=new C(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new C(e);let t=this.#y(S.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&E(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=D(e,0,this.#r),i=D(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&E(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=O(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=k(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=O(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!A(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{hd as i,mr as a,zf as o}from"./utils-BVnIIHXP.js";import{w as s}from"./Virtualizer-B3FSTwJv.js";import{o as c}from"./DiffWorkerPoolProvider-BwOTmWKP.js";import{t as l}from"./textarea-xZYMC9X5.js";function u({metaKey:e,ctrlKey:t},n=s()){return n?e&&!t:t&&!e}function d(e){if(s()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(u(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}var f=new WeakMap,p=h([{bindings:{Tab:`indent`,"shift+Tab":`outdent`,"cmdOrCtrl+[":`indentLess`,"cmdOrCtrl+]":`indentMore`,"cmdOrCtrl+z":`undo`,"cmdOrCtrl+shift+z":`redo`,"cmdOrCtrl+a":`selectAll`,"cmdOrCtrl+d":`findNextMatch`,"cmdOrCtrl+f":`openSearchPanel`,"cmdOrCtrl+alt+f":`openSearchReplacePanel`,"alt+ArrowUp":`moveLineUp`,"alt+ArrowDown":`moveLineDown`,"shift+alt+ArrowUp":`copyLineUp`,"shift+alt+ArrowDown":`copyLineDown`,Escape:`simplifySelection`,"cmdOrCtrl+Enter":`insertBlankLine`,"cmdOrCtrl+/":`toggleComment`,"shift+alt+a":`toggleBlockComment`,"cmdOrCtrl+Home":`moveCursorToDocStart`,"cmdOrCtrl+End":`moveCursorToDocEnd`,"cmdOrCtrl+shift+Home":`expandSelectionDocStart`,"cmdOrCtrl+shift+End":`expandSelectionDocEnd`}},{platform:`mac`,bindings:{"ctrl+k":`deleteHardLineForward`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`,"cmd+ArrowUp":`moveCursorToDocStart`,"cmd+ArrowDown":`moveCursorToDocEnd`,"cmd+shift+ArrowUp":`expandSelectionDocStart`,"cmd+shift+ArrowDown":`expandSelectionDocEnd`}},{platform:`windows`,bindings:{"ctrl+y":`redo`}},{platform:`linux`,bindings:{"ctrl+y":`redo`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`}}]),m={Backquote:"`",Minus:`-`,Equal:`=`,Comma:`,`,Period:`.`,Slash:`/`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Space:`Space`};function h(e){let t=f.get(e);if(t===void 0){t={mac:new Map,windows:new Map,linux:new Map};for(let n of e)for(let e of Object.keys(n.bindings)){let r=n.bindings[e];if(r===void 0)continue;let i=e.split(`+`),a=i.pop();for(let e of[`mac`,`windows`,`linux`]){if(n.platform!==void 0&&n.platform!==e)continue;let o=0;for(let t of i)t===`alt`?o|=1:t===`ctrl`?o|=2:t===`cmd`?o|=4:t===`shift`?o|=8:t===`cmdOrCtrl`&&(o|=e===`mac`?4:2);let s=t[e].get(o);s===void 0&&(s=new Map,t[e].set(o,s)),s.set(a,r)}}f.set(e,t)}return t}function g(e,t,n=s()){let r=e.key===` `?`Space`:e.key.length===1?e.key.toLowerCase():e.key,i=e.code??``,a=i.startsWith(`Key`)&&i.length===4?i.slice(3).toLowerCase():i.startsWith(`Digit`)&&i.length===6?i.slice(5):m[i],o=n?`mac`:globalThis.navigator?.platform.includes(`Linux`)===!0?`linux`:`windows`,c=+!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);if(t!==void 0){let e=h(t)[o].get(c),n=e?.get(r)??(a===void 0?void 0:e?.get(a));if(n!==void 0)return n}let l=p[o].get(c);return l?.get(r)??(a===void 0?void 0:l?.get(a))}function _(e,t=s()){if(!e.altKey&&u(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var v=1e5,y=10,b=13,x=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,S=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},C=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=c(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===y||r===b)&&(r===b&&e.charCodeAt(n+1)===y&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},w=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!N(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!N(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},T=class{#e;#t=new C(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new C(e);let t=this.#y(S.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&E(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=D(e,0,this.#r),i=D(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&E(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=O(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=k(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=O(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!A(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
2
2
  `)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=R(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#l(t,e.wholeWord,v)}#l(e,t,n){let r=[],i=this.#g(),a=i.length,o=c(i);for(let s=0;s<o.length;s++){let c=o[s],l=o[s+1]??a;for(;l>c&&E(i.charCodeAt(l-1));)l--;let u=i.slice(c,l);e.lastIndex=0;let d;for(;(d=e.exec(u))!==null;){let a=d.index,o=d[0];if(o.length===0){e.lastIndex=V(u,a);continue}let s=c+a;if((!t||L(i,s,o.length))&&(r.push([s,s+o.length]),r.length>=n))return r;a===e.lastIndex&&(e.lastIndex=V(u,a))}}return r}insert(e,t){if(e.length===0)return;let n=D(t,0,this.#r);this.#b(n,n,e),this.#x()}delete(e,t){if(t<=0||this.#r===0)return;let n=D(e,0,this.#r),r=D(n+t,n,this.#r);n!==r&&(this.#b(n,r,``),this.#x())}applyEdits(e){if(e.length!==0){for(let t=e.length-1;t>=0;t--){let n=e[t],r=D(n.start,0,this.#r),i=D(n.end,r,this.#r);this.#b(r,i,n.text)}this.#x()}}positionAt(e){let t=D(e,0,this.#r);if(this.#r===0)return{line:0,character:0};let n=this.#p(t),r=t-(n===0?0:this.#m(n-1));return this.#s=[n,r,t],{line:n,character:r}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#r===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#r===0)return 0;if(e.line>=this.#i)throw Error(`Line index out of range: ${e.line}`);let t=this.#s;if(t!==null&&t[0]===e.line&&t[1]===e.character)return t[2];let n=this.#f(e.line);if(n===void 0)throw Error(`Line index out of range: ${e.line}`);let r=D(e.character,0,n[1]-n[0]);return n[0]+r}#u(e){if(e<0||e>=this.#r)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e)t=t.left;else{if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}}#d(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#f(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#r===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#i)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#m(e-1),e<this.#i-1?this.#m(e):this.#r]}#p(e){let t=this.#n,n=D(e,0,this.#r),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e)t=t.left;else{if(r+=(t.left?.subtreeLineBreakCount??0)-+!!N(t.left?.subtreeLastCharCode,t.piece.firstCharCode),n-=e,n<=t.piece.length){let e=this.#v(t.piece.source),i=Math.min(P(e.lineOffsets,t.piece.offset+n),t.piece.lineOffsetEnd);return r+=i-t.piece.lineOffsetStart,n===t.piece.length&&t.piece.hasVirtualTrailingCRBreak&&r++,n===t.piece.length&&N(t.piece.lastCharCode,this.#d(t)?.piece.firstCharCode)&&r--,r}r+=t.piece.lineBreakCount-+!!N(t.piece.lastCharCode,t.right?.subtreeFirstCharCode),n-=t.piece.length,t=t.right}}return this.#i-1}#m(e){let t=this.#n,n=e,r=0,i;for(;t!==null;){let e=(t.left?.subtreeLineBreakCount??0)-+!!N(t.left?.subtreeLastCharCode,t.piece.firstCharCode);if(n<e){i=t.piece.firstCharCode,t=t.left;continue}let a=t.left?.subtreeLength??0;r+=a,n-=e;let o=t.right?.subtreeFirstCharCode??i,s=t.piece.lineBreakCount-+!!N(t.piece.lastCharCode,o);if(n<s)return r+this.#h(t.piece,n);r+=t.piece.length,n-=s,t=t.right}return this.#r}#h(e,t){return t<e.lineOffsetEnd-e.lineOffsetStart?this.#v(e.source).lineOffsets[e.lineOffsetStart+t]-e.offset:e.length}#g(){let e=[];return this.#_(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#_(e){this.#j(this.#n,t=>{let n=this.#v(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#v(e){return e===S.Original?this.#e:this.#t}#y(e,t,n){let r=this.#v(e),i=t+n,a=P(r.lineOffsets,t),o=P(r.lineOffsets,i),s=r.text.charCodeAt(i-1);return new S(e,t,n,a,o,s===b&&r.lineOffsets[o-1]!==i,r.text.charCodeAt(t),s)}#b(e,t,n){if(e===t&&n.length===0)return;let[r,i]=this.#E(this.#n,e),a=this.#D(i,t-e),o;if(n.length>0){let e=this.#y(S.Added,this.#t.append(n),n.length);o=this.#O(this.#k(r,e),a)}else{let[e,t]=this.#A(a);o=e===void 0?r:this.#O(this.#k(r,e),t)}o!==null&&(o.parent=null),this.#n=o,this.#r=o?.subtreeLength??0,this.#i=(o?.subtreeLineBreakCount??0)+1}#x(){this.#a=null,this.#o=null,this.#s=null}#S(){return this.#c=Math.imul(this.#c,1664525)+1013904223>>>0,this.#c}#C(e){let t=new w(e);return t.priority=this.#S(),t}#w(e,t){e.left=t,t!==null&&(t.parent=e)}#T(e,t){e.right=t,t!==null&&(t.parent=e)}#E(e,t){if(e===null)return[null,null];if(t<=0)return[null,e];if(t>=e.subtreeLength)return[e,null];let n=e.left?.subtreeLength??0;if(t<=n){let[n,r]=this.#E(e.left,t);return this.#w(e,r),e.updateSubtreeLength(),[n,e]}let r=e.piece.length;if(t>=n+r){let[i,a]=this.#E(e.right,t-n-r);return this.#T(e,i),e.updateSubtreeLength(),[e,a]}let i=t-n,a=new w(this.#y(e.piece.source,e.piece.offset,i)),o=new w(this.#y(e.piece.source,e.piece.offset+i,r-i));return a.priority=e.priority,o.priority=e.priority,this.#w(a,e.left),this.#T(o,e.right),a.updateSubtreeLength(),o.updateSubtreeLength(),[a,o]}#D(e,t){if(e===null||t>=e.subtreeLength)return null;if(t<=0)return e;let n=e.left?.subtreeLength??0;if(t<=n)return this.#w(e,this.#D(e.left,t)),e.updateSubtreeLength(),e;let r=n+e.piece.length;if(t>=r)return this.#D(e.right,t-r);let i=t-n,a=new w(this.#y(e.piece.source,e.piece.offset+i,e.piece.length-i));return a.priority=e.priority,this.#T(a,e.right),a.updateSubtreeLength(),a}#O(e,t){return e===null?t:t===null?e:e.priority>=t.priority?(this.#T(e,this.#O(e.right,t)),e.updateSubtreeLength(),e):(this.#w(t,this.#O(e,t.left)),t.updateSubtreeLength(),t)}#k(e,t){if(e===null)return this.#C(t);let n=e;for(;n.right!==null;)n=n.right;if(j(n.piece,t)){n.piece=M(n.piece,t);for(let t=n;t!==null&&(t.updateSubtreeLength(),t!==e);)t=t.parent;return e}return this.#O(e,this.#C(t))}#A(e){if(e===null)return[void 0,null];if(e.left===null)return[e.piece,e.right];let[t,n]=this.#A(e.left);return this.#w(e,n),e.updateSubtreeLength(),[t,e]}#j(e,t){return e===null?!0:!this.#j(e.left,t)||t(e)===!1?!1:this.#j(e.right,t)}};function E(e){return e===10||e===13}function D(e,t,n){return Math.min(Math.max(e,t),n)}function O(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function k(e,t){let n=[];for(let[r,i]of e){let e=D(r,0,t),a=D(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];t!==void 0&&e[0]<=t[1]?t[1]=Math.max(t[1],e[1]):r.push(e)}return r}function A(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function j(e,t){return e.source===t.source&&e.offset+e.length===t.offset&&!N(e.lastCharCode,t.firstCharCode)}function M(e,t){return new S(e.source,e.offset,e.length+t.length,e.lineOffsetStart,t.lineOffsetEnd,t.hasVirtualTrailingCRBreak,e.firstCharCode,t.lastCharCode)}function N(e,t){return e===b&&t===y}function P(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function I(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return x.includes(t)}function L(e,t,n){let r=t<=0||I(e.charCodeAt(t-1)),i=t+n>=e.length||I(e.charCodeAt(t+n));return r&&i}function R(e,t,n){let r=t?e:F(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function z(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function B(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l;try{l=R(r.text,!0,r.caseSensitive)}catch{return r.replaceText}l.lastIndex=c;let u=l.exec(s);return u===null||u.index!==c||u[0].length!==a-i?r.replaceText:z(r.replaceText,u)}function V(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}function H(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function U(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function W(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function ee(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function te(e,t){return Object.assign(e,t)}function ne(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function re(e,t=1e3){return Math.round(e*t)/t}function ie(e){return e.endsWith(`
3
3
  `)||e.endsWith(`\r`)}function G(e){if(typeof Intl<`u`&&typeof Intl.Segmenter==`function`)return new Intl.Segmenter(void 0,e)}var K,q=!1;function J(){return q||=(K=G({granularity:`grapheme`}),!0),K}function ae(e){let t=e.ownerDocument,n=e.parentElement;for(;n!=null&&n!==t.body&&n!==t.documentElement;){let e=n.ownerDocument.defaultView?.getComputedStyle(n).overflowY;if(e===`auto`||e===`scroll`||e===`overlay`)return n;n=n.parentElement}return t}var Y=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
4
4
  <symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
@@ -33,4 +33,4 @@ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJe
33
33
  <use href="#diffs-editor-icon-${e}"></use>
34
34
  </svg>`,se=class{#e;#t;#n;#r;#i;#a;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,allowReplace:a=!0,initialMatch:o,scrollToMatch:s,applyReplace:c,onUpdate:l,onClose:d}=e,f={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},p={all:[],current:void 0},m=H(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),h=e=>{p.all=f.text===``?[]:t.search(f);let n=p.all.length===0;if(P.disabled=n,F.disabled=n,n)m.textContent=`No results`,m.dataset.noMatches=``,p.current=void 0,l([]);else if(delete m.dataset.noMatches,e?.syncSelection===!1){let e=l(p.all,{syncSelection:!1});g(e)}else g(l(p.all))};this.#n=h;let g=e=>{if(e===void 0)m.textContent=`${p.all.length} results`;else{let[t,n]=e,r=p.all.findIndex(e=>e[0]===t&&e[1]===n);m.textContent=`${r+1} of ${p.all.length}`}p.current=e},v=(e,t)=>{f[e]=t,h()},y=(e=!1,t=!1)=>{let n=p.all,r=n[0];if(n.length>0){if(e){let e=p.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=p.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}}r!==void 0&&(g(r),s(r,t)),p.current=r};this.#i=e=>y(e,!0);let b=(e,n)=>({start:e,end:n,text:B(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),f,e,n)}),x=()=>{if(f.text===``||p.all.length===0)return;let e=p.current;if(e===void 0&&(y(!1,!0),e=p.current,e===void 0))return;let[t,n]=e,r=b(t,n);c([r]),s([t+r.text.length,t+r.text.length],!0),p.current=void 0,h()},S=()=>{f.text!==``&&p.all.length!==0&&(c(p.all.map(([e,t])=>b(e,t))),p.current=void 0,h())},C=()=>{this.cleanup(),d()};this.#a=C;let w=e=>H(`button`,{type:`button`,title:e.label,ariaLabel:e.label,dataset:{searchIcon:``,...e.dataset},innerHTML:X(e.icon,e.size??16),onclick:e.onClick}),T=(e,t,n)=>{let r=w({icon:e,label:t,size:14,onClick:()=>{let e=!f[n];r.ariaPressed=String(e),v(n,e)}});return r.ariaPressed=String(f[n]),r},E=T(`case`,`Match Case`,`caseSensitive`),D=T(`whole-word`,`Whole Word`,`wholeWord`),O=T(`regex`,`Regexp`,`regex`),k=H(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{f.replaceText=e.target.value},onkeydown:e=>{if(e.isComposing||e.keyCode===229)return;let t=_(e);e.key===`Escape`?(e.preventDefault(),C()):e.key===`Enter`?(e.preventDefault(),x()):t!==void 0&&(e.preventDefault(),y(t===`previous`,!0))}});this.#t=H(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{f.text=e.target.value,p.current=void 0,h()},onkeydown:e=>{if(e.isComposing||e.keyCode===229)return;let t=_(e);e.key===`Escape`?(e.preventDefault(),C()):e.key===`Enter`?(e.preventDefault(),y(e.shiftKey,!0)):t===void 0?u(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),z(e.altKey?`replace`:`find`)):(e.preventDefault(),y(t===`previous`,!0))}});let A=H(`div`,{dataset:`searchToggles`,children:[E,D,O]}),j=H(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,A]}),M=H(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[k]}),N=H(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[w({icon:`replace`,label:`Replace`,onClick:x}),w({icon:`replace-all`,label:`Replace All`,onClick:S})]}),P=w({icon:`arrow-up`,label:`Previous`,onClick:()=>{y(!0)}}),F=w({icon:`arrow-down`,label:`Next`,onClick:()=>{y()}});P.disabled=!0,F.disabled=!0;let I=H(`div`,{dataset:`searchNav`,children:[P,F]}),L=w({icon:`close`,label:`Close`,onClick:C,dataset:{searchClose:``}}),R=H(`div`,{dataset:{searchGrid:``,mode:i},children:[j,M,N,m,I,L]}),z=e=>{R.dataset.mode=a?e:`find`,this.#t.focus(),this.#t.select()};this.#r=z,this.#e=H(`div`,{dataset:`searchPanel`,children:[H(`div`,{dataset:`editorWidget`,children:[R]})]}),p.current=o,n.before(this.#e),requestAnimationFrame(()=>{o===void 0?l([]):h(),this.#t.select()})}focus(){this.#t.focus()}navigate(e){this.#i?.(e)}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}close(){this.#a?.()}cleanup(){this.#e.remove()}},ce=`@layer base,theme,rendered,unsafe;::selection{background-color:#0000}[data-deleted-text-selection] [data-deletions] ::selection,[data-deleted-text-selection] [data-line-type=change-deletion] ::selection{background-color:var(--diffs-editor-selection-bg)}@keyframes blinking{0%{opacity:1}50%{opacity:0}to{opacity:1}}:host,[data-code],[data-content],[data-diff-type=split][data-overflow=wrap]{position:relative}[data-code]{container-type:inline-size}[data-content]{cursor:text;caret-color:var(--diffs-bg-caret);background-color:#0000;outline:none}[data-line]{cursor:text;background-color:#0000}[data-line]:after{content:"";z-index:-20;background-color:var(--diffs-line-bg);pointer-events:none;position:absolute;inset:0}[data-line][data-editor-active-line]:after{box-shadow:inset 0 0 0 1px var(--diffs-editor-line-highlight-border)}[data-editor-overlay]{display:contents}[data-caret],[data-edit-prediction],[data-selection-range],[data-match-range],[data-bracket-match-range],[data-edit-prediction-deletion-range],[data-edit-prediction-insertion-range],[data-edit-prediction-replacement-range],[data-marker-range],[data-remote-caret],[data-caret-highlight-range]{height:1lh;line-height:var(--diffs-line-height);pointer-events:none;position:absolute;top:0;left:0}[data-edit-prediction]{z-index:1;user-select:none;width:max-content;height:auto;color:var(--diffs-editor-edit-prediction-fg,color-mix(in lab, var(--diffs-fg) 45%, transparent));overflow:visible}[data-edit-prediction-line]{box-sizing:border-box;white-space:pre;width:max-content;min-height:1lh;display:block}[data-edit-prediction][data-replacement] [data-edit-prediction-line],[data-edit-prediction-insertion-range],[data-edit-prediction-replacement-range]{background-color:var(--diffs-edit-prediction-bg,var(--diffs-bg))}[data-edit-prediction-suffix]{color:var(--diffs-fg)}[data-edit-prediction][data-wrap] [data-edit-prediction-line]{overflow-wrap:anywhere;white-space:pre-wrap;max-width:100%}[data-edit-prediction-line][data-empty]:after{content:"↵"}[data-edit-prediction-spacer]{margin-block-end:var(--diffs-edit-prediction-spacer-height)}[data-code][data-deletions] [data-edit-prediction-spacer]{box-sizing:content-box;margin-block-end:0;padding-block-end:var(--diffs-edit-prediction-spacer-height)}[data-edit-prediction-deletion-range]{--diffs-edit-prediction-deletion-color:var(--diffs-editor-edit-prediction-deletion-fg,color-mix(in lab, var(--diffs-deletion-base) 70%, transparent));z-index:1;background:linear-gradient(to bottom, transparent calc(50% - .5px), var(--diffs-edit-prediction-deletion-color) calc(50% - .5px), var(--diffs-edit-prediction-deletion-color) calc(50% + .5px), transparent calc(50% + .5px))}[data-edit-prediction-insertion-range]{z-index:0}[data-edit-prediction-replacement-range]{z-index:1}[data-caret]{z-index:2;background-color:var(--diffs-bg-caret-override,var(--diffs-editor-cursor-fg,light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));visibility:hidden;width:2px}@media (prefers-reduced-motion:no-preference){[data-caret]{animation:1.2s .8s infinite blinking}}[data-selection-range]{z-index:-10;background-color:var(--diffs-editor-selection-bg)}[data-caret-highlight-range]{z-index:-10;background-color:var(--diffs-caret-highlight-bg,var(--diffs-editor-selection-bg))}[data-selection-corner]{background-color:var(--diffs-selection-corner-bg,var(--diffs-bg));width:100%;height:100%}[data-match-range]{z-index:-10;background-color:var(--diffs-editor-match-bg,var(--diffs-editor-selection-bg))}[data-match-range]:not([data-focus]){background-color:var(--diffs-editor-match-highlight-bg,light-dark(#ff963288,#ff963266))}[data-bracket-match-range]{z-index:-9;box-sizing:border-box;border-bottom:1px solid var(--diffs-editor-bracket-match-border,color-mix(in lab, var(--diffs-fg) 60%, transparent));background-color:var(--diffs-editor-bracket-match-bg,color-mix(in lab, var(--diffs-fg) 5%, transparent))}[data-rtl]{border-top-left-radius:3px}[data-rtr]{border-top-right-radius:3px}[data-rbl]{border-bottom-left-radius:3px}[data-rbr]{border-bottom-right-radius:3px}[data-marker-range]{z-index:1;background-color:var(--diffs-marker-bg);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+);mask-position:0 100%;mask-size:6px 3px;mask-repeat:repeat-x}[data-marker-error]{--diffs-marker-contrast:light-dark(#fff,#000);--diffs-marker-bg:var(--diffs-editor-error-fg,var(--diffs-deletion-base))}[data-marker-warning]{--diffs-marker-contrast:#000;--diffs-marker-bg:var(--diffs-editor-warning-fg,light-dark(var(--diffs-warning-light),var(--diffs-warning-dark)))}[data-marker-info]{--diffs-marker-contrast:#000;--diffs-marker-bg:var(--diffs-editor-info-fg,var(--diffs-modified-base))}[data-marker-hint]{--diffs-marker-contrast:light-dark(#fff,#000);--diffs-marker-bg:var(--diffs-editor-hint-fg,var(--diffs-fg-number))}@media (width>=480px){[data-content]{caret-color:#0000}[data-content]:focus~[data-editor-overlay] [data-caret]{visibility:visible}}[data-editor-widget]{--diffs-widget-fg:var(--diffs-fg);--diffs-widget-bg:color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));--diffs-widget-border:color-mix(in lab, var(--diffs-fg) 20%, transparent);--diffs-widget-shadow:inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013, 0 6px 18px #00000013;z-index:100;width:fit-content;max-width:calc(100% - 24px);font:14px/20px var(--diffs-header-font-fallback);border:1px solid var(--diffs-widget-border);background-color:var(--diffs-widget-bg);box-shadow:var(--diffs-widget-shadow);background-clip:padding-box;border-radius:9px;position:absolute;top:0;left:0}[data-marker-popover],[data-selection-action-popover]{--popover-gap:var(--diffs-popover-gap,var(--diffs-gap-fallback,8px));--popover-viewport-left:0px;--popover-viewport-right:100cqw;--popover-viewport-top:-99999px;--popover-viewport-bottom:99999px;--popover-min-left:calc(var(--popover-viewport-left) + var(--gutter-width,0px) + var(--popover-gap));--popover-available-width:max(0px, calc(var(--popover-viewport-right) - var(--popover-min-left) - var(--popover-gap)));max-width:min(640px, var(--popover-available-width));translate:clamp(var(--popover-min-left), var(--popover-x,var(--popover-min-left)), calc(var(--popover-viewport-right) - var(--popover-gap) - 100%)) clamp(var(--popover-viewport-top), calc(var(--popover-y,0px) + var(--popover-y-shift,0px)), calc(var(--popover-viewport-bottom) - var(--popover-gap) - 100%))}[data-marker-popover]{--diffs-widget-bg:var(--diffs-marker-bg);--diffs-widget-shadow:0 4px 8px #00000026, 0 6px 18px #00000026;min-width:min(180px, var(--popover-available-width));overflow-wrap:anywhere;color:var(--diffs-marker-contrast);white-space:normal;pointer-events:auto;border:0;padding:8px 12px;@supports (color:contrast-color(red)){color:contrast-color(var(--diffs-marker-bg,var(--diffs-bg)))}& [data-marker-message]{white-space:normal;overflow-wrap:anywhere;& code{white-space:normal;color:inherit;background-color:#0000;display:inline}}}[data-selection-action-popover]{pointer-events:auto;flex-wrap:wrap;align-items:center;gap:4px;width:max-content;padding:4px;display:flex}[data-search-panel]{z-index:100;flex-direction:column;justify-content:right;width:100%;height:0;display:flex;position:sticky;top:16px;right:16px;container:search-panel/inline-size;& [data-editor-widget]{z-index:100;flex-shrink:0;align-items:stretch;gap:8px;min-width:260px;max-width:100%;margin-inline:auto 16px;padding:4px;display:flex;position:relative}& svg{fill:currentColor;width:12px;height:12px;display:block}}[data-search-grid]{grid-template-columns:auto auto auto;grid-template-areas:"find matches nav""replace actions.";align-items:center;gap:4px 6px;width:100%;display:grid}[data-input-box][data-find]{grid-area:find}[data-search-nav]{grid-area:nav}[data-input-box][data-replace]{grid-area:replace}[data-replace-actions]{grid-area:actions}[data-search-grid][data-mode=find]{grid-template-areas:"find matches nav"}[data-search-grid][data-mode=find] [data-replace-cell]{display:none}@container search-panel (width<400px){[data-search-panel] [data-editor-widget]{padding:10px}[data-search-grid][data-mode=replace]{grid-template-columns:auto 1fr auto;grid-template-areas:"find find find""replace replace replace""nav matches actions"}[data-search-grid][data-mode=find]{grid-template-columns:auto 1fr auto;grid-template-areas:"find find find""nav matches matches"}[data-replace-actions]{justify-self:end}[data-search-grid] [data-input-box]{width:auto}}[data-input-box]{align-items:center;width:200px;display:flex;position:relative;& input{width:100%;min-width:0;color:var(--diffs-fg);background-color:var(--diffs-bg);border:1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));border-radius:6px;outline:none;flex-grow:1;padding-inline:6px;font-size:13px;line-height:24px;&::selection{background-color:color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg))}&:focus-visible{outline:1px solid var(--diffs-modified-base)}}&[data-find] input{padding-inline-end:72px}& [data-search-icon]{--diffs-search-icon-size:20px}}[data-search-toggles]{align-items:center;gap:1px;display:flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}[data-matches]{white-space:nowrap;min-width:50px;color:color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));flex-shrink:0;grid-area:matches;font-size:12px;font-weight:500;line-height:20px;&[data-no-matches]{color:color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg))}}[data-replace-actions],[data-search-nav]{align-items:center;display:flex}[data-search-icon]{appearance:none;width:var(--diffs-search-icon-size,24px);height:var(--diffs-search-icon-size,24px);color:color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));border-radius:var(--diffs-search-icon-radius,4px);cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;margin:0;padding:0;transition:background-color .1s ease-in-out,color .1s ease-in-out;display:flex;&:disabled{opacity:.25;cursor:default}&:not(:disabled):hover{color:var(--diffs-fg)}&:focus-visible{outline:1px solid var(--diffs-modified-base)}&[aria-pressed=true]{color:var(--diffs-modified-base)}}[data-search-close]{--diffs-search-icon-size:20px;--diffs-search-icon-radius:50%;color:var(--diffs-widget-bg);background-color:color-mix(in lab, var(--diffs-widget-fg) 50%, var(--diffs-bg));position:absolute;top:0;right:0;transform:translate(50%,-50%);&:not(:disabled):hover{opacity:1;color:var(--diffs-widget-bg);background-color:var(--diffs-widget-fg)}}
35
35
  `,Z=e(t(),1),le=n();function Q(e,t,n){return!n&&(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&t.trim().length>0}var $=e(r(),1);function ue(e){let t=(0,le.c)(48),{kind:n,rangeLabel:r,text:s,onTextChange:c,onCancel:u,onComment:d,onDelete:f,placeholder:p,submitLabel:m,pending:h,secondaryAction:g,focusOnMount:_}=e,v=p===void 0?`Add a comment…`:p,y=m===void 0?`Comment`:m,b=h!==void 0&&h,x=_===void 0||_,[S,C]=(0,Z.useState)(``),w=n===`draft`&&!c?S:s,T;t[0]===w?T=t[1]:(T=w.trim(),t[0]=w,t[1]=T);let E=T,D=(0,Z.useRef)(null),O,k;if(t[2]!==x||t[3]!==n?(O=()=>{if(n!==`draft`||!x)return;let e=window.requestAnimationFrame(()=>{D.current?.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(e)},k=[x,n],t[2]=x,t[3]=n,t[4]=O,t[5]=k):(O=t[4],k=t[5]),(0,Z.useLayoutEffect)(O,k),n===`comment`){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(i,{className:`mt-0.5 size-3.5 shrink-0 text-primary/70`,"aria-hidden":`true`}),t[6]=e):e=t[6];let n;t[7]===w?n=t[8]:(n=(0,$.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap text-sm leading-5`,children:w}),t[7]=w,t[8]=n);let r;t[9]===f?r=t[10]:(r=f?(0,$.jsx)(`span`,{className:`-my-1 -mr-1 flex shrink-0 opacity-0 transition-opacity group-hover/comment:opacity-100 focus-within:opacity-100 max-sm:opacity-100`,children:(0,$.jsx)(a,{variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Delete comment`,onClick:f,children:(0,$.jsx)(o,{className:`size-3`})})}):null,t[9]=f,t[10]=r);let s;return t[11]!==r||t[12]!==n?(s=(0,$.jsxs)(`div`,{"data-diff-comment-annotation":!0,className:`group/comment flex min-w-0 items-start gap-2.5 border-s-2 border-primary/55 bg-primary/[0.045] px-3 py-2.5 font-sans text-foreground`,contentEditable:!1,onPointerDown:pe,children:[e,n,r]}),t[11]=r,t[12]=n,t[13]=s):s=t[13],s}let A=`Comment on lines ${r}`,j;t[14]===c?j=t[15]:(j=e=>(c??C)(e.target.value),t[14]=c,t[15]=j);let M;t[16]!==u||t[17]!==d||t[18]!==b||t[19]!==E?(M=e=>{e.key===`Escape`&&(e.preventDefault(),u()),Q(e,E,b)&&(e.preventDefault(),d(E))},t[16]=u,t[17]=d,t[18]=b,t[19]=E,t[20]=M):M=t[20];let N;t[21]!==w||t[22]!==x||t[23]!==v||t[24]!==M||t[25]!==A||t[26]!==j?(N=(0,$.jsx)(l,{ref:D,autoFocus:x,size:`sm`,value:w,placeholder:v,"aria-label":A,onChange:j,onFocus:de,onKeyDown:M}),t[21]=w,t[22]=x,t[23]=v,t[24]=M,t[25]=A,t[26]=j,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(`span`,{className:`mr-auto text-3xs text-muted-foreground/70`,children:`⌘/Ctrl Enter to send`}),t[28]=P):P=t[28];let F;t[29]===u?F=t[30]:(F=(0,$.jsx)(a,{variant:`ghost-muted`,size:`xs`,onClick:u,children:`Cancel`}),t[29]=u,t[30]=F);let I;t[31]!==g||t[32]!==E?(I=g?(0,$.jsxs)(a,{size:`xs`,variant:`outline`,disabled:!g.allowEmpty&&!E,onClick:()=>g.onAction(E),children:[g.icon,g.label]}):null,t[31]=g,t[32]=E,t[33]=I):I=t[33];let L=b||!E,R;t[34]!==d||t[35]!==E?(R=()=>d(E),t[34]=d,t[35]=E,t[36]=R):R=t[36];let z;t[37]!==y||t[38]!==L||t[39]!==R?(z=(0,$.jsx)(a,{size:`xs`,disabled:L,onClick:R,children:y}),t[37]=y,t[38]=L,t[39]=R,t[40]=z):z=t[40];let B;t[41]!==F||t[42]!==I||t[43]!==z?(B=(0,$.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1`,children:[P,F,I,z]}),t[41]=F,t[42]=I,t[43]=z,t[44]=B):B=t[44];let V;return t[45]!==N||t[46]!==B?(V=(0,$.jsxs)(`div`,{"data-diff-comment-annotation":!0,className:`px-3 py-2 font-sans text-foreground`,contentEditable:!1,onPointerDown:fe,children:[N,B]}),t[45]=N,t[46]=B,t[47]=V):V=t[47],V}function de(e){let t=e.currentTarget.value.length;e.currentTarget.setSelectionRange(t,t)}function fe(e){return e.stopPropagation()}function pe(e){return e.stopPropagation()}export{u as S,re as _,Y as a,_ as b,ee as c,ie as d,te as f,ae as g,H as h,se as i,G as l,W as m,Q as n,oe as o,J as p,ce as r,U as s,ue as t,ne as u,T as v,d as x,g as y};
36
- //# sourceMappingURL=DiffCommentAnnotation-BjI2rZNS.js.map
36
+ //# sourceMappingURL=DiffCommentAnnotation-eHSeIufV.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{mr as i,t as a}from"./utils-BVnIIHXP.js";import{_ as o,g as s,u as c}from"./TooltipProvider-DQ0TF9NB.js";import{K as l}from"./useSettings-hYzrsDTp.js";import{u as ee}from"./diffRendering-DJnBG6ZN.js";import{c as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./fileTreeExpansion-DHPBKDpm.js";import{t as ce}from"./pierre-icons-BYPQj09G.js";var le=n(),u=e(t(),1);function d(e,t,n){let r=(0,le.c)(8),[i,a]=(0,u.useState)(null),o=(0,u.useRef)(null),s,c;r[0]!==n||r[1]!==i||r[2]!==t||r[3]!==e?(s=()=>{i!==null&&o.current!==i&&(i.scope===t?!e?.getInstance()||n&&!n.includes(i.fileKey)||(e.scrollTo({type:`item`,id:i.fileKey,align:`start`}),o.current=i):o.current=i)},c=[i,t,e,n],r[0]=n,r[1]=i,r[2]=t,r[3]=e,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,u.useEffect)(s,c);let l;return r[6]===t?l=r[7]:(l=e=>a({fileKey:e,scope:t}),r[6]=t,r[7]=l),l}function f(e,t){return e.length>0&&e.every(e=>t.has(e))}function p(e,t){return f(e,t)?new Set:new Set(e)}function m(e){switch(e.type){case`new`:return`added`;case`deleted`:return`deleted`;case`rename-pure`:case`rename-changed`:return`renamed`;case`change`:return`modified`}}function h(e){let t=new Map;for(let n of e){let e=ee(n),r=m(n),i=t.get(e);t.set(e,i===void 0||i===r?r:`modified`)}return[...t].map(([e,t])=>({path:e,status:t}))}function ue(e){let t=new Set;for(let n of e){let e=n.split(`/`),r=``;for(let n of e.slice(0,-1))r+=`${n}/`,t.add(r)}return[...t]}function de(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n);let r=``;for(let i of e.split(`/`).slice(0,-1))r+=`${i}/`,t.has(r)||t.set(r,n)}),t}function g(e){return(t,n)=>{let r=e();return(r.get(t.path)??2**53-1)-(r.get(n.path)??2**53-1)||t.depth-n.depth||t.path.localeCompare(n.path)}}function _(e){return e.split(`/`).filter(Boolean).length}function fe(e,t){let n=new Set(ue(e)),r=new Set(ue(t)),i=new Set(e),a=new Set(t),o=[];for(let t of e)a.has(t)||o.push({type:`remove`,path:t});let s=[...n].filter(e=>!r.has(e)).toSorted((e,t)=>_(t)-_(e));for(let e of s)o.push({type:`remove`,path:e,recursive:!0});let c=[...r].filter(e=>!n.has(e)).toSorted((e,t)=>_(e)-_(t));for(let e of c)o.push({type:`add`,path:e});for(let e of t)i.has(e)||o.push({type:`add`,path:e});return o}var v=e(r(),1);function y(e){let t=(0,le.c)(64),{entries:n,onSelectFile:r,selectedPath:ee,revealRequestId:d,ariaLabel:f,headerAccessory:p,footer:m,className:h}=e,g=ee===void 0?null:ee,_=d===void 0?0:d,{resolvedTheme:y}=l(),b;t[0]===n?b=t[1]:(b=n.map(he),t[0]=n,t[1]=b);let x=b,S;t[2]===x?S=t[3]:(S=ue(x),t[2]=x,t[3]=S);let C=S,w;t[4]===x?w=t[5]:(w=de(x),t[4]=x,t[5]=w);let T=w,[E]=(0,u.useState)(me),D;t[6]===n?D=t[7]:(D=n.map(pe),t[6]=n,t[7]=D);let O=D,k;t[8]===x?k=t[9]:(k=new Set(x),t[8]=x,t[9]=k);let A=(0,u.useRef)(k),j=(0,u.useRef)(r),ge=(0,u.useRef)(!1),M=(0,u.useRef)(null),_e=(0,u.useRef)(null),N,P;t[10]!==r||t[11]!==x?(N=()=>{A.current=new Set(x),j.current=r},P=[r,x],t[10]=r,t[11]=x,t[12]=N,t[13]=P):(N=t[12],P=t[13]),(0,u.useEffect)(N,P);let F,I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{if(ge.current)return;let t=e.at(-1)?.replace(/\/$/,``);t&&A.current.has(t)&&j.current(t)},I=[],t[14]=F,t[15]=I):(F=t[14],I=t[15]);let L;t[16]===E.sort?L=t[17]:(L={density:`compact`,flattenEmptyDirectories:!0,initialExpansion:`open`,icons:ce,onSelectionChange:F,paths:I,search:!1,sort:E.sort,unsafeCSS:ae},t[16]=E.sort,t[17]=L);let{model:R}=oe(L),z;t[18]===C?z=t[19]:(z=e=>se(e,C),t[18]=C,t[19]=z);let B=ie(R,z),V,H;t[20]!==C||t[21]!==O||t[22]!==R||t[23]!==E||t[24]!==x||t[25]!==T?(V=()=>{E.update(T);let e=_e.current;if(e!==x){if(_e.current=x,e===null)R.resetPaths(x);else if(e.every((e,t)=>x[t]===e)){let t=fe(e,x);t.length>0&&R.batch(t)}else{let e=C.filter(e=>{let t=R.getItem(e);return t!==null&&`isExpanded`in t&&!t.isExpanded()});R.resetPaths(x);for(let t of e){let e=R.getItem(t);e!==null&&`collapse`in e&&e.collapse()}}R.setGitStatus(O)}},H=[C,O,R,E,x,T],t[20]=C,t[21]=O,t[22]=R,t[23]=E,t[24]=x,t[25]=T,t[26]=V,t[27]=H):(V=t[26],H=t[27]),(0,u.useEffect)(V,H);let U;t[28]!==R||t[29]!==_||t[30]!==g?(U=()=>{if(g===null){M.current=null;return}let e=R.getItem(g);if(e===null||e.isDirectory()){M.current=null;return}let t=M.current;if(t?.path===g&&t.revealRequestId===_)return;M.current={path:g,revealRequestId:_},ge.current=!0;for(let e of R.getSelectedPaths())e!==g&&R.getItem(e)?.deselect();let n=``;for(let e of g.split(`/`).slice(0,-1)){n+=`${e}/`;let t=R.getItem(n);t!==null&&`expand`in t&&t.expand()}e.select(),R.scrollToPath(g,{offset:`nearest`}),queueMicrotask(()=>{ge.current=!1})},t[28]=R,t[29]=_,t[30]=g,t[31]=U):U=t[31];let W;t[32]!==R||t[33]!==x||t[34]!==_||t[35]!==g?(W=[R,x,_,g],t[32]=R,t[33]=x,t[34]=_,t[35]=g,t[36]=W):W=t[36],(0,u.useEffect)(U,W);let G;t[37]===h?G=t[38]:(G=a(`flex min-h-0 flex-1 flex-col bg-background`,h),t[37]=h,t[38]=G);let K;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,v.jsx)(`span`,{className:`px-1 font-medium text-foreground`,children:`Files`}),t[39]=K):K=t[39];let q;t[40]===n.length?q=t[41]:(q=(0,v.jsx)(`span`,{className:`ml-auto tabular-nums`,children:n.length}),t[40]=n.length,t[41]=q);let J;t[42]!==B||t[43]!==C||t[44]!==R?(J=C.length>0?(0,v.jsx)(i,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":B?`Collapse all folders`:`Expand all folders`,onClick:()=>re(R,C,!B),children:(0,v.jsx)(c,{className:`size-3.5`,icon:B?s:o})}):null,t[42]=B,t[43]=C,t[44]=R,t[45]=J):J=t[45];let Y;t[46]!==p||t[47]!==q||t[48]!==J?(Y=(0,v.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 text-xs text-muted-foreground in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[K,q,p,J]}),t[46]=p,t[47]=q,t[48]=J,t[49]=Y):Y=t[49];let X;t[50]===R?X=t[51]:(X=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=R.getSelectedPaths(),n=t.length===1?t[0]:void 0;n&&A.current.has(n)&&e.nativeEvent.composedPath().some(e=>e instanceof HTMLElement&&e.getAttribute(`data-item-path`)===n)&&j.current(n)},t[50]=R,t[51]=X);let Z;t[52]===y?Z=t[53]:(Z=ne(y),t[52]=y,t[53]=Z);let Q;t[54]!==f||t[55]!==R||t[56]!==X||t[57]!==Z?(Q=(0,v.jsx)(te,{model:R,"aria-label":f,onClickCapture:X,className:`min-h-0 flex-1 overflow-hidden`,style:Z}),t[54]=f,t[55]=R,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let $;return t[59]!==m||t[60]!==G||t[61]!==Y||t[62]!==Q?($=(0,v.jsxs)(`div`,{className:G,children:[Y,Q,m]}),t[59]=m,t[60]=G,t[61]=Y,t[62]=Q,t[63]=$):$=t[63],$}function pe(e){return{path:e.path,status:e.status}}function me(){let e=new Map;return{sort:g(()=>e),update:t=>{e=t}}}function he(e){return e.path}export{d as a,p as i,h as n,f as r,y as t};
2
- //# sourceMappingURL=DiffFileTree-C6VB4VCo.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{mr as i,t as a}from"./utils-BVnIIHXP.js";import{_ as o,g as s,u as c}from"./TooltipProvider-DQ0TF9NB.js";import{K as l}from"./useSettings-Dp27sUML.js";import{u as ee}from"./diffRendering-B7lkQ5_O.js";import{c as te,i as ne,n as re,o as ie,r as ae,s as oe,t as se}from"./fileTreeExpansion-Bp5eLBXI.js";import{t as ce}from"./pierre-icons-BfZ11Q2h.js";var le=n(),u=e(t(),1);function d(e,t,n){let r=(0,le.c)(8),[i,a]=(0,u.useState)(null),o=(0,u.useRef)(null),s,c;r[0]!==n||r[1]!==i||r[2]!==t||r[3]!==e?(s=()=>{i!==null&&o.current!==i&&(i.scope===t?!e?.getInstance()||n&&!n.includes(i.fileKey)||(e.scrollTo({type:`item`,id:i.fileKey,align:`start`}),o.current=i):o.current=i)},c=[i,t,e,n],r[0]=n,r[1]=i,r[2]=t,r[3]=e,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,u.useEffect)(s,c);let l;return r[6]===t?l=r[7]:(l=e=>a({fileKey:e,scope:t}),r[6]=t,r[7]=l),l}function f(e,t){return e.length>0&&e.every(e=>t.has(e))}function p(e,t){return f(e,t)?new Set:new Set(e)}function m(e){switch(e.type){case`new`:return`added`;case`deleted`:return`deleted`;case`rename-pure`:case`rename-changed`:return`renamed`;case`change`:return`modified`}}function h(e){let t=new Map;for(let n of e){let e=ee(n),r=m(n),i=t.get(e);t.set(e,i===void 0||i===r?r:`modified`)}return[...t].map(([e,t])=>({path:e,status:t}))}function ue(e){let t=new Set;for(let n of e){let e=n.split(`/`),r=``;for(let n of e.slice(0,-1))r+=`${n}/`,t.add(r)}return[...t]}function de(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n);let r=``;for(let i of e.split(`/`).slice(0,-1))r+=`${i}/`,t.has(r)||t.set(r,n)}),t}function g(e){return(t,n)=>{let r=e();return(r.get(t.path)??2**53-1)-(r.get(n.path)??2**53-1)||t.depth-n.depth||t.path.localeCompare(n.path)}}function _(e){return e.split(`/`).filter(Boolean).length}function fe(e,t){let n=new Set(ue(e)),r=new Set(ue(t)),i=new Set(e),a=new Set(t),o=[];for(let t of e)a.has(t)||o.push({type:`remove`,path:t});let s=[...n].filter(e=>!r.has(e)).toSorted((e,t)=>_(t)-_(e));for(let e of s)o.push({type:`remove`,path:e,recursive:!0});let c=[...r].filter(e=>!n.has(e)).toSorted((e,t)=>_(e)-_(t));for(let e of c)o.push({type:`add`,path:e});for(let e of t)i.has(e)||o.push({type:`add`,path:e});return o}var v=e(r(),1);function y(e){let t=(0,le.c)(64),{entries:n,onSelectFile:r,selectedPath:ee,revealRequestId:d,ariaLabel:f,headerAccessory:p,footer:m,className:h}=e,g=ee===void 0?null:ee,_=d===void 0?0:d,{resolvedTheme:y}=l(),b;t[0]===n?b=t[1]:(b=n.map(he),t[0]=n,t[1]=b);let x=b,S;t[2]===x?S=t[3]:(S=ue(x),t[2]=x,t[3]=S);let C=S,w;t[4]===x?w=t[5]:(w=de(x),t[4]=x,t[5]=w);let T=w,[E]=(0,u.useState)(me),D;t[6]===n?D=t[7]:(D=n.map(pe),t[6]=n,t[7]=D);let O=D,k;t[8]===x?k=t[9]:(k=new Set(x),t[8]=x,t[9]=k);let A=(0,u.useRef)(k),j=(0,u.useRef)(r),ge=(0,u.useRef)(!1),M=(0,u.useRef)(null),_e=(0,u.useRef)(null),N,P;t[10]!==r||t[11]!==x?(N=()=>{A.current=new Set(x),j.current=r},P=[r,x],t[10]=r,t[11]=x,t[12]=N,t[13]=P):(N=t[12],P=t[13]),(0,u.useEffect)(N,P);let F,I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{if(ge.current)return;let t=e.at(-1)?.replace(/\/$/,``);t&&A.current.has(t)&&j.current(t)},I=[],t[14]=F,t[15]=I):(F=t[14],I=t[15]);let L;t[16]===E.sort?L=t[17]:(L={density:`compact`,flattenEmptyDirectories:!0,initialExpansion:`open`,icons:ce,onSelectionChange:F,paths:I,search:!1,sort:E.sort,unsafeCSS:ae},t[16]=E.sort,t[17]=L);let{model:R}=oe(L),z;t[18]===C?z=t[19]:(z=e=>se(e,C),t[18]=C,t[19]=z);let B=ie(R,z),V,H;t[20]!==C||t[21]!==O||t[22]!==R||t[23]!==E||t[24]!==x||t[25]!==T?(V=()=>{E.update(T);let e=_e.current;if(e!==x){if(_e.current=x,e===null)R.resetPaths(x);else if(e.every((e,t)=>x[t]===e)){let t=fe(e,x);t.length>0&&R.batch(t)}else{let e=C.filter(e=>{let t=R.getItem(e);return t!==null&&`isExpanded`in t&&!t.isExpanded()});R.resetPaths(x);for(let t of e){let e=R.getItem(t);e!==null&&`collapse`in e&&e.collapse()}}R.setGitStatus(O)}},H=[C,O,R,E,x,T],t[20]=C,t[21]=O,t[22]=R,t[23]=E,t[24]=x,t[25]=T,t[26]=V,t[27]=H):(V=t[26],H=t[27]),(0,u.useEffect)(V,H);let U;t[28]!==R||t[29]!==_||t[30]!==g?(U=()=>{if(g===null){M.current=null;return}let e=R.getItem(g);if(e===null||e.isDirectory()){M.current=null;return}let t=M.current;if(t?.path===g&&t.revealRequestId===_)return;M.current={path:g,revealRequestId:_},ge.current=!0;for(let e of R.getSelectedPaths())e!==g&&R.getItem(e)?.deselect();let n=``;for(let e of g.split(`/`).slice(0,-1)){n+=`${e}/`;let t=R.getItem(n);t!==null&&`expand`in t&&t.expand()}e.select(),R.scrollToPath(g,{offset:`nearest`}),queueMicrotask(()=>{ge.current=!1})},t[28]=R,t[29]=_,t[30]=g,t[31]=U):U=t[31];let W;t[32]!==R||t[33]!==x||t[34]!==_||t[35]!==g?(W=[R,x,_,g],t[32]=R,t[33]=x,t[34]=_,t[35]=g,t[36]=W):W=t[36],(0,u.useEffect)(U,W);let G;t[37]===h?G=t[38]:(G=a(`flex min-h-0 flex-1 flex-col bg-background`,h),t[37]=h,t[38]=G);let K;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,v.jsx)(`span`,{className:`px-1 font-medium text-foreground`,children:`Files`}),t[39]=K):K=t[39];let q;t[40]===n.length?q=t[41]:(q=(0,v.jsx)(`span`,{className:`ml-auto tabular-nums`,children:n.length}),t[40]=n.length,t[41]=q);let J;t[42]!==B||t[43]!==C||t[44]!==R?(J=C.length>0?(0,v.jsx)(i,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":B?`Collapse all folders`:`Expand all folders`,onClick:()=>re(R,C,!B),children:(0,v.jsx)(c,{className:`size-3.5`,icon:B?s:o})}):null,t[42]=B,t[43]=C,t[44]=R,t[45]=J):J=t[45];let Y;t[46]!==p||t[47]!==q||t[48]!==J?(Y=(0,v.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 text-xs text-muted-foreground in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[K,q,p,J]}),t[46]=p,t[47]=q,t[48]=J,t[49]=Y):Y=t[49];let X;t[50]===R?X=t[51]:(X=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=R.getSelectedPaths(),n=t.length===1?t[0]:void 0;n&&A.current.has(n)&&e.nativeEvent.composedPath().some(e=>e instanceof HTMLElement&&e.getAttribute(`data-item-path`)===n)&&j.current(n)},t[50]=R,t[51]=X);let Z;t[52]===y?Z=t[53]:(Z=ne(y),t[52]=y,t[53]=Z);let Q;t[54]!==f||t[55]!==R||t[56]!==X||t[57]!==Z?(Q=(0,v.jsx)(te,{model:R,"aria-label":f,onClickCapture:X,className:`min-h-0 flex-1 overflow-hidden`,style:Z}),t[54]=f,t[55]=R,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let $;return t[59]!==m||t[60]!==G||t[61]!==Y||t[62]!==Q?($=(0,v.jsxs)(`div`,{className:G,children:[Y,Q,m]}),t[59]=m,t[60]=G,t[61]=Y,t[62]=Q,t[63]=$):$=t[63],$}function pe(e){return{path:e.path,status:e.status}}function me(){let e=new Map;return{sort:g(()=>e),update:t=>{e=t}}}function he(e){return e.path}export{d as a,p as i,h as n,f as r,y as t};
2
+ //# sourceMappingURL=DiffFileTree-opfyNeFz.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{A as i,D as a,Du as o,I as s,Jo as c,Ju as l,Kd as u,Lf as d,Ol as f,Os as p,Ql as m,Ss as h,Yo as g,Zn as _,Zo as ee,ar as v,dr as te,es as ne,fr as y,ir as re,kl as b,lf as x,lr as S,mr as C,ns as ie,rr as w,sf as T,sl as E,t as ae,ur as D}from"./utils-BVnIIHXP.js";import{As as O,Ec as oe,Ir as se,Pf as k,ju as A,md as ce,n as j,yd as M}from"./src-DHn7yNZx.js";import{Ar as N,Dr as P,Sr as F,Ur as I,_r as L,gr as le,hr as R,pr as z,t as B}from"./runtime-CbYvES7U.js";import{s as V}from"./vcsRefInvalidation-C5gDWck3.js";import{E as ue,O as de,S as fe}from"./entities-CjoTQlW3.js";import{C as pe,_ as me,f as he,g as ge,m as _e,p as H,u as ve}from"./TooltipProvider-DQ0TF9NB.js";import{t as ye}from"./useParams-DsmZTF__.js";import{m as be,u as xe}from"./relay-BLgoNhyd.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./DiffFileTree-C6VB4VCo.js";import{K as De,s as Oe,v as ke}from"./useSettings-hYzrsDTp.js";import{f as Ae}from"./server-CEMcTnD1.js";import{n as je}from"./query-DFSffMGJ.js";import{t as Me}from"./use-atom-command-DWabKYXN.js";import{f as Ne,p as Pe}from"./providerSkills-gNPMp_MW.js";import{t as Fe,u as Ie}from"./queries-ckipBW-f.js";import{n as Le,t as Re}from"./diffPanelStore-CGdPbp5I.js";import{a as ze,c as Be,l as Ve,n as He,o as Ue,r as We,s as Ge,u as U}from"./diffRendering-DJnBG6ZN.js";import{B as Ke,F as qe,L as Je,R as W,z as Ye}from"./PanelLayoutControls-CKWjLO_e.js";import{t as Xe}from"./DiffCommentAnnotation-BjI2rZNS.js";import{c as Ze}from"./timestampFormat-Dq7sHZpd.js";import{B as Qe,H as $e,V as et}from"./ThreadDetailsItemsMenu-BOMU-3M3.js";import{a as tt,n as nt,t as rt}from"./tooltip-BhCWnsdW.js";import{n as G}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as it,t as at}from"./toggle-group-CzE2mG-B.js";import{i as ot,l as st,n as ct,o as lt,r as ut,s as dt,t as ft}from"./combobox-B0IMIA-1.js";import{Bo as pt,No as mt,Po as ht,Uo as gt}from"./main-xhw8F2iL.js";import{C as _t,S as vt,w as yt}from"./_chat-BrgTPEvH.js";var K=e(t(),1),q=n();function bt(e,t){let n=(0,q.c)(4),r=Fe(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var J=e(r(),1);function xt(e){let t=(0,q.c)(17),{filePath:n}=e,r=(0,K.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>$e(r),onError:e=>et(r,e),timeout:Qe},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=be(i),s;t[1]!==a||t[2]!==n?(s=(0,J.jsx)(C,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=ae(`size-3`,c),t[4]=c,t[5]=l);let u=o?he:pe,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(ve,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,J.jsx)(tt,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,J.jsx)(nt,{children:(0,J.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,J.jsxs)(rt,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var St=[];function Ct(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function Y(e,t,n){let r=Ct(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function wt(e){let t=(0,q.c)(66),{codeViewKey:n,files:r,sectionId:o,sectionTitle:c,composerDraftTarget:l,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:ee}=e,v=a(kt),te=a(X),ne;t[0]===l?ne=t[1]:(ne=e=>e.getComposerDraft(l)?.reviewComments??St,t[0]=l,t[1]=ne);let y=a(ne),[re,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(null),[C,ie]=(0,K.useState)(``),w;t[2]===r?w=t[3]:(w=new Map(r.map(Ot)),t[2]=r,t[3]=w);let T=w,E;if(t[4]!==x||t[5]!==r||t[6]!==y||t[7]!==o){let e;t[9]!==x||t[10]!==y||t[11]!==o?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:a}=e,c=y.filter(e=>e.sectionId===o&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=s(t,n);return r?Y(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),l=x?.fileKey===r?[...c,x.annotation]:c;return{id:r,type:`diff`,fileDiff:t,annotations:l,collapsed:a,version:ze(`${i}:${a?`1`:`0`}:${l.flatMap(Et).join(`:`)}`)}},t[9]=x,t[10]=y,t[11]=o,t[12]=e):e=t[12],E=r.map(e),t[4]=x,t[5]=r,t[6]=y,t[7]=o,t[8]=E}else E=t[8];let ae=E,D;t[13]!==l||t[14]!==x?.annotation||t[15]!==te?(D=e=>{b(null),x?.annotation.metadata.entries.some(t=>t.id===e)?(S(null),ie(``)):te(l,e)},t[13]=l,t[14]=x?.annotation,t[15]=te,t[16]=D):D=t[16];let O=D,oe;t[17]!==v||t[18]!==l||t[19]!==x||t[20]!==T||t[21]!==o||t[22]!==c?(oe=(e,t)=>{let n=x?.annotation.metadata.entries.find(t=>t.id===e),r=x?T.get(x.fileKey):void 0;if(!n||!r)return;let a=i({id:n.id,sectionId:o,sectionTitle:c,filePath:r.filePath,fileDiff:r.fileDiff,range:n.range,text:t});a&&v(l,a),b(null),S(null),ie(``)},t[17]=v,t[18]=l,t[19]=x,t[20]=T,t[21]=o,t[22]=c,t[23]=oe):oe=t[23];let se=oe,k;t[24]!==o||t[25]!==c?(k=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let r=G(),a=i({id:r,sectionId:o,sectionTitle:c,filePath:U(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});a&&(ie(``),S({fileKey:n.id,annotation:{side:Ct(e),lineNumber:e.end,metadata:{entries:[{id:r,kind:`draft`,range:e,rangeLabel:a.rangeLabel,text:``}]}}}))},t[24]=o,t[25]=c,t[26]=k):k=t[26];let A=k,ce=x!==null,j;t[27]===d?j=t[28]:(j=d?{viewerRef:d}:{},t[27]=d,t[28]=j);let M;t[29]===f?M=t[30]:(M=f?{className:f}:{},t[29]=f,t[30]=M);let N;t[31]===m?N=t[32]:(N=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=N);let P;t[33]===h?P=t[34]:(P=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=P);let F;t[35]===p?F=t[36]:(F=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=F);let I;t[37]===ee?I=t[38]:(I=e=>ee(e.id),t[37]=ee,t[38]=I);let L=!ce,le=!ce,R;t[39]!==A||t[40]!==u||t[41]!==L||t[42]!==le?(R={...u,enableGutterUtility:L,enableLineSelection:le,onGutterUtilityClick:A},t[39]=A,t[40]=u,t[41]=L,t[42]=le,t[43]=R):R=t[43];let z;t[44]===g?z=t[45]:(z=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=z);let B;t[46]===_?B=t[47]:(B=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=B);let V;t[48]!==C||t[49]!==O||t[50]!==se?(V=e=>{let t=e.metadata.entries.some(Tt);return(0,J.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,J.jsx)(Xe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?C:e.text,onTextChange:ie,onCancel:()=>O(e.id),onComment:t=>se(e.id,t),onDelete:()=>O(e.id)},e.id))})},t[48]=C,t[49]=O,t[50]=se,t[51]=V):V=t[51];let ue;return t[52]!==n||t[53]!==ae||t[54]!==re||t[55]!==P||t[56]!==F||t[57]!==I||t[58]!==R||t[59]!==z||t[60]!==B||t[61]!==V||t[62]!==j||t[63]!==M||t[64]!==N?(ue=(0,J.jsx)(Je,{...j,...M,...N,...P,...F,items:ae,selectedLines:re,onSelectedLinesChange:b,onRevealSearchMatch:I,options:R,renderHeaderFilenameSuffix:z,renderHeaderPrefix:B,renderAnnotation:V},n),t[52]=n,t[53]=ae,t[54]=re,t[55]=P,t[56]=F,t[57]=I,t[58]=R,t[59]=z,t[60]=B,t[61]=V,t[62]=j,t[63]=M,t[64]=N,t[65]=ue):ue=t[65],ue}function Tt(e){return e.kind===`draft`}function Et(e){return e.metadata.entries.map(Dt)}function Dt(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ot(e){return[e.fileKey,e]}function X(e){return e.removeReviewComment}function kt(e){return e.addReviewComment}function At(e){let t=O(4),n=z();return{diffPreview:L(e,{label:`environment-data:review:diff-preview`,tag:j.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:R(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>N(j.reviewGetDiffPreview,e.request).pipe(t.withPermit,M(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?k(n):ce(new se({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:le(e,{label:`environment-data:review:diff-file-contents`,tag:j.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var jt=At(B);function Mt(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function Nt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&Mt(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function Pt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var Ft=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function It(e){let t=(0,q.c)(86),{environmentId:n,cwd:r,source:i,baseRef:a,ignoreWhitespace:o,theme:s,revision:l,preview:u}=e,d=(0,K.useContext)(g),f;t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==o||t[4]!==i?.diffHash||t[5]!==i?.kind?(f=JSON.stringify([n,r,i?.kind,i?.diffHash,a,o]),t[0]=a,t[1]=r,t[2]=n,t[3]=o,t[4]=i?.diffHash,t[5]=i?.kind,t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=[0,1,2,3],t[7]=m):m=t[7];let _;t[8]===p?_=t[9]:(_={scope:p,indices:m},t[8]=p,t[9]=_);let[v,te]=(0,K.useState)(_),y;t[10]!==v.indices||t[11]!==v.scope||t[12]!==p?(y=v.scope===p?v.indices:[0,1,2,3],t[10]=v.indices,t[11]=v.scope,t[12]=p,t[13]=y):y=t[13];let re=y,b;t[14]===i?.files?b=t[15]:(b=()=>i?.files?.toSorted(Q)??[],t[14]=i?.files,t[15]=b),i?.files;let x;t[16]===b?x=t[17]:(x=b(),t[16]=b,t[17]=x);let S=x,C;t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==S||t[22]!==o||t[23]!==re||t[24]!==p||t[25]!==i?(C=!n||!r||!i?[]:re.filter(e=>e<S.length).map(e=>{let t=S[e];return{index:e,query:jt.diffFilePatch({environmentId:n,input:{cacheKey:p,request:{cwd:r,...a?{baseRef:a}:{},ignoreWhitespace:o,file:{path:t.path,previousPath:t.previousPath,sourceKind:i.kind}}}})}}),t[18]=a,t[19]=r,t[20]=n,t[21]=S,t[22]=o,t[23]=re,t[24]=p,t[25]=i,t[26]=C):C=t[26];let w=C,T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[27]=T):T=t[27];let E;t[28]!==l||t[29]!==p?(E={scope:p,revision:l,queries:T},t[28]=l,t[29]=p,t[30]=E):E=t[30];let ae=(0,K.useRef)(E),D,O;t[31]!==w||t[32]!==d||t[33]!==l||t[34]!==p?(D=()=>{let e=ae.current;ae.current={scope:p,revision:l,queries:w};for(let{query:t}of w){let n=e.scope===p&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&d.get(t)._tag!==`Initial`&&!d.get(t).waiting;(n||r)&&d.refresh(t)}},O=[p,l,w,d],t[31]=w,t[32]=d,t[33]=l,t[34]=p,t[35]=D,t[36]=O):(D=t[35],O=t[36]),(0,K.useEffect)(D,O);let oe;t[37]===s?oe=t[38]:(oe=ee(e=>ie(e,e=>h(e,e=>{let t=Be(e.diff,`diff-panel:${s}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=s,t[38]=oe);let se=oe,k;t[39]!==se||t[40]!==w?(k=ne(e=>new Map(w.map(t=>{let{index:n,query:r}=t;return[n,e(se(r))]}))),t[39]=se,t[40]=w,t[41]=k):k=t[41];let A=c(k),ce;t[42]===A?ce=t[43]:(ce=(e,t)=>{let n=A.get(t);return!n||n._tag===`Initial`},t[42]=A,t[43]=ce);let j=S.findIndex(ce),M=i?j<0?S.length:j:u?.kind===`files`?u.files.length:0,N;t[44]===p?N=t[45]:(N=e=>te(t=>{let n=t.scope===p?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:p,indices:[...n,...r]}}),t[44]=p,t[45]=N);let P=N,F;t[46]!==P||t[47]!==M?(F=()=>P(Array.from({length:4},(e,t)=>M+t)),t[46]=P,t[47]=M,t[48]=F):F=t[48];let I=F,L;t[49]===P?L=t[50]:(L=e=>P([e]),t[49]=P,t[50]=L);let le=L,R;t[51]!==S||t[52]!==w?(R={queries:w,files:S},t[51]=S,t[52]=w,t[53]=R):R=t[53];let z=(0,K.useRef)(R),B,V;t[54]!==S||t[55]!==w?(B=()=>{z.current={queries:w,files:S}},V=[w,S],t[54]=S,t[55]=w,t[56]=B,t[57]=V):(B=t[56],V=t[57]),(0,K.useLayoutEffect)(B,V);let ue;t[58]===d?ue=t[59]:(ue=e=>{let{queries:t,files:n}=z.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&d.refresh(r)},t[58]=d,t[59]=ue);let de=ue,fe;t[60]!==S||t[61]!==A||t[62]!==u||t[63]!==p||t[64]!==i?(fe=i?S.map((e,t)=>{let n=A.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>U(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${p}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Rt),t[60]=S,t[61]=A,t[62]=u,t[63]=p,t[64]=i,t[65]=fe):fe=t[65];let pe=fe,me;if(t[66]!==S||t[67]!==A){let e;t[69]===A?e=t[70]:(e=(e,t)=>{let n=A.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>U(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=A,t[70]=e),me=new Map(S.map(e)),t[66]=S,t[67]=A,t[68]=me}else me=t[68];let he=me,ge;if(t[71]!==S||t[72]!==A){let e;t[74]===A?e=t[75]:(e=(e,t)=>{let n=A.get(t);return n&&n._tag!==`Initial`},t[74]=A,t[75]=e),ge=new Set(S.filter(e).map(Lt)),t[71]=S,t[72]=A,t[73]=ge}else ge=t[73];let _e=ge,H=[...A.values()].some(Z),ve;return t[76]!==he||t[77]!==I||t[78]!==_e||t[79]!==pe||t[80]!==le||t[81]!==de||t[82]!==p||t[83]!==M||t[84]!==H?(ve={scope:p,fileStates:he,isPending:H,retry:de,requestFile:le,readyFilePaths:_e,renderableFiles:pe,settledFileCount:M,loadNextFiles:I},t[76]=he,t[77]=I,t[78]=_e,t[79]=pe,t[80]=le,t[81]=de,t[82]=p,t[83]=M,t[84]=H,t[85]=ve):ve=t[85],ve}function Z(e){return e._tag===`Initial`||e.waiting}function Lt(e){return e.path}function Rt(e,t){return Ft.compare(U(e),U(t))}function Q(e,t){return Ft.compare(e.path,t.path)}function zt(e){let t=(0,q.c)(5),{load:n,count:r}=e,i=(0,K.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Vt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,K.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,J.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Bt)}),t[3]=r,t[4]=s),s}function Bt(e,t){return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,J.jsx)(W,{titleWidth:`medium`})},t)}function Vt(e){return e.isIntersecting}function Ht(e){let t=(0,q.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,J.jsx)(T,{className:`size-3`}):(0,J.jsx)(l,{className:`size-3`}),t[6]=n,t[7]=c);let u;t[8]!==s||t[9]!==c?(u=(0,J.jsx)(tt,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=u):u=t[10];let d=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,f;t[11]===d?f=t[12]:(f=(0,J.jsx)(nt,{children:d}),t[11]=d,t[12]=f);let p;return t[13]!==u||t[14]!==f?(p=(0,J.jsxs)(rt,{children:[u,f]}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}var Ut=`__automatic_base_ref__`,Wt=`p4code.diffFileTreeOpen`,Gt=new WeakMap;function Kt(e){let t=Gt.get(e);if(t)return t;let n={fileDiff:e,fileKey:We(e),fileVersion:He(e)};return Gt.set(e,n),n}var qt=new Set;function Jt(e){let t=(0,q.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=ae(`size-4`,o),t[8]=o,t[9]=f);let p=i?_e:H,m;t[10]!==f||t[11]!==p?(m=(0,J.jsx)(ve,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,J.jsx)(tt,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,J.jsx)(nt,{side:`top`,children:g}),t[16]=g,t[17]=_);let ee;return t[18]!==_||t[19]!==h?(ee=(0,J.jsxs)(rt,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=ee):ee=t[20],ee}function Yt(e){let t=(0,q.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,J.jsx)(xt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,J.jsx)(Ht,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsxs)(J.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Xt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:n}){let{resolvedTheme:r}=De(),i=Oe(),a=i.diffLayout,s=ke(),[l,h]=(0,K.useState)(i.wordWrap),[g,ee]=(0,K.useState)(i.diffIgnoreWhitespace),[ne,ie]=p(Wt,!1,oe),[T,O]=(0,K.useState)(``),[se,k]=(0,K.useState)(()=>({scopeKey:null,fileKeys:qt})),[ce,j]=(0,K.useState)(0),[M,N]=(0,K.useState)(null),L=ye({strict:!1,select:e=>xe(e)}),le=L?.threadId??null,R=de(L),z=ue(L)?.projection??null,B=V(R?.environmentId??null),{canReadFiles:pe}=B,he=R?.projectId??null,_e=fe(R&&he?{environmentId:R.environmentId,projectId:he}:null),H=R?.worktreePath??_e?.workspaceRoot,be=R?.worktreePath?void 0:_e?.repositoryIdentity?.rootPath,Fe=c(Ae.configValueAtom(R?.environmentId??null)),ze=Ne(R?.environmentId??null),He=pt(R?.environmentId??null,Fe?.availableEditors??[]),We=Me(jt.diffFileContents),Je=je(R!=null&&H!=null?Ie.status({environmentId:R.environmentId,input:{cwd:H}}):null),W=Le(e=>Re(e.byThreadKey,L)),Xe=Je.data?.isRepo??!0,{turnDiffSummaries:Qe,inferredCheckpointTurnCountByRunId:$e}=yt(z),et=(0,K.useMemo)(()=>[...Qe].toSorted((e,t)=>{let n=e.checkpointTurnCount??$e[e.runId]??0,r=t.checkpointTurnCount??$e[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[$e,Qe]);(0,K.useEffect)(()=>{L&&W.kind===`turn`&&Le.getState().reconcileTurnSelection(L,et.map(e=>e.runId))},[W,et,L]);let G=W.kind===`turn`?W.turnId:null,q=W.kind===`unstaged`?`unstaged`:`branch`,xt=W.kind===`branch`?W.baseRef:null,St=W.kind===`turn`?W.filePath:null,Ct=W.kind===`turn`?W.revealRequestId:0,Y=G===null?void 0:et.find(e=>e.runId===G)??et[0],Tt=Y&&(Y.checkpointTurnCount??$e[Y.runId]),Et=et[0],Dt=G===null?q===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Et?.runId?`Latest turn`:`Turn ${Tt??`?`}`,Ot=Y?`turn:${Y.runId}`:q,X=L?`${L.environmentId}:${L.threadId}:${Ot}`:null,kt=`${X??Ot}:${ce}`,At=Y?`Turn ${Tt??`?`}`:q===`unstaged`?`Uncommitted`:`Changes`,Mt=(0,K.useMemo)(()=>typeof Tt==`number`?{fromTurnCount:Math.max(0,Tt-1),toTurnCount:Tt}:null,[Tt]),Ft=bt({environmentId:R?.environmentId??null,threadId:le,fromTurnCount:Mt?.fromTurnCount??null,toTurnCount:Mt?.toTurnCount??null,ignoreWhitespace:g,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:Xe&&Y!==void 0}),Z=je(pe&&G===null&&R&&H?jt.diffPreview({environmentId:R.environmentId,input:{cwd:H,...xt?{baseRef:xt}:{},ignoreWhitespace:g}}):null),Lt=Xe&&G===null&&R!=null&&H!=null,Rt=L?`${L.environmentId}:${L.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(q===`unstaged`?`working-tree`:`branch-range`)),Bt=Z.refresh,Vt=Bt,Ht=(0,K.useMemo)(()=>{let e=Z.data;if(G===null&&R&&e&&Q&&pe)return qe(We,{environmentId:R.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[R,Z.data,We,pe,Q,G]),Gt=(0,K.useRef)(Ht);Gt.current=Ht;let Xt=(0,K.useCallback)(async e=>{let t=Gt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Zt=Q?.headRef??Je.data?.refName??`HEAD`,Qt=Q?.baseRef??xt??`Automatic`,$t=G===null&&pe&&Lt&&q===`branch`,en=Z.data?.cwd??H,tn=je($t&&R&&en?Ie.listRefs({environmentId:R.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`local`,...T.trim().length>0?{query:T.trim()}:{},limit:100}}):null),nn=je($t&&R&&en?Ie.listRefs({environmentId:R.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`remote`,...T.trim().length>0?{query:T.trim()}:{},limit:100}}):null),rn=Nt(tn.data?.refs.filter(e=>e.name!==Zt)??[],nn.data?.refs??[]),an=Pt(rn,T),on=e=>xt&&xt===e.remote?.name?xt:e.local?.name??e.remote?.name??e.id,sn=[Ut,...rn.map(on)],cn=[...T.trim().length===0?[Ut]:[],...an.map(on)],ln=Q?.diff,un=Y?Ft.data?.diff:ln,dn=!Y&&Q?.truncated===!0,fn=Y?Ft.isPending:Z.isPending,pn=Y?Ft.error:Z.error,mn=typeof un==`string`&&un.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,hn=(0,K.useMemo)(()=>$?null:Be(un,`diff-panel:${r}`,{compactPartialHunkOffsets:G===null}),[$,r,un,G]),gn=(0,K.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:_n,isPending:vn,fileStates:yn,retry:bn,requestFile:xn,readyFilePaths:Sn,renderableFiles:Cn,settledFileCount:wn,loadNextFiles:Tn}=It({environmentId:R?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??xt,ignoreWhitespace:g,theme:r,revision:Z.data?A(Z.data.generatedAt):void 0,preview:hn}),En=Bt;(0,K.useEffect)(()=>{if(!Lt)return;let e=()=>En();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,En]),_t({enabled:Lt,mutationId:n,refresh:En,resourceKey:`diff:${Rt??``}`});let Dn=Z.isPending||vn,On=(0,K.useMemo)(()=>Cn.map(Kt),[Cn]),kn=(0,K.useMemo)(()=>i.diffFilesCollapsed?new Set(On.map(e=>e.fileKey)):qt,[On,i.diffFilesCollapsed]),An=se.scopeKey===X?se.fileKeys:kn,jn=(0,K.useCallback)(()=>wn<Cn.length?(0,J.jsx)(zt,{load:Tn,count:Cn.length-wn}):null,[wn,Cn.length,Tn]),Mn=(0,K.useMemo)(()=>On.filter(({fileDiff:e})=>!$||Sn.has(U(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:U(e),fileKey:t,fileVersion:n,collapsed:An.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[An,On,$,Sn]),Nn=(0,K.useMemo)(()=>On.map(e=>e.fileKey),[On]),Pn=Te(Nn,An),Fn=(0,K.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):Ge(Cn),[Cn,Q,Y]),In=(0,K.useMemo)(()=>we(Cn),[Cn]),Ln=St?Mn.find(e=>e.filePath===St)?.fileKey??null:null;(0,K.useEffect)(()=>{Ln&&M?.getInstance()&&M.scrollTo({type:`item`,id:Ln,align:`start`})},[M,kt,Ln,Ct]);let Rn=(0,K.useMemo)(()=>({collapseScopeKey:X,diffSelection:W}),[X,W]),zn=Se(M,Rn,Mn.map(e=>e.fileKey)),Bn=(0,K.useCallback)(e=>{let t=On.findIndex(t=>U(t.fileDiff)===e),n=On[t];n&&(k(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:kn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=wn&&xn(t),zn(n.fileKey))},[On,X,kn,zn,$,wn,xn]),Vn=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(Vn.current?.cache!==_n||Vn.current.key!==e)&&(Vn.current={cache:_n,key:e},Bn(St))},[$,St,Ct,_n,Bn]);let Hn=(0,K.useCallback)(e=>{Pe({threadRef:L,filePath:e,activeCwd:H,repositoryRoot:be,openInEditor:e=>{(async()=>{let t=await He(e);t._tag===`Failure`&&!F(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...L?{environmentId:L.environmentId,threadId:L.threadId}:{},...I(P(t))})})()}})},[H,be,He,L]),Un=(0,K.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn});(0,K.useLayoutEffect)(()=>{Un.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn}},[X,kn]);let Wn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;k(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Gn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;k(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Kn=(0,K.useCallback)(()=>{j(e=>e+1),k(e=>{let t=e.scopeKey===X?e.fileKeys:kn;return{scopeKey:X,fileKeys:Ce(Nn,t)}})},[X,kn,Nn]),qn=e=>{L&&Le.getState().selectTurn(L,e)},Jn=e=>{L&&Le.getState().selectGitScope(L,e)},Yn=e=>{L&&Le.getState().selectBranchBaseRef(L,e)},Xn=Y?`turn:${Y.runId}`:``,Zn=G===null?q:Y?.runId===Et?.runId?`latest`:Xn,Qn=e=>{if(e===`unstaged`||e===`branch`)Jn(e);else if(e===`latest`)Et&&qn(Et.runId);else{let t=et.find(t=>`turn:${t.runId}`===e);t&&qn(t.runId)}},$n=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,J.jsxs)(_,{children:[(0,J.jsxs)(y,{render:(0,J.jsx)(C,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Dt}`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:Dt}),(0,J.jsx)(b,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(w,{align:`start`,children:[(0,J.jsxs)(re,{value:Zn,onValueChange:Qn,children:[(0,J.jsx)(v,{value:`branch`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Changes`})}),(0,J.jsx)(v,{value:`unstaged`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Uncommitted`})}),(0,J.jsx)(v,{value:`latest`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Latest turn`})})]}),(0,J.jsxs)(S,{children:[(0,J.jsx)(te,{children:`Turn`}),(0,J.jsx)(D,{children:(0,J.jsx)(re,{value:Xn,onValueChange:Qn,children:et.map(e=>{let t=e.checkpointTurnCount??$e[e.runId]??`?`;return(0,J.jsx)(v,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Turn `,t]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:Ze(e.completedAt,i.timestampFormat)})]})},e.runId)})})})]})]})]}),$t&&(0,J.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Zt} against ${Qt}`,children:[(0,J.jsxs)(rt,{children:[(0,J.jsxs)(tt,{render:(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,J.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Zt}),(0,J.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsx)(nt,{side:`top`,children:`${Zt} → ${Qt}`})]}),(0,J.jsxs)(ft,{items:sn,filteredItems:cn,value:xt??Ut,onOpenChange:e=>{e||O(``)},onValueChange:e=>{e&&Yn(e===Ut?null:e)},children:[(0,J.jsxs)(st,{render:(0,J.jsx)(C,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Qt}`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:Qt}),(0,J.jsx)(b,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(lt,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,J.jsx)(dt,{placeholder:`Search refs...`,value:T,onChange:e=>O(e.target.value)}),(0,J.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,J.jsx)(`span`,{children:`Branch`}),(0,J.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,J.jsx)(ct,{children:`No matching refs.`}),(0,J.jsxs)(ot,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:Ut,children:(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),rn.map(e=>{let t=on(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,J.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,J.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,J.jsx)(mt,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Yn(n)}})}):e.remote?(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,J.jsx)(f,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,J.jsx)(nt,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Mn.length>0||!Y&&Q?.files?.length?(0,J.jsx)(vt,{additions:Fn.additions,deletions:Fn.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Dn?`Refreshing diff`:`Refresh diff`,onClick:Vt}),children:(0,J.jsx)(gt,{size:`sm`,refreshing:Dn})}),(0,J.jsx)(nt,{side:`top`,children:Dn?`Refreshing diff…`:`Refresh diff`})]}),Nn.length>0&&(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Pn?`Expand all files`:`Collapse all files`,onClick:Kn,children:(0,J.jsx)(ve,{className:`size-3.5`,icon:Pn?me:ge})}),(0,J.jsxs)(it,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[a],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&s({diffLayout:t})},children:[(0,J.jsx)(at,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,J.jsx)(x,{className:`size-3.5`})}),(0,J.jsx)(at,{"aria-label":`Split diff view`,value:`split`,children:(0,J.jsx)(m,{className:`size-3.5`})})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":l?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:l,onPressedChange:e=>{h(!!e)}}),children:(0,J.jsx)(d,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:l?`Disable line wrapping`:`Enable line wrapping`})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":g?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:g,onPressedChange:e=>{ee(!!e)}}),children:(0,J.jsx)(u,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:g?`Show whitespace changes`:`Hide whitespace changes`})]}),Nn.length>0&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":ne?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:ne,onPressedChange:e=>ie(!!e)}),children:(0,J.jsx)(o,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:ne?`Hide file tree`:`Show file tree`})]})]})]});return(0,J.jsx)(Ke,{mode:e,header:$n,children:R?Xe?G!==null&&et.length===0?(0,J.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.`}):G===null&&!pe?B.isPending?(0,J.jsx)(Ye,{label:`Checking file access...`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:B.error??`This connection cannot read local diffs.`}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[dn&&!$&&(0,J.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),pn&&!hn&&(0,J.jsx)(`div`,{className:`px-3`,children:(0,J.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:pn})}),!hn&&!$?fn?(0,J.jsx)(Ye,{label:Y?`Loading checkpoint diff...`:q===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,J.jsx)(`p`,{children:mn?`No net changes in this selection.`:`No patch available for this selection.`})}):$||hn?.kind===`files`?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Hn(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=Mn.find(e=>e.filePath===r);i&&Wn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),ze({environmentId:R?.environmentId??null,filePath:t,workspaceRoot:H,repositoryRoot:be},e))},children:(0,J.jsx)(wt,{viewerRef:N,codeViewKey:`${kt}:${$?_n:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:Mn,renderCodeViewFooter:jn,sectionId:Ot,sectionTitle:At,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=U(e),n=yn.get(t);return(0,J.jsx)(Yt,{filePath:t,hasStat:gn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:bn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=gn.get(U(e));return t?(0,J.jsx)(vt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Gn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,J.jsx)(Jt,{filePath:U(e),fileKey:t,collapsed:n||An.has(t),unavailable:n,iconClassName:Ue(e),onToggle:Wn})},options:{diffStyle:a===`split`?`split`:`unified`,lineDiffType:`none`,overflow:l?`wrap`:`scroll`,theme:Ve(r),preferredHighlighter:ht,themeType:r,stickyHeaders:!0,...Ht?{loadDiffFiles:Xt}:{}}},X??Ot)}),ne?(0,J.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,J.jsx)(Ee,{ariaLabel:`${At} files`,entries:In,selectedPath:St,revealRequestId:Ct,onSelectFile:Bn})}):null]}):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:hn?.kind===`raw`?hn.reason:null}),(0,J.jsx)(`pre`,{className:ae(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,l?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:hn?.kind===`raw`?hn.text:null})]})})]})}):(0,J.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,J.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{Xt as default};
2
- //# sourceMappingURL=DiffPanel-pkAdnqL7.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{A as i,D as a,Du as o,I as s,Jo as c,Ju as l,Kd as u,Lf as d,Ol as f,Os as p,Ql as m,Ss as h,Yo as g,Zn as _,Zo as ee,ar as v,dr as te,es as ne,fr as y,ir as re,kl as b,lf as x,lr as S,mr as C,ns as ie,rr as w,sf as T,sl as E,t as ae,ur as D}from"./utils-BVnIIHXP.js";import{As as O,Ec as oe,Ir as se,Pf as k,ju as A,md as ce,n as j,yd as M}from"./src-DHn7yNZx.js";import{Ar as N,Dr as P,Sr as F,Ur as I,_r as L,gr as le,hr as R,pr as z,t as B}from"./runtime-vb0YwEUc.js";import{s as V}from"./vcsRefInvalidation-DU1ipBl9.js";import{E as ue,O as de,S as fe}from"./entities-JWl3bvMT.js";import{C as pe,_ as me,f as he,g as ge,m as _e,p as H,u as ve}from"./TooltipProvider-DQ0TF9NB.js";import{t as ye}from"./useParams-DsmZTF__.js";import{m as be,u as xe}from"./relay-Ceq0htTl.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./DiffFileTree-opfyNeFz.js";import{K as De,s as Oe,v as ke}from"./useSettings-Dp27sUML.js";import{f as Ae}from"./server-Bw1ZPPkk.js";import{n as je}from"./query-DFSffMGJ.js";import{t as Me}from"./use-atom-command-DkmE-pw9.js";import{f as Ne,p as Pe}from"./providerSkills-Dfc0PY_E.js";import{t as Fe,u as Ie}from"./queries-BQAICaPF.js";import{n as Le,t as Re}from"./diffPanelStore-CGdPbp5I.js";import{a as ze,c as Be,l as Ve,n as He,o as Ue,r as We,s as Ge,u as U}from"./diffRendering-B7lkQ5_O.js";import{B as Ke,F as qe,L as Je,R as W,z as Ye}from"./PanelLayoutControls-CcdUv-ij.js";import{t as Xe}from"./DiffCommentAnnotation-eHSeIufV.js";import{c as Ze}from"./timestampFormat-Dq7sHZpd.js";import{B as Qe,H as $e,V as et}from"./ThreadDetailsItemsMenu-D0mfEKtW.js";import{a as tt,n as nt,t as rt}from"./tooltip-BhCWnsdW.js";import{n as G}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as it,t as at}from"./toggle-group-CzE2mG-B.js";import{i as ot,l as st,n as ct,o as lt,r as ut,s as dt,t as ft}from"./combobox-B0IMIA-1.js";import{Bo as pt,No as mt,Po as ht,Uo as gt}from"./main-43D2LVmx.js";import{C as _t,S as vt,w as yt}from"./_chat-BA5cbHxE.js";var K=e(t(),1),q=n();function bt(e,t){let n=(0,q.c)(4),r=Fe(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var J=e(r(),1);function xt(e){let t=(0,q.c)(17),{filePath:n}=e,r=(0,K.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>$e(r),onError:e=>et(r,e),timeout:Qe},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=be(i),s;t[1]!==a||t[2]!==n?(s=(0,J.jsx)(C,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=ae(`size-3`,c),t[4]=c,t[5]=l);let u=o?he:pe,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(ve,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,J.jsx)(tt,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,J.jsx)(nt,{children:(0,J.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,J.jsxs)(rt,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var St=[];function Ct(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function Y(e,t,n){let r=Ct(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function wt(e){let t=(0,q.c)(66),{codeViewKey:n,files:r,sectionId:o,sectionTitle:c,composerDraftTarget:l,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:ee}=e,v=a(kt),te=a(X),ne;t[0]===l?ne=t[1]:(ne=e=>e.getComposerDraft(l)?.reviewComments??St,t[0]=l,t[1]=ne);let y=a(ne),[re,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(null),[C,ie]=(0,K.useState)(``),w;t[2]===r?w=t[3]:(w=new Map(r.map(Ot)),t[2]=r,t[3]=w);let T=w,E;if(t[4]!==x||t[5]!==r||t[6]!==y||t[7]!==o){let e;t[9]!==x||t[10]!==y||t[11]!==o?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:a}=e,c=y.filter(e=>e.sectionId===o&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=s(t,n);return r?Y(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),l=x?.fileKey===r?[...c,x.annotation]:c;return{id:r,type:`diff`,fileDiff:t,annotations:l,collapsed:a,version:ze(`${i}:${a?`1`:`0`}:${l.flatMap(Et).join(`:`)}`)}},t[9]=x,t[10]=y,t[11]=o,t[12]=e):e=t[12],E=r.map(e),t[4]=x,t[5]=r,t[6]=y,t[7]=o,t[8]=E}else E=t[8];let ae=E,D;t[13]!==l||t[14]!==x?.annotation||t[15]!==te?(D=e=>{b(null),x?.annotation.metadata.entries.some(t=>t.id===e)?(S(null),ie(``)):te(l,e)},t[13]=l,t[14]=x?.annotation,t[15]=te,t[16]=D):D=t[16];let O=D,oe;t[17]!==v||t[18]!==l||t[19]!==x||t[20]!==T||t[21]!==o||t[22]!==c?(oe=(e,t)=>{let n=x?.annotation.metadata.entries.find(t=>t.id===e),r=x?T.get(x.fileKey):void 0;if(!n||!r)return;let a=i({id:n.id,sectionId:o,sectionTitle:c,filePath:r.filePath,fileDiff:r.fileDiff,range:n.range,text:t});a&&v(l,a),b(null),S(null),ie(``)},t[17]=v,t[18]=l,t[19]=x,t[20]=T,t[21]=o,t[22]=c,t[23]=oe):oe=t[23];let se=oe,k;t[24]!==o||t[25]!==c?(k=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let r=G(),a=i({id:r,sectionId:o,sectionTitle:c,filePath:U(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});a&&(ie(``),S({fileKey:n.id,annotation:{side:Ct(e),lineNumber:e.end,metadata:{entries:[{id:r,kind:`draft`,range:e,rangeLabel:a.rangeLabel,text:``}]}}}))},t[24]=o,t[25]=c,t[26]=k):k=t[26];let A=k,ce=x!==null,j;t[27]===d?j=t[28]:(j=d?{viewerRef:d}:{},t[27]=d,t[28]=j);let M;t[29]===f?M=t[30]:(M=f?{className:f}:{},t[29]=f,t[30]=M);let N;t[31]===m?N=t[32]:(N=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=N);let P;t[33]===h?P=t[34]:(P=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=P);let F;t[35]===p?F=t[36]:(F=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=F);let I;t[37]===ee?I=t[38]:(I=e=>ee(e.id),t[37]=ee,t[38]=I);let L=!ce,le=!ce,R;t[39]!==A||t[40]!==u||t[41]!==L||t[42]!==le?(R={...u,enableGutterUtility:L,enableLineSelection:le,onGutterUtilityClick:A},t[39]=A,t[40]=u,t[41]=L,t[42]=le,t[43]=R):R=t[43];let z;t[44]===g?z=t[45]:(z=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=z);let B;t[46]===_?B=t[47]:(B=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=B);let V;t[48]!==C||t[49]!==O||t[50]!==se?(V=e=>{let t=e.metadata.entries.some(Tt);return(0,J.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,J.jsx)(Xe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?C:e.text,onTextChange:ie,onCancel:()=>O(e.id),onComment:t=>se(e.id,t),onDelete:()=>O(e.id)},e.id))})},t[48]=C,t[49]=O,t[50]=se,t[51]=V):V=t[51];let ue;return t[52]!==n||t[53]!==ae||t[54]!==re||t[55]!==P||t[56]!==F||t[57]!==I||t[58]!==R||t[59]!==z||t[60]!==B||t[61]!==V||t[62]!==j||t[63]!==M||t[64]!==N?(ue=(0,J.jsx)(Je,{...j,...M,...N,...P,...F,items:ae,selectedLines:re,onSelectedLinesChange:b,onRevealSearchMatch:I,options:R,renderHeaderFilenameSuffix:z,renderHeaderPrefix:B,renderAnnotation:V},n),t[52]=n,t[53]=ae,t[54]=re,t[55]=P,t[56]=F,t[57]=I,t[58]=R,t[59]=z,t[60]=B,t[61]=V,t[62]=j,t[63]=M,t[64]=N,t[65]=ue):ue=t[65],ue}function Tt(e){return e.kind===`draft`}function Et(e){return e.metadata.entries.map(Dt)}function Dt(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ot(e){return[e.fileKey,e]}function X(e){return e.removeReviewComment}function kt(e){return e.addReviewComment}function At(e){let t=O(4),n=z();return{diffPreview:L(e,{label:`environment-data:review:diff-preview`,tag:j.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:R(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>N(j.reviewGetDiffPreview,e.request).pipe(t.withPermit,M(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?k(n):ce(new se({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:le(e,{label:`environment-data:review:diff-file-contents`,tag:j.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var jt=At(B);function Mt(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function Nt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&Mt(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function Pt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var Ft=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function It(e){let t=(0,q.c)(86),{environmentId:n,cwd:r,source:i,baseRef:a,ignoreWhitespace:o,theme:s,revision:l,preview:u}=e,d=(0,K.useContext)(g),f;t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==o||t[4]!==i?.diffHash||t[5]!==i?.kind?(f=JSON.stringify([n,r,i?.kind,i?.diffHash,a,o]),t[0]=a,t[1]=r,t[2]=n,t[3]=o,t[4]=i?.diffHash,t[5]=i?.kind,t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=[0,1,2,3],t[7]=m):m=t[7];let _;t[8]===p?_=t[9]:(_={scope:p,indices:m},t[8]=p,t[9]=_);let[v,te]=(0,K.useState)(_),y;t[10]!==v.indices||t[11]!==v.scope||t[12]!==p?(y=v.scope===p?v.indices:[0,1,2,3],t[10]=v.indices,t[11]=v.scope,t[12]=p,t[13]=y):y=t[13];let re=y,b;t[14]===i?.files?b=t[15]:(b=()=>i?.files?.toSorted(Q)??[],t[14]=i?.files,t[15]=b),i?.files;let x;t[16]===b?x=t[17]:(x=b(),t[16]=b,t[17]=x);let S=x,C;t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==S||t[22]!==o||t[23]!==re||t[24]!==p||t[25]!==i?(C=!n||!r||!i?[]:re.filter(e=>e<S.length).map(e=>{let t=S[e];return{index:e,query:jt.diffFilePatch({environmentId:n,input:{cacheKey:p,request:{cwd:r,...a?{baseRef:a}:{},ignoreWhitespace:o,file:{path:t.path,previousPath:t.previousPath,sourceKind:i.kind}}}})}}),t[18]=a,t[19]=r,t[20]=n,t[21]=S,t[22]=o,t[23]=re,t[24]=p,t[25]=i,t[26]=C):C=t[26];let w=C,T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[27]=T):T=t[27];let E;t[28]!==l||t[29]!==p?(E={scope:p,revision:l,queries:T},t[28]=l,t[29]=p,t[30]=E):E=t[30];let ae=(0,K.useRef)(E),D,O;t[31]!==w||t[32]!==d||t[33]!==l||t[34]!==p?(D=()=>{let e=ae.current;ae.current={scope:p,revision:l,queries:w};for(let{query:t}of w){let n=e.scope===p&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&d.get(t)._tag!==`Initial`&&!d.get(t).waiting;(n||r)&&d.refresh(t)}},O=[p,l,w,d],t[31]=w,t[32]=d,t[33]=l,t[34]=p,t[35]=D,t[36]=O):(D=t[35],O=t[36]),(0,K.useEffect)(D,O);let oe;t[37]===s?oe=t[38]:(oe=ee(e=>ie(e,e=>h(e,e=>{let t=Be(e.diff,`diff-panel:${s}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=s,t[38]=oe);let se=oe,k;t[39]!==se||t[40]!==w?(k=ne(e=>new Map(w.map(t=>{let{index:n,query:r}=t;return[n,e(se(r))]}))),t[39]=se,t[40]=w,t[41]=k):k=t[41];let A=c(k),ce;t[42]===A?ce=t[43]:(ce=(e,t)=>{let n=A.get(t);return!n||n._tag===`Initial`},t[42]=A,t[43]=ce);let j=S.findIndex(ce),M=i?j<0?S.length:j:u?.kind===`files`?u.files.length:0,N;t[44]===p?N=t[45]:(N=e=>te(t=>{let n=t.scope===p?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:p,indices:[...n,...r]}}),t[44]=p,t[45]=N);let P=N,F;t[46]!==P||t[47]!==M?(F=()=>P(Array.from({length:4},(e,t)=>M+t)),t[46]=P,t[47]=M,t[48]=F):F=t[48];let I=F,L;t[49]===P?L=t[50]:(L=e=>P([e]),t[49]=P,t[50]=L);let le=L,R;t[51]!==S||t[52]!==w?(R={queries:w,files:S},t[51]=S,t[52]=w,t[53]=R):R=t[53];let z=(0,K.useRef)(R),B,V;t[54]!==S||t[55]!==w?(B=()=>{z.current={queries:w,files:S}},V=[w,S],t[54]=S,t[55]=w,t[56]=B,t[57]=V):(B=t[56],V=t[57]),(0,K.useLayoutEffect)(B,V);let ue;t[58]===d?ue=t[59]:(ue=e=>{let{queries:t,files:n}=z.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&d.refresh(r)},t[58]=d,t[59]=ue);let de=ue,fe;t[60]!==S||t[61]!==A||t[62]!==u||t[63]!==p||t[64]!==i?(fe=i?S.map((e,t)=>{let n=A.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>U(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${p}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Rt),t[60]=S,t[61]=A,t[62]=u,t[63]=p,t[64]=i,t[65]=fe):fe=t[65];let pe=fe,me;if(t[66]!==S||t[67]!==A){let e;t[69]===A?e=t[70]:(e=(e,t)=>{let n=A.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>U(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=A,t[70]=e),me=new Map(S.map(e)),t[66]=S,t[67]=A,t[68]=me}else me=t[68];let he=me,ge;if(t[71]!==S||t[72]!==A){let e;t[74]===A?e=t[75]:(e=(e,t)=>{let n=A.get(t);return n&&n._tag!==`Initial`},t[74]=A,t[75]=e),ge=new Set(S.filter(e).map(Lt)),t[71]=S,t[72]=A,t[73]=ge}else ge=t[73];let _e=ge,H=[...A.values()].some(Z),ve;return t[76]!==he||t[77]!==I||t[78]!==_e||t[79]!==pe||t[80]!==le||t[81]!==de||t[82]!==p||t[83]!==M||t[84]!==H?(ve={scope:p,fileStates:he,isPending:H,retry:de,requestFile:le,readyFilePaths:_e,renderableFiles:pe,settledFileCount:M,loadNextFiles:I},t[76]=he,t[77]=I,t[78]=_e,t[79]=pe,t[80]=le,t[81]=de,t[82]=p,t[83]=M,t[84]=H,t[85]=ve):ve=t[85],ve}function Z(e){return e._tag===`Initial`||e.waiting}function Lt(e){return e.path}function Rt(e,t){return Ft.compare(U(e),U(t))}function Q(e,t){return Ft.compare(e.path,t.path)}function zt(e){let t=(0,q.c)(5),{load:n,count:r}=e,i=(0,K.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Vt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,K.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,J.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Bt)}),t[3]=r,t[4]=s),s}function Bt(e,t){return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,J.jsx)(W,{titleWidth:`medium`})},t)}function Vt(e){return e.isIntersecting}function Ht(e){let t=(0,q.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,J.jsx)(T,{className:`size-3`}):(0,J.jsx)(l,{className:`size-3`}),t[6]=n,t[7]=c);let u;t[8]!==s||t[9]!==c?(u=(0,J.jsx)(tt,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=u):u=t[10];let d=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,f;t[11]===d?f=t[12]:(f=(0,J.jsx)(nt,{children:d}),t[11]=d,t[12]=f);let p;return t[13]!==u||t[14]!==f?(p=(0,J.jsxs)(rt,{children:[u,f]}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}var Ut=`__automatic_base_ref__`,Wt=`p4code.diffFileTreeOpen`,Gt=new WeakMap;function Kt(e){let t=Gt.get(e);if(t)return t;let n={fileDiff:e,fileKey:We(e),fileVersion:He(e)};return Gt.set(e,n),n}var qt=new Set;function Jt(e){let t=(0,q.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,J.jsx)(C,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=ae(`size-4`,o),t[8]=o,t[9]=f);let p=i?_e:H,m;t[10]!==f||t[11]!==p?(m=(0,J.jsx)(ve,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,J.jsx)(tt,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,J.jsx)(nt,{side:`top`,children:g}),t[16]=g,t[17]=_);let ee;return t[18]!==_||t[19]!==h?(ee=(0,J.jsxs)(rt,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=ee):ee=t[20],ee}function Yt(e){let t=(0,q.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,J.jsx)(xt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,J.jsx)(Ht,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsxs)(J.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Xt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:n}){let{resolvedTheme:r}=De(),i=Oe(),a=i.diffLayout,s=ke(),[l,h]=(0,K.useState)(i.wordWrap),[g,ee]=(0,K.useState)(i.diffIgnoreWhitespace),[ne,ie]=p(Wt,!1,oe),[T,O]=(0,K.useState)(``),[se,k]=(0,K.useState)(()=>({scopeKey:null,fileKeys:qt})),[ce,j]=(0,K.useState)(0),[M,N]=(0,K.useState)(null),L=ye({strict:!1,select:e=>xe(e)}),le=L?.threadId??null,R=de(L),z=ue(L)?.projection??null,B=V(R?.environmentId??null),{canReadFiles:pe}=B,he=R?.projectId??null,_e=fe(R&&he?{environmentId:R.environmentId,projectId:he}:null),H=R?.worktreePath??_e?.workspaceRoot,be=R?.worktreePath?void 0:_e?.repositoryIdentity?.rootPath,Fe=c(Ae.configValueAtom(R?.environmentId??null)),ze=Ne(R?.environmentId??null),He=pt(R?.environmentId??null,Fe?.availableEditors??[]),We=Me(jt.diffFileContents),Je=je(R!=null&&H!=null?Ie.status({environmentId:R.environmentId,input:{cwd:H}}):null),W=Le(e=>Re(e.byThreadKey,L)),Xe=Je.data?.isRepo??!0,{turnDiffSummaries:Qe,inferredCheckpointTurnCountByRunId:$e}=yt(z),et=(0,K.useMemo)(()=>[...Qe].toSorted((e,t)=>{let n=e.checkpointTurnCount??$e[e.runId]??0,r=t.checkpointTurnCount??$e[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[$e,Qe]);(0,K.useEffect)(()=>{L&&W.kind===`turn`&&Le.getState().reconcileTurnSelection(L,et.map(e=>e.runId))},[W,et,L]);let G=W.kind===`turn`?W.turnId:null,q=W.kind===`unstaged`?`unstaged`:`branch`,xt=W.kind===`branch`?W.baseRef:null,St=W.kind===`turn`?W.filePath:null,Ct=W.kind===`turn`?W.revealRequestId:0,Y=G===null?void 0:et.find(e=>e.runId===G)??et[0],Tt=Y&&(Y.checkpointTurnCount??$e[Y.runId]),Et=et[0],Dt=G===null?q===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Et?.runId?`Latest turn`:`Turn ${Tt??`?`}`,Ot=Y?`turn:${Y.runId}`:q,X=L?`${L.environmentId}:${L.threadId}:${Ot}`:null,kt=`${X??Ot}:${ce}`,At=Y?`Turn ${Tt??`?`}`:q===`unstaged`?`Uncommitted`:`Changes`,Mt=(0,K.useMemo)(()=>typeof Tt==`number`?{fromTurnCount:Math.max(0,Tt-1),toTurnCount:Tt}:null,[Tt]),Ft=bt({environmentId:R?.environmentId??null,threadId:le,fromTurnCount:Mt?.fromTurnCount??null,toTurnCount:Mt?.toTurnCount??null,ignoreWhitespace:g,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:Xe&&Y!==void 0}),Z=je(pe&&G===null&&R&&H?jt.diffPreview({environmentId:R.environmentId,input:{cwd:H,...xt?{baseRef:xt}:{},ignoreWhitespace:g}}):null),Lt=Xe&&G===null&&R!=null&&H!=null,Rt=L?`${L.environmentId}:${L.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(q===`unstaged`?`working-tree`:`branch-range`)),Bt=Z.refresh,Vt=Bt,Ht=(0,K.useMemo)(()=>{let e=Z.data;if(G===null&&R&&e&&Q&&pe)return qe(We,{environmentId:R.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[R,Z.data,We,pe,Q,G]),Gt=(0,K.useRef)(Ht);Gt.current=Ht;let Xt=(0,K.useCallback)(async e=>{let t=Gt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Zt=Q?.headRef??Je.data?.refName??`HEAD`,Qt=Q?.baseRef??xt??`Automatic`,$t=G===null&&pe&&Lt&&q===`branch`,en=Z.data?.cwd??H,tn=je($t&&R&&en?Ie.listRefs({environmentId:R.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`local`,...T.trim().length>0?{query:T.trim()}:{},limit:100}}):null),nn=je($t&&R&&en?Ie.listRefs({environmentId:R.environmentId,input:{cwd:en,includeMatchingRemoteRefs:!0,refKind:`remote`,...T.trim().length>0?{query:T.trim()}:{},limit:100}}):null),rn=Nt(tn.data?.refs.filter(e=>e.name!==Zt)??[],nn.data?.refs??[]),an=Pt(rn,T),on=e=>xt&&xt===e.remote?.name?xt:e.local?.name??e.remote?.name??e.id,sn=[Ut,...rn.map(on)],cn=[...T.trim().length===0?[Ut]:[],...an.map(on)],ln=Q?.diff,un=Y?Ft.data?.diff:ln,dn=!Y&&Q?.truncated===!0,fn=Y?Ft.isPending:Z.isPending,pn=Y?Ft.error:Z.error,mn=typeof un==`string`&&un.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,hn=(0,K.useMemo)(()=>$?null:Be(un,`diff-panel:${r}`,{compactPartialHunkOffsets:G===null}),[$,r,un,G]),gn=(0,K.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:_n,isPending:vn,fileStates:yn,retry:bn,requestFile:xn,readyFilePaths:Sn,renderableFiles:Cn,settledFileCount:wn,loadNextFiles:Tn}=It({environmentId:R?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??xt,ignoreWhitespace:g,theme:r,revision:Z.data?A(Z.data.generatedAt):void 0,preview:hn}),En=Bt;(0,K.useEffect)(()=>{if(!Lt)return;let e=()=>En();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,En]),_t({enabled:Lt,mutationId:n,refresh:En,resourceKey:`diff:${Rt??``}`});let Dn=Z.isPending||vn,On=(0,K.useMemo)(()=>Cn.map(Kt),[Cn]),kn=(0,K.useMemo)(()=>i.diffFilesCollapsed?new Set(On.map(e=>e.fileKey)):qt,[On,i.diffFilesCollapsed]),An=se.scopeKey===X?se.fileKeys:kn,jn=(0,K.useCallback)(()=>wn<Cn.length?(0,J.jsx)(zt,{load:Tn,count:Cn.length-wn}):null,[wn,Cn.length,Tn]),Mn=(0,K.useMemo)(()=>On.filter(({fileDiff:e})=>!$||Sn.has(U(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:U(e),fileKey:t,fileVersion:n,collapsed:An.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[An,On,$,Sn]),Nn=(0,K.useMemo)(()=>On.map(e=>e.fileKey),[On]),Pn=Te(Nn,An),Fn=(0,K.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):Ge(Cn),[Cn,Q,Y]),In=(0,K.useMemo)(()=>we(Cn),[Cn]),Ln=St?Mn.find(e=>e.filePath===St)?.fileKey??null:null;(0,K.useEffect)(()=>{Ln&&M?.getInstance()&&M.scrollTo({type:`item`,id:Ln,align:`start`})},[M,kt,Ln,Ct]);let Rn=(0,K.useMemo)(()=>({collapseScopeKey:X,diffSelection:W}),[X,W]),zn=Se(M,Rn,Mn.map(e=>e.fileKey)),Bn=(0,K.useCallback)(e=>{let t=On.findIndex(t=>U(t.fileDiff)===e),n=On[t];n&&(k(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:kn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=wn&&xn(t),zn(n.fileKey))},[On,X,kn,zn,$,wn,xn]),Vn=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(Vn.current?.cache!==_n||Vn.current.key!==e)&&(Vn.current={cache:_n,key:e},Bn(St))},[$,St,Ct,_n,Bn]);let Hn=(0,K.useCallback)(e=>{Pe({threadRef:L,filePath:e,activeCwd:H,repositoryRoot:be,openInEditor:e=>{(async()=>{let t=await He(e);t._tag===`Failure`&&!F(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...L?{environmentId:L.environmentId,threadId:L.threadId}:{},...I(P(t))})})()}})},[H,be,He,L]),Un=(0,K.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn});(0,K.useLayoutEffect)(()=>{Un.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:kn}},[X,kn]);let Wn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;k(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Gn=(0,K.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Un.current;k(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Kn=(0,K.useCallback)(()=>{j(e=>e+1),k(e=>{let t=e.scopeKey===X?e.fileKeys:kn;return{scopeKey:X,fileKeys:Ce(Nn,t)}})},[X,kn,Nn]),qn=e=>{L&&Le.getState().selectTurn(L,e)},Jn=e=>{L&&Le.getState().selectGitScope(L,e)},Yn=e=>{L&&Le.getState().selectBranchBaseRef(L,e)},Xn=Y?`turn:${Y.runId}`:``,Zn=G===null?q:Y?.runId===Et?.runId?`latest`:Xn,Qn=e=>{if(e===`unstaged`||e===`branch`)Jn(e);else if(e===`latest`)Et&&qn(Et.runId);else{let t=et.find(t=>`turn:${t.runId}`===e);t&&qn(t.runId)}},$n=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,J.jsxs)(_,{children:[(0,J.jsxs)(y,{render:(0,J.jsx)(C,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Dt}`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:Dt}),(0,J.jsx)(b,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(w,{align:`start`,children:[(0,J.jsxs)(re,{value:Zn,onValueChange:Qn,children:[(0,J.jsx)(v,{value:`branch`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Changes`})}),(0,J.jsx)(v,{value:`unstaged`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Uncommitted`})}),(0,J.jsx)(v,{value:`latest`,closeOnClick:!0,children:(0,J.jsx)(`span`,{children:`Latest turn`})})]}),(0,J.jsxs)(S,{children:[(0,J.jsx)(te,{children:`Turn`}),(0,J.jsx)(D,{children:(0,J.jsx)(re,{value:Xn,onValueChange:Qn,children:et.map(e=>{let t=e.checkpointTurnCount??$e[e.runId]??`?`;return(0,J.jsx)(v,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{children:[`Turn `,t]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:Ze(e.completedAt,i.timestampFormat)})]})},e.runId)})})})]})]})]}),$t&&(0,J.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Zt} against ${Qt}`,children:[(0,J.jsxs)(rt,{children:[(0,J.jsxs)(tt,{render:(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,J.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Zt}),(0,J.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsx)(nt,{side:`top`,children:`${Zt} → ${Qt}`})]}),(0,J.jsxs)(ft,{items:sn,filteredItems:cn,value:xt??Ut,onOpenChange:e=>{e||O(``)},onValueChange:e=>{e&&Yn(e===Ut?null:e)},children:[(0,J.jsxs)(st,{render:(0,J.jsx)(C,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Qt}`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:Qt}),(0,J.jsx)(b,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,J.jsxs)(lt,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,J.jsx)(dt,{placeholder:`Search refs...`,value:T,onChange:e=>O(e.target.value)}),(0,J.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,J.jsx)(`span`,{children:`Branch`}),(0,J.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,J.jsx)(ct,{children:`No matching refs.`}),(0,J.jsxs)(ot,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:Ut,children:(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),rn.map(e=>{let t=on(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,J.jsx)(ut,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,J.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,J.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,J.jsx)(mt,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Yn(n)}})}):e.remote?(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,J.jsx)(f,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,J.jsx)(nt,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Mn.length>0||!Y&&Q?.files?.length?(0,J.jsx)(vt,{additions:Fn.additions,deletions:Fn.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Dn?`Refreshing diff`:`Refresh diff`,onClick:Vt}),children:(0,J.jsx)(gt,{size:`sm`,refreshing:Dn})}),(0,J.jsx)(nt,{side:`top`,children:Dn?`Refreshing diff…`:`Refresh diff`})]}),Nn.length>0&&(0,J.jsx)(C,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Pn?`Expand all files`:`Collapse all files`,onClick:Kn,children:(0,J.jsx)(ve,{className:`size-3.5`,icon:Pn?me:ge})}),(0,J.jsxs)(it,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[a],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&s({diffLayout:t})},children:[(0,J.jsx)(at,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,J.jsx)(x,{className:`size-3.5`})}),(0,J.jsx)(at,{"aria-label":`Split diff view`,value:`split`,children:(0,J.jsx)(m,{className:`size-3.5`})})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":l?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:l,onPressedChange:e=>{h(!!e)}}),children:(0,J.jsx)(d,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:l?`Disable line wrapping`:`Enable line wrapping`})]}),(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":g?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:g,onPressedChange:e=>{ee(!!e)}}),children:(0,J.jsx)(u,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:g?`Show whitespace changes`:`Hide whitespace changes`})]}),Nn.length>0&&(0,J.jsxs)(rt,{children:[(0,J.jsx)(tt,{render:(0,J.jsx)(at,{"aria-label":ne?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:ne,onPressedChange:e=>ie(!!e)}),children:(0,J.jsx)(o,{className:`size-3.5`})}),(0,J.jsx)(nt,{side:`top`,children:ne?`Hide file tree`:`Show file tree`})]})]})]});return(0,J.jsx)(Ke,{mode:e,header:$n,children:R?Xe?G!==null&&et.length===0?(0,J.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.`}):G===null&&!pe?B.isPending?(0,J.jsx)(Ye,{label:`Checking file access...`}):(0,J.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:B.error??`This connection cannot read local diffs.`}):(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[dn&&!$&&(0,J.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),pn&&!hn&&(0,J.jsx)(`div`,{className:`px-3`,children:(0,J.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:pn})}),!hn&&!$?fn?(0,J.jsx)(Ye,{label:Y?`Loading checkpoint diff...`:q===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,J.jsx)(`p`,{children:mn?`No net changes in this selection.`:`No patch available for this selection.`})}):$||hn?.kind===`files`?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Hn(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=Mn.find(e=>e.filePath===r);i&&Wn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),ze({environmentId:R?.environmentId??null,filePath:t,workspaceRoot:H,repositoryRoot:be},e))},children:(0,J.jsx)(wt,{viewerRef:N,codeViewKey:`${kt}:${$?_n:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:Mn,renderCodeViewFooter:jn,sectionId:Ot,sectionTitle:At,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=U(e),n=yn.get(t);return(0,J.jsx)(Yt,{filePath:t,hasStat:gn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:bn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=gn.get(U(e));return t?(0,J.jsx)(vt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Gn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,J.jsx)(Jt,{filePath:U(e),fileKey:t,collapsed:n||An.has(t),unavailable:n,iconClassName:Ue(e),onToggle:Wn})},options:{diffStyle:a===`split`?`split`:`unified`,lineDiffType:`none`,overflow:l?`wrap`:`scroll`,theme:Ve(r),preferredHighlighter:ht,themeType:r,stickyHeaders:!0,...Ht?{loadDiffFiles:Xt}:{}}},X??Ot)}),ne?(0,J.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,J.jsx)(Ee,{ariaLabel:`${At} files`,entries:In,selectedPath:St,revealRequestId:Ct,onSelectFile:Bn})}):null]}):(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:hn?.kind===`raw`?hn.reason:null}),(0,J.jsx)(`pre`,{className:ae(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,l?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:hn?.kind===`raw`?hn.text:null})]})})]})}):(0,J.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,J.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{Xt as default};
2
+ //# sourceMappingURL=DiffPanel-C4ySgbUg.js.map