@p4code/cli 0.8.16 → 0.8.18

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 (295) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CI34F60b.mjs → binCli-usgrWcNe.mjs} +150 -43
  3. package/dist/client/.vite/manifest.json +2143 -2143
  4. package/dist/client/assets/AlertDialogRoot-D6ed6zQR.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-CzFc8xri.js → AnimatedHeight-CO3_zEQw.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-BIM2_E9K.js → AuthSurfaceShell-BBPbK1uA.js} +2 -2
  7. package/dist/client/assets/{CSPContext-DcW0os5z.js → CSPContext-D8znCJtI.js} +2 -2
  8. package/dist/client/assets/{ChatGptUsageButton-D6bmo65C.js → ChatGptUsageButton-Bda8Ir5S.js} +2 -2
  9. package/dist/client/assets/{ChatMarkdown-CjusdpPE.js → ChatMarkdown-BS1t8pnS.js} +4 -4
  10. package/dist/client/assets/{CheckboxIndicator-DRAilQdq.js → CheckboxIndicator-D-KUEtIm.js} +2 -2
  11. package/dist/client/assets/{CodexSetupSection.logic-CSXvl05k.js → CodexSetupSection.logic-Ed9SDkqP.js} +2 -2
  12. package/dist/client/assets/{CollapsiblePanel-DMH4QH0_.js → CollapsiblePanel-84e9KCIs.js} +2 -2
  13. package/dist/client/assets/{ComboboxClear-DV4ygCOL.js → ComboboxClear-FsZ2LcVw.js} +2 -2
  14. package/dist/client/assets/{CommandBlock-DVrmnpxz.js → CommandBlock-C7ASE_F_.js} +2 -2
  15. package/dist/client/assets/{ComposerPromptEditor-CvJcJEtN.js → ComposerPromptEditor-BGcYrFoa.js} +4 -4
  16. package/dist/client/assets/{CompositeRoot-CsrLt1o5.js → CompositeRoot-fbPbFqqK.js} +2 -2
  17. package/dist/client/assets/{ConnectionStatusDot-uWbIqk3l.js → ConnectionStatusDot-t_vHmaco.js} +2 -2
  18. package/dist/client/assets/{DevicePanel-Bf1rvcrw.js → DevicePanel-CS1FTu-C.js} +2 -2
  19. package/dist/client/assets/{DeviceSetup-CX-B4Xfz.js → DeviceSetup-DZAK0_tm.js} +2 -2
  20. package/dist/client/assets/{DialogTitle-BgclXafx.js → DialogTitle-DnR18OB7.js} +2 -2
  21. package/dist/client/assets/{DiffCommentAnnotation-CKRC0OaV.js → DiffCommentAnnotation-Br9sOo_6.js} +2 -2
  22. package/dist/client/assets/{DiffFileTree-xeoOBCTn.js → DiffFileTree-DkLJXYZf.js} +2 -2
  23. package/dist/client/assets/{DiffPanel-CzkU9nAC.js → DiffPanel-CGV12wM6.js} +2 -2
  24. package/dist/client/assets/{DiffWorkerPoolProvider-NaKmpbcL.js → DiffWorkerPoolProvider-DydpPFgM.js} +2 -2
  25. package/dist/client/assets/{EmbeddedDesign-hjnHhasg.js → EmbeddedDesign--Xz14U92.js} +2 -2
  26. package/dist/client/assets/{EnvironmentMachineIcon-Czk_PJpp.js → EnvironmentMachineIcon-BMWCDR69.js} +2 -2
  27. package/dist/client/assets/{ExpandableText-Ggw0uVXl.js → ExpandableText-B6Dvgn62.js} +2 -2
  28. package/dist/client/assets/{FieldControl-Bw2_eFMa.js → FieldControl-CVOjReHh.js} +2 -2
  29. package/dist/client/assets/{FileDiff-VvQl3KAm.js → FileDiff-Dhyt7ZAJ.js} +2 -2
  30. package/dist/client/assets/{FilePreviewPanel-DpzZ6qxm.js → FilePreviewPanel-8tUtMikb.js} +2 -2
  31. package/dist/client/assets/{FoldedSettingsSection-BFkFGK44.js → FoldedSettingsSection-Clo0JgyS.js} +2 -2
  32. package/dist/client/assets/{FormContext-7fCTOXXA.js → FormContext--axmNCbu.js} +2 -2
  33. package/dist/client/assets/{Icons-CSAp87pJ.js → Icons-BYSK3arN.js} +2 -2
  34. package/dist/client/assets/Input-CVwvVqbx.js +2 -0
  35. package/dist/client/assets/{KeybindingsSettings.logic-CsSjvH9c.js → KeybindingsSettings.logic-30fwcukL.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero--g3-0FUP.js → NoProjectsHero-Lsb9cuvO.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-BxdDsUL3.js → PanelLayoutControls-DL7sleZ-.js} +4 -4
  38. package/dist/client/assets/{PierreEntryIcon-B-E3YaL1.js → PierreEntryIcon-DKHnMJOl.js} +2 -2
  39. package/dist/client/assets/{PopoverHandle-BkhR-kKK.js → PopoverHandle-C-e81PS3.js} +2 -2
  40. package/dist/client/assets/{PreviewPanel-VoVAdWRz.js → PreviewPanel-DmaoFTEA.js} +2 -2
  41. package/dist/client/assets/{ProjectDefaultsSettings-DtvFnrMn.js → ProjectDefaultsSettings-CrKY01_P.js} +2 -2
  42. package/dist/client/assets/{ProjectFavicon-CeJHd7lY.js → ProjectFavicon-B5C6TpKj.js} +3 -3
  43. package/dist/client/assets/{ProjectIconPickerDialog-DBo5zoxF.js → ProjectIconPickerDialog-Bxa9i4w_.js} +2 -2
  44. package/dist/client/assets/{ProjectMonogram-CWdfC9NP.js → ProjectMonogram-CYD6eMbI.js} +2 -2
  45. package/dist/client/assets/{ProviderAuthTerminal-BPUxIxWE.js → ProviderAuthTerminal-Cm88QElc.js} +2 -2
  46. package/dist/client/assets/{ProviderModelPicker-JUsjo9GU.js → ProviderModelPicker-CeB11O3P.js} +2 -2
  47. package/dist/client/assets/{ProviderSettingsForm-VoB8oygt.js → ProviderSettingsForm-CLYzJJII.js} +2 -2
  48. package/dist/client/assets/{PullRequestCodeTab-CbKTE6Jz.js → PullRequestCodeTab-BqH4glgo.js} +2 -2
  49. package/dist/client/assets/{ReadOnlySourcePreview-DlWlnYoW.js → ReadOnlySourcePreview-D2Vkrzyc.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DpI8Ovyx.js → RenderErrorBoundary-BgOA8qma.js} +2 -2
  51. package/dist/client/assets/{ScheduledTasksSettings-Cc15ado1.js → ScheduledTasksSettings-BMQ-_Rms.js} +2 -2
  52. package/dist/client/assets/{ScopedSwitch-CaVh740d.js → ScopedSwitch-BrJEJr8I.js} +2 -2
  53. package/dist/client/assets/{ScrollAreaCorner-DXYr9Xbu.js → ScrollAreaCorner-BYUnXNwJ.js} +2 -2
  54. package/dist/client/assets/{SecretInput-WUih9JDs.js → SecretInput-CIbdWrQZ.js} +2 -2
  55. package/dist/client/assets/{SelectScrollUpArrow-BIdW5z3c.js → SelectScrollUpArrow-Cr4PrE_F.js} +2 -2
  56. package/dist/client/assets/{SettingsPanels-CSUZtGSF.js → SettingsPanels-B8q4OSW7.js} +2 -2
  57. package/dist/client/assets/{SettingsPanels.logic-Ce6a_3Zx.js → SettingsPanels.logic-C5FkY28P.js} +2 -2
  58. package/dist/client/assets/{SettingsScopeNotice-RvGwRluQ.js → SettingsScopeNotice-_WSLtOW4.js} +2 -2
  59. package/dist/client/assets/{T3ConnectAccountPages-Dltl5esW.js → T3ConnectAccountPages-DDSM7QWS.js} +2 -2
  60. package/dist/client/assets/{T3ConnectSidebarSignIn-qx3Qtdnf.js → T3ConnectSidebarSignIn-GnkVas23.js} +2 -2
  61. package/dist/client/assets/{ThemeEditorPanel-DspojrU_.js → ThemeEditorPanel-DB8D5_6u.js} +2 -2
  62. package/dist/client/assets/{ThreadTerminalDrawer-mE2aj0U7.js → ThreadTerminalDrawer-4huAp-uS.js} +2 -2
  63. package/dist/client/assets/{TooltipViewport-Daddx30c.js → TooltipViewport-kqulS2nz.js} +2 -2
  64. package/dist/client/assets/{Virtualizer-DySKW4Qd.js → Virtualizer-DjBOkz4F.js} +2 -2
  65. package/dist/client/assets/{WorkspaceBreadcrumb-B3WecLwo.js → WorkspaceBreadcrumb-ClxInGsT.js} +2 -2
  66. package/dist/client/assets/{WorkspacePageContainer-rn16R8Ps.js → WorkspacePageContainer-DwN_ETF0.js} +2 -2
  67. package/dist/client/assets/{WorkspacePageHeader-B2wsiKGJ.js → WorkspacePageHeader-BvKCy7v2.js} +2 -2
  68. package/dist/client/assets/{_chat-D4KQBrU-.js → _chat-C2VZmKVT.js} +5 -5
  69. package/dist/client/assets/{_chat.index-DYOE3ChI.js → _chat.index-CQSbFMBa.js} +2 -2
  70. package/dist/client/assets/{_chat.new-BTckKJwz.js → _chat.new-BxObe9FX.js} +2 -2
  71. package/dist/client/assets/{_chat.pull-requests-BYdISBjt.js → _chat.pull-requests-JS9EZDI7.js} +2 -2
  72. package/dist/client/assets/{abnfDiagram-VCTEODGH-CiK3BBs3.js → abnfDiagram-VCTEODGH-Cv0dw1u8.js} +2 -2
  73. package/dist/client/assets/{alert-CvIEaZOb.js → alert-DYmkyE3l.js} +2 -2
  74. package/dist/client/assets/architecture-7GRP2DOG-Dd1d-ckm.js +1 -0
  75. package/dist/client/assets/{architectureDiagram-5GKGNRK7-wAHn9Lrj.js → architectureDiagram-5GKGNRK7-BvQMjhmC.js} +2 -2
  76. package/dist/client/assets/{assets-B17ISP56.js → assets-COg7jyyX.js} +2 -2
  77. package/dist/client/assets/{blockDiagram-I7D4REHJ-Cp3-BNSr.js → blockDiagram-I7D4REHJ-DR7f58YJ.js} +2 -2
  78. package/dist/client/assets/{browserHistoryStore-DWdy6V_l.js → browserHistoryStore-_SurQa0e.js} +2 -2
  79. package/dist/client/assets/{browserLinkTarget-BEJDPOgD.js → browserLinkTarget-Bp-zUm0R.js} +2 -2
  80. package/dist/client/assets/{c4Diagram-7LVT6UL2-NaJ4CkHK.js → c4Diagram-7LVT6UL2-zgFjNACn.js} +2 -2
  81. package/dist/client/assets/channel-Dsne2IjR.js +2 -0
  82. package/dist/client/assets/{checkbox-EHQPSidC.js → checkbox-brLYzznm.js} +2 -2
  83. package/dist/client/assets/{chunk-4HAMMTFA-qa80OHyq.js → chunk-4HAMMTFA-Q6ZY3Aj6.js} +2 -2
  84. package/dist/client/assets/{chunk-75Z2AOVW-BQGpvZ-z.js → chunk-75Z2AOVW-Dv4NtCmQ.js} +2 -2
  85. package/dist/client/assets/{chunk-DU6HZSFF-D2KfUzzn.js → chunk-DU6HZSFF-D-pyRDMG.js} +2 -2
  86. package/dist/client/assets/{chunk-F27PBJKO-DWzMfgh0.js → chunk-F27PBJKO-BOXrNdwG.js} +2 -2
  87. package/dist/client/assets/{chunk-GMAD6QVW-C20gX9zS.js → chunk-GMAD6QVW-uYd_Q5lX.js} +2 -2
  88. package/dist/client/assets/{chunk-GVQU2GXP-CkUVHa35.js → chunk-GVQU2GXP-C3aAR6o_.js} +2 -2
  89. package/dist/client/assets/{chunk-IMKFNOWR-Dnxgnf8H.js → chunk-IMKFNOWR-CbCHd80E.js} +2 -2
  90. package/dist/client/assets/{chunk-L3NEJ4N5-DUqnqYMY.js → chunk-L3NEJ4N5-B5jDlsms.js} +2 -2
  91. package/dist/client/assets/{chunk-OSK3NFVY-DEacs3_i.js → chunk-OSK3NFVY-DgNZQb8q.js} +2 -2
  92. package/dist/client/assets/{chunk-P2QGCYS3-ZwThzrs-.js → chunk-P2QGCYS3-ptp4LKHi.js} +2 -2
  93. package/dist/client/assets/{chunk-POPQ4Y6H-BFIplCZ4.js → chunk-POPQ4Y6H-CRBmOW8B.js} +2 -2
  94. package/dist/client/assets/{chunk-PWAF6VOD-CV049Zsa.js → chunk-PWAF6VOD-DHkc8IcS.js} +2 -2
  95. package/dist/client/assets/{chunk-SHT3W25Y-BE3qAxKX.js → chunk-SHT3W25Y-B5XMb9ST.js} +2 -2
  96. package/dist/client/assets/{chunk-SVP7TREG-DWTRXiC1.js → chunk-SVP7TREG-Lt0ZENIq.js} +2 -2
  97. package/dist/client/assets/{chunk-TICWLB2K-D7wrITi8.js → chunk-TICWLB2K-BhZt3DVX.js} +2 -2
  98. package/dist/client/assets/classDiagram-ZZMXUADV-Dazl0CLN.js +2 -0
  99. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Dazl0CLN.js +2 -0
  100. package/dist/client/assets/{color-picker-Dd1K-QRk.js → color-picker-D7d1go0g.js} +2 -2
  101. package/dist/client/assets/{combobox-BqpUmoio.js → combobox-DSVavlIH.js} +2 -2
  102. package/dist/client/assets/{command-D1peviZr.js → command-DsE3Ju6m.js} +2 -2
  103. package/dist/client/assets/{connect-BJSxZzk6.js → connect-C39BhZ-c.js} +2 -2
  104. package/dist/client/assets/{connect-agent-DfhS_H4b.js → connect-agent-Dj_Cfdx6.js} +2 -2
  105. package/dist/client/assets/{cynefin-OW5HDTMX-dVUNi-Eg.js → cynefin-OW5HDTMX-CNKdS-0M.js} +1 -1
  106. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Djkby1yV.js → cynefinDiagram-5FMLGOSQ-CoFxzJSW.js} +2 -2
  107. package/dist/client/assets/{dagre-GXQ25YYZ-By44EUZw.js → dagre-GXQ25YYZ-q0omC4bc.js} +2 -2
  108. package/dist/client/assets/{device-Dk2NULhB.js → device-CWgOLpbF.js} +2 -2
  109. package/dist/client/assets/{diagram-S7CK7UJ4-C0o6sI0g.js → diagram-S7CK7UJ4-CdFkGs_B.js} +2 -2
  110. package/dist/client/assets/{diagram-UQ7AKVKN-s2vz22qd.js → diagram-UQ7AKVKN-B0KtokqT.js} +2 -2
  111. package/dist/client/assets/{diagram-VSXAHHWV-CylpbhVy.js → diagram-VSXAHHWV-DjtTeImL.js} +2 -2
  112. package/dist/client/assets/{diagram-VX7I27RA-Bz50mxAk.js → diagram-VX7I27RA-DRYLlkkf.js} +2 -2
  113. package/dist/client/assets/{diagram-Z3DM3KII-BwwAXl7S.js → diagram-Z3DM3KII-C-x2EfL6.js} +2 -2
  114. package/dist/client/assets/{dialog-BfenC7sz.js → dialog-DYFQxVoN.js} +2 -2
  115. package/dist/client/assets/{diffRendering-4kDIxoRz.js → diffRendering-6DuM2rGF.js} +2 -2
  116. package/dist/client/assets/{discovery-list-NHMaJPrr.js → discovery-list-BvblDG7m.js} +2 -2
  117. package/dist/client/assets/{dist-DPoczA-G.js → dist-CkgAUeqn.js} +3 -3
  118. package/dist/client/assets/{draft-input-rVkOduh_.js → draft-input-27erQjx_.js} +2 -2
  119. package/dist/client/assets/{duoViewer-CYEmwhMX.js → duoViewer-CBnLVCTt.js} +2 -2
  120. package/dist/client/assets/{dynamic-DO1Y_hZw.js → dynamic-Cjr9H8t4.js} +2 -2
  121. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CZWDrYgP.js → ebnfDiagram-PWID7BFC-UISo4OT-.js} +2 -2
  122. package/dist/client/assets/{embeddedScripts-gw0IVEit.js → embeddedScripts-Dr-tOtuJ.js} +2 -2
  123. package/dist/client/assets/{empty-xf3NEL4p.js → empty-2jxBvPLn.js} +2 -2
  124. package/dist/client/assets/{entities-D1h9ACDa.js → entities-DCbEYTvn.js} +2 -2
  125. package/dist/client/assets/{environments-CShRJEmR.js → environments-iW64jjyO.js} +2 -2
  126. package/dist/client/assets/{erDiagram-RLTQ6QDP-nQAwXpMH.js → erDiagram-RLTQ6QDP-CeWlUdOf.js} +2 -2
  127. package/dist/client/assets/eventmodeling-NTZA5JFV-B5z8GPGl.js +1 -0
  128. package/dist/client/assets/{fileLinks-hdHZBPGX.js → fileLinks-5NSgRKPU.js} +2 -2
  129. package/dist/client/assets/{fileTreeExpansion-VkvCaw5c.js → fileTreeExpansion-CA6c4E3-.js} +2 -2
  130. package/dist/client/assets/flowDiagram-HODETNUW-CEpweBDE.js +1 -0
  131. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DWYM0gWT.js → ganttDiagram-EL5Y4UJY-KPPMvqNL.js} +2 -2
  132. package/dist/client/assets/{getDiffFileInput-D107eiKt.js → getDiffFileInput-CuM1lgsL.js} +2 -2
  133. package/dist/client/assets/{gitGraph-4MIJSDKK-COMcQtZ6.js → gitGraph-4MIJSDKK-BGSFaZro.js} +1 -1
  134. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BQoQgnaf.js → gitGraphDiagram-WWUBYQGX-CwYf9r63.js} +2 -2
  135. package/dist/client/assets/{guideRunStore-U-mQ5TrH.js → guideRunStore-B3Y6e_nf.js} +2 -2
  136. package/dist/client/assets/{htmlRender-CDbYs9Mi.js → htmlRender-BaqdfJ6m.js} +2 -2
  137. package/dist/client/assets/{index-B3Ar6SfQ.js → index-DmPPPGJb.js} +3 -3
  138. package/dist/client/assets/{info-A6RAGUB7-DztiJcIo.js → info-A6RAGUB7-C831OtOR.js} +1 -1
  139. package/dist/client/assets/{infoDiagram-27XIBGKW-4UkpJDZ8.js → infoDiagram-27XIBGKW-DVstIW76.js} +2 -2
  140. package/dist/client/assets/{input-CF-egQtG.js → input-83N8btBC.js} +2 -2
  141. package/dist/client/assets/{input-group-CifPZlNg.js → input-group-Q757vhrD.js} +2 -2
  142. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhRs1gS_.js → ishikawaDiagram-5VMMS53U-CJq0N-AL.js} +2 -2
  143. package/dist/client/assets/{journeyDiagram-3NMN7TZE-CkzLNTms.js → journeyDiagram-3NMN7TZE-D76KCD6f.js} +2 -2
  144. package/dist/client/assets/{kanban-definition-UXKFOSKX-DnnZRuwk.js → kanban-definition-UXKFOSKX-D1kzRMIP.js} +2 -2
  145. package/dist/client/assets/{kbd-DN9MXWor.js → kbd-D8UfTN0o.js} +2 -2
  146. package/dist/client/assets/{keybindings-BlEA4Dlt.js → keybindings-DLDyoB30.js} +2 -2
  147. package/dist/client/assets/{lazyRouteComponent-b9hpLjZB.js → lazyRouteComponent-BCGAjyjO.js} +2 -2
  148. package/dist/client/assets/{line-BQc8Tfxv.js → line-QHGhF6Vm.js} +2 -2
  149. package/dist/client/assets/{link-BIudTto8.js → link-Bgj44djS.js} +2 -2
  150. package/dist/client/assets/{linkedPrompt-DhAklUFf.js → linkedPrompt-D1aW6nV5.js} +2 -2
  151. package/dist/client/assets/{main-CqNzdsfA.js → main-lV-t-UZx.js} +7 -7
  152. package/dist/client/assets/{mediaReference-Cnqpj8T4.js → mediaReference-CQtke4j3.js} +2 -2
  153. package/dist/client/assets/{mediaSource-DoFgutG9.js → mediaSource-CI2bKK3n.js} +2 -2
  154. package/dist/client/assets/{mermaid-parser.core-DkdUKkht.js → mermaid-parser.core-Brqe55KM.js} +4 -4
  155. package/dist/client/assets/{mermaid.core-Bq1JlzgL.js → mermaid.core-Cdl6aiT5.js} +5 -5
  156. package/dist/client/assets/{mindmap-definition-YA3MSWOX-D8mmtbMo.js → mindmap-definition-YA3MSWOX-CcdCCRbd.js} +2 -2
  157. package/dist/client/assets/{number-field-CydqGM9B.js → number-field-DQIrEOoj.js} +2 -2
  158. package/dist/client/assets/{observeResize-BxVCxCXG.js → observeResize-BaPAtI3Q.js} +2 -2
  159. package/dist/client/assets/{onboarding-DeRMOHIy.js → onboarding-ObMsA9VF.js} +2 -2
  160. package/dist/client/assets/{openFileInPreview-yiAUHSWv.js → openFileInPreview-CdBR5kuZ.js} +2 -2
  161. package/dist/client/assets/{p4ProjectFile-CN1m1U7N.js → p4ProjectFile--u7SOSK5.js} +2 -2
  162. package/dist/client/assets/{packet-AYTQ26CC-BWg_Iaga.js → packet-AYTQ26CC-BSuHbq7S.js} +1 -1
  163. package/dist/client/assets/{pair-DzpeGOSy.js → pair-C11lrlzi.js} +2 -2
  164. package/dist/client/assets/{pegDiagram-XKGWAZYB-CAzHwR2-.js → pegDiagram-XKGWAZYB-Iy9neoGN.js} +2 -2
  165. package/dist/client/assets/{phoneViewer-FlyoV9qT.js → phoneViewer-iqsNqM8D.js} +2 -2
  166. package/dist/client/assets/{pie-WAS4IAKB-DcySclOi.js → pie-WAS4IAKB-BlC5Ctcv.js} +1 -1
  167. package/dist/client/assets/{pieDiagram-E7YTZNPT-B00nxfti.js → pieDiagram-E7YTZNPT-CtVgATJF.js} +2 -2
  168. package/dist/client/assets/{pierre-icons-u_a0tCKH.js → pierre-icons-fSsw9aa-.js} +2 -2
  169. package/dist/client/assets/{popover-BunL7s_L.js → popover-B1MF5i1c.js} +2 -2
  170. package/dist/client/assets/{preview-DJTsHJUF.js → preview-DwLWkMZG.js} +2 -2
  171. package/dist/client/assets/{preview-B_wcdd8X.js → preview-ITad1JAy.js} +2 -2
  172. package/dist/client/assets/{previewMiniPlayerStore-gZV-IkW-.js → previewMiniPlayerStore-DN-AYBed.js} +2 -2
  173. package/dist/client/assets/{primary-BqinBW4U.js → primary-8A8hvHFL.js} +2 -2
  174. package/dist/client/assets/{primaryCloudLinkState-hwg0TXVd.js → primaryCloudLinkState-BP-HZzf2.js} +2 -2
  175. package/dist/client/assets/{projectFilesQueryState-DVWHpzC3.js → projectFilesQueryState-CGllQp_V.js} +2 -2
  176. package/dist/client/assets/{projectScriptEditor-RRQopHne.js → projectScriptEditor-DwqFzld2.js} +2 -2
  177. package/dist/client/assets/{providerSkills-BmchYM4E.js → providerSkills-O72EMm0V.js} +2 -2
  178. package/dist/client/assets/{pullRequestDetail.logic-CjznZ6xd.js → pullRequestDetail.logic-CkxKh0fV.js} +2 -2
  179. package/dist/client/assets/{pullRequestIcons-BZCS4C5B.js → pullRequestIcons-CSZus-cz.js} +2 -2
  180. package/dist/client/assets/{pullRequestReviewStore-BqvYYzmT.js → pullRequestReviewStore-78f71w6J.js} +2 -2
  181. package/dist/client/assets/{pullRequests-iwguXcJ4.js → pullRequests-7IQc0VIk.js} +2 -2
  182. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DXb-ZTK9.js → quadrantDiagram-AXDQQJYC-kq18RP_F.js} +2 -2
  183. package/dist/client/assets/{queries-D53cjqgz.js → queries-DCKH7ltg.js} +2 -2
  184. package/dist/client/assets/{query-CRswjQ7f.js → query-B1uAr_ii.js} +2 -2
  185. package/dist/client/assets/{radar-RG4KPBEZ-BeXZggD1.js → radar-RG4KPBEZ-Cbkq33o2.js} +1 -1
  186. package/dist/client/assets/{radio-group-DzD2uI5x.js → radio-group-CFJMQH66.js} +2 -2
  187. package/dist/client/assets/{railroad-74A4TZTK-DGDA4rny.js → railroad-74A4TZTK-Ba3TZ4Wg.js} +1 -1
  188. package/dist/client/assets/railroad-abnf-HS5TGJTU-l3gFfdc2.js +1 -0
  189. package/dist/client/assets/railroad-ebnf-LZEXJU2U-eiWL8AW4.js +1 -0
  190. package/dist/client/assets/railroad-peg-WCYAUIDC-UK0E-Txe.js +1 -0
  191. package/dist/client/assets/{railroadDiagram-O6MQD6OU-2U2BGUTN.js → railroadDiagram-O6MQD6OU-BfOnyiaT.js} +2 -2
  192. package/dist/client/assets/{renderScheduler-Bwwdk-oE.js → renderScheduler-CcWhS7Yq.js} +2 -2
  193. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BpZZUYPx.js → requirementDiagram-BXWQKSXE-DFzAGiJp.js} +2 -2
  194. package/dist/client/assets/{rightPanelStore-CcmIdfDA.js → rightPanelStore-DfMWWfvR.js} +2 -2
  195. package/dist/client/assets/runtime-B5cKWtKn.js +2 -0
  196. package/dist/client/assets/{runtime-Dz1hyHmq.js → runtime-B9IDNXDU.js} +3 -3
  197. package/dist/client/assets/{runtimeModeConfig-CGosfJJ5.js → runtimeModeConfig-C3TbI2qR.js} +2 -2
  198. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DC4ft80C.js → sankeyDiagram-P5KCCOFB-D9gFGibV.js} +2 -2
  199. package/dist/client/assets/{scheduledTasksSettings.logic-Bmbv-9DS.js → scheduledTasksSettings.logic-DVbZRIYJ.js} +2 -2
  200. package/dist/client/assets/{scroll-area-OkcD8f0Y.js → scroll-area-DGS0jgnh.js} +2 -2
  201. package/dist/client/assets/{select-BUFUt6O3.js → select-Dsx46akG.js} +2 -2
  202. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-COMPHZuQ.js → sequenceDiagram-WJ2MYXX4-C9pRaNT5.js} +2 -2
  203. package/dist/client/assets/{server-BSKDpYuc.js → server-CoH7V4JL.js} +2 -2
  204. package/dist/client/assets/{session-BaKBc24W.js → session-Bo2ZSprC.js} +2 -2
  205. package/dist/client/assets/{session-logic-DOC4SSh-.js → session-logic-C4wGF3_E.js} +2 -2
  206. package/dist/client/assets/{settings-Ce3HYftt.js → settings-mrxLMm57.js} +2 -2
  207. package/dist/client/assets/{settings.appearance-BELQs8GW.js → settings.appearance-6ktu9wdJ.js} +2 -2
  208. package/dist/client/assets/settings.archived-Hl4HyrFx.js +2 -0
  209. package/dist/client/assets/{settings.computer-use-BjiS8S48.js → settings.computer-use-C24sO93u.js} +2 -2
  210. package/dist/client/assets/{settings.connections-CL91uyd1.js → settings.connections-CgaYGg_W.js} +2 -2
  211. package/dist/client/assets/{settings.data-controls-AB6ME8V3.js → settings.data-controls-DNY0fL9E.js} +2 -2
  212. package/dist/client/assets/{settings.decisions-DEFo-Pd2.js → settings.decisions-kar2kv7T.js} +2 -2
  213. package/dist/client/assets/{settings.diagnostics-DgncclwX.js → settings.diagnostics-BHSEPjF8.js} +2 -2
  214. package/dist/client/assets/{settings.general-BHYFN8uF.js → settings.general-C1zsJgwK.js} +2 -2
  215. package/dist/client/assets/{settings.integrations-BxqEAKSC.js → settings.integrations-DykwmCf7.js} +2 -2
  216. package/dist/client/assets/{settings.keybindings-DQ8svgeo.js → settings.keybindings-CYcsJ6DQ.js} +2 -2
  217. package/dist/client/assets/{settings.open-source-licenses-DX92vMDE.js → settings.open-source-licenses-DnBHlZE2.js} +2 -2
  218. package/dist/client/assets/settings.plugins-B7Nlb85S.js +5 -0
  219. package/dist/client/assets/{settings.projects-C8uYKsz6.js → settings.projects-Ob8jKbIh.js} +3 -3
  220. package/dist/client/assets/settings.providers-BIm-8j9C.js +3 -0
  221. package/dist/client/assets/{settings.scheduled-tasks-B2CT-4iw.js → settings.scheduled-tasks-Bf37L1OK.js} +2 -2
  222. package/dist/client/assets/{settings.snap-shot-FpIHq57J.js → settings.snap-shot-D37zM8an.js} +2 -2
  223. package/dist/client/assets/{settings.source-control-Cgg8tzrr.js → settings.source-control-DmRUgcsk.js} +2 -2
  224. package/dist/client/assets/{settings.storage-gQMFfL_2.js → settings.storage-DmbTXujz.js} +2 -2
  225. package/dist/client/assets/{settingsLayout-DUyA66EK.js → settingsLayout-CqGfrbmD.js} +2 -2
  226. package/dist/client/assets/{sidebar-CNP67lTi.js → sidebar-C_I_pq_E.js} +2 -2
  227. package/dist/client/assets/{sidebarProjectGrouping-lWfRDsCI.js → sidebarProjectGrouping-DrnsFA8t.js} +2 -2
  228. package/dist/client/assets/{skeleton-DDh76jpd.js → skeleton-0mC3wMw1.js} +2 -2
  229. package/dist/client/assets/{sortable.esm-Bc--TVlq.js → sortable.esm-DuAaqmgD.js} +2 -2
  230. package/dist/client/assets/{sourceControl-BppF1prF.js → sourceControl-D6TEHNpa.js} +2 -2
  231. package/dist/client/assets/{spinner-DYnZ-Bpa.js → spinner-DHOdl-gn.js} +2 -2
  232. package/dist/client/assets/{standalone-page-DUgQaNPq.js → standalone-page-Dx8vGwaJ.js} +2 -2
  233. package/dist/client/assets/{stateDiagram-D77RDMKH-Dk5dNGVk.js → stateDiagram-D77RDMKH-D8n56CID.js} +2 -2
  234. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DqXgq-FS.js +2 -0
  235. package/dist/client/assets/{swimlanes-42K2YHIH-D6oOm69V.js → swimlanes-42K2YHIH-DZZct2ih.js} +2 -2
  236. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DAX63YhZ.js +9 -0
  237. package/dist/client/assets/{terminal-links-CV_3r1U3.js → terminal-links-Di9Ijg8X.js} +2 -2
  238. package/dist/client/assets/{terminalSessions-DCMAHO3E.js → terminalSessions-B8EDcX8b.js} +2 -2
  239. package/dist/client/assets/{textarea-Dt0w6mtc.js → textarea-BvPoR1cI.js} +2 -2
  240. package/dist/client/assets/{themePalette-9CODTNe7.js → themePalette-zFOiBKDi.js} +2 -2
  241. package/dist/client/assets/{threadSort-DJdKuCKp.js → threadSort-Cn23YHH2.js} +2 -2
  242. package/dist/client/assets/{timeline-definition-24CTP7MA-Dd3smJPR.js → timeline-definition-24CTP7MA-BGfuRztb.js} +2 -2
  243. package/dist/client/assets/{toast-BeM8bZbF.js → toast-CN7Jd-pG.js} +2 -2
  244. package/dist/client/assets/{toggle-C3pF5hng.js → toggle-DeCGfzT2.js} +2 -2
  245. package/dist/client/assets/{toggle-group-C4V_4iet.js → toggle-group-DekLc0Ax.js} +2 -2
  246. package/dist/client/assets/{tooltip-Cco13jKX.js → tooltip-DaSC-3cL.js} +2 -2
  247. package/dist/client/assets/{treeView-Q6P3EWNA-Dbb-EyFc.js → treeView-Q6P3EWNA-BPM2x-ME.js} +1 -1
  248. package/dist/client/assets/{treemap-WGGIJYW6-C4Asv2we.js → treemap-WGGIJYW6-sku0fChI.js} +1 -1
  249. package/dist/client/assets/{usage-C5gCqDEF.js → usage-CKRSqJso.js} +2 -2
  250. package/dist/client/assets/{usageAccess-CeCsk7TS.js → usageAccess-BGb3m0YV.js} +2 -2
  251. package/dist/client/assets/{usageFormat-CQXspPhL.js → usageFormat-H-RgZ0fy.js} +2 -2
  252. package/dist/client/assets/{usageShortcuts-DaMuOxo1.js → usageShortcuts-C320W17X.js} +2 -2
  253. package/dist/client/assets/{use-atom-command-CMd4xAvF.js → use-atom-command-GpCw1tWF.js} +2 -2
  254. package/dist/client/assets/{useAriaLabelledBy-BinWYOc0.js → useAriaLabelledBy-C8nSWyQ9.js} +2 -2
  255. package/dist/client/assets/{useHandleNewThread-2sRVaQar.js → useHandleNewThread-FJLPEfoH.js} +2 -2
  256. package/dist/client/assets/{useLocation-BQwksr61.js → useLocation-Ccsih1eo.js} +2 -2
  257. package/dist/client/assets/useNavigate-Dhy_1-Mg.js +2 -0
  258. package/dist/client/assets/{useNavigateBack-D2S1CDHR.js → useNavigateBack-PnWVFtkU.js} +2 -2
  259. package/dist/client/assets/{useParams-D_8gJiai.js → useParams-CoeDewwU.js} +2 -2
  260. package/dist/client/assets/{usePermissionStatus-Bl_cAihc.js → usePermissionStatus-mBtsOu9K.js} +2 -2
  261. package/dist/client/assets/{usePullRequestActions-BcGz_qON.js → usePullRequestActions-_K7fD4Ny.js} +2 -2
  262. package/dist/client/assets/{useRegisterFieldControl-Bp078Il-.js → useRegisterFieldControl-9rSmWR2W.js} +2 -2
  263. package/dist/client/assets/{useScopedModelAvailability-DAU9OPOv.js → useScopedModelAvailability-DE1E_lbg.js} +2 -2
  264. package/dist/client/assets/{useSettings-DpVy22yc.js → useSettings-CKA-LDDj.js} +2 -2
  265. package/dist/client/assets/{useT3ConnectAuthPrompt-BsnsXdaF.js → useT3ConnectAuthPrompt-ZyPZIXm7.js} +2 -2
  266. package/dist/client/assets/utils-BAPnqm16.js +37 -0
  267. package/dist/client/assets/{vcsRefInvalidation--2K54DE9.js → vcsRefInvalidation-DfCz0cGO.js} +2 -2
  268. package/dist/client/assets/{vennDiagram-4TSXK5OY-V_3xLf5G.js → vennDiagram-4TSXK5OY-CjhblZp4.js} +2 -2
  269. package/dist/client/assets/{wardley-WFR3VGLG-CDlEm4As.js → wardley-WFR3VGLG-Cuf_pn9-.js} +1 -1
  270. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CBqbrzOI.js → wardleyDiagram-VM6X3IG4-CMQ-_cYv.js} +2 -2
  271. package/dist/client/assets/{welcome-DdV5o2sn.js → welcome-nE6tva7L.js} +2 -2
  272. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BBAHFXyY.js → xychartDiagram-S5SC5T6Z-BlCqmJgA.js} +2 -2
  273. package/dist/client/index.html +1 -1
  274. package/dist/{renderer-B8qsc7RL.mjs → renderer-7OJ6c0Me.mjs} +2 -2
  275. package/dist/{runtime-CEdmfdaF.mjs → runtime-BHqdsO3Y.mjs} +35 -6
  276. package/package.json +1 -1
  277. package/dist/client/assets/AlertDialogRoot-DYtW2IF3.js +0 -2
  278. package/dist/client/assets/Input-Cr3X6dPy.js +0 -2
  279. package/dist/client/assets/architecture-7GRP2DOG-I5ogqlvV.js +0 -1
  280. package/dist/client/assets/channel-3VrneojD.js +0 -2
  281. package/dist/client/assets/classDiagram-ZZMXUADV-cGz3NSHA.js +0 -2
  282. package/dist/client/assets/classDiagram-v2-VYDZK3BY-cGz3NSHA.js +0 -2
  283. package/dist/client/assets/eventmodeling-NTZA5JFV-CCbbQaex.js +0 -1
  284. package/dist/client/assets/flowDiagram-HODETNUW-BwO_EBwI.js +0 -1
  285. package/dist/client/assets/railroad-abnf-HS5TGJTU-BszadkTZ.js +0 -1
  286. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Cs2gjnvT.js +0 -1
  287. package/dist/client/assets/railroad-peg-WCYAUIDC-mvB_-15Z.js +0 -1
  288. package/dist/client/assets/runtime-D1cxRUzP.js +0 -2
  289. package/dist/client/assets/settings.archived-_xyYN0XB.js +0 -2
  290. package/dist/client/assets/settings.plugins-DZqUpuLK.js +0 -5
  291. package/dist/client/assets/settings.providers-CDPVCtiM.js +0 -3
  292. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BqI4Wri4.js +0 -2
  293. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Des4AqSq.js +0 -9
  294. package/dist/client/assets/useNavigate-LjcLtV_e.js +0 -2
  295. package/dist/client/assets/utils-Dx_TSvdC.js +0 -37
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$m as n,$w as r,Ft as i,Ht as a,It as o,Jd as s,Jt as c,Kd as l,NE as u,NT as d,Nt as f,Vt as p,Wn as m,Zw as h,cr as g,dh as _,fh as v,gd as y,ks as b,lE as x,nn as S,qd as C,sr as w,t as T}from"./utils-Dx_TSvdC.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-CydqGM9B.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-BUFUt6O3.js";import{t as ee}from"./useNavigate-LjcLtV_e.js";import{i as te}from"./toast-BeM8bZbF.js";import{a as ne,n as re,t as ie}from"./tooltip-Cco13jKX.js";import{f as I,t as ae}from"./server-BSKDpYuc.js";import{n as oe}from"./query-CRswjQ7f.js";import{t as L}from"./use-atom-command-CMd4xAvF.js";import{C as se,E as ce,T as le,f as ue,k as de,w as fe}from"./useSettings-DpVy22yc.js";import{t as R}from"./skeleton-DDh76jpd.js";import{t as pe}from"./textarea-Dt0w6mtc.js";import{t as me}from"./input-CF-egQtG.js";import{a as he,i as ge,n as z,o as _e,r as ve,t as ye}from"./empty-xf3NEL4p.js";import{t as be}from"./sourceControl-BppF1prF.js";import{g as xe,m as Se}from"./Icons-CSAp87pJ.js";import{c as Ce,s as we}from"./threadSort-DJdKuCKp.js";import{n as B}from"./pullRequestIcons-BZCS4C5B.js";import{B as Te,F as Ee,L as De,P as Oe,a as V,f as H,i as ke,n as Ae,o as U,r as je,s as Me,t as Ne}from"./settingsLayout-DUyA66EK.js";import{Fa as Pe,La as Fe,Ni as W,Pa as Ie,ar as Le,fr as Re,ir as G,pr as ze,qa as Be,yn as Ve}from"./main-CqNzdsfA.js";import{t as He}from"./ProviderModelPicker-JUsjo9GU.js";import{t as Ue}from"./useScopedModelAvailability-DAU9OPOv.js";import{t as We}from"./ProjectDefaultsSettings-DtvFnrMn.js";import{t as Ge}from"./SecretInput-WUih9JDs.js";import{t as Ke}from"./ProviderSettingsForm-VoB8oygt.js";var K=u(),q=e(t(),1),J=e(x(),1);function qe({environmentId:e,definition:t,onSaved:n}){let r=ue(e,e=>e.sourceControlHosts[t.kind]),i=L(I.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,q.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,J.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,J.jsx)(Ke,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,J.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,J.jsx)(w,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Je(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Ye(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var Xe=`active gh account`;function Y(e){let t=(0,K.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,J.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,J.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:ze(e.account)}),(0,J.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Ze({environmentId:e,auth:t,onSaved:n}){let r=ue(e,we).hosts,i=L(I.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,q.useState)(!1),[c,l]=(0,q.useState)(!1),u=Je(t.accounts??[]),d=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Ye(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return u.length===0?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,J.jsxs)(`div`,{className:`grid gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>l(e=>!e),"aria-label":c?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":c,children:c?(0,J.jsx)(s,{}):(0,J.jsx)(C,{})})]}),u.map(e=>{let t=r[e.host],n=t?.enabled??!0,i=t?.account!==void 0&&!e.selectable.includes(t.account),o=t?.account!==void 0&&!i?t.account:Xe;return(0,J.jsxs)(`div`,{className:`grid gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,J.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:`Signed in as`}),(0,J.jsx)(Y,{revealed:c,account:e.selectable[0]})]}):null]}),(0,J.jsx)(Fe,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void d(e.host,{enabled:t})})]}),e.selectable.length>1?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,J.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,J.jsxs)(F,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&d(e.host,{account:t===Xe?null:t})},children:[(0,J.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,J.jsx)(M,{children:t=>t===Xe?(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,J.jsxs)(J.Fragment,{children:[`(`,(0,J.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]}):(0,J.jsx)(Y,{revealed:c,account:t})})}),(0,J.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,J.jsx)(j,{value:Xe,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,J.jsxs)(J.Fragment,{children:[`(`,(0,J.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,J.jsx)(j,{value:e,children:(0,J.jsx)(Y,{revealed:c,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,J.jsx)(w,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void d(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,J.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,J.jsx)(Y,{revealed:c,account:e.account}),(0,J.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,J.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var X=`github.com`;function Qe(e){return`https://${e}/settings/personal-access-tokens/new`}function $e({environmentId:e,onSaved:t}){let{tokens:n}=ue(e,we),r=L(I.updateSettings,{label:`save GitHub token`}),[i,a]=(0,q.useState)(X),[o,s]=(0,q.useState)(``),[c,u]=(0,q.useState)(!1),d=i.trim().toLowerCase(),f=(n[d]??``).length>0,p=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),m=async(i,a)=>{u(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{u(!1)}};return(0,J.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),d&&o.trim()&&m(d,o.trim())},children:(0,J.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,J.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,J.jsxs)(g,{render:(0,J.jsx)(`a`,{href:Qe(d||X),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,J.jsx)(l,{"aria-hidden":!0,className:`size-3`})]})]}),(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(W,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,J.jsx)(me,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:X,value:i,onChange:e=>a(e.target.value)})]}),(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(W,{htmlFor:`github-token-${e}`,children:`Token`}),(0,J.jsx)(Ge,{id:`github-token-${e}`,size:`sm`,configured:f,value:o,onChange:e=>s(e.target.value)})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${p.join(`, `)}.`}),(0,J.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[f?(0,J.jsx)(w,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void m(d,``),children:`Remove`}):null,(0,J.jsx)(w,{type:`submit`,size:`xs`,disabled:!d||!o.trim()||c,children:`Save`})]})]})]})})}var et={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,K.c)(40),t=Oe(),{targets:r}=Te(),i;e[0]===r?i=e[1]:(i=r.map(it).join(`,`),e[0]=r,e[1]=i);let a=i,o=(0,q.useRef)(!1),s=(0,q.useRef)(!1),c=De(),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`branchNamingMode`],e[2]=l):l=e[2];let u=Ee(l),d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`branchNamePrefix`],e[3]=d):d=e[3];let f=Ee(d),p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`branchNameInstructions`],e[4]=p):p=e[4];let m=Ee(p),h,g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`branchNamingMode`],g=G(`worktree-branch-naming`),e[5]=h,e[6]=g):(h=e[5],g=e[6]);let v=!u&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,y;e[7]!==u||e[8]!==t.branchNamingMode||e[9]!==c?(y=t.branchNamingMode!==_.branchNamingMode||u?(0,J.jsx)(je,{label:`branch naming`,onClick:()=>c({branchNamingMode:_.branchNamingMode})}):null,e[7]=u,e[8]=t.branchNamingMode,e[9]=c,e[10]=y):y=e[10];let b=u?null:t.branchNamingMode,x;e[11]===c?x=e[12]:(x=e=>{n.literals.includes(e)&&c({branchNamingMode:e})},e[11]=c,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,J.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:n.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,J.jsxs)(F,{value:b,onValueChange:x,children:[S,C]}),e[15]=b,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==v||e[20]!==y?(T=(0,J.jsx)(V,{serverScoped:!0,settingKeys:h,...g,description:`Choose how new worktree branches are named from your first message.`,status:v,resetAction:y,control:w}),e[18]=w,e[19]=v,e[20]=y,e[21]=T):T=e[21];let E;e[22]!==u||e[23]!==f||e[24]!==a||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==c?(E=!u&&t.branchNamingMode===`static`?(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:f||t.branchNamePrefix!==_.branchNamePrefix?(0,J.jsx)(je,{label:`branch prefix`,onClick:()=>c({branchNamePrefix:_.branchNamePrefix})}):null,control:(0,J.jsx)(me,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{o.current=!0},placeholder:f?`Mixed`:`No prefix`,defaultValue:f?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();o.current&&(f||n!==t.branchNamePrefix)&&c({branchNamePrefix:n}),o.current=!1}},`${a}:${f}:${t.branchNamePrefix}`)}):null,e[22]=u,e[23]=f,e[24]=a,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=c,e[28]=E):E=e[28];let D;e[29]!==m||e[30]!==u||e[31]!==a||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==c?(D=!u&&t.branchNamingMode===`custom`?(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:m||t.branchNameInstructions!==``?(0,J.jsx)(je,{label:`branch naming instructions`,onClick:()=>c({branchNameInstructions:``})}):null,children:(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{"aria-label":`Branch naming instructions`,onChange:()=>{s.current=!0},rows:4,defaultValue:m?``:t.branchNameInstructions,placeholder:m?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();s.current&&(m||n!==t.branchNameInstructions)&&c({branchNameInstructions:n}),s.current=!1}},`${a}:${m}:${t.branchNameInstructions}`)})}):null,e[29]=m,e[30]=u,e[31]=a,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=c,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,J.jsxs)(J.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,J.jsx)(j,{value:e,children:et[e]},e)}function rt(e){return e===null?`Mixed`:et[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`In each project, matches recent change descriptions and change request titles.`},conventional_commits:{label:`Conventional Commits`,description:`Use Conventional Commit prefixes and keep change request text concise.`},custom:{label:`Custom instructions`,description:`Use your instructions for change descriptions and change requests in every project.`}};function ot(){let e=(0,K.c)(80),t=Oe(),n=De(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`reviewGuidesEnabled`],e[0]=r):r=e[0];let s=Ee(r),l=ee(),{environment:u,connectedEnvironments:d,targets:m,target:h}=Te(),g=u?.environmentId??null,_=d.length>0,y=u?.serverConfig?.providers??ae,x;e[1]===m?x=e[2]:(x=e=>{let t=m[0];return t!==void 0&&m.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=m,e[2]=x);let C=x,T;e[3]===C?T=e[4]:(T=C(`mode`),e[3]=C,e[4]=T);let E=T,D;e[5]===C?D=e[6]:(D=C(`customInstructions`),e[5]=C,e[6]=D);let O=D,k;e[7]===C?k=e[8]:(k=C(`followChangeRequestTemplates`),e[7]=C,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=Ee(ne),ie;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[`reviewGuideModelSelection`],e[10]=ie):ie=e[10];let I=Ee(ie),oe;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideInstructions`],e[11]=oe):oe=e[11];let L=Ee(oe),ce=(0,q.useRef)(!1),le;e[12]===m?le=e[13]:(le=m.map(mt).join(`,`),e[12]=m,e[13]=le);let ue=le,de=(0,q.useRef)(null),[R,me]=(0,q.useState)(!1),[he,ge]=(0,q.useState)(null),z=t.sourceControlWritingStyle,_e=v.sourceControlWritingStyle,ve=j||z.mode!==_e.mode||z.customInstructions!==_e.customInstructions,ye=y.filter(pt),be=c(p(a(ye),t,h?.projectId??null)),xe=new Set(be.filter(ft).map(dt)),Se=ye.filter(e=>xe.has(e.instanceId)),Ce=i(t,Se),we=t.sourceControlWriterModelSelection!==null,B=i({...t,textGenerationModelSelection:fe(t,Se,h?.projectId??null)},Se),H=be.some(e=>e.instanceId===Ce.instanceId&&e.enabled&&e.isAvailable),ke=f(t,Se,B.instanceId,B.model),U=Ue(t,be),Ne=be.find(e=>e.instanceId===B.instanceId),Pe=t.reviewGuideModelSelection!==null,W=i({...t,textGenerationModelSelection:se(t,ye,h?.projectId??null)},ye),Ie=f(t,ye,W.instanceId,W.model),Le=be.find(e=>e.instanceId===W.instanceId),Re=Me,ze;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,J.jsx)(tt,{}),e[14]=ze):ze=e[14];let Be;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Be=[`sourceControlWritingStyle`],e[15]=Be):Be=e[15];let Ve;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=G(`source-control-writing-style`),e[16]=Ve):Ve=e[16];let We=at[z.mode],Ge;e[17]!==ve||e[18]!==n?(Ge=ve?(0,J.jsx)(je,{label:`source control writing style`,onClick:()=>n({sourceControlWritingStyle:{mode:_e.mode,customInstructions:_e.customInstructions}})}):null,e[17]=ve,e[18]=n,e[19]=Ge):Ge=e[19];let Ke=E?null:z.mode,qe;e[20]===n?qe=e[21]:(qe=e=>{let t=de.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=qe);let Je;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,J.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,J.jsx)(M,{children:ut})}),e[22]=Je):Je=e[22];let Ye;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=Object.keys(at),e[23]=Ye):Ye=e[23];let Xe;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,J.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Ye.map(lt)}),e[24]=Xe):Xe=e[24];let Y;e[25]!==Ke||e[26]!==qe?(Y=(0,J.jsxs)(F,{value:Ke,onValueChange:qe,children:[Je,Xe]}),e[25]=Ke,e[26]=qe,e[27]=Y):Y=e[27];let Ze;e[28]!==he||e[29]!==R||e[30]!==z.customInstructions||e[31]!==z.mode||e[32]!==n||e[33]!==j?(Ze=j?(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:R?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(pe,{value:he??``,onChange:e=>ge(e.target.value),rows:4,"aria-label":`Custom source control instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,J.jsx)(w,{size:`sm`,variant:`outline`,disabled:he===null,onClick:()=>{he!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:he.trim()}}),me(!1))},children:`Apply instructions to all`})]}):(0,J.jsx)(w,{size:`sm`,variant:`outline`,onClick:()=>{ge(null),me(!0)},children:`Write custom instructions for all`})}):z.mode===`custom`?(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{ref:de,defaultValue:z.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==z.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep titles concise. Use short bullet points in descriptions.`,"aria-label":`Custom source control writing instructions`},z.customInstructions)}):null,e[28]=he,e[29]=R,e[30]=z.customInstructions,e[31]=z.mode,e[32]=n,e[33]=j,e[34]=Ze):Ze=e[34];let X;e[35]!==We.description||e[36]!==Ge||e[37]!==Y||e[38]!==Ze||e[39]!==j?(X=(0,J.jsx)(V,{serverScoped:!0,settingKeys:Be,mixed:j,...Ve,description:We.description,resetAction:Ge,control:Y,children:Ze}),e[35]=We.description,e[36]=Ge,e[37]=Y,e[38]=Ze,e[39]=j,e[40]=X):X=e[40];let Qe;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=[`sourceControlWritingStyle`],e[41]=Qe):Qe=e[41];let $e;e[42]===Symbol.for(`react.memo_cache_sentinel`)?($e=G(`follow-change-request-templates`),e[42]=$e):$e=e[42];let et;e[43]!==z.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(et=A||z.followChangeRequestTemplates!==_e.followChangeRequestTemplates?(0,J.jsx)(je,{label:`change request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:_e.followChangeRequestTemplates}})}):null,e[43]=z.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=et):et=e[46];let nt=!A&&z.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,J.jsx)(Fe,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow change request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==et||e[54]!==it||e[55]!==A?(ot=(0,J.jsx)(V,{serverScoped:!0,settingKeys:Qe,mixed:A,...$e,description:`Use the repository's template for change request descriptions when available.`,resetAction:et,control:it}),e[53]=et,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=G(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=_?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[we&&!H?(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,we&&H?(0,J.jsx)(He,{environmentId:g,activeInstanceId:B.instanceId,model:B.model,lockedProvider:null,instanceEntries:be,modelOptionsByInstance:ke,triggerClassName:Ae,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...g?{onOpenProviderSetup:e=>{l({to:`/settings/providers`,search:{environmentId:g,instanceId:e}})}}:{},getModelDisabledReason:U,onInstanceModelChange:(e,t)=>{let r=U(e,t);if(r){te.add({type:`error`,title:`Source control writer model not saved`,description:r});return}n({sourceControlWriterModelSelection:b(e,t)})}}):null,we&&H&&!re&&Ne?(0,J.jsx)(S,{provider:Ne.driverKind,models:Ne.models,model:B.model,prompt:``,onPromptChange:ct,modelOptions:B.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(B.options),triggerClassName:Ae,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:b(B.instanceId,B.model,e)})}):null,(0,J.jsx)(Fe,{checked:we,disabled:!we&&!H,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?b(Ce.instanceId,Ce.model,Ce.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,J.jsx)(V,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=G(`review-guides`),e[62]=bt):bt=e[62];let xt=!s&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==s||e[66]!==xt||e[67]!==Z?(Q=(0,J.jsx)(Fe,{mixed:s,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=s,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==s||e[70]!==Q?($=(0,J.jsx)(V,{serverScoped:!0,settingKeys:yt,mixed:s,...bt,description:`Adds a Guide tab to pull requests: an agent writes a tour of the change, stop by stop, with the calls a maintainer should make.`,control:Q}),e[69]=s,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...G(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:_?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Pe||I)&&H?(0,J.jsx)(He,{environmentId:g,activeInstanceId:W.instanceId,model:W.model,lockedProvider:null,instanceEntries:be,modelOptionsByInstance:Ie,triggerClassName:Ae,triggerAriaLabel:`Review guide model`,...I?{triggerLabel:`Mixed`}:{},getModelDisabledReason:U,onInstanceModelChange:(e,t)=>{let r=U(e,t);if(r){te.add({type:`error`,title:`Review guide model not saved`,description:r});return}n({reviewGuideModelSelection:b(e,t)})}}):null,Pe&&H&&!I&&Le?(0,J.jsx)(S,{provider:Le.driverKind,models:Le.models,model:W.model,prompt:``,onPromptChange:st,modelOptions:W.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(W.options),triggerClassName:Ae,onModelOptionsChange:e=>n({reviewGuideModelSelection:b(W.instanceId,W.model,e)})}):null,(0,J.jsx)(Fe,{mixed:I,checked:!I&&Pe,disabled:!Pe&&!H,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=U(B.instanceId,B.model);if(t){te.add({type:`error`,title:`Review guide model not saved`,description:t});return}n({reviewGuideModelSelection:b(B.instanceId,B.model,B.options)})},"aria-label":`Use a separate review guide model`})]}):(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...G(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:L||t.reviewGuideInstructions!==``?(0,J.jsx)(je,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{"aria-label":`Review guide instructions`,onChange:()=>{ce.current=!0},rows:4,defaultValue:L?``:t.reviewGuideInstructions,placeholder:L?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();ce.current&&(L||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),ce.current=!1}},`${ue}:${L}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==Re||e[73]!==ze||e[74]!==X||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,J.jsxs)(Re,{id:`source-control-text-generation`,title:`Text generation`,children:[ze,X,ot,vt,$,St]}),e[72]=Re,e[73]=ze,e[74]=X,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,J.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:Se,jj:xe},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(r(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:le(e),overrides:n}}}function Z(e){return d(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,K.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,J.jsx)(Re,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,K.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?Ce.find(n.kind):void 0,c=Q(n)?s&&Ve(s):gt[n.kind];if(!c){o=(0,J.jsx)(`span`,{className:T(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,J.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=T(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,J.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,J.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,J.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,J.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:`Authenticated`}),n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,J.jsx)(Ct,{account:n})]}):null,e?(0,J.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,J.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,J.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,J.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,J.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,J.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,K.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,s=Q(n)?n.auth:null,c;t[2]===s?c=t[3]:(c=s?St(s):null,t[2]=s,t[3]=c);let l=c,u=s?Z(s.account):null,[d,f]=(0,q.useState)(!1),p=r!==void 0,h=H(),g;t[4]!==n.kind||t[5]!==h||t[6]!==f?(g=()=>{(n.kind===`git`&&h===G(`git-fetch-interval`).id||h===Le(n.kind)||n.kind===`github`&&h===G(`github-accounts`).id)&&f(!0)},t[4]=n.kind,t[5]=h,t[6]=f,t[7]=g):g=t[7];let _;t[8]!==n.kind||t[9]!==h?(_=[n.kind,h],t[8]=n.kind,t[9]=h,t[10]=_):_=t[10],(0,q.useEffect)(g,_);let v;t[11]===n?v=t[12]:(v=T(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=v);let b;t[13]===n?b=t[14]:(b=(0,J.jsx)(Tt,{item:n}),t[13]=n,t[14]=b);let x;t[15]===n.label?x=t[16]:(x=(0,J.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=x);let S;t[17]===a?S=t[18]:(S=a?(0,J.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=S);let C;t[19]===n?C=t[20]:(C=$(n)?(0,J.jsx)(m,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=C);let E;t[21]===l?E=t[22]:(E=l?.badge?(0,J.jsx)(m,{variant:l.badge,size:`sm`,children:l.label}):null,t[21]=l,t[22]=E);let D;t[23]!==x||t[24]!==S||t[25]!==C||t[26]!==E||t[27]!==b?(D=(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b,x,S,C,E]}),t[23]=x,t[24]=S,t[25]=C,t[26]=E,t[27]=b,t[28]=D):D=t[28];let O=Et({item:n,auth:s,authAccount:u}),k;t[29]===O?k=t[30]:(k=(0,J.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==p||t[35]!==d||t[36]!==n.label||t[37]!==f?(j=p?(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>f(Ot),"aria-expanded":d,"aria-label":`Toggle ${n.label} details`,children:(0,J.jsx)(y,{className:T(`size-3.5 transition-transform`,d&&`rotate-180`)})}):null,t[34]=p,t[35]=d,t[36]=n.label,t[37]=f,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,J.jsx)(Fe,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,J.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,J.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==p||t[50]!==d||t[51]!==f?(F=p?(0,J.jsx)(Ie,{open:d,onOpenChange:f,children:(0,J.jsx)(Pe,{children:(0,J.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=p,t[50]=d,t[51]=f,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==v?(ee=(0,J.jsxs)(`div`,{className:v,children:[P,F]}),t[53]=P,t[54]=F,t[55]=v,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,K.c)(33),t=Oe(),n=De(),r;e[0]===t?r=e[1]:(r=yt(de(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=yt(ce(le(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=G(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,J.jsx)(Ne,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=T(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,g;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(g=o?(0,J.jsx)(je,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=g):g=e[12];let _;e[13]!==p||e[14]!==m||e[15]!==g?(_=(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,J.jsx)(`span`,{className:p,"aria-hidden":m,children:g})]}),e[13]=p,e[14]=m,e[15]=g,e[16]=_):_=e[16];let v;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=v):v=e[17];let y;e[18]===_?y=e[19]:(y=(0,J.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[_,v]}),e[18]=_,e[19]=y);let b;e[20]!==t.backgroundActivity||e[21]!==n?(b=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:h(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=b):b=e[22];let x;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsxs)(k,{children:[(0,J.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,J.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,J.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=x):x=e[23];let S;e[24]!==i||e[25]!==b?(S=(0,J.jsx)(A,{value:i,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:b,children:x}),e[24]=i,e[25]=b,e[26]=S):S=e[26];let C;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=C):C=e[27];let w;e[28]===S?w=e[29]:(w=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[S,C]}),e[28]=S,e[29]=w);let j;return e[30]!==y||e[31]!==w?(j=(0,J.jsx)(U,{id:l,className:`grid gap-3`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[y,w]})}),e[30]=y,e[31]=w,e[32]=j):j=e[32],j}function At(e){let t=(0,K.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,J.jsx)(Me,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,J.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,J.jsx)(R,{className:`size-4.5`}),(0,J.jsx)(R,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,J.jsx)(R,{shape:`pill`,className:`h-4 w-28`}),(0,J.jsx)(R,{shape:`pill`,className:`h-5 w-14`})]}),(0,J.jsx)(R,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(R,{className:`size-7`}),(0,J.jsx)(R,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,K.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=G(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(he,{variant:`icon`,children:(0,J.jsx)(B.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,J.jsx)(_e,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,J.jsx)(ve,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,J.jsxs)(ge,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,J.jsx)(Be,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,J.jsx)(z,{children:(0,J.jsxs)(w,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==m?(h=(0,J.jsx)(Me,{id:o.id,title:`Server environment`,children:(0,J.jsxs)(ye,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=h):h=t[17],h}function Nt(){let e=(0,K.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Te(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:be.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=oe(o),c=s.data??ht,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=Ce.find(e);if(t?.settings&&i!==null)return(0,J.jsx)(U,{id:Le(e),children:(0,J.jsx)(qe,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let h=m,g;e[7]===s.isPending?g=e[8]:(g=(0,J.jsx)(Be,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=g);let _;e[9]!==s.isPending||e[10]!==p||e[11]!==g?(_=(0,J.jsx)(ne,{render:(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:g})}),e[9]=s.isPending,e[10]=p,e[11]=g,e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(re,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=v):v=e[13];let y;e[14]===_?y=e[15]:(y=(0,J.jsxs)(ie,{children:[_,v]}),e[14]=_,e[15]=y);let b=y,x;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(We,{category:`source-control`}),e[16]=x):x=e[16];let S;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==h||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==b?(S=i===null?(0,J.jsx)(Me,{id:G(`source-control`).id,title:`Server environment`,children:(0,J.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(At,{title:`Version Control${a}`,headerAction:b}),(0,J.jsx)(At,{title:`Source Control Providers`})]}):u?(0,J.jsxs)(J.Fragment,{children:[l?(0,J.jsx)(Me,{id:G(`source-control`).id,title:`Version Control${a}`,headerAction:b,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,J.jsx)(Me,{id:l?void 0:G(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:b,children:c.sourceControlProviders.map(e=>(0,J.jsx)(Dt,{item:e,children:e.kind===`github`?(0,J.jsx)(U,{id:G(`github-accounts`).id,children:(0,J.jsxs)(`div`,{className:`grid gap-6`,children:[(0,J.jsx)($e,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,J.jsx)(Ze,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):h(e.kind)},`provider:${e.kind}`))}):null]}):(0,J.jsx)(Mt,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=h,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=b,e[29]=S):S=e[29];let C;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(ot,{}),e[30]=C):C=e[30];let T;return e[31]===S?T=e[32]:(T=(0,J.jsxs)(ke,{children:[x,S,C]}),e[31]=S,e[32]=T),T}function Pt(e){return(0,J.jsx)(Dt,{item:e,children:e.kind===`git`?(0,J.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
2
- //# sourceMappingURL=settings.source-control-Cgg8tzrr.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$m as n,$w as r,Ft as i,Ht as a,It as o,Jd as s,Jt as c,Kd as l,NE as u,NT as d,Nt as f,Vt as p,Wn as m,Zw as h,cr as g,dh as _,fh as v,gd as y,ks as b,lE as x,nn as S,qd as C,sr as w,t as T}from"./utils-BAPnqm16.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-DQIrEOoj.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-Dsx46akG.js";import{t as ee}from"./useNavigate-Dhy_1-Mg.js";import{i as te}from"./toast-CN7Jd-pG.js";import{a as ne,n as re,t as ie}from"./tooltip-DaSC-3cL.js";import{f as I,t as ae}from"./server-CoH7V4JL.js";import{n as oe}from"./query-B1uAr_ii.js";import{t as L}from"./use-atom-command-GpCw1tWF.js";import{C as se,E as ce,T as le,f as ue,k as de,w as fe}from"./useSettings-CKA-LDDj.js";import{t as R}from"./skeleton-0mC3wMw1.js";import{t as pe}from"./textarea-BvPoR1cI.js";import{t as me}from"./input-83N8btBC.js";import{a as he,i as ge,n as z,o as _e,r as ve,t as ye}from"./empty-2jxBvPLn.js";import{t as be}from"./sourceControl-D6TEHNpa.js";import{g as xe,m as Se}from"./Icons-BYSK3arN.js";import{c as Ce,s as we}from"./threadSort-Cn23YHH2.js";import{n as B}from"./pullRequestIcons-CSZus-cz.js";import{B as Te,F as Ee,L as De,P as Oe,a as V,f as H,i as ke,n as Ae,o as U,r as je,s as Me,t as Ne}from"./settingsLayout-CqGfrbmD.js";import{Fa as Pe,La as Fe,Ni as W,Pa as Ie,ar as Le,fr as Re,ir as G,pr as ze,qa as Be,yn as Ve}from"./main-lV-t-UZx.js";import{t as He}from"./ProviderModelPicker-CeB11O3P.js";import{t as Ue}from"./useScopedModelAvailability-DE1E_lbg.js";import{t as We}from"./ProjectDefaultsSettings-CrKY01_P.js";import{t as Ge}from"./SecretInput-CIbdWrQZ.js";import{t as Ke}from"./ProviderSettingsForm-CLYzJJII.js";var K=u(),q=e(t(),1),J=e(x(),1);function qe({environmentId:e,definition:t,onSaved:n}){let r=ue(e,e=>e.sourceControlHosts[t.kind]),i=L(I.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,q.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,J.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,J.jsx)(Ke,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,J.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,J.jsx)(w,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Je(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Ye(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var Xe=`active gh account`;function Y(e){let t=(0,K.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,J.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,J.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:ze(e.account)}),(0,J.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Ze({environmentId:e,auth:t,onSaved:n}){let r=ue(e,we).hosts,i=L(I.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,q.useState)(!1),[c,l]=(0,q.useState)(!1),u=Je(t.accounts??[]),d=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Ye(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return u.length===0?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,J.jsxs)(`div`,{className:`grid gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>l(e=>!e),"aria-label":c?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":c,children:c?(0,J.jsx)(s,{}):(0,J.jsx)(C,{})})]}),u.map(e=>{let t=r[e.host],n=t?.enabled??!0,i=t?.account!==void 0&&!e.selectable.includes(t.account),o=t?.account!==void 0&&!i?t.account:Xe;return(0,J.jsxs)(`div`,{className:`grid gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,J.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:`Signed in as`}),(0,J.jsx)(Y,{revealed:c,account:e.selectable[0]})]}):null]}),(0,J.jsx)(Fe,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void d(e.host,{enabled:t})})]}),e.selectable.length>1?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,J.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,J.jsxs)(F,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&d(e.host,{account:t===Xe?null:t})},children:[(0,J.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,J.jsx)(M,{children:t=>t===Xe?(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,J.jsxs)(J.Fragment,{children:[`(`,(0,J.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]}):(0,J.jsx)(Y,{revealed:c,account:t})})}),(0,J.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,J.jsx)(j,{value:Xe,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,J.jsxs)(J.Fragment,{children:[`(`,(0,J.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,J.jsx)(j,{value:e,children:(0,J.jsx)(Y,{revealed:c,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,J.jsx)(w,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void d(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,J.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,J.jsx)(Y,{revealed:c,account:e.account}),(0,J.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,J.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var X=`github.com`;function Qe(e){return`https://${e}/settings/personal-access-tokens/new`}function $e({environmentId:e,onSaved:t}){let{tokens:n}=ue(e,we),r=L(I.updateSettings,{label:`save GitHub token`}),[i,a]=(0,q.useState)(X),[o,s]=(0,q.useState)(``),[c,u]=(0,q.useState)(!1),d=i.trim().toLowerCase(),f=(n[d]??``).length>0,p=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),m=async(i,a)=>{u(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{u(!1)}};return(0,J.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),d&&o.trim()&&m(d,o.trim())},children:(0,J.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,J.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,J.jsxs)(g,{render:(0,J.jsx)(`a`,{href:Qe(d||X),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,J.jsx)(l,{"aria-hidden":!0,className:`size-3`})]})]}),(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(W,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,J.jsx)(me,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:X,value:i,onChange:e=>a(e.target.value)})]}),(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(W,{htmlFor:`github-token-${e}`,children:`Token`}),(0,J.jsx)(Ge,{id:`github-token-${e}`,size:`sm`,configured:f,value:o,onChange:e=>s(e.target.value)})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${p.join(`, `)}.`}),(0,J.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[f?(0,J.jsx)(w,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void m(d,``),children:`Remove`}):null,(0,J.jsx)(w,{type:`submit`,size:`xs`,disabled:!d||!o.trim()||c,children:`Save`})]})]})]})})}var et={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,K.c)(40),t=Oe(),{targets:r}=Te(),i;e[0]===r?i=e[1]:(i=r.map(it).join(`,`),e[0]=r,e[1]=i);let a=i,o=(0,q.useRef)(!1),s=(0,q.useRef)(!1),c=De(),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`branchNamingMode`],e[2]=l):l=e[2];let u=Ee(l),d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`branchNamePrefix`],e[3]=d):d=e[3];let f=Ee(d),p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`branchNameInstructions`],e[4]=p):p=e[4];let m=Ee(p),h,g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`branchNamingMode`],g=G(`worktree-branch-naming`),e[5]=h,e[6]=g):(h=e[5],g=e[6]);let v=!u&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,y;e[7]!==u||e[8]!==t.branchNamingMode||e[9]!==c?(y=t.branchNamingMode!==_.branchNamingMode||u?(0,J.jsx)(je,{label:`branch naming`,onClick:()=>c({branchNamingMode:_.branchNamingMode})}):null,e[7]=u,e[8]=t.branchNamingMode,e[9]=c,e[10]=y):y=e[10];let b=u?null:t.branchNamingMode,x;e[11]===c?x=e[12]:(x=e=>{n.literals.includes(e)&&c({branchNamingMode:e})},e[11]=c,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,J.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:n.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,J.jsxs)(F,{value:b,onValueChange:x,children:[S,C]}),e[15]=b,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==v||e[20]!==y?(T=(0,J.jsx)(V,{serverScoped:!0,settingKeys:h,...g,description:`Choose how new worktree branches are named from your first message.`,status:v,resetAction:y,control:w}),e[18]=w,e[19]=v,e[20]=y,e[21]=T):T=e[21];let E;e[22]!==u||e[23]!==f||e[24]!==a||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==c?(E=!u&&t.branchNamingMode===`static`?(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:f||t.branchNamePrefix!==_.branchNamePrefix?(0,J.jsx)(je,{label:`branch prefix`,onClick:()=>c({branchNamePrefix:_.branchNamePrefix})}):null,control:(0,J.jsx)(me,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{o.current=!0},placeholder:f?`Mixed`:`No prefix`,defaultValue:f?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();o.current&&(f||n!==t.branchNamePrefix)&&c({branchNamePrefix:n}),o.current=!1}},`${a}:${f}:${t.branchNamePrefix}`)}):null,e[22]=u,e[23]=f,e[24]=a,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=c,e[28]=E):E=e[28];let D;e[29]!==m||e[30]!==u||e[31]!==a||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==c?(D=!u&&t.branchNamingMode===`custom`?(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:m||t.branchNameInstructions!==``?(0,J.jsx)(je,{label:`branch naming instructions`,onClick:()=>c({branchNameInstructions:``})}):null,children:(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{"aria-label":`Branch naming instructions`,onChange:()=>{s.current=!0},rows:4,defaultValue:m?``:t.branchNameInstructions,placeholder:m?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();s.current&&(m||n!==t.branchNameInstructions)&&c({branchNameInstructions:n}),s.current=!1}},`${a}:${m}:${t.branchNameInstructions}`)})}):null,e[29]=m,e[30]=u,e[31]=a,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=c,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,J.jsxs)(J.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,J.jsx)(j,{value:e,children:et[e]},e)}function rt(e){return e===null?`Mixed`:et[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`In each project, matches recent change descriptions and change request titles.`},conventional_commits:{label:`Conventional Commits`,description:`Use Conventional Commit prefixes and keep change request text concise.`},custom:{label:`Custom instructions`,description:`Use your instructions for change descriptions and change requests in every project.`}};function ot(){let e=(0,K.c)(80),t=Oe(),n=De(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`reviewGuidesEnabled`],e[0]=r):r=e[0];let s=Ee(r),l=ee(),{environment:u,connectedEnvironments:d,targets:m,target:h}=Te(),g=u?.environmentId??null,_=d.length>0,y=u?.serverConfig?.providers??ae,x;e[1]===m?x=e[2]:(x=e=>{let t=m[0];return t!==void 0&&m.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=m,e[2]=x);let C=x,T;e[3]===C?T=e[4]:(T=C(`mode`),e[3]=C,e[4]=T);let E=T,D;e[5]===C?D=e[6]:(D=C(`customInstructions`),e[5]=C,e[6]=D);let O=D,k;e[7]===C?k=e[8]:(k=C(`followChangeRequestTemplates`),e[7]=C,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=Ee(ne),ie;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[`reviewGuideModelSelection`],e[10]=ie):ie=e[10];let I=Ee(ie),oe;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideInstructions`],e[11]=oe):oe=e[11];let L=Ee(oe),ce=(0,q.useRef)(!1),le;e[12]===m?le=e[13]:(le=m.map(mt).join(`,`),e[12]=m,e[13]=le);let ue=le,de=(0,q.useRef)(null),[R,me]=(0,q.useState)(!1),[he,ge]=(0,q.useState)(null),z=t.sourceControlWritingStyle,_e=v.sourceControlWritingStyle,ve=j||z.mode!==_e.mode||z.customInstructions!==_e.customInstructions,ye=y.filter(pt),be=c(p(a(ye),t,h?.projectId??null)),xe=new Set(be.filter(ft).map(dt)),Se=ye.filter(e=>xe.has(e.instanceId)),Ce=i(t,Se),we=t.sourceControlWriterModelSelection!==null,B=i({...t,textGenerationModelSelection:fe(t,Se,h?.projectId??null)},Se),H=be.some(e=>e.instanceId===Ce.instanceId&&e.enabled&&e.isAvailable),ke=f(t,Se,B.instanceId,B.model),U=Ue(t,be),Ne=be.find(e=>e.instanceId===B.instanceId),Pe=t.reviewGuideModelSelection!==null,W=i({...t,textGenerationModelSelection:se(t,ye,h?.projectId??null)},ye),Ie=f(t,ye,W.instanceId,W.model),Le=be.find(e=>e.instanceId===W.instanceId),Re=Me,ze;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,J.jsx)(tt,{}),e[14]=ze):ze=e[14];let Be;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Be=[`sourceControlWritingStyle`],e[15]=Be):Be=e[15];let Ve;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=G(`source-control-writing-style`),e[16]=Ve):Ve=e[16];let We=at[z.mode],Ge;e[17]!==ve||e[18]!==n?(Ge=ve?(0,J.jsx)(je,{label:`source control writing style`,onClick:()=>n({sourceControlWritingStyle:{mode:_e.mode,customInstructions:_e.customInstructions}})}):null,e[17]=ve,e[18]=n,e[19]=Ge):Ge=e[19];let Ke=E?null:z.mode,qe;e[20]===n?qe=e[21]:(qe=e=>{let t=de.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=qe);let Je;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,J.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,J.jsx)(M,{children:ut})}),e[22]=Je):Je=e[22];let Ye;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=Object.keys(at),e[23]=Ye):Ye=e[23];let Xe;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,J.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Ye.map(lt)}),e[24]=Xe):Xe=e[24];let Y;e[25]!==Ke||e[26]!==qe?(Y=(0,J.jsxs)(F,{value:Ke,onValueChange:qe,children:[Je,Xe]}),e[25]=Ke,e[26]=qe,e[27]=Y):Y=e[27];let Ze;e[28]!==he||e[29]!==R||e[30]!==z.customInstructions||e[31]!==z.mode||e[32]!==n||e[33]!==j?(Ze=j?(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:R?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(pe,{value:he??``,onChange:e=>ge(e.target.value),rows:4,"aria-label":`Custom source control instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,J.jsx)(w,{size:`sm`,variant:`outline`,disabled:he===null,onClick:()=>{he!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:he.trim()}}),me(!1))},children:`Apply instructions to all`})]}):(0,J.jsx)(w,{size:`sm`,variant:`outline`,onClick:()=>{ge(null),me(!0)},children:`Write custom instructions for all`})}):z.mode===`custom`?(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{ref:de,defaultValue:z.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==z.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep titles concise. Use short bullet points in descriptions.`,"aria-label":`Custom source control writing instructions`},z.customInstructions)}):null,e[28]=he,e[29]=R,e[30]=z.customInstructions,e[31]=z.mode,e[32]=n,e[33]=j,e[34]=Ze):Ze=e[34];let X;e[35]!==We.description||e[36]!==Ge||e[37]!==Y||e[38]!==Ze||e[39]!==j?(X=(0,J.jsx)(V,{serverScoped:!0,settingKeys:Be,mixed:j,...Ve,description:We.description,resetAction:Ge,control:Y,children:Ze}),e[35]=We.description,e[36]=Ge,e[37]=Y,e[38]=Ze,e[39]=j,e[40]=X):X=e[40];let Qe;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=[`sourceControlWritingStyle`],e[41]=Qe):Qe=e[41];let $e;e[42]===Symbol.for(`react.memo_cache_sentinel`)?($e=G(`follow-change-request-templates`),e[42]=$e):$e=e[42];let et;e[43]!==z.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(et=A||z.followChangeRequestTemplates!==_e.followChangeRequestTemplates?(0,J.jsx)(je,{label:`change request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:_e.followChangeRequestTemplates}})}):null,e[43]=z.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=et):et=e[46];let nt=!A&&z.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,J.jsx)(Fe,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow change request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==et||e[54]!==it||e[55]!==A?(ot=(0,J.jsx)(V,{serverScoped:!0,settingKeys:Qe,mixed:A,...$e,description:`Use the repository's template for change request descriptions when available.`,resetAction:et,control:it}),e[53]=et,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=G(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=_?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[we&&!H?(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,we&&H?(0,J.jsx)(He,{environmentId:g,activeInstanceId:B.instanceId,model:B.model,lockedProvider:null,instanceEntries:be,modelOptionsByInstance:ke,triggerClassName:Ae,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...g?{onOpenProviderSetup:e=>{l({to:`/settings/providers`,search:{environmentId:g,instanceId:e}})}}:{},getModelDisabledReason:U,onInstanceModelChange:(e,t)=>{let r=U(e,t);if(r){te.add({type:`error`,title:`Source control writer model not saved`,description:r});return}n({sourceControlWriterModelSelection:b(e,t)})}}):null,we&&H&&!re&&Ne?(0,J.jsx)(S,{provider:Ne.driverKind,models:Ne.models,model:B.model,prompt:``,onPromptChange:ct,modelOptions:B.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(B.options),triggerClassName:Ae,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:b(B.instanceId,B.model,e)})}):null,(0,J.jsx)(Fe,{checked:we,disabled:!we&&!H,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?b(Ce.instanceId,Ce.model,Ce.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,J.jsx)(V,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=G(`review-guides`),e[62]=bt):bt=e[62];let xt=!s&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==s||e[66]!==xt||e[67]!==Z?(Q=(0,J.jsx)(Fe,{mixed:s,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=s,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==s||e[70]!==Q?($=(0,J.jsx)(V,{serverScoped:!0,settingKeys:yt,mixed:s,...bt,description:`Adds a Guide tab to pull requests: an agent writes a tour of the change, stop by stop, with the calls a maintainer should make.`,control:Q}),e[69]=s,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...G(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:_?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Pe||I)&&H?(0,J.jsx)(He,{environmentId:g,activeInstanceId:W.instanceId,model:W.model,lockedProvider:null,instanceEntries:be,modelOptionsByInstance:Ie,triggerClassName:Ae,triggerAriaLabel:`Review guide model`,...I?{triggerLabel:`Mixed`}:{},getModelDisabledReason:U,onInstanceModelChange:(e,t)=>{let r=U(e,t);if(r){te.add({type:`error`,title:`Review guide model not saved`,description:r});return}n({reviewGuideModelSelection:b(e,t)})}}):null,Pe&&H&&!I&&Le?(0,J.jsx)(S,{provider:Le.driverKind,models:Le.models,model:W.model,prompt:``,onPromptChange:st,modelOptions:W.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(W.options),triggerClassName:Ae,onModelOptionsChange:e=>n({reviewGuideModelSelection:b(W.instanceId,W.model,e)})}):null,(0,J.jsx)(Fe,{mixed:I,checked:!I&&Pe,disabled:!Pe&&!H,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=U(B.instanceId,B.model);if(t){te.add({type:`error`,title:`Review guide model not saved`,description:t});return}n({reviewGuideModelSelection:b(B.instanceId,B.model,B.options)})},"aria-label":`Use a separate review guide model`})]}):(0,J.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,J.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...G(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:L||t.reviewGuideInstructions!==``?(0,J.jsx)(je,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,J.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,J.jsx)(pe,{"aria-label":`Review guide instructions`,onChange:()=>{ce.current=!0},rows:4,defaultValue:L?``:t.reviewGuideInstructions,placeholder:L?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();ce.current&&(L||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),ce.current=!1}},`${ue}:${L}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==Re||e[73]!==ze||e[74]!==X||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,J.jsxs)(Re,{id:`source-control-text-generation`,title:`Text generation`,children:[ze,X,ot,vt,$,St]}),e[72]=Re,e[73]=ze,e[74]=X,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,J.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:Se,jj:xe},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(r(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:le(e),overrides:n}}}function Z(e){return d(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,K.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,J.jsx)(Re,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,K.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?Ce.find(n.kind):void 0,c=Q(n)?s&&Ve(s):gt[n.kind];if(!c){o=(0,J.jsx)(`span`,{className:T(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,J.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=T(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,J.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,J.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,J.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,J.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:`Authenticated`}),n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,J.jsx)(Ct,{account:n})]}):null,e?(0,J.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,J.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,J.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,J.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,J.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,J.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,J.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,K.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,s=Q(n)?n.auth:null,c;t[2]===s?c=t[3]:(c=s?St(s):null,t[2]=s,t[3]=c);let l=c,u=s?Z(s.account):null,[d,f]=(0,q.useState)(!1),p=r!==void 0,h=H(),g;t[4]!==n.kind||t[5]!==h||t[6]!==f?(g=()=>{(n.kind===`git`&&h===G(`git-fetch-interval`).id||h===Le(n.kind)||n.kind===`github`&&h===G(`github-accounts`).id)&&f(!0)},t[4]=n.kind,t[5]=h,t[6]=f,t[7]=g):g=t[7];let _;t[8]!==n.kind||t[9]!==h?(_=[n.kind,h],t[8]=n.kind,t[9]=h,t[10]=_):_=t[10],(0,q.useEffect)(g,_);let v;t[11]===n?v=t[12]:(v=T(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=v);let b;t[13]===n?b=t[14]:(b=(0,J.jsx)(Tt,{item:n}),t[13]=n,t[14]=b);let x;t[15]===n.label?x=t[16]:(x=(0,J.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=x);let S;t[17]===a?S=t[18]:(S=a?(0,J.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=S);let C;t[19]===n?C=t[20]:(C=$(n)?(0,J.jsx)(m,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=C);let E;t[21]===l?E=t[22]:(E=l?.badge?(0,J.jsx)(m,{variant:l.badge,size:`sm`,children:l.label}):null,t[21]=l,t[22]=E);let D;t[23]!==x||t[24]!==S||t[25]!==C||t[26]!==E||t[27]!==b?(D=(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b,x,S,C,E]}),t[23]=x,t[24]=S,t[25]=C,t[26]=E,t[27]=b,t[28]=D):D=t[28];let O=Et({item:n,auth:s,authAccount:u}),k;t[29]===O?k=t[30]:(k=(0,J.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==p||t[35]!==d||t[36]!==n.label||t[37]!==f?(j=p?(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>f(Ot),"aria-expanded":d,"aria-label":`Toggle ${n.label} details`,children:(0,J.jsx)(y,{className:T(`size-3.5 transition-transform`,d&&`rotate-180`)})}):null,t[34]=p,t[35]=d,t[36]=n.label,t[37]=f,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,J.jsx)(Fe,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,J.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,J.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==p||t[50]!==d||t[51]!==f?(F=p?(0,J.jsx)(Ie,{open:d,onOpenChange:f,children:(0,J.jsx)(Pe,{children:(0,J.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=p,t[50]=d,t[51]=f,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==v?(ee=(0,J.jsxs)(`div`,{className:v,children:[P,F]}),t[53]=P,t[54]=F,t[55]=v,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,K.c)(33),t=Oe(),n=De(),r;e[0]===t?r=e[1]:(r=yt(de(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=yt(ce(le(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=G(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,J.jsx)(Ne,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=T(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,g;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(g=o?(0,J.jsx)(je,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=g):g=e[12];let _;e[13]!==p||e[14]!==m||e[15]!==g?(_=(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,J.jsx)(`span`,{className:p,"aria-hidden":m,children:g})]}),e[13]=p,e[14]=m,e[15]=g,e[16]=_):_=e[16];let v;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=v):v=e[17];let y;e[18]===_?y=e[19]:(y=(0,J.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[_,v]}),e[18]=_,e[19]=y);let b;e[20]!==t.backgroundActivity||e[21]!==n?(b=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:h(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=b):b=e[22];let x;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsxs)(k,{children:[(0,J.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,J.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,J.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=x):x=e[23];let S;e[24]!==i||e[25]!==b?(S=(0,J.jsx)(A,{value:i,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:b,children:x}),e[24]=i,e[25]=b,e[26]=S):S=e[26];let C;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=C):C=e[27];let w;e[28]===S?w=e[29]:(w=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[S,C]}),e[28]=S,e[29]=w);let j;return e[30]!==y||e[31]!==w?(j=(0,J.jsx)(U,{id:l,className:`grid gap-3`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[y,w]})}),e[30]=y,e[31]=w,e[32]=j):j=e[32],j}function At(e){let t=(0,K.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,J.jsx)(Me,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,J.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,J.jsx)(R,{className:`size-4.5`}),(0,J.jsx)(R,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,J.jsx)(R,{shape:`pill`,className:`h-4 w-28`}),(0,J.jsx)(R,{shape:`pill`,className:`h-5 w-14`})]}),(0,J.jsx)(R,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(R,{className:`size-7`}),(0,J.jsx)(R,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,K.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=G(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(he,{variant:`icon`,children:(0,J.jsx)(B.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,J.jsx)(_e,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,J.jsx)(ve,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,J.jsxs)(ge,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,J.jsx)(Be,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,J.jsx)(z,{children:(0,J.jsxs)(w,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==m?(h=(0,J.jsx)(Me,{id:o.id,title:`Server environment`,children:(0,J.jsxs)(ye,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=h):h=t[17],h}function Nt(){let e=(0,K.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Te(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:be.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=oe(o),c=s.data??ht,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=Ce.find(e);if(t?.settings&&i!==null)return(0,J.jsx)(U,{id:Le(e),children:(0,J.jsx)(qe,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let h=m,g;e[7]===s.isPending?g=e[8]:(g=(0,J.jsx)(Be,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=g);let _;e[9]!==s.isPending||e[10]!==p||e[11]!==g?(_=(0,J.jsx)(ne,{render:(0,J.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:g})}),e[9]=s.isPending,e[10]=p,e[11]=g,e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(re,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=v):v=e[13];let y;e[14]===_?y=e[15]:(y=(0,J.jsxs)(ie,{children:[_,v]}),e[14]=_,e[15]=y);let b=y,x;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(We,{category:`source-control`}),e[16]=x):x=e[16];let S;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==h||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==b?(S=i===null?(0,J.jsx)(Me,{id:G(`source-control`).id,title:`Server environment`,children:(0,J.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(At,{title:`Version Control${a}`,headerAction:b}),(0,J.jsx)(At,{title:`Source Control Providers`})]}):u?(0,J.jsxs)(J.Fragment,{children:[l?(0,J.jsx)(Me,{id:G(`source-control`).id,title:`Version Control${a}`,headerAction:b,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,J.jsx)(Me,{id:l?void 0:G(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:b,children:c.sourceControlProviders.map(e=>(0,J.jsx)(Dt,{item:e,children:e.kind===`github`?(0,J.jsx)(U,{id:G(`github-accounts`).id,children:(0,J.jsxs)(`div`,{className:`grid gap-6`,children:[(0,J.jsx)($e,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,J.jsx)(Ze,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):h(e.kind)},`provider:${e.kind}`))}):null]}):(0,J.jsx)(Mt,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=h,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=b,e[29]=S):S=e[29];let C;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(ot,{}),e[30]=C):C=e[30];let T;return e[31]===S?T=e[32]:(T=(0,J.jsxs)(ke,{children:[x,S,C]}),e[31]=S,e[32]=T),T}function Pt(e){return(0,J.jsx)(Dt,{item:e,children:e.kind===`git`?(0,J.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
2
+ //# sourceMappingURL=settings.source-control-DmRUgcsk.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,NE as r,Yo as i,lE as a,sr as o}from"./utils-Dx_TSvdC.js";import{R as s,W as c}from"./runtime-Dz1hyHmq.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-CydqGM9B.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-BUFUt6O3.js";import{i as y}from"./toast-BeM8bZbF.js";import{f as b}from"./server-BSKDpYuc.js";import{t as x}from"./use-atom-command-CMd4xAvF.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-CF-egQtG.js";import{a as w}from"./p4ProjectFile-CN1m1U7N.js";import{B as T,F as E,L as D,M as O,P as k,U as A,a as j,i as M,r as N,s as P,u as F}from"./settingsLayout-DUyA66EK.js";import{La as I,ir as L}from"./main-CqNzdsfA.js";import{t as R}from"./FoldedSettingsSection-BFkFGK44.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-RvGwRluQ.js";var V=r(),H=e(t(),1),U=e(a(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=T(),r=k(),i=D(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=E(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=L(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(N,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(j,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(I,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(j,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){F(6e4);let{connectedEnvironments:e}=T(),[t,r]=(0,H.useState)(!1),a=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=i((0,H.useMemo)(()=>n(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){r(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await a({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{r(!1)}}};return(0,U.jsxs)(P,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(A,{children:(0,U.jsx)(j,{...L(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(o,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=T(),a=k(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=D(),S=O(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let E=C,A;e[15]===x?A=e[16]:(A=e=>x({storageCleanup:e}),e[15]=x,e[16]=A);let N=A,F;e[17]!==o||e[18]!==N||e[19]!==x?(F=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):N(e),e[17]=o,e[18]=N,e[19]=x,e[20]=F):F=e[20];let R=F;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(j,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==E||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(j,{title:`Delete worktrees with deleted threads`,status:E(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(j,{title:`Delete inactive worktrees`,status:E(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete merged worktrees`,status:E(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(j,{title:`Delete unchanged worktrees`,status:E(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(j,{...L(`storage-worktree-keep-when`),status:E(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:E(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:E(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=E,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(P,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==E||e[48]!==u||e[49]!==N?(Y=!o&&(0,U.jsxs)(P,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(j,{title:`Delete old browser artifacts`,status:E(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>N({browserArtifactsAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete old rotated logs`,status:E(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>N({logsAfterDays:e})})})]}),e[46]=o,e[47]=E,e[48]=u,e[49]=N,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(M,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
2
- //# sourceMappingURL=settings.storage-gQMFfL_2.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,NE as r,Yo as i,lE as a,sr as o}from"./utils-BAPnqm16.js";import{R as s,W as c}from"./runtime-B9IDNXDU.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-DQIrEOoj.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-Dsx46akG.js";import{i as y}from"./toast-CN7Jd-pG.js";import{f as b}from"./server-CoH7V4JL.js";import{t as x}from"./use-atom-command-GpCw1tWF.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-83N8btBC.js";import{a as w}from"./p4ProjectFile--u7SOSK5.js";import{B as T,F as E,L as D,M as O,P as k,U as A,a as j,i as M,r as N,s as P,u as F}from"./settingsLayout-CqGfrbmD.js";import{La as I,ir as L}from"./main-lV-t-UZx.js";import{t as R}from"./FoldedSettingsSection-Clo0JgyS.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-_WSLtOW4.js";var V=r(),H=e(t(),1),U=e(a(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=T(),r=k(),i=D(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=E(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=L(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(N,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(j,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(I,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(j,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){F(6e4);let{connectedEnvironments:e}=T(),[t,r]=(0,H.useState)(!1),a=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=i((0,H.useMemo)(()=>n(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){r(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await a({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{r(!1)}}};return(0,U.jsxs)(P,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(A,{children:(0,U.jsx)(j,{...L(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(o,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=T(),a=k(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=D(),S=O(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let E=C,A;e[15]===x?A=e[16]:(A=e=>x({storageCleanup:e}),e[15]=x,e[16]=A);let N=A,F;e[17]!==o||e[18]!==N||e[19]!==x?(F=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):N(e),e[17]=o,e[18]=N,e[19]=x,e[20]=F):F=e[20];let R=F;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(j,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==E||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(j,{title:`Delete worktrees with deleted threads`,status:E(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(j,{title:`Delete inactive worktrees`,status:E(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete merged worktrees`,status:E(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(j,{title:`Delete unchanged worktrees`,status:E(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(j,{...L(`storage-worktree-keep-when`),status:E(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:E(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:E(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=E,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(P,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==E||e[48]!==u||e[49]!==N?(Y=!o&&(0,U.jsxs)(P,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(j,{title:`Delete old browser artifacts`,status:E(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>N({browserArtifactsAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete old rotated logs`,status:E(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>N({logsAfterDays:e})})})]}),e[46]=o,e[47]=E,e[48]=u,e[49]=N,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(M,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
2
+ //# sourceMappingURL=settings.storage-DmbTXujz.js.map
@@ -1,3 +1,3 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,Aw as i,C_ as a,Ch as o,Ff as s,Gn as c,Mf as l,NE as u,NT as d,Om as f,Oy as p,Qn as m,Ss as h,XT as g,Yo as _,Zn as v,cr as y,dh as b,er as x,fw as S,gd as C,hd as w,hh as T,k_ as E,lE as D,mh as O,ms as ee,nl as te,or as k,rl as A,sr as j,t as M,th as N,tr as ne,vh as P,yl as F}from"./utils-Dx_TSvdC.js";import{C as re}from"./entities-D1h9ACDa.js";import{t as ie}from"./useNavigate-LjcLtV_e.js";import{t as I}from"./useLocation-BQwksr61.js";import{i as ae}from"./toast-BeM8bZbF.js";import{a as oe,n as se,t as ce}from"./tooltip-Cco13jKX.js";import{a as L,o as le,s as ue}from"./environments-CShRJEmR.js";import{f as de}from"./server-BSKDpYuc.js";import{i as fe,n as pe,o as me}from"./session-BaKBc24W.js";import{t as he}from"./use-atom-command-CMd4xAvF.js";import{a as ge,g as _e,i as ve,p as ye,s as R,t as be}from"./useSettings-DpVy22yc.js";import{m as xe}from"./queries-D53cjqgz.js";import{o as Se}from"./threadSort-DJdKuCKp.js";import{i as Ce,o as we,t as Te}from"./popover-BunL7s_L.js";import{t as Ee}from"./ProjectFavicon-CeJHd7lY.js";import{r as De,s as Oe}from"./projectFilesQueryState-DVWHpzC3.js";import{t as ke}from"./pullRequestDetail.logic-CjznZ6xd.js";import{a as z,f as B,i as V,n as H,t as U}from"./p4ProjectFile-CN1m1U7N.js";import{r as W}from"./sidebarProjectGrouping-lWfRDsCI.js";import{n as G}from"./EnvironmentMachineIcon-Czk_PJpp.js";import{t as K}from"./WorkspacePageContainer-rn16R8Ps.js";var q=u(),J=e(D(),1);function Y(e){let t=(0,q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({variant:i,divided:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`grouped`:i,s=a===void 0||a,c=o===`grouped`?`rounded-xl border border-border/60 bg-card/40 shadow-xs/5`:`space-y-1`,l=o===`grouped`&&s&&`[&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none`,u;t[5]!==n||t[6]!==c||t[7]!==l?(u=M(`relative overflow-visible text-foreground`,c,l,n),t[5]=n,t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==u?(d=(0,J.jsx)(`div`,{...r,className:u}),t[9]=r,t[10]=u,t[11]=d):d=t[11],d}var X=e(t(),1);function Z(){let e=(0,q.c)(5),t=re(),n=R(B),r=ue(),{environments:i}=L(),a;if(e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==n){let o=new Map(i.map(je));a=W({projects:t,settings:n,primaryEnvironmentId:r,resolveEnvironmentLabel:e=>o.get(e)??null}).sort(Ae),e[0]=i,e[1]=r,e[2]=t,e[3]=n,e[4]=a}else a=e[4];return a}function Ae(e,t){return e.displayName.localeCompare(t.displayName)}function je(e){return[e.environmentId,e.label]}var Me=new Set(Object.keys(T.fields)),Ne=new Set(Object.keys(N.fields)),Pe=new Set(O);function Q(e){return Pe.has(e)}function Fe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ie(e,t,n){let r=new Set(e.environmentIds),i=t.filter(e=>r.has(e.environmentId)),a=i.filter(e=>e.connection.phase===`connected`&&e.serverConfig!==null);return{environments:i,connectedEnvironments:a,environment:a.find(e=>e.environmentId===n)??a[0]??null}}function Le(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e]));return e.kind===`project`||e.kind===`checkout`?e.members.flatMap(e=>{let t=r.get(e.environmentId);if(!t?.serverConfig)return[];let i=n?.get(e.physicalProjectKey),a=i===void 0?V(t.serverConfig.settings,e.id):V(t.serverConfig.settings,e.id,null,i);return[{environmentId:e.environmentId,label:t.label,projectId:e.id,settings:a.settings,sources:a.sources}]}):t.flatMap(e=>e.serverConfig?[{environmentId:e.environmentId,label:e.label,projectId:null,settings:e.serverConfig.settings,sources:V(e.serverConfig.settings,null).sources}]:[])}function Re(e,t){let n=e[0];return n!==void 0&&e.some(e=>t.some(t=>!g(n.settings[t],e.settings[t])))}function ze(e,t){let n=t.filter(Q);if(n.length===0||e.length===0)return`environment`;let r=new Set(e.flatMap(e=>n.map(t=>e.sources[t])));return r.size>1?`mixed`:r.has(`project`)?`project`:r.has(`p4.json`)?`p4.json`:`environment`}function Be(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e])),i=new Map;for(let t of e.members){let e=r.get(t.environmentId);if(!e?.serverConfig||e.connection.phase!==`connected`||e.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0)continue;let a=e.serverConfig.settings,o=n(a.projectSettingsOverrides[t.id]??{},a,t.id),s=i.get(t.environmentId);i.set(t.environmentId,{environmentId:t.environmentId,label:e.label,previous:a,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[t.id]:o}}})}return[...i.values()]}function Ve(e,t,n){let r=Object.fromEntries(Object.entries(n).filter(([e])=>Ne.has(e)&&!Me.has(e))),i=Object.fromEntries(Object.entries(n).filter(([e])=>Me.has(e))),a=Object.keys(i),{connectedEnvironments:o}=Ie(e,t,null),s=e.kind===`project`||e.kind===`checkout`,c=s?a.filter(e=>!Q(e)):[],l=a.length===0?[]:s?c.length>0?[]:Be(e,t,(e,t,n)=>{let r=V(t,n).settings,a={...e};for(let[e,o]of Object.entries(i)){if(e===`worktreeCleanup`&&i.worktreeCleanup?.mode===`custom`){a[e]={mode:`custom`,rules:{...z(t,n),...i.worktreeCleanup.rules}};continue}if(o===null&&!P(e)){delete a[e];continue}let s=r[e];a[e]=Fe(o)&&Fe(s)?{...s,...o}:o}return a}):e.kind===`all`||e.kind===`environment`?o.flatMap(e=>{let t=e.serverConfig?.settings;return t?[{environmentId:e.environmentId,label:e.label,previous:t,patch:t.worktreeCleanup!=null&&i.storageCleanup&&Object.keys(i.storageCleanup).some(e=>e.startsWith(`worktree`))?{...i,worktreeCleanup:{mode:`custom`,rules:{...z(t,null),...Object.fromEntries(Object.entries(i.storageCleanup).filter(([e])=>e.startsWith(`worktree`)))}}}:i}]:[]}):[],u=Object.keys(r).length>0;return{clientPatch:r,hasClientWrite:u,serverWrites:l,unavailableReason:u||l.length>0||Object.keys(n).length===0?null:e.kind===`unavailable`?e.message:c.length>0?`This setting is environment-wide and cannot be overridden by a project.`:s?`Connect the selected checkouts, or update their environments, to save a project override.`:`Connect ${e.kind===`environment`?e.label:`an environment`} to save this setting.`}}function He(e,t,n){let r=e.kind===`project`||e.kind===`checkout`?Be(e,t,(e,t,r)=>H(t,r,n)):[];return{clientPatch:{},hasClientWrite:!1,serverWrites:r,unavailableReason:r.length>0?null:`Connect the selected checkouts, or update their environments, to reset this override.`}}function Ue(e,t){let n=t.filter(Q);return n.length===0?[]:e.flatMap(e=>{let t=e.serverConfig?.settings.projectSettingsOverrides;return t?Object.entries(t).flatMap(([t,r])=>n.some(e=>Object.hasOwn(r,e))?[{environmentId:e.environmentId,projectId:t}]:[]):[]})}function We(e,t,n){let r=new Map(e.map(e=>[e.environmentId,e])),i=new Map;for(let{environmentId:e,projectId:a}of t){let t=r.get(e);if(!t?.serverConfig||t.connection.phase!==`connected`)continue;let o=t.serverConfig.settings,s=i.get(e);i.set(e,{environmentId:e,label:t.label,previous:o,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[a]:H(o,a,n)}}})}let a=[...i.values()];return{clientPatch:{},hasClientWrite:!1,serverWrites:a,unavailableReason:a.length>0?null:`Connect the environments to reset these overrides.`}}function Ge(e,t,n){if(e===null)return t!=null&&g(n,t);if(Fe(e)&&!Array.isArray(t)&&!Array.isArray(n)){let r=(e,t)=>Fe(e)?e[t]:void 0;return Object.entries(e).some(([e,i])=>Ge(i,r(t,e),r(n,e)))}return!(typeof e==`string`&&typeof t==`string`?e.trim()===t:g(e,t))&&g(n,t)}function Ke(e,t){return t===void 0?[]:Object.entries(e.patch).flatMap(([n,r])=>Ge(r,e.previous[n],t[n])?[n]:[])}async function qe(e,t,n){e.hasClientWrite&&n(e.clientPatch);let r=await Promise.allSettled(e.serverWrites.map(({environmentId:e,patch:n})=>t({environmentId:e,input:{patch:n}}))),a=t=>{let n=r[t];return n?.status===`fulfilled`&&n.value._tag===`Success`&&Ke(e.serverWrites[t],n.value.value).length===0},o=e.serverWrites.flatMap((e,t)=>{if(a(t))return[];let n=r[t];if(n?.status===`fulfilled`&&n.value._tag===`Success`)return[{...e,message:`This environment does not support this setting. Update P4 Code on it.`}];let o=n?.status===`rejected`?n.reason:n?.status===`fulfilled`&&n.value.cause?i(n.value.cause):void 0;return[{...e,message:o instanceof Error?o.message:`The save failed. Try reconnecting and saving again.`}]}),s=e.serverWrites.filter((e,t)=>a(t));return{failedEnvironments:o,savedEnvironments:s,savedEnvironmentCount:s.length}}function Je(e){let t=e=>typeof e==`string`&&e.trim().length>0?e:void 0,n=t(e.project),r=t(e.machine),i=t(e.checkout);return{...n===void 0?{}:{project:n},...r===void 0?{}:{machine:r},...i===void 0?{}:{checkout:i}}}function Ye(e,t,n){let r=(e,t)=>({kind:`unavailable`,reason:e,label:`Unavailable selection`,message:t,members:[],environmentIds:[]});if(e.checkout&&!e.project)return r(`project-required`,`Select a project to choose one of its checkouts.`);let i=n.find(t=>t.environmentId===e.machine);if(e.machine&&!i)return r(`environment-missing`,`This environment is no longer available.`);if(e.project){let a=t.find(t=>t.projectKey===e.project);if(!a)return r(`project-missing`,`This project is no longer available.`);let o=a.memberProjects.filter(t=>(e.machine===void 0||t.environmentId===e.machine)&&(e.checkout===void 0||t.physicalProjectKey===e.checkout));if(o.length===0)return r(`checkout-missing`,e.checkout?`This checkout is no longer available in the selected project and environment.`:`This project has no checkout on this environment.`);if(e.checkout){let e=o[0],t=n.find(t=>t.environmentId===e.environmentId);if(!t)return r(`environment-missing`,`This checkout's environment is no longer available.`);let i=a.memberProjects.some(t=>t.environmentId===e.environmentId&&t.physicalProjectKey!==e.physicalProjectKey);return{kind:`checkout`,group:a,checkout:e,environmentId:e.environmentId,label:`${a.displayName} / ${t.label}${i?` · ${e.workspaceRoot}`:``}`,members:o,environmentIds:[e.environmentId]}}return{kind:`project`,group:a,environmentId:i?.environmentId??null,label:`${a.displayName} / ${i?.label??`All checkouts`}`,members:o,environmentIds:[...new Set(o.map(e=>e.environmentId))]}}return i?{kind:`environment`,environmentId:i.environmentId,label:i.label,members:[],environmentIds:[i.environmentId]}:{kind:`all`,label:`All environments`,members:[],environmentIds:n.map(e=>e.environmentId)}}function Xe(e,t){return t.some(t=>t.environmentId!==e.environmentId&&t.label===e.label)?`${e.label} · ${e.displayUrl??e.environmentId}`:e.label}function Ze(e,t){return e.machine??t??`all`}function Qe(e){return e.project??`all`}function $e(e,t){let n={};return e.project&&(n.project=e.project),t!==`all`&&(n.machine=t),n}function et(e,t){let n={};return t!==`all`&&(n.project=t),e.machine&&(n.machine=e.machine),n}function tt(e,t,n,r){if(e.machine||t.kind===`unavailable`)return e;let i=new Set(t.environmentIds),a=n.filter(e=>i.has(e.environmentId)),o=a.find(e=>e.environmentId===r)??a.find(e=>e.connection.phase===`connected`)??a[0];return o?{...e,machine:o.environmentId}:e}function nt(e){let t=(0,q.c)(5),n;t[0]!==e.kind||t[1]!==e.members?(n=e.kind===`project`||e.kind===`checkout`?e.members:[],t[0]=e.kind,t[1]=e.members,t[2]=n):n=t[2];let i=n,a;return t[3]===i?a=t[4]:(a=r(e=>{let t=new Map;for(let n of i){let r=e(De(n.environmentId,n.workspaceRoot,te));if(r.waiting)continue;let i=d(h(r)),a=e(Oe(n.environmentId,n.workspaceRoot,`p4.json`))?.data??e(Oe(n.environmentId,n.workspaceRoot,i?.relativePath??`p4.json`))?.data??i;t.set(n.physicalProjectKey,a===null||a.truncated?null:U(a.contents))}return t}),t[3]=i,t[4]=a),_(a)}function rt(e,t){let n=(0,q.c)(24),r=Z(),{environments:i}=L(),a=ue(),o;n[0]!==i||n[1]!==r||n[2]!==a||n[3]!==e||n[4]!==t?(o=t?tt(e,Ye(e,r,i),i,a):e,n[0]=i,n[1]=r,n[2]=a,n[3]=e,n[4]=t,n[5]=o):o=n[5];let s=o,c;n[6]!==i||n[7]!==r||n[8]!==s?(c=Ye(s,r,i),n[6]=i,n[7]=r,n[8]=s,n[9]=c):c=n[9];let l=c,u=nt(l),d,f,p;n[10]!==i||n[11]!==a||n[12]!==u||n[13]!==l?(d=Ie(l,i,a),p=Le(l,d.connectedEnvironments,u),f=p.find(e=>e.environmentId===d.environment?.environmentId)??p[0]??null,n[10]=i,n[11]=a,n[12]=u,n[13]=l,n[14]=d,n[15]=f,n[16]=p):(d=n[14],f=n[15],p=n[16]);let m=f,h;return n[17]!==r||n[18]!==l||n[19]!==s||n[20]!==d||n[21]!==m||n[22]!==p?(h={scope:l,groups:r,search:s,...d,targets:p,target:m},n[17]=r,n[18]=l,n[19]=s,n[20]=d,n[21]=m,n[22]=p,n[23]=h):h=n[23],h}var it=(0,X.createContext)(null);function at(e){let t=(0,q.c)(7),{search:n,onChange:r,children:i,singleEnvironment:a}=e,o=a!==void 0&&a,s=rt(n,o),c;t[0]!==r||t[1]!==s||t[2]!==o?(c={...s,singleEnvironment:o,selectScope:r},t[0]=r,t[1]=s,t[2]=o,t[3]=c):c=t[3];let l=c,u;return t[4]!==i||t[5]!==l?(u=(0,J.jsx)(it,{value:l,children:i}),t[4]=i,t[5]=l,t[6]=u):u=t[6],u}function ot(){return(0,X.useContext)(it)}function $(){let e=ot();if(e===null)throw Error(`Settings scope must be read inside SettingsScopeProvider.`);return e}var st=new Set([`/settings/appearance`,`/settings/snap-shot`,`/settings/connections`]);function ct(){let e=(0,q.c)(20),t=ot(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:lt},e[0]=n):n=e[0];let r=I(n),{environments:i}=L();if(t===null||st.has(r))return null;let a;e[1]!==i||e[2]!==t.groups||e[3]!==t.search||e[4]!==t.selectScope||e[5]!==t.singleEnvironment?(a={value:t.search,singleEnvironment:t.singleEnvironment,groups:t.groups,environments:i,onChange:t.selectScope},e[1]=i,e[2]=t.groups,e[3]=t.search,e[4]=t.selectScope,e[5]=t.singleEnvironment,e[6]=a):a=e[6];let o=a,s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(`span`,{className:`shrink-0`,children:`Applying settings for`}),e[7]=s):s=e[7];let c;e[8]===o?c=e[9]:(c=(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[s,(0,J.jsx)(ft,{...o})]}),e[8]=o,e[9]=c);let l=t.search.machine||t.scope.kind===`checkout`?`on`:`across`,u;e[10]===l?u=e[11]:(u=(0,J.jsx)(`span`,{className:`shrink-0`,children:l}),e[10]=l,e[11]=u);let d;e[12]===o?d=e[13]:(d=(0,J.jsx)(dt,{...o}),e[12]=o,e[13]=d);let f;e[14]!==u||e[15]!==d?(f=(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[u,d]}),e[14]=u,e[15]=d,e[16]=f):f=e[16];let p;return e[17]!==c||e[18]!==f?(p=(0,J.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 px-3 text-base text-muted-foreground sm:px-4`,children:[c,f]}),e[17]=c,e[18]=f,e[19]=p):p=e[19],p}function lt(e){return e.pathname}function ut(e){let t=(0,q.c)(13),{ariaLabel:n,icon:r,label:i,children:a}=e,o=`${n}: ${i}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(y,{tone:`picker`}),t[0]=s):s=t[0];let l;t[1]===i?l=t[2]:(l=(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[1]=i,t[2]=l);let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(C,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),t[3]=u):u=t[3];let d;t[4]!==r||t[5]!==o||t[6]!==l?(d=(0,J.jsxs)(k,{"aria-label":o,render:s,className:`min-w-0 max-w-72`,children:[r,l,u]}),t[4]=r,t[5]=o,t[6]=l,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=(0,J.jsx)(v,{align:`start`,children:a}),t[8]=a,t[9]=f);let p;return t[10]!==d||t[11]!==f?(p=(0,J.jsxs)(c,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function dt(e){let t=(0,q.c)(31),{value:r,groups:i,environments:a,onChange:o,singleEnvironment:c}=e,l;if(t[0]!==a||t[1]!==i||t[2]!==r){let e=Ye(r,i,a);l=Ze(r,e.kind===`checkout`?e.environmentId:null),t[0]=a,t[1]=i,t[2]=r,t[3]=l}else l=t[3];let u=l,d,f,p,h;if(t[4]!==u||t[5]!==a||t[6]!==c){let e;t[11]===u?e=t[12]:(e=e=>e.environmentId===u,t[11]=u,t[12]=e);let n=a.find(e);d=ut,f=`Environment scope`,p=n?(0,J.jsx)(G,{"aria-hidden":!0,kind:F(n.serverConfig),className:`size-3.5 shrink-0`}):null,h=n?Xe(n,a):u===`all`?c?`No environments`:`All environments`:`Unavailable environment`,t[4]=u,t[5]=a,t[6]=c,t[7]=d,t[8]=f,t[9]=p,t[10]=h}else d=t[7],f=t[8],p=t[9],h=t[10];let g;t[13]!==o||t[14]!==r?(g=e=>{typeof e==`string`&&o($e(r,e))},t[13]=o,t[14]=r,t[15]=g):g=t[15];let _;t[16]===c?_=t[17]:(_=c?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(n,{value:`all`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All environments`}),(0,J.jsx)(x,{})]})}),(0,J.jsx)(ne,{})]}),t[16]=c,t[17]=_);let v;t[18]===a?v=t[19]:(v=a.map(e=>(0,J.jsx)(n,{value:e.environmentId,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(G,{"aria-hidden":!0,kind:F(e.serverConfig),className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Xe(e,a)}),e.connection.phase===`connected`?null:(0,J.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`Offline`}),(0,J.jsx)(x,{})]})},e.environmentId)),t[18]=a,t[19]=v);let y;t[20]!==u||t[21]!==g||t[22]!==_||t[23]!==v?(y=(0,J.jsxs)(m,{value:u,onValueChange:g,children:[_,v]}),t[20]=u,t[21]=g,t[22]=_,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==d||t[26]!==f||t[27]!==p||t[28]!==h||t[29]!==y?(b=(0,J.jsx)(d,{ariaLabel:f,icon:p,label:h,children:y}),t[25]=d,t[26]=f,t[27]=p,t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function ft(e){let t=(0,q.c)(24),{value:r,groups:i,onChange:a}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.projectKey===r.project,t[3]=r,t[4]=e),o=i.find(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]===s?c=t[6]:(c=s?(0,J.jsx)(Ee,{project:s,className:`size-3.5 shrink-0`}):null,t[5]=s,t[6]=c);let l=s?.displayName??(r.project?`Unavailable project`:`All projects`),u;t[7]===r?u=t[8]:(u=Qe(r),t[7]=r,t[8]=u);let d;t[9]!==a||t[10]!==r?(d=e=>{typeof e==`string`&&a(et(r,e))},t[9]=a,t[10]=r,t[11]=d):d=t[11];let f,p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(n,{value:`all`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All projects`}),(0,J.jsx)(x,{})]})}),p=(0,J.jsx)(ne,{}),t[12]=f,t[13]=p):(f=t[12],p=t[13]);let h;t[14]===i?h=t[15]:(h=i.map(pt),t[14]=i,t[15]=h);let g;t[16]!==u||t[17]!==d||t[18]!==h?(g=(0,J.jsxs)(m,{value:u,onValueChange:d,children:[f,p,h]}),t[16]=u,t[17]=d,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==c||t[21]!==l||t[22]!==g?(_=(0,J.jsx)(ut,{ariaLabel:`Project scope`,icon:c,label:l,children:g}),t[20]=c,t[21]=l,t[22]=g,t[23]=_):_=t[23],_}function pt(e){return(0,J.jsx)(n,{value:e.projectKey,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(Ee,{project:e,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.displayName}),(0,J.jsx)(x,{})]})},e.projectKey)}function mt(e){let t=(0,q.c)(6),{target:n}=$(),r=R(),i=n?.settings??b;ye(n?.environmentId??null,n?.settings??null);let a;t[0]!==r||t[1]!==i?(a=ve(i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;return t[3]!==e||t[4]!==o?(s=e?e(o):o,t[3]=e,t[4]=o,t[5]=s):s=t[5],s}function ht(e){let t=(0,q.c)(3),{targets:n}=$(),r;return t[0]!==e||t[1]!==n?(r=Re(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function gt(e){let t=(0,q.c)(3),{targets:n}=$(),r;return t[0]!==e||t[1]!==n?(r=ze(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function _t(){let e=(0,q.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={reportFailure:!1},e[0]=t):t=e[0];let n=he(de.updateSettings,t),r;return e[1]===n?r=e[2]:(r=e=>{if(e.unavailableReason){ae.add({type:`warning`,title:`Setting not saved`,description:e.unavailableReason});return}qe(e,async e=>{let t=o(e.input.patch).find(t=>!pe(e.environmentId,t));return t?ee(S(new E({requiredScope:t,message:`This connection lacks permission to change these settings.`}))):n(e)},ge).then(vt)},e[1]=n,e[2]=r),r}function vt(e){let{failedEnvironments:t,savedEnvironments:n,savedEnvironmentCount:r}=e;t.length!==0&&ae.add({type:`error`,title:r>0?`Setting saved on some environments`:`Setting not saved`,description:[...t.map(bt),...r>0?[`Saved on ${n.map(yt).join(`, `)}.`]:[]].join(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,Aw as i,C_ as a,Ch as o,Ff as s,Gn as c,Mf as l,NE as u,NT as d,Om as f,Oy as p,Qn as m,Ss as h,XT as g,Yo as _,Zn as v,cr as y,dh as b,er as x,fw as S,gd as C,hd as w,hh as T,k_ as E,lE as D,mh as O,ms as ee,nl as te,or as k,rl as A,sr as j,t as M,th as N,tr as ne,vh as P,yl as F}from"./utils-BAPnqm16.js";import{C as re}from"./entities-DCbEYTvn.js";import{t as ie}from"./useNavigate-Dhy_1-Mg.js";import{t as I}from"./useLocation-Ccsih1eo.js";import{i as ae}from"./toast-CN7Jd-pG.js";import{a as oe,n as se,t as ce}from"./tooltip-DaSC-3cL.js";import{a as L,o as le,s as ue}from"./environments-iW64jjyO.js";import{f as de}from"./server-CoH7V4JL.js";import{i as fe,n as pe,o as me}from"./session-Bo2ZSprC.js";import{t as he}from"./use-atom-command-GpCw1tWF.js";import{a as ge,g as _e,i as ve,p as ye,s as R,t as be}from"./useSettings-CKA-LDDj.js";import{m as xe}from"./queries-DCKH7ltg.js";import{o as Se}from"./threadSort-Cn23YHH2.js";import{i as Ce,o as we,t as Te}from"./popover-B1MF5i1c.js";import{t as Ee}from"./ProjectFavicon-B5C6TpKj.js";import{r as De,s as Oe}from"./projectFilesQueryState-CGllQp_V.js";import{t as ke}from"./pullRequestDetail.logic-CkxKh0fV.js";import{a as z,f as B,i as V,n as H,t as U}from"./p4ProjectFile--u7SOSK5.js";import{r as W}from"./sidebarProjectGrouping-DrnsFA8t.js";import{n as G}from"./EnvironmentMachineIcon-BMWCDR69.js";import{t as K}from"./WorkspacePageContainer-DwN_ETF0.js";var q=u(),J=e(D(),1);function Y(e){let t=(0,q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({variant:i,divided:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`grouped`:i,s=a===void 0||a,c=o===`grouped`?`rounded-xl border border-border/60 bg-card/40 shadow-xs/5`:`space-y-1`,l=o===`grouped`&&s&&`[&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none`,u;t[5]!==n||t[6]!==c||t[7]!==l?(u=M(`relative overflow-visible text-foreground`,c,l,n),t[5]=n,t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==u?(d=(0,J.jsx)(`div`,{...r,className:u}),t[9]=r,t[10]=u,t[11]=d):d=t[11],d}var X=e(t(),1);function Z(){let e=(0,q.c)(5),t=re(),n=R(B),r=ue(),{environments:i}=L(),a;if(e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==n){let o=new Map(i.map(je));a=W({projects:t,settings:n,primaryEnvironmentId:r,resolveEnvironmentLabel:e=>o.get(e)??null}).sort(Ae),e[0]=i,e[1]=r,e[2]=t,e[3]=n,e[4]=a}else a=e[4];return a}function Ae(e,t){return e.displayName.localeCompare(t.displayName)}function je(e){return[e.environmentId,e.label]}var Me=new Set(Object.keys(T.fields)),Ne=new Set(Object.keys(N.fields)),Pe=new Set(O);function Q(e){return Pe.has(e)}function Fe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ie(e,t,n){let r=new Set(e.environmentIds),i=t.filter(e=>r.has(e.environmentId)),a=i.filter(e=>e.connection.phase===`connected`&&e.serverConfig!==null);return{environments:i,connectedEnvironments:a,environment:a.find(e=>e.environmentId===n)??a[0]??null}}function Le(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e]));return e.kind===`project`||e.kind===`checkout`?e.members.flatMap(e=>{let t=r.get(e.environmentId);if(!t?.serverConfig)return[];let i=n?.get(e.physicalProjectKey),a=i===void 0?V(t.serverConfig.settings,e.id):V(t.serverConfig.settings,e.id,null,i);return[{environmentId:e.environmentId,label:t.label,projectId:e.id,settings:a.settings,sources:a.sources}]}):t.flatMap(e=>e.serverConfig?[{environmentId:e.environmentId,label:e.label,projectId:null,settings:e.serverConfig.settings,sources:V(e.serverConfig.settings,null).sources}]:[])}function Re(e,t){let n=e[0];return n!==void 0&&e.some(e=>t.some(t=>!g(n.settings[t],e.settings[t])))}function ze(e,t){let n=t.filter(Q);if(n.length===0||e.length===0)return`environment`;let r=new Set(e.flatMap(e=>n.map(t=>e.sources[t])));return r.size>1?`mixed`:r.has(`project`)?`project`:r.has(`p4.json`)?`p4.json`:`environment`}function Be(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e])),i=new Map;for(let t of e.members){let e=r.get(t.environmentId);if(!e?.serverConfig||e.connection.phase!==`connected`||e.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0)continue;let a=e.serverConfig.settings,o=n(a.projectSettingsOverrides[t.id]??{},a,t.id),s=i.get(t.environmentId);i.set(t.environmentId,{environmentId:t.environmentId,label:e.label,previous:a,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[t.id]:o}}})}return[...i.values()]}function Ve(e,t,n){let r=Object.fromEntries(Object.entries(n).filter(([e])=>Ne.has(e)&&!Me.has(e))),i=Object.fromEntries(Object.entries(n).filter(([e])=>Me.has(e))),a=Object.keys(i),{connectedEnvironments:o}=Ie(e,t,null),s=e.kind===`project`||e.kind===`checkout`,c=s?a.filter(e=>!Q(e)):[],l=a.length===0?[]:s?c.length>0?[]:Be(e,t,(e,t,n)=>{let r=V(t,n).settings,a={...e};for(let[e,o]of Object.entries(i)){if(e===`worktreeCleanup`&&i.worktreeCleanup?.mode===`custom`){a[e]={mode:`custom`,rules:{...z(t,n),...i.worktreeCleanup.rules}};continue}if(o===null&&!P(e)){delete a[e];continue}let s=r[e];a[e]=Fe(o)&&Fe(s)?{...s,...o}:o}return a}):e.kind===`all`||e.kind===`environment`?o.flatMap(e=>{let t=e.serverConfig?.settings;return t?[{environmentId:e.environmentId,label:e.label,previous:t,patch:t.worktreeCleanup!=null&&i.storageCleanup&&Object.keys(i.storageCleanup).some(e=>e.startsWith(`worktree`))?{...i,worktreeCleanup:{mode:`custom`,rules:{...z(t,null),...Object.fromEntries(Object.entries(i.storageCleanup).filter(([e])=>e.startsWith(`worktree`)))}}}:i}]:[]}):[],u=Object.keys(r).length>0;return{clientPatch:r,hasClientWrite:u,serverWrites:l,unavailableReason:u||l.length>0||Object.keys(n).length===0?null:e.kind===`unavailable`?e.message:c.length>0?`This setting is environment-wide and cannot be overridden by a project.`:s?`Connect the selected checkouts, or update their environments, to save a project override.`:`Connect ${e.kind===`environment`?e.label:`an environment`} to save this setting.`}}function He(e,t,n){let r=e.kind===`project`||e.kind===`checkout`?Be(e,t,(e,t,r)=>H(t,r,n)):[];return{clientPatch:{},hasClientWrite:!1,serverWrites:r,unavailableReason:r.length>0?null:`Connect the selected checkouts, or update their environments, to reset this override.`}}function Ue(e,t){let n=t.filter(Q);return n.length===0?[]:e.flatMap(e=>{let t=e.serverConfig?.settings.projectSettingsOverrides;return t?Object.entries(t).flatMap(([t,r])=>n.some(e=>Object.hasOwn(r,e))?[{environmentId:e.environmentId,projectId:t}]:[]):[]})}function We(e,t,n){let r=new Map(e.map(e=>[e.environmentId,e])),i=new Map;for(let{environmentId:e,projectId:a}of t){let t=r.get(e);if(!t?.serverConfig||t.connection.phase!==`connected`)continue;let o=t.serverConfig.settings,s=i.get(e);i.set(e,{environmentId:e,label:t.label,previous:o,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[a]:H(o,a,n)}}})}let a=[...i.values()];return{clientPatch:{},hasClientWrite:!1,serverWrites:a,unavailableReason:a.length>0?null:`Connect the environments to reset these overrides.`}}function Ge(e,t,n){if(e===null)return t!=null&&g(n,t);if(Fe(e)&&!Array.isArray(t)&&!Array.isArray(n)){let r=(e,t)=>Fe(e)?e[t]:void 0;return Object.entries(e).some(([e,i])=>Ge(i,r(t,e),r(n,e)))}return!(typeof e==`string`&&typeof t==`string`?e.trim()===t:g(e,t))&&g(n,t)}function Ke(e,t){return t===void 0?[]:Object.entries(e.patch).flatMap(([n,r])=>Ge(r,e.previous[n],t[n])?[n]:[])}async function qe(e,t,n){e.hasClientWrite&&n(e.clientPatch);let r=await Promise.allSettled(e.serverWrites.map(({environmentId:e,patch:n})=>t({environmentId:e,input:{patch:n}}))),a=t=>{let n=r[t];return n?.status===`fulfilled`&&n.value._tag===`Success`&&Ke(e.serverWrites[t],n.value.value).length===0},o=e.serverWrites.flatMap((e,t)=>{if(a(t))return[];let n=r[t];if(n?.status===`fulfilled`&&n.value._tag===`Success`)return[{...e,message:`This environment does not support this setting. Update P4 Code on it.`}];let o=n?.status===`rejected`?n.reason:n?.status===`fulfilled`&&n.value.cause?i(n.value.cause):void 0;return[{...e,message:o instanceof Error?o.message:`The save failed. Try reconnecting and saving again.`}]}),s=e.serverWrites.filter((e,t)=>a(t));return{failedEnvironments:o,savedEnvironments:s,savedEnvironmentCount:s.length}}function Je(e){let t=e=>typeof e==`string`&&e.trim().length>0?e:void 0,n=t(e.project),r=t(e.machine),i=t(e.checkout);return{...n===void 0?{}:{project:n},...r===void 0?{}:{machine:r},...i===void 0?{}:{checkout:i}}}function Ye(e,t,n){let r=(e,t)=>({kind:`unavailable`,reason:e,label:`Unavailable selection`,message:t,members:[],environmentIds:[]});if(e.checkout&&!e.project)return r(`project-required`,`Select a project to choose one of its checkouts.`);let i=n.find(t=>t.environmentId===e.machine);if(e.machine&&!i)return r(`environment-missing`,`This environment is no longer available.`);if(e.project){let a=t.find(t=>t.projectKey===e.project);if(!a)return r(`project-missing`,`This project is no longer available.`);let o=a.memberProjects.filter(t=>(e.machine===void 0||t.environmentId===e.machine)&&(e.checkout===void 0||t.physicalProjectKey===e.checkout));if(o.length===0)return r(`checkout-missing`,e.checkout?`This checkout is no longer available in the selected project and environment.`:`This project has no checkout on this environment.`);if(e.checkout){let e=o[0],t=n.find(t=>t.environmentId===e.environmentId);if(!t)return r(`environment-missing`,`This checkout's environment is no longer available.`);let i=a.memberProjects.some(t=>t.environmentId===e.environmentId&&t.physicalProjectKey!==e.physicalProjectKey);return{kind:`checkout`,group:a,checkout:e,environmentId:e.environmentId,label:`${a.displayName} / ${t.label}${i?` · ${e.workspaceRoot}`:``}`,members:o,environmentIds:[e.environmentId]}}return{kind:`project`,group:a,environmentId:i?.environmentId??null,label:`${a.displayName} / ${i?.label??`All checkouts`}`,members:o,environmentIds:[...new Set(o.map(e=>e.environmentId))]}}return i?{kind:`environment`,environmentId:i.environmentId,label:i.label,members:[],environmentIds:[i.environmentId]}:{kind:`all`,label:`All environments`,members:[],environmentIds:n.map(e=>e.environmentId)}}function Xe(e,t){return t.some(t=>t.environmentId!==e.environmentId&&t.label===e.label)?`${e.label} · ${e.displayUrl??e.environmentId}`:e.label}function Ze(e,t){return e.machine??t??`all`}function Qe(e){return e.project??`all`}function $e(e,t){let n={};return e.project&&(n.project=e.project),t!==`all`&&(n.machine=t),n}function et(e,t){let n={};return t!==`all`&&(n.project=t),e.machine&&(n.machine=e.machine),n}function tt(e,t,n,r){if(e.machine||t.kind===`unavailable`)return e;let i=new Set(t.environmentIds),a=n.filter(e=>i.has(e.environmentId)),o=a.find(e=>e.environmentId===r)??a.find(e=>e.connection.phase===`connected`)??a[0];return o?{...e,machine:o.environmentId}:e}function nt(e){let t=(0,q.c)(5),n;t[0]!==e.kind||t[1]!==e.members?(n=e.kind===`project`||e.kind===`checkout`?e.members:[],t[0]=e.kind,t[1]=e.members,t[2]=n):n=t[2];let i=n,a;return t[3]===i?a=t[4]:(a=r(e=>{let t=new Map;for(let n of i){let r=e(De(n.environmentId,n.workspaceRoot,te));if(r.waiting)continue;let i=d(h(r)),a=e(Oe(n.environmentId,n.workspaceRoot,`p4.json`))?.data??e(Oe(n.environmentId,n.workspaceRoot,i?.relativePath??`p4.json`))?.data??i;t.set(n.physicalProjectKey,a===null||a.truncated?null:U(a.contents))}return t}),t[3]=i,t[4]=a),_(a)}function rt(e,t){let n=(0,q.c)(24),r=Z(),{environments:i}=L(),a=ue(),o;n[0]!==i||n[1]!==r||n[2]!==a||n[3]!==e||n[4]!==t?(o=t?tt(e,Ye(e,r,i),i,a):e,n[0]=i,n[1]=r,n[2]=a,n[3]=e,n[4]=t,n[5]=o):o=n[5];let s=o,c;n[6]!==i||n[7]!==r||n[8]!==s?(c=Ye(s,r,i),n[6]=i,n[7]=r,n[8]=s,n[9]=c):c=n[9];let l=c,u=nt(l),d,f,p;n[10]!==i||n[11]!==a||n[12]!==u||n[13]!==l?(d=Ie(l,i,a),p=Le(l,d.connectedEnvironments,u),f=p.find(e=>e.environmentId===d.environment?.environmentId)??p[0]??null,n[10]=i,n[11]=a,n[12]=u,n[13]=l,n[14]=d,n[15]=f,n[16]=p):(d=n[14],f=n[15],p=n[16]);let m=f,h;return n[17]!==r||n[18]!==l||n[19]!==s||n[20]!==d||n[21]!==m||n[22]!==p?(h={scope:l,groups:r,search:s,...d,targets:p,target:m},n[17]=r,n[18]=l,n[19]=s,n[20]=d,n[21]=m,n[22]=p,n[23]=h):h=n[23],h}var it=(0,X.createContext)(null);function at(e){let t=(0,q.c)(7),{search:n,onChange:r,children:i,singleEnvironment:a}=e,o=a!==void 0&&a,s=rt(n,o),c;t[0]!==r||t[1]!==s||t[2]!==o?(c={...s,singleEnvironment:o,selectScope:r},t[0]=r,t[1]=s,t[2]=o,t[3]=c):c=t[3];let l=c,u;return t[4]!==i||t[5]!==l?(u=(0,J.jsx)(it,{value:l,children:i}),t[4]=i,t[5]=l,t[6]=u):u=t[6],u}function ot(){return(0,X.useContext)(it)}function $(){let e=ot();if(e===null)throw Error(`Settings scope must be read inside SettingsScopeProvider.`);return e}var st=new Set([`/settings/appearance`,`/settings/snap-shot`,`/settings/connections`]);function ct(){let e=(0,q.c)(20),t=ot(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:lt},e[0]=n):n=e[0];let r=I(n),{environments:i}=L();if(t===null||st.has(r))return null;let a;e[1]!==i||e[2]!==t.groups||e[3]!==t.search||e[4]!==t.selectScope||e[5]!==t.singleEnvironment?(a={value:t.search,singleEnvironment:t.singleEnvironment,groups:t.groups,environments:i,onChange:t.selectScope},e[1]=i,e[2]=t.groups,e[3]=t.search,e[4]=t.selectScope,e[5]=t.singleEnvironment,e[6]=a):a=e[6];let o=a,s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(`span`,{className:`shrink-0`,children:`Applying settings for`}),e[7]=s):s=e[7];let c;e[8]===o?c=e[9]:(c=(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[s,(0,J.jsx)(ft,{...o})]}),e[8]=o,e[9]=c);let l=t.search.machine||t.scope.kind===`checkout`?`on`:`across`,u;e[10]===l?u=e[11]:(u=(0,J.jsx)(`span`,{className:`shrink-0`,children:l}),e[10]=l,e[11]=u);let d;e[12]===o?d=e[13]:(d=(0,J.jsx)(dt,{...o}),e[12]=o,e[13]=d);let f;e[14]!==u||e[15]!==d?(f=(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[u,d]}),e[14]=u,e[15]=d,e[16]=f):f=e[16];let p;return e[17]!==c||e[18]!==f?(p=(0,J.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 px-3 text-base text-muted-foreground sm:px-4`,children:[c,f]}),e[17]=c,e[18]=f,e[19]=p):p=e[19],p}function lt(e){return e.pathname}function ut(e){let t=(0,q.c)(13),{ariaLabel:n,icon:r,label:i,children:a}=e,o=`${n}: ${i}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(y,{tone:`picker`}),t[0]=s):s=t[0];let l;t[1]===i?l=t[2]:(l=(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[1]=i,t[2]=l);let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(C,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),t[3]=u):u=t[3];let d;t[4]!==r||t[5]!==o||t[6]!==l?(d=(0,J.jsxs)(k,{"aria-label":o,render:s,className:`min-w-0 max-w-72`,children:[r,l,u]}),t[4]=r,t[5]=o,t[6]=l,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=(0,J.jsx)(v,{align:`start`,children:a}),t[8]=a,t[9]=f);let p;return t[10]!==d||t[11]!==f?(p=(0,J.jsxs)(c,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function dt(e){let t=(0,q.c)(31),{value:r,groups:i,environments:a,onChange:o,singleEnvironment:c}=e,l;if(t[0]!==a||t[1]!==i||t[2]!==r){let e=Ye(r,i,a);l=Ze(r,e.kind===`checkout`?e.environmentId:null),t[0]=a,t[1]=i,t[2]=r,t[3]=l}else l=t[3];let u=l,d,f,p,h;if(t[4]!==u||t[5]!==a||t[6]!==c){let e;t[11]===u?e=t[12]:(e=e=>e.environmentId===u,t[11]=u,t[12]=e);let n=a.find(e);d=ut,f=`Environment scope`,p=n?(0,J.jsx)(G,{"aria-hidden":!0,kind:F(n.serverConfig),className:`size-3.5 shrink-0`}):null,h=n?Xe(n,a):u===`all`?c?`No environments`:`All environments`:`Unavailable environment`,t[4]=u,t[5]=a,t[6]=c,t[7]=d,t[8]=f,t[9]=p,t[10]=h}else d=t[7],f=t[8],p=t[9],h=t[10];let g;t[13]!==o||t[14]!==r?(g=e=>{typeof e==`string`&&o($e(r,e))},t[13]=o,t[14]=r,t[15]=g):g=t[15];let _;t[16]===c?_=t[17]:(_=c?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(n,{value:`all`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All environments`}),(0,J.jsx)(x,{})]})}),(0,J.jsx)(ne,{})]}),t[16]=c,t[17]=_);let v;t[18]===a?v=t[19]:(v=a.map(e=>(0,J.jsx)(n,{value:e.environmentId,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(G,{"aria-hidden":!0,kind:F(e.serverConfig),className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Xe(e,a)}),e.connection.phase===`connected`?null:(0,J.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`Offline`}),(0,J.jsx)(x,{})]})},e.environmentId)),t[18]=a,t[19]=v);let y;t[20]!==u||t[21]!==g||t[22]!==_||t[23]!==v?(y=(0,J.jsxs)(m,{value:u,onValueChange:g,children:[_,v]}),t[20]=u,t[21]=g,t[22]=_,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==d||t[26]!==f||t[27]!==p||t[28]!==h||t[29]!==y?(b=(0,J.jsx)(d,{ariaLabel:f,icon:p,label:h,children:y}),t[25]=d,t[26]=f,t[27]=p,t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function ft(e){let t=(0,q.c)(24),{value:r,groups:i,onChange:a}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.projectKey===r.project,t[3]=r,t[4]=e),o=i.find(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]===s?c=t[6]:(c=s?(0,J.jsx)(Ee,{project:s,className:`size-3.5 shrink-0`}):null,t[5]=s,t[6]=c);let l=s?.displayName??(r.project?`Unavailable project`:`All projects`),u;t[7]===r?u=t[8]:(u=Qe(r),t[7]=r,t[8]=u);let d;t[9]!==a||t[10]!==r?(d=e=>{typeof e==`string`&&a(et(r,e))},t[9]=a,t[10]=r,t[11]=d):d=t[11];let f,p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(n,{value:`all`,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All projects`}),(0,J.jsx)(x,{})]})}),p=(0,J.jsx)(ne,{}),t[12]=f,t[13]=p):(f=t[12],p=t[13]);let h;t[14]===i?h=t[15]:(h=i.map(pt),t[14]=i,t[15]=h);let g;t[16]!==u||t[17]!==d||t[18]!==h?(g=(0,J.jsxs)(m,{value:u,onValueChange:d,children:[f,p,h]}),t[16]=u,t[17]=d,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==c||t[21]!==l||t[22]!==g?(_=(0,J.jsx)(ut,{ariaLabel:`Project scope`,icon:c,label:l,children:g}),t[20]=c,t[21]=l,t[22]=g,t[23]=_):_=t[23],_}function pt(e){return(0,J.jsx)(n,{value:e.projectKey,closeOnClick:!0,children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(Ee,{project:e,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.displayName}),(0,J.jsx)(x,{})]})},e.projectKey)}function mt(e){let t=(0,q.c)(6),{target:n}=$(),r=R(),i=n?.settings??b;ye(n?.environmentId??null,n?.settings??null);let a;t[0]!==r||t[1]!==i?(a=ve(i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;return t[3]!==e||t[4]!==o?(s=e?e(o):o,t[3]=e,t[4]=o,t[5]=s):s=t[5],s}function ht(e){let t=(0,q.c)(3),{targets:n}=$(),r;return t[0]!==e||t[1]!==n?(r=Re(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function gt(e){let t=(0,q.c)(3),{targets:n}=$(),r;return t[0]!==e||t[1]!==n?(r=ze(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function _t(){let e=(0,q.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={reportFailure:!1},e[0]=t):t=e[0];let n=he(de.updateSettings,t),r;return e[1]===n?r=e[2]:(r=e=>{if(e.unavailableReason){ae.add({type:`warning`,title:`Setting not saved`,description:e.unavailableReason});return}qe(e,async e=>{let t=o(e.input.patch).find(t=>!pe(e.environmentId,t));return t?ee(S(new E({requiredScope:t,message:`This connection lacks permission to change these settings.`}))):n(e)},ge).then(vt)},e[1]=n,e[2]=r),r}function vt(e){let{failedEnvironments:t,savedEnvironments:n,savedEnvironmentCount:r}=e;t.length!==0&&ae.add({type:`error`,title:r>0?`Setting saved on some environments`:`Setting not saved`,description:[...t.map(bt),...r>0?[`Saved on ${n.map(yt).join(`, `)}.`]:[]].join(`
2
2
  `)})}function yt(e){let{label:t}=e;return t}function bt(e){let{label:t,message:n}=e;return`Could not save on ${t}: ${n}`}function xt(){let e=(0,q.c)(4),{scope:t,environments:n}=$(),r=_t(),i;return e[0]!==n||e[1]!==r||e[2]!==t?(i=e=>r(Ve(t,n,e)),e[0]=n,e[1]=r,e[2]=t,e[3]=i):i=e[3],i}function St(){let e=(0,q.c)(3),t=ot(),n=_t(),r;return e[0]!==t||e[1]!==n?(r=e=>{t!==null&&n(He(t.scope,t.environments,e))},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function Ct(){let e=(0,q.c)(3),t=ot(),n=_t(),r;return e[0]!==t||e[1]!==n?(r=(e,r)=>{t!==null&&n(We(t.environments,e,r))},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function wt(){let e=(0,q.c)(3),{connectedEnvironments:t}=$(),n=me(t,a),r;return e[0]!==t||e[1]!==n?(r=t.length>0&&t.every(e=>n.has(e.environmentId)),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}p([`auto`,`local`,`worktree`]);function Tt(e){return e!==`local`}var Et=new Set([`local`,`local environment`]);function Dt(e){let t=e?.trim();return t&&t.length>0?t:null}function Ot(e){let t=Dt(e.runtimeLabel),n=Dt(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!Et.has(e.toLowerCase()):!1)??`This device`:t??n??e.environmentId}function kt(e){return e.canPickEnvironment?!0:e.activeEnvironment!==null&&!e.activeEnvironment.isPrimary}function At(e){return e.hasActiveProject&&(e.isDraftHeroState||e.persistInActiveThreads)&&(e.isGitRepo||e.showEnvironmentIndicator||e.hostsRestingComposerControls)}var jt=16;function Mt(e){return e.compact?e.neededWidth>e.availableWidth-jt:e.neededWidth>e.availableWidth}function Nt(e){return e===`worktree`?`New worktree`:e===`auto`?`Auto`:`Current checkout`}var Pt={recursive:`Recursive`,"top-level":`Top level only`,none:`Skip`};function Ft(e){return e?`Current worktree`:Nt(`local`)}function It(e,t){return e?`Worktree`:t===`worktree`?Nt(`worktree`):`Local checkout`}function Lt(e){let t=null;for(let n of e.threads){if(!n.worktreePath||n.worktreePath===e.currentWorktreePath||(n.archivedAt??null)!==null)continue;let r=Se(n.updatedAt);r!==null&&(t===null||r>t.updatedAt)&&(t={branch:n.branch,worktreePath:n.worktreePath,updatedAt:r})}return t===null?null:{branch:t.branch,worktreePath:t.worktreePath}}function Rt(e){return e.branch?`Previous worktree (${e.branch})`:`Previous worktree`}function zt(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r,preparingWorktree:i}=e;return n?t||i?`worktree`:`local`:t?`local`:r??`local`}function Bt(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t?`worktree`:Tt(r)&&!n?r:`local`}function Vt(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return Tt(t)&&!n?r??i:i??r}function Ht(e){let{activeWorktreePath:t,effectiveEnvMode:n,resolvedActiveBranch:r,resolvedActiveBranchIsRemote:i,startFromOrigin:a}=e;return r?Tt(n)&&!t?`From ${a&&i===!1?`origin/${r}`:r}`:r:`Select ref`}function Ut(e){return e.activeThreadBranch===e.resolvedActiveBranch?e.activeThreadBranch:null}function Wt(e){let{effectiveEnvMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t!==`local`||n!==null||!r||!i||r===i?null:{threadBranch:r,currentBranch:i}}function Gt(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function Kt(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=t.toLowerCase();if(a.includes(n))return!0;let o=xe(n);return o.length>0&&o!==n&&a.includes(o)}var qt={repo_conventions:`Repository conventions`,conventional_commits:`Conventional Commits`,custom:`Custom instructions`};function Jt(e,t){if(t==null)return e===`pullRequestMergeMethod`?`Last selected`:e===`sidebarAutoSettleAfterDays`?`Never`:e===`defaultModelSelection`?`Automatic`:e===`sourceControlWriterModelSelection`?`Text generation model`:e===`reviewGuideModelSelection`?`Source control writer model`:e===`defaultThreadEnvMode`||e===`worktreeSubmodules`?`Inherit`:`Not set`;if(typeof t==`boolean`)return t?`On`:`Off`;if(typeof t==`number`)return e===`sidebarAutoSettleAfterDays`?`${t} ${t===1?`day`:`days`}`:String(t);if(typeof t==`string`)return e===`defaultThreadEnvMode`&&(t===`auto`||t===`local`||t===`worktree`)?Nt(t):e===`worktreeSubmodules`&&t in Pt?Pt[t]:e===`pullRequestMergeMethod`&&t in ke?ke[t]:t===``?`Empty`:t;if(Array.isArray(t))return`${t.length} ${t.length===1?`item`:`items`}`;if(typeof t==`object`){if(`model`in t&&typeof t.model==`string`)return t.model;if(`mode`in t&&typeof t.mode==`string`)return qt[t.mode]??t.mode}return`Custom`}function Yt(e,t,n){let r=t[n],i=Q(n)?e.sources[n]:`environment`,a=!g(r,b[n]),o=Xt(n),s=[];e.projectId!==null&&Q(n)&&s.push({key:`project`,label:`Project`,value:i===`project`?Jt(n,e.settings[n]):`Inherits`,effective:i===`project`,set:i===`project`}),s.push({key:`environment`,label:e.label,value:a?Jt(n,r):`Inherits`,effective:i===`environment`&&a,set:a}),o&&e.projectId!==null&&s.push({key:`p4.json`,label:`p4.json`,value:i===`p4.json`?Jt(n,e.settings[n]):`Inherits`,effective:i===`p4.json`,set:i===`p4.json`});let c=o?A[n].builtIn:b[n];return s.push({key:`built-in`,label:`Default`,value:Jt(n,c),effective:i===`environment`&&!a,set:!0}),s}function Xt(e){return Object.hasOwn(A,e)}function Zt(e){let t=(0,q.c)(52),{state:n,summary:r,targets:i,environments:a,keys:o,overridingProjects:c,onClearOverrides:l}=e,u;t[0]===c?u=t[1]:(u=c===void 0?[]:c,t[0]=c,t[1]=u);let d=u,f=o[0];if(!f||i.length===0)return null;let p=d.length>0?`${r} · ${d.length} project ${d.length===1?`override`:`overrides`}`:r,m,h,g,_,v,b,x,S;if(t[2]!==a||t[3]!==f||t[4]!==l||t[5]!==p||t[6]!==d||t[7]!==n||t[8]!==i){let e;t[17]!==a||t[18]!==f?(e=e=>{let t=a.find(t=>t.environmentId===e.environmentId);return t?.serverConfig?[{target:e,environment:{...t,serverConfig:t.serverConfig},machine:F(t.serverConfig),layers:Yt(e,t.serverConfig.settings,f)}]:[]},t[17]=a,t[18]=f,t[19]=e):e=t[19];let r=i.flatMap(e);h=Te;let o=`${p}. Show where this value comes from`,c;t[20]===o?c=t[21]:(c=(0,J.jsx)(we,{render:(0,J.jsx)(j,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":o})}),t[20]=o,t[21]=c);let u=n===`overridden`&&`text-primary`,C=n===`mixed`&&`text-warning`,w;t[22]!==u||t[23]!==C?(w=M(`size-3`,u,C),t[22]=u,t[23]=C,t[24]=w):w=t[24];let T;t[25]===w?T=t[26]:(T=(0,J.jsx)(s,{className:w}),t[25]=w,t[26]=T);let E;t[27]!==c||t[28]!==T?(E=(0,J.jsx)(oe,{render:c,children:T}),t[27]=c,t[28]=T,t[29]=E):E=t[29];let D;t[30]===p?D=t[31]:(D=(0,J.jsx)(se,{side:`top`,children:p}),t[30]=p,t[31]=D),t[32]!==E||t[33]!==D?(S=(0,J.jsxs)(ce,{children:[E,D]}),t[32]=E,t[33]=D,t[34]=S):S=t[34],m=Ce,v=`start`,b=`md`,x=`none`,g=`divide-y divide-border/60`;let O;t[35]!==f||t[36]!==l||t[37]!==d?(O=e=>{let{target:t,environment:n,machine:r,layers:i}=e;return(0,J.jsxs)(`section`,{className:`px-3 py-2.5`,children:[(0,J.jsxs)(`h4`,{className:`flex items-center gap-1.5 pb-1.5 text-xs font-medium text-muted-foreground`,children:[(0,J.jsx)(G,{"aria-hidden":!0,kind:r,className:`size-3.5 shrink-0`}),(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label})]}),(0,J.jsx)(`ol`,{role:`list`,className:`text-sm`,children:i.map(Qt)}),(()=>{let e=d.filter(e=>e.environmentId===t.environmentId);if(e.length===0)return null;let r=n.serverConfig.settings.projectSettingsOverrides;return(0,J.jsxs)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:`Overridden by`}),l?(0,J.jsxs)(y,{onClick:()=>l(e),children:[`Reset `,e.length===1?`it`:`all`]}):null]}),(0,J.jsx)(`ul`,{role:`list`,className:`mt-0.5 text-sm`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 px-2 py-1`,children:[(0,J.jsx)(y,{className:`min-w-0 justify-start`,onClick:e.open,children:(0,J.jsx)(`span`,{className:`truncate`,children:e.label})}),(0,J.jsx)(`span`,{className:`max-w-32 truncate text-muted-foreground tabular-nums`,children:Q(f)?Jt(f,r[e.projectId]?.[f]):null})]},e.projectId))})]})})()]},`${t.environmentId}:${t.projectId??``}`)},t[35]=f,t[36]=l,t[37]=d,t[38]=O):O=t[38],_=r.map(O),t[2]=a,t[3]=f,t[4]=l,t[5]=p,t[6]=d,t[7]=n,t[8]=i,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=b,t[15]=x,t[16]=S}else m=t[9],h=t[10],g=t[11],_=t[12],v=t[13],b=t[14],x=t[15],S=t[16];let C;t[39]!==g||t[40]!==_?(C=(0,J.jsx)(`div`,{className:g,children:_}),t[39]=g,t[40]=_,t[41]=C):C=t[41];let w;t[42]!==m||t[43]!==v||t[44]!==b||t[45]!==x||t[46]!==C?(w=(0,J.jsx)(m,{align:v,width:b,padding:x,children:C}),t[42]=m,t[43]=v,t[44]=b,t[45]=x,t[46]=C,t[47]=w):w=t[47];let T;return t[48]!==h||t[49]!==w||t[50]!==S?(T=(0,J.jsxs)(h,{children:[S,w]}),t[48]=h,t[49]=w,t[50]=S,t[51]=T):T=t[51],T}function Qt(e){return(0,J.jsxs)(`li`,{className:M(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 rounded-md px-2 py-1`,e.effective&&`bg-foreground/[0.06]`),children:[(0,J.jsx)(`span`,{className:M(`min-w-0 truncate`,e.effective?`font-medium text-foreground`:`text-muted-foreground`),children:e.key===`environment`?`Environment`:e.label}),(0,J.jsxs)(`span`,{className:M(`flex items-center gap-1.5 tabular-nums`,e.effective?`text-foreground`:e.set?`text-muted-foreground`:`text-muted-foreground/60`),children:[(0,J.jsx)(`span`,{className:`max-w-32 truncate`,children:e.value}),e.effective?(0,J.jsx)(w,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-primary`}):(0,J.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]})]},e.key)}var $t=[],en=()=>void 0,tn=(0,X.createContext)({targetId:null,highlightTarget:!0,onTargetHandled:en});function nn(e){let t=(0,q.c)(7),{targetId:n,highlightTarget:r,onTargetHandled:i,children:a}=e,o=r===void 0||r,s=i===void 0?en:i,c;t[0]!==o||t[1]!==s||t[2]!==n?(c={targetId:n,highlightTarget:o,onTargetHandled:s},t[0]=o,t[1]=s,t[2]=n,t[3]=c):c=t[3];let l=c,u;return t[4]!==a||t[5]!==l?(u=(0,J.jsx)(tn,{value:l,children:a}),t[4]=a,t[5]=l,t[6]=u):u=t[6],u}function rn(e,t=!0){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;((typeof e.querySelector==`function`?e.querySelector(`:scope > [data-settings-scroll-target]`):null)??(e.tagName===`SECTION`&&e.firstElementChild?e.firstElementChild:e)).scrollIntoView({behavior:n?`auto`:`smooth`,block:`center`}),e.focus({preventScroll:!0}),e.classList.remove(`settings-search-target-pulse`),t&&!n&&(e.offsetWidth,e.classList.add(`settings-search-target-pulse`),e.addEventListener(`blur`,()=>e.classList.remove(`settings-search-target-pulse`),{once:!0}))}function an(){return(0,X.useContext)(tn).targetId}function on(e){let t=(0,q.c)(4),{targetId:n,highlightTarget:r,onTargetHandled:i}=(0,X.useContext)(tn),a=e!==void 0&&e===n,o;return t[0]!==r||t[1]!==a||t[2]!==i?(o=e=>{e&&a&&(rn(e,r),i())},t[0]=r,t[1]=a,t[2]=i,t[3]=o):o=t[3],o}function sn(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=on(r.id),a=r.id?-1:r.tabIndex,o;return t[3]!==n||t[4]!==a||t[5]!==r||t[6]!==i?(o=(0,J.jsx)(`div`,{...r,ref:i,tabIndex:a,children:n}),t[3]=n,t[4]=a,t[5]=r,t[6]=i,t[7]=o):o=t[7],o}var cn=`min-w-0 max-w-none shrink-0`;function ln(e){let t=(0,q.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(oe,{delay:200,render:(0,J.jsx)(j,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Background policy details`,children:(0,J.jsx)(l,{className:`size-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,J.jsxs)(ce,{children:[r,(0,J.jsx)(se,{side:`top`,children:n})]}),t[1]=n,t[2]=i),i}function un(e){let t=(0,q.c)(3),n=e===void 0?1e3:e,[r,i]=(0,X.useState)(dn),a,o;return t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=setInterval(()=>i(Date.now()),n);return()=>clearInterval(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,X.useEffect)(a,o),r}function dn(){return Date.now()}function fn(e){let t=(0,q.c)(30),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({title:l,hideTitle:s,icon:a,titleAction:u,headerAction:i,variant:c,children:n,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let d=s!==void 0&&s,f=c===void 0?`grouped`:c,p=on(o.id),m=o.id?-1:o.tabIndex,h=!d&&`space-y-2.5`,g;t[10]!==r||t[11]!==h?(g=M(h,r),t[10]=r,t[11]=h,t[12]=g):g=t[12];let _;t[13]!==i||t[14]!==d||t[15]!==a||t[16]!==l||t[17]!==u?(_=d?(0,J.jsx)(`h2`,{className:`sr-only`,children:l}):(0,J.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,J.jsxs)(`h2`,{className:`flex min-h-7 items-center gap-2 text-sm font-normal text-foreground/70`,children:[a,l]}),u]}),(0,J.jsx)(`div`,{className:`flex min-h-7 min-w-7 items-center justify-end`,children:i})]}),t[13]=i,t[14]=d,t[15]=a,t[16]=l,t[17]=u,t[18]=_):_=t[18];let v=d?``:void 0,y;t[19]!==n||t[20]!==v||t[21]!==f?(y=(0,J.jsx)(Y,{"data-settings-scroll-target":v,variant:f,children:n}),t[19]=n,t[20]=v,t[21]=f,t[22]=y):y=t[22];let b;return t[23]!==o||t[24]!==m||t[25]!==g||t[26]!==_||t[27]!==y||t[28]!==p?(b=(0,J.jsxs)(`section`,{...o,ref:p,tabIndex:m,className:g,children:[_,y]}),t[23]=o,t[24]=m,t[25]=g,t[26]=_,t[27]=y,t[28]=p,t[29]=b):b=t[29],b}function pn(e){let t=(0,q.c)(8),{children:n,message:r}=e;if(r===void 0)return n;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(l,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=(0,J.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2 text-xs leading-relaxed text-muted-foreground sm:px-4`,children:[i,(0,J.jsx)(`p`,{children:r})]}),t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=(0,J.jsx)(`div`,{className:`[&_h3]:opacity-64 [&_p]:opacity-64`,children:n}),t[3]=n,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,J.jsxs)(`div`,{className:`border-border/60 bg-muted/20 py-1.5`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function mn(e){let t=(0,q.c)(118),n,r,i,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({title:m,description:o,status:d,resetAction:l,onResetOverride:c,control:i,serverScoped:f,settingKeys:p,mixed:s,children:n,className:r,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=f!==void 0&&f,_=p===void 0?$t:p,v=on(u.id),y=_e(),x=ot(),S=ue(),C=le(),w=fe(S,a),T;t[13]===x?.connectedEnvironments?T=t[14]:(T=x?.connectedEnvironments??[],t[13]=x?.connectedEnvironments,t[14]=T);let E=me(T,a),D;t[15]!==x||t[16]!==w||t[17]!==E?(D=x?x.connectedEnvironments.length>0&&x.connectedEnvironments.every(e=>E.has(e.environmentId)):w,t[15]=x,t[16]=w,t[17]=E,t[18]=D):D=t[18];let O=D,ee=St(),te=Ct(),k=x!==null&&(x.scope.kind===`project`||x.scope.kind===`checkout`),A,j,N,ne;if(t[19]!==x||t[20]!==k||t[21]!==s||t[22]!==h||t[23]!==_){N=_.filter(Q),A=k&&h&&N.length===0;let e;t[28]!==x||t[29]!==s||t[30]!==_?(e=s??(x!==null&&Re(x.targets,_)),t[28]=x,t[29]=s,t[30]=_,t[31]=e):e=t[31],j=e,ne=x&&k?ze(x.targets,N):null,t[19]=x,t[20]=k,t[21]=s,t[22]=h,t[23]=_,t[24]=A,t[25]=j,t[26]=N,t[27]=ne}else A=t[24],j=t[25],N=t[26],ne=t[27];let P=ne,F=h&&(!O||!(x?x.connectedEnvironments.length>0:y)),re;t[32]!==x||t[33]!==P?(re=P===`environment`&&x?.scope.environmentIds.length===1?x.environments.find(e=>e.environmentId===x.scope.environmentIds[0])?.label??`environment`:`environment`,t[32]=x,t[33]=P,t[34]=re):re=t[34];let ie=re;x?.connectedEnvironments;let I;t[35]===x?.connectedEnvironments?I=t[36]:(I=new Map((x?.connectedEnvironments??[]).flatMap(gn)),t[35]=x?.connectedEnvironments,t[36]=I);let ae=I,L;bb0:{if(x===null||k||N.length===0){let e;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[37]=e):e=t[37],L=e;break bb0}let e;if(t[38]!==x||t[39]!==N){let n;t[41]===x?n=t[42]:(n=e=>{let t=x.groups.find(t=>t.memberProjects.some(t=>t.environmentId===e.environmentId&&t.id===e.projectId));return t?[{...e,label:t.displayName,open:()=>x.selectScope({project:t.projectKey,...x.search.machine?{machine:x.search.machine}:{}})}]:[]},t[41]=x,t[42]=n),e=Ue(x.connectedEnvironments,N).flatMap(n),t[38]=x,t[39]=N,t[40]=e}else e=t[40];L=e}let de=L,pe;t[43]!==ee||t[44]!==k||t[45]!==c||t[46]!==l||t[47]!==N||t[48]!==P||t[49]!==m||t[50]!==F?(pe=F?null:k&&N.length>0?P===`project`||P===`mixed`?(0,J.jsx)(_n,{label:typeof m==`string`?m:`override`,tooltip:`Reset to inherited value`,onClick:()=>c?c():ee(N)}):null:l,t[43]=ee,t[44]=k,t[45]=c,t[46]=l,t[47]=N,t[48]=P,t[49]=m,t[50]=F,t[51]=pe):pe=t[51];let he=pe,ge;t[52]===i?ge=t[53]:(ge=e=>(0,J.jsxs)(ce,{children:[(0,J.jsx)(oe,{render:(0,J.jsx)(`span`,{tabIndex:0,className:`flex w-full items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring @min-[32rem]/settings-row:w-auto`}),children:(0,J.jsx)(`div`,{inert:!0,className:`flex w-full items-center gap-2 opacity-50 @min-[32rem]/settings-row:w-auto`,children:i})}),(0,J.jsx)(se,{side:`top`,children:e})]}),t[52]=i,t[53]=ge);let ve=ge,ye;t[54]!==O||t[55]!==x||t[56]!==i||t[57]!==A||t[58]!==ve||t[59]!==C?.label||t[60]!==F||t[61]!==E?(ye=F&&i?ve(O?x?`Reconnect the selected environment to change this setting.`:be:`This connection lacks permission to change settings on ${x?x.connectedEnvironments.filter(e=>!E.has(e.environmentId)).map(hn).join(`, `)||`the selected environment`:C?.label??`the primary environment`}.`):A&&i?ve(`Environment-wide setting. Select an environment to change it.`):i,t[54]=O,t[55]=x,t[56]=i,t[57]=A,t[58]=ve,t[59]=C?.label,t[60]=F,t[61]=E,t[62]=ye):ye=t[62];let R=ye,xe;t[63]!==x||t[64]!==ae||t[65]!==_?(xe=x!==null&&_.some(e=>x.targets.some(t=>{let n=ae.get(t.environmentId);return n!==void 0&&!g(n[e],b[e])})),t[63]=x,t[64]=ae,t[65]=_,t[66]=xe):xe=t[66];let Se=xe,Ce;t[67]!==Se||t[68]!==ie||t[69]!==j||t[70]!==N||t[71]!==P?(Ce=j?{state:`mixed`,summary:`Mixed across selected environments`}:P===`project`?{state:`overridden`,summary:`Overridden for this project`}:P===`p4.json`?{state:`inherited`,summary:`Inherited from the repository's p4.json`}:P===`environment`&&N.length>0?{state:`inherited`,summary:`Inherited from ${ie}`}:Se?{state:`environment`,summary:`Set on the environment`}:{state:`default`,summary:`Built-in default`},t[67]=Se,t[68]=ie,t[69]=j,t[70]=N,t[71]=P,t[72]=Ce):Ce=t[72];let we=Ce,Te;t[73]!==O||t[74]!==te||t[75]!==x||t[76]!==we||t[77]!==de||t[78]!==N||t[79]!==h||t[80]!==_?(Te=x&&h&&_.length>0?(0,J.jsx)(Zt,{state:we.state,summary:we.summary,targets:x.targets,environments:x.connectedEnvironments,keys:_,overridingProjects:de,...O?{onClearOverrides:e=>te(e,N)}:{}}):null,t[73]=O,t[74]=te,t[75]=x,t[76]=we,t[77]=de,t[78]=N,t[79]=h,t[80]=_,t[81]=Te):Te=t[81];let Ee=Te,De=d,Oe=u.id?-1:u.tabIndex,ke=n?`pt-3 pb-1`:`py-3`,z;t[82]!==r||t[83]!==ke?(z=M(`@container/settings-row rounded-xl px-3 sm:px-4 aria-disabled:opacity-64 aria-disabled:[&_*]:text-muted-foreground`,ke,r),t[82]=r,t[83]=ke,t[84]=z):z=t[84];let B;t[85]===m?B=t[86]:(B=(0,J.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:m}),t[85]=m,t[86]=B);let V;t[87]===Ee?V=t[88]:(V=Ee?(0,J.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:Ee}):null,t[87]=Ee,t[88]=V);let H;t[89]===he?H=t[90]:(H=(0,J.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:he}),t[89]=he,t[90]=H);let U;t[91]!==B||t[92]!==V||t[93]!==H?(U=(0,J.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[B,V,H]}),t[91]=B,t[92]=V,t[93]=H,t[94]=U):U=t[94];let W;t[95]===o?W=t[96]:(W=o?(0,J.jsx)(`p`,{className:`max-w-xl text-xs leading-normal text-muted-foreground/80`,children:o}):null,t[95]=o,t[96]=W);let G;t[97]===De?G=t[98]:(G=De?(0,J.jsx)(`div`,{className:`pt-0.5 text-xs text-muted-foreground`,children:De}):null,t[97]=De,t[98]=G);let K;t[99]!==U||t[100]!==W||t[101]!==G?(K=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[U,W,G]}),t[99]=U,t[100]=W,t[101]=G,t[102]=K):K=t[102];let Y;t[103]===R?Y=t[104]:(Y=R?(0,J.jsx)(`div`,{className:`flex w-full min-w-0 shrink-0 items-center gap-2 @min-[32rem]/settings-row:w-auto @min-[32rem]/settings-row:justify-end`,children:R}):null,t[103]=R,t[104]=Y);let X;t[105]!==K||t[106]!==Y?(X=(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 @min-[32rem]/settings-row:grid @min-[32rem]/settings-row:grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] @min-[32rem]/settings-row:items-center @min-[32rem]/settings-row:gap-8`,children:[K,Y]}),t[105]=K,t[106]=Y,t[107]=X):X=t[107];let Z;t[108]!==n||t[109]!==F?(Z=F&&n?(0,J.jsx)(`div`,{inert:!0,className:`opacity-50`,children:n}):n,t[108]=n,t[109]=F,t[110]=Z):Z=t[110];let Ae;return t[111]!==u||t[112]!==Oe||t[113]!==z||t[114]!==X||t[115]!==Z||t[116]!==v?(Ae=(0,J.jsxs)(`div`,{...u,ref:v,tabIndex:Oe,"data-slot":`settings-row`,className:z,children:[X,Z]}),t[111]=u,t[112]=Oe,t[113]=z,t[114]=X,t[115]=Z,t[116]=v,t[117]=Ae):Ae=t[117],Ae}function hn(e){return e.label}function gn(e){return e.serverConfig?[[e.environmentId,e.serverConfig.settings]]:[]}function _n(e){let t=(0,q.c)(12),{label:n,tooltip:r,disabled:i,onClick:a}=e,o=r===void 0?`Reset to default`:r,s=i!==void 0&&i,c=`Reset ${n} to default`,l;t[0]===a?l=t[1]:(l=e=>{e.stopPropagation(),a()},t[0]=a,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(f,{className:`size-3`}),t[2]=u):u=t[2];let d;t[3]!==s||t[4]!==c||t[5]!==l?(d=(0,J.jsx)(oe,{render:(0,J.jsx)(j,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":c,disabled:s,onClick:l,children:u})}),t[3]=s,t[4]=c,t[5]=l,t[6]=d):d=t[6];let p;t[7]===o?p=t[8]:(p=(0,J.jsx)(se,{side:`top`,children:o}),t[7]=o,t[8]=p);let m;return t[9]!==d||t[10]!==p?(m=(0,J.jsxs)(ce,{children:[d,p]}),t[9]=d,t[10]=p,t[11]=m):m=t[11],m}function vn(e){let t=(0,q.c)(18),{children:n,className:r,width:i}=e,a=i===void 0?`readable`:i,o=ie(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={select:bn},t[0]=s):s=t[0];let c=I(s),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={select:yn},t[1]=l):l=t[1];let u=I(l),d;t[2]===c?d=t[3]:(d=c.replace(/^#/,``)||null,t[2]=c,t[3]=d);let f=d,p;t[4]===o?p=t[5]:(p=()=>{o({hash:``,replace:!0,resetScroll:!1,hashScrollIntoView:!1,state:{settingsTargetHighlight:!0}})},t[4]=o,t[5]=p);let m=p,h;t[6]===r?h=t[7]:(h=M(`gap-8`,r),t[6]=r,t[7]=h);let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(ct,{}),t[8]=g):g=t[8];let _;t[9]!==n||t[10]!==h||t[11]!==a?(_=(0,J.jsx)(`div`,{className:`topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto`,"data-settings-page-scroll":!0,children:(0,J.jsxs)(K,{width:a,className:h,children:[g,n]})}),t[9]=n,t[10]=h,t[11]=a,t[12]=_):_=t[12];let v;return t[13]!==m||t[14]!==u||t[15]!==_||t[16]!==f?(v=(0,J.jsx)(nn,{targetId:f,highlightTarget:u,onTargetHandled:m,children:_}),t[13]=m,t[14]=u,t[15]=_,t[16]=f,t[17]=v):v=t[17],v}function yn(e){return e.state.settingsTargetHighlight!==!1}function bn(e){return e.hash}function xn(e,{highlight:t=!0}={}){let n=document.getElementById(e);return n?(rn(n,t),!0):!1}export{kt as A,$ as B,Ot as C,Lt as D,Rt as E,ht as F,Z as H,wt as I,xt as L,St as M,gt as N,Kt as O,mt as P,st as R,Nt as S,It as T,Y as U,Je as V,Ht as _,mn as a,Bt as b,pn as c,on as d,an as f,Vt as g,Ut as h,vn as i,Tt as j,At as k,xn as l,Gt as m,cn as n,sn as o,Pt as p,_n as r,fn as s,ln as t,un as u,Mt as v,Wt as w,zt as x,Ft as y,at as z};
3
- //# sourceMappingURL=settingsLayout-DUyA66EK.js.map
3
+ //# sourceMappingURL=settingsLayout-CqGfrbmD.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cs as n,Lu as r,NE as i,Ts as a,Ty as o,Um as s,lE as c,sr as l,t as u,ur as d,yo as f}from"./utils-Dx_TSvdC.js";import{F as p,I as m,a as h,c as g,n as _,t as v}from"./tooltip-Cco13jKX.js";import{t as y}from"./input-CF-egQtG.js";import{t as b}from"./scroll-area-OkcD8f0Y.js";import{c as x,l as S,n as C,o as w,r as T,s as E,t as D,u as O}from"./DialogTitle-BgclXafx.js";import{t as k}from"./useResizeDrag-KJl_F2EN.js";var A=e(t(),1),j=i(),M=e(c(),1),N=T,P=w;function F(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`fixed inset-0 z-(--z-sheet) bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(O,{className:i,"data-slot":`sheet-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function I(e){let t=(0,j.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,side:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=i===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,c=i===`top`&&`grid grid-rows-[auto_1fr] pb-12`,l=i===`left`&&`flex justify-start`,d=i===`right`&&`flex justify-end`,f=o===`inset`&&`sm:p-4`,p;t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f?(p=u(`fixed inset-0 z-(--z-sheet) grid`,s,c,l,d,f,n),t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==r||t[13]!==p?(m=(0,M.jsx)(C,{className:p,"data-slot":`sheet-viewport`,...r}),t[12]=r,t[13]=p,t[14]=m):m=t[14],m}function L(e){let t=(0,j.c)(42),n,r,i,a,o,c,d,f,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],d=t[7],f=t[8],p=t[9]):({className:r,children:n,showCloseButton:o,keepMounted:c,transitionDurationMs:p,side:d,variant:f,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=d,t[8]=f,t[9]=p);let m=o===void 0||o,h=c!==void 0&&c,g=d===void 0?`right`:d,_=f===void 0?`default`:f,v;t[10]===p?v=t[11]:(v=p===void 0?void 0:{transitionDuration:`${p}ms`},t[10]=p,t[11]=v);let y=v,b=p===0,x=b?`transition-none! data-ending-style:opacity-100! data-starting-style:opacity-100!`:void 0,C;t[12]!==x||t[13]!==y?(C=(0,M.jsx)(F,{className:x,style:y}),t[12]=x,t[13]=y,t[14]=C):C=t[14];let w=g===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,T=g===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,D=g===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,O=g===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,k=_===`inset`&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,A=b&&`transition-none! will-change-auto! data-ending-style:translate-x-0! data-starting-style:translate-x-0! data-ending-style:translate-y-0! data-starting-style:translate-y-0! data-ending-style:opacity-100! data-starting-style:opacity-100!`,N;t[15]!==r||t[16]!==D||t[17]!==O||t[18]!==k||t[19]!==A||t[20]!==w||t[21]!==T?(N=u(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,w,T,D,O,k,A,r),t[15]=r,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=w,t[21]=T,t[22]=N):N=t[22];let L;t[23]!==a||t[24]!==y?(L={...y,...a},t[23]=a,t[24]=y,t[25]=L):L=t[25];let R;t[26]===m?R=t[27]:(R=m&&(0,M.jsx)(S,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,M.jsx)(l,{size:`icon`,variant:`ghost`}),children:(0,M.jsx)(s,{})}),t[26]=m,t[27]=R);let z;t[28]!==n||t[29]!==i||t[30]!==N||t[31]!==L||t[32]!==R?(z=(0,M.jsxs)(E,{className:N,"data-slot":`sheet-popup`,style:L,...i,children:[n,R]}),t[28]=n,t[29]=i,t[30]=N,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==g||t[35]!==z||t[36]!==_?(B=(0,M.jsx)(I,{side:g,variant:_,children:z}),t[34]=g,t[35]=z,t[36]=_,t[37]=B):B=t[37];let V;return t[38]!==h||t[39]!==B||t[40]!==C?(V=(0,M.jsxs)(P,{keepMounted:h,children:[C,B]}),t[38]=h,t[39]=B,t[40]=C,t[41]=V):V=t[41],V}function R(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`font-semibold text-xl leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(D,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function B(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(x,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V={"2xl":1536,"3xl":1600,"4xl":2e3,lg:1024,md:768,sm:640,xl:1280};function H(e){return`(min-width: ${typeof e==`number`?e:V[e]}px)`}function U(e){return`(max-width: ${(typeof e==`number`?e:V[e])-1}px)`}function ee(e){if(typeof e!=`string`){let t=[];return e.min!=null&&t.push(H(e.min)),e.max!=null&&t.push(U(e.max)),e.pointer===`coarse`&&t.push(`(pointer: coarse)`),e.pointer===`fine`&&t.push(`(pointer: fine)`),t.length===0?`(min-width: 0px)`:t.join(` and `)}if(e.startsWith(`(`))return e;let t=[];for(let n of e.split(`:`))if(n.startsWith(`max-`)){let e=n.slice(4);e in V&&t.push(U(e))}else n in V&&t.push(H(n));return t.length>0?t.join(` and `):e}function te(){return!1}function W(e){let t=(0,j.c)(6),n;t[0]===e?n=t[1]:(n=ee(e),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=e=>{if(typeof window>`u`)return ne;let t=window.matchMedia(r);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},t[2]=r,t[3]=i);let a=i,o;return t[4]===r?o=t[5]:(o=()=>typeof window>`u`?!1:window.matchMedia(r).matches,t[4]=r,t[5]=o),(0,A.useSyncExternalStore)(a,o,te)}function ne(){}function G(){return W(`max-md`)}function re(e){return(e.isMobile?e.openMobile:e.open)?`expanded`:`collapsed`}var ie=`sidebar_state`,ae=604800,K=`16rem`,q=`calc(100vw - var(--spacing(3)))`,oe=`3rem`,se=256,J=`max-sm:[--workspace-titlebar-control-size:--spacing(8)]`,Y=A.createContext(null),X=A.createContext(null);function Z(){let e=A.use(Y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ce(){let{isMobile:e,open:t,openMobile:n}=Z();return e?n:t}function le(e){let t=(0,j.c)(40),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,d=G(),[f,p]=A.useState(!1),[m,h]=A.useState(!1),g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{h(e!==null)},t[8]=g):g=t[8];let _=g,[v,y]=A.useState(l),b=i??v,x;t[9]!==b||t[10]!==o?(x=async e=>{let t=typeof e==`function`?e(b):e;o?o(t):y(t),await cookieStore.set({expires:Date.now()+ae*1e3,name:ie,path:`/`,value:String(t)})},t[9]=b,t[10]=o,t[11]=x):x=t[11];let S=x,C;t[12]!==d||t[13]!==S?(C=()=>d?p(de):S(ue),t[12]=d,t[13]=S,t[14]=C):C=t[14];let w=C,T;t[15]!==d||t[16]!==b||t[17]!==f?(T=re({isMobile:d,open:b,openMobile:f}),t[15]=d,t[16]=b,t[17]=f,t[18]=T):T=t[18];let E=T,D;t[19]!==d||t[20]!==m||t[21]!==b||t[22]!==f||t[23]!==S||t[24]!==E||t[25]!==w?(D={isMobile:d,open:b,openMobile:f,mobileSheetMounted:m,setMobileSheetElement:_,setOpen:S,setOpenMobile:p,state:E,toggleSidebar:w},t[19]=d,t[20]=m,t[21]=b,t[22]=f,t[23]=S,t[24]=E,t[25]=w,t[26]=D):D=t[26];let O=D,k;t[27]===r?k=t[28]:(k=u(`group/sidebar-wrapper flex min-h-svh w-full`,J,r),t[27]=r,t[28]=k);let N;t[29]===s?N=t[30]:(N={"--sidebar-width":K,"--sidebar-width-icon":oe,"--workspace-titlebar-content-left":`calc(var(--workspace-controls-left) + var(--workspace-titlebar-control-size) + var(--workspace-titlebar-control-gap) + var(--workspace-history-controls-width, 0px))`,...s},t[29]=s,t[30]=N);let P=N,F;t[31]!==n||t[32]!==a||t[33]!==E||t[34]!==k||t[35]!==P?(F=(0,M.jsx)(`div`,{className:k,"data-sidebar-state":E,"data-slot":`sidebar-wrapper`,style:P,...a,children:n}),t[31]=n,t[32]=a,t[33]=E,t[34]=k,t[35]=P,t[36]=F):F=t[36];let I;return t[37]!==O||t[38]!==F?(I=(0,M.jsx)(Y,{value:O,children:F}),t[37]=O,t[38]=F,t[39]=I):I=t[39],I}function ue(e){return!e}function de(e){return!e}function fe(e){let t=(0,j.c)(80),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({side:a,variant:o,collapsible:s,resizable:c,separator:l,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let d=a===void 0?`left`:a,f=o===void 0?`sidebar`:o,p=s===void 0?`offcanvas`:s,m=c!==void 0&&c,h=l===void 0||l,{isMobile:g,state:_,openMobile:v,setOpenMobile:y,setMobileSheetElement:b}=Z(),x;bb0:{if(g||p===`none`||!m){x=null;break bb0}let e;t[9]===m?e=t[10]:(e=typeof m==`boolean`?{}:m,t[9]=m,t[10]=e);let n=e,r=n.maxWidth??1/0,i=n.minWidth??se,a=n.storageKey??null,o;t[11]===n.onResize?o=t[12]:(o=n.onResize?{onResize:n.onResize}:{},t[11]=n.onResize,t[12]=o);let s;t[13]===n.shouldAcceptWidth?s=t[14]:(s=n.shouldAcceptWidth?{shouldAcceptWidth:n.shouldAcceptWidth}:{},t[13]=n.shouldAcceptWidth,t[14]=s);let c;t[15]!==a||t[16]!==o||t[17]!==s||t[18]!==r||t[19]!==i?(c={maxWidth:r,minWidth:i,storageKey:a,...o,...s},t[15]=a,t[16]=o,t[17]=s,t[18]=r,t[19]=i,t[20]=c):c=t[20],x=c}let S=x,C;t[21]!==S||t[22]!==d?(C={side:d,resizable:S},t[21]=S,t[22]=d,t[23]=C):C=t[23];let w=C;if(p===`none`){let e;t[24]===r?e=t[25]:(e=u(`flex h-full w-(--sidebar-width) flex-col bg-sidebar surface-grain text-sidebar-foreground`,r),t[24]=r,t[25]=e);let a;t[26]!==n||t[27]!==i||t[28]!==e?(a=(0,M.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[26]=n,t[27]=i,t[28]=e,t[29]=a):a=t[29];let o;return t[30]!==w||t[31]!==a?(o=(0,M.jsx)(X,{value:w,children:a}),t[30]=w,t[31]=a,t[32]=o):o=t[32],o}if(g){let e;t[33]===r?e=t[34]:(e=u(`w-(--sidebar-width) max-w-none bg-sidebar surface-grain p-0 text-sidebar-foreground`,r),t[33]=r,t[34]=e);let a;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(a={"--sidebar-width":q},t[35]=a):a=t[35];let o;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsxs)(R,{className:`sr-only`,children:[(0,M.jsx)(z,{children:`Sidebar`}),(0,M.jsx)(B,{children:`Displays the mobile sidebar.`})]}),t[36]=o):o=t[36];let s=d===`left`?`pl-safe`:`pr-safe`,c;t[37]===s?c=t[38]:(c=u(`flex h-full w-full flex-col pb-safe pt-safe`,J,s),t[37]=s,t[38]=c);let l;t[39]!==n||t[40]!==i||t[41]!==c?(l=(0,M.jsx)(`div`,{className:c,...i,children:n}),t[39]=n,t[40]=i,t[41]=c,t[42]=l):l=t[42];let f;t[43]!==b||t[44]!==d||t[45]!==l||t[46]!==e?(f=(0,M.jsxs)(L,{ref:b,className:e,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,showCloseButton:!1,side:d,style:a,children:[o,l]}),t[43]=b,t[44]=d,t[45]=l,t[46]=e,t[47]=f):f=t[47];let p;t[48]!==v||t[49]!==y||t[50]!==f?(p=(0,M.jsx)(N,{onOpenChange:y,open:v,children:f}),t[48]=v,t[49]=y,t[50]=f,t[51]=p):p=t[51];let m;return t[52]!==w||t[53]!==p?(m=(0,M.jsx)(X,{value:w,children:p}),t[52]=w,t[53]=p,t[54]=m):m=t[54],m}let T=_===`collapsed`?p:``,E=f===`floating`||f===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,D;t[55]===E?D=t[56]:(D=u(`relative w-(--sidebar-width) bg-transparent`,`[[data-panel-animations=true]_&]:transition-[width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,E),t[55]=E,t[56]=D);let O;t[57]===D?O=t[58]:(O=(0,M.jsx)(`div`,{className:D,"data-slot":`sidebar-gap`}),t[57]=D,t[58]=O);let k=d===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,A;t[59]!==r||t[60]!==h||t[61]!==k||t[62]!==f?(A=u(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex`,`[[data-panel-animations=true]_&]:transition-[left,right,width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,k,f===`floating`||f===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:u(`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,h&&`group-data-[side=left]:border-r group-data-[side=right]:border-l`),r),t[59]=r,t[60]=h,t[61]=k,t[62]=f,t[63]=A):A=t[63];let P;t[64]===n?P=t[65]:(P=(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col bg-sidebar surface-grain group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm/5`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[64]=n,t[65]=P);let F;t[66]!==i||t[67]!==A||t[68]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-slot":`sidebar-container`,...i,children:P}),t[66]=i,t[67]=A,t[68]=P,t[69]=F):F=t[69];let I;t[70]!==d||t[71]!==_||t[72]!==O||t[73]!==F||t[74]!==T||t[75]!==f?(I=(0,M.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":T,"data-side":d,"data-slot":`sidebar`,"data-state":_,"data-variant":f,children:[O,F]}),t[70]=d,t[71]=_,t[72]=O,t[73]=F,t[74]=T,t[75]=f,t[76]=I):I=t[76];let V;return t[77]!==w||t[78]!==I?(V=(0,M.jsx)(X,{value:w,children:I}),t[77]=w,t[78]=I,t[79]=V):V=t[79],V}function pe(e){let t=(0,j.c)(18),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=Z(),o=ce(),s;t[4]===n?s=t[5]:(s=u(`size-[var(--workspace-titlebar-control-size)]! [-webkit-app-region:no-drag]`,n),t[4]=n,t[5]=s);let c;t[6]!==r||t[7]!==a?(c=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=c):c=t[8];let d=o?m:p,f;t[9]===d?f=t[10]:(f=(0,M.jsx)(g,{className:`size-4`,icon:d}),t[9]=d,t[10]=f);let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[11]=h):h=t[11];let _;return t[12]!==o||t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(_=(0,M.jsxs)(l,{className:s,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,"aria-pressed":o,onClick:c,size:`icon`,variant:`ghost`,...i,children:[f,h]}),t[12]=o,t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=_):_=t[17],_}function Q(e,t){return Math.max(t.minWidth,Math.min(e,t.maxWidth))}function me(e){let t=(0,j.c)(53),r,i,s,c,l,d,f,p;t[0]===e?(r=t[1],i=t[2],s=t[3],c=t[4],l=t[5],d=t[6],f=t[7],p=t[8]):({className:r,onClick:i,onPointerCancel:c,onLostPointerCapture:s,onPointerDown:l,onPointerMove:d,onPointerUp:f,...p}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=s,t[4]=c,t[5]=l,t[6]=d,t[7]=f,t[8]=p);let{open:m,toggleSidebar:h}=Z(),g=A.use(X),_=A.useRef(null),v=A.useRef(!1),y=g?.resizable??null,b=A.useRef(y),x=y!==null&&m?`Resize Sidebar`:`Toggle Sidebar`,S;t[9]!==m||t[10]!==y||t[11]!==g?.side?(S=e=>{if(!y||!m)return null;let t=e.currentTarget,n=t.closest(`[data-slot='sidebar-wrapper']`),r=t.closest(`[data-slot='sidebar']`),i=r?.querySelector(`[data-slot='sidebar-container']`);if(!n||!r||!i)return null;let s=g?.side??`left`,c=Q(i.getBoundingClientRect().width,y),l=[r.querySelector(`[data-slot='sidebar-gap']`),i].filter(_e),u=e=>{l.forEach(t=>{t.style.setProperty(`width`,`${e}px`)})};return l.forEach(ge),u(c),{width:c,edge:s===`left`?`right`:`left`,resize(e){let i=b.current;if(!i)return c;let a=Q(e,i);return(i.shouldAcceptWidth?.({currentWidth:c,nextWidth:a,rail:t,side:s,sidebarRoot:r,wrapper:n})??!0)&&(u(a),c=a),c},finish(e,t){n.style.setProperty(`--sidebar-width`,`${e}px`),v.current=t;let r=b.current;if(r?.storageKey)try{a(r.storageKey,e,o)}catch(e){console.error(`Could not persist sidebar width.`,e)}r?.onResize?.(e)},cleanup(){l.forEach(he)}}},t[9]=m,t[10]=y,t[11]=g?.side,t[12]=S):S=t[12];let C=k(S,String(m)),w;t[13]!==C||t[14]!==y?(w=()=>{b.current=y,C.refresh()},t[13]=C,t[14]=y,t[15]=w):w=t[15];let T;t[16]===y?T=t[17]:(T=[y],t[16]=y,t[17]=T),A.useLayoutEffect(w,T);let E;t[18]!==i||t[19]!==m||t[20]!==y||t[21]!==h?(E=e=>{if(i?.(e),!e.defaultPrevented){if(v.current){v.current=!1,e.preventDefault();return}if(y&&m){e.preventDefault();return}h()}},t[18]=i,t[19]=m,t[20]=y,t[21]=h,t[22]=E):E=t[22];let D=E,O,N;t[23]===y?(O=t[24],N=t[25]):(O=()=>{if(!y?.storageKey||typeof window>`u`)return;let e=_.current;if(!e)return;let t=e.closest(`[data-slot='sidebar-wrapper']`);if(!t)return;let r;try{r=n(y.storageKey,o)}catch(e){console.error(`Could not restore persisted sidebar width.`,e);return}if(r===null)return;let i=Q(r,y);t.style.setProperty(`--sidebar-width`,`${i}px`),y.onResize?.(i)},N=[y],t[23]=y,t[24]=O,t[25]=N),A.useLayoutEffect(O,N);let P;t[26]===r?P=t[27]:(P=u(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none`,`[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),t[26]=r,t[27]=P);let F;t[28]!==s||t[29]!==C?(F=e=>{s?.(e),e.defaultPrevented||C.onLostPointerCapture(e)},t[28]=s,t[29]=C,t[30]=F):F=t[30];let I;t[31]!==c||t[32]!==C?(I=e=>{c?.(e),e.defaultPrevented||C.onPointerCancel(e)},t[31]=c,t[32]=C,t[33]=I):I=t[33];let L;t[34]!==l||t[35]!==C?(L=e=>{l?.(e),e.defaultPrevented||C.onPointerDown(e)},t[34]=l,t[35]=C,t[36]=L):L=t[36];let R;t[37]!==d||t[38]!==C?(R=e=>{d?.(e),e.defaultPrevented||C.onPointerMove(e)},t[37]=d,t[38]=C,t[39]=R):R=t[39];let z;t[40]!==f||t[41]!==C?(z=e=>{f?.(e),e.defaultPrevented||C.onPointerUp(e)},t[40]=f,t[41]=C,t[42]=z):z=t[42];let B;return t[43]!==D||t[44]!==p||t[45]!==x||t[46]!==L||t[47]!==R||t[48]!==z||t[49]!==P||t[50]!==F||t[51]!==I?(B=(0,M.jsx)(`button`,{"aria-label":x,className:P,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:D,onLostPointerCapture:F,onPointerCancel:I,onPointerDown:L,onPointerMove:R,onPointerUp:z,ref:_,tabIndex:-1,type:`button`,...p}),t[43]=D,t[44]=p,t[45]=x,t[46]=L,t[47]=R,t[48]=z,t[49]=P,t[50]=F,t[51]=I,t[52]=B):B=t[52],B}function he(e){e.style.removeProperty(`width`),e.style.removeProperty(`transition-duration`)}function ge(e){e.style.setProperty(`transition-duration`,`0ms`)}function _e(e){return e!==null}function ve(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`[&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(y,{className:i,unstyled:!0,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex min-w-0 w-full flex-1 flex-col bg-background surface-grain`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm/5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`main`,{className:i,"data-slot":`sidebar-inset`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 px-[var(--sidebar-content-inset)] py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,j.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,fixedHeader:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=r?(0,M.jsx)(`div`,{className:`w-full shrink-0`,children:r}):null,t[4]=r,t[5]=a);let o=r&&`[&>[data-sidebar=group]:first-child]:pt-0`,s;t[6]!==n||t[7]!==o?(s=u(`flex w-full min-w-0 flex-col [overflow-anchor:none] group-data-[collapsible=icon]:overflow-hidden [&>[data-sidebar=group]+[data-sidebar=group]]:pt-0`,o,n),t[6]=n,t[7]=o,t[8]=s):s=t[8];let c;t[9]!==i||t[10]!==s?(c=(0,M.jsx)(b,{hideScrollbars:!0,scrollFade:!0,scrollFadePadding:!1,viewportTabIndex:-1,className:`h-auto min-h-0 flex-1 [&>[data-slot=scroll-area-viewport]]:[--fade-size:0.75rem]`,children:(0,M.jsx)(`div`,{className:s,"data-sidebar":`content`,"data-slot":`sidebar-content`,...i})}),t[9]=i,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==a||t[13]!==c?(l=(0,M.jsxs)(M.Fragment,{children:[a,c]}),t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function xe(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex w-full min-w-0 flex-col p-[var(--sidebar-content-inset)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex w-full min-w-0 flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ce(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var we=r(`peer/menu-button flex w-full cursor-pointer items-center gap-[var(--sidebar-control-gap)] overflow-hidden text-left outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 data-[active=true]:bg-sidebar-row-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[state=open]:hover:bg-sidebar-row-hover data-[state=open]:hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-[var(--sidebar-content-inset)]! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-[var(--sidebar-icon-color)] hover:[&>svg]:text-sidebar-foreground active:[&>svg]:text-sidebar-foreground data-[active=true]:[&>svg]:text-sidebar-foreground`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 rounded-[var(--control-radius)] px-[var(--sidebar-row-content-inset)] py-1.5 text-sm`,icon:`size-8 justify-center rounded-[var(--control-radius)] p-0`,lg:`h-12 rounded-lg p-2 text-sm group-data-[collapsible=icon]:p-0!`,sm:`h-7 rounded-lg p-2 text-xs`},variant:{default:`font-medium text-sidebar-foreground`,outline:`bg-sidebar-control-surface ring-1 ring-sidebar-border`,project:`font-normal text-sidebar-muted-foreground`,settings:`h-9 gap-2.5 rounded-xl px-3 font-normal text-sidebar-foreground data-[active=true]:font-normal [&>svg:not([class*='size-'])]:size-4.5 [&>svg]:text-sidebar-foreground`}}});function Te(e){let t=(0,j.c)(13),{isActive:n,variant:r,size:i,tooltip:a,className:o,render:s,...c}=e,l=n!==void 0&&n,p=r===void 0?`default`:r,m=i===void 0?`default`:i,{isMobile:g,state:y}=Z(),b={className:u(we({size:m,variant:p}),o),"data-active":l,"data-sidebar":`menu-button`,"data-size":m,"data-slot":`sidebar-menu-button`},x=f(b,c),S;t[0]!==x||t[1]!==s?(S={defaultTagName:`button`,props:x,render:s},t[0]=x,t[1]=s,t[2]=S):S=t[2];let C=d(S);if(!a)return C;if(typeof a==`string`){let e;t[3]===a?e=t[4]:(e={children:a},t[3]=a,t[4]=e),a=e}let w=C,T;t[5]===w?T=t[6]:(T=(0,M.jsx)(h,{render:w}),t[5]=w,t[6]=T);let E=y!==`collapsed`||g,D;t[7]!==E||t[8]!==a?(D=(0,M.jsx)(_,{align:`center`,hidden:E,side:`right`,...a}),t[7]=E,t[8]=a,t[9]=D):D=t[9];let O;return t[10]!==T||t[11]!==D?(O=(0,M.jsxs)(v,{children:[T,D]}),t[10]=T,t[11]=D,t[12]=O):O=t[12],O}function Ee(e){let t=(0,j.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?`tree`:i)===`flat`?`gap-0.5`:`mx-3.5 translate-x-px gap-1 border-sidebar-border border-l px-2.5 py-0.5`,o;t[4]!==n||t[5]!==a?(o=u(`flex min-w-0 flex-col`,a,`group-data-[collapsible=icon]:hidden`,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,M.jsx)(`ul`,{className:o,"data-sidebar":`menu-sub`,"data-slot":`sidebar-menu-sub`,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function De(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-sub-item`,"data-slot":`sidebar-menu-sub-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,j.c)(9),n,r,i,a;if(t[0]!==e){let{size:o,isActive:s,className:c,render:l,...p}=e;n=l;let m=o===void 0?`md`:o,h=s!==void 0&&s,g={className:u(`-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground`,`data-[active=true]:bg-sidebar-row-selected data-[active=true]:text-sidebar-foreground`,m===`sm`&&`text-xs`,m===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,c),"data-active":h,"data-sidebar":`menu-sub-button`,"data-size":m,"data-slot":`sidebar-menu-sub-button`};a=d,r=`a`,i=f(g,p),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;return t[5]!==n||t[6]!==r||t[7]!==i?(o={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8],a(o)}export{G as _,ve as a,L as b,Te as c,Oe as d,De as f,Z as g,pe as h,xe as i,Ce as l,me as m,$ as n,ye as o,le as p,be as r,Se as s,fe as t,Ee as u,W as v,N as y};
2
- //# sourceMappingURL=sidebar-CNP67lTi.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cs as n,Lu as r,NE as i,Ts as a,Ty as o,Um as s,lE as c,sr as l,t as u,ur as d,yo as f}from"./utils-BAPnqm16.js";import{F as p,I as m,a as h,c as g,n as _,t as v}from"./tooltip-DaSC-3cL.js";import{t as y}from"./input-83N8btBC.js";import{t as b}from"./scroll-area-DGS0jgnh.js";import{c as x,l as S,n as C,o as w,r as T,s as E,t as D,u as O}from"./DialogTitle-DnR18OB7.js";import{t as k}from"./useResizeDrag-KJl_F2EN.js";var A=e(t(),1),j=i(),M=e(c(),1),N=T,P=w;function F(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`fixed inset-0 z-(--z-sheet) bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(O,{className:i,"data-slot":`sheet-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function I(e){let t=(0,j.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,side:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=i===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,c=i===`top`&&`grid grid-rows-[auto_1fr] pb-12`,l=i===`left`&&`flex justify-start`,d=i===`right`&&`flex justify-end`,f=o===`inset`&&`sm:p-4`,p;t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f?(p=u(`fixed inset-0 z-(--z-sheet) grid`,s,c,l,d,f,n),t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==r||t[13]!==p?(m=(0,M.jsx)(C,{className:p,"data-slot":`sheet-viewport`,...r}),t[12]=r,t[13]=p,t[14]=m):m=t[14],m}function L(e){let t=(0,j.c)(42),n,r,i,a,o,c,d,f,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],d=t[7],f=t[8],p=t[9]):({className:r,children:n,showCloseButton:o,keepMounted:c,transitionDurationMs:p,side:d,variant:f,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=d,t[8]=f,t[9]=p);let m=o===void 0||o,h=c!==void 0&&c,g=d===void 0?`right`:d,_=f===void 0?`default`:f,v;t[10]===p?v=t[11]:(v=p===void 0?void 0:{transitionDuration:`${p}ms`},t[10]=p,t[11]=v);let y=v,b=p===0,x=b?`transition-none! data-ending-style:opacity-100! data-starting-style:opacity-100!`:void 0,C;t[12]!==x||t[13]!==y?(C=(0,M.jsx)(F,{className:x,style:y}),t[12]=x,t[13]=y,t[14]=C):C=t[14];let w=g===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,T=g===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,D=g===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,O=g===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,k=_===`inset`&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,A=b&&`transition-none! will-change-auto! data-ending-style:translate-x-0! data-starting-style:translate-x-0! data-ending-style:translate-y-0! data-starting-style:translate-y-0! data-ending-style:opacity-100! data-starting-style:opacity-100!`,N;t[15]!==r||t[16]!==D||t[17]!==O||t[18]!==k||t[19]!==A||t[20]!==w||t[21]!==T?(N=u(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,w,T,D,O,k,A,r),t[15]=r,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=w,t[21]=T,t[22]=N):N=t[22];let L;t[23]!==a||t[24]!==y?(L={...y,...a},t[23]=a,t[24]=y,t[25]=L):L=t[25];let R;t[26]===m?R=t[27]:(R=m&&(0,M.jsx)(S,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,M.jsx)(l,{size:`icon`,variant:`ghost`}),children:(0,M.jsx)(s,{})}),t[26]=m,t[27]=R);let z;t[28]!==n||t[29]!==i||t[30]!==N||t[31]!==L||t[32]!==R?(z=(0,M.jsxs)(E,{className:N,"data-slot":`sheet-popup`,style:L,...i,children:[n,R]}),t[28]=n,t[29]=i,t[30]=N,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==g||t[35]!==z||t[36]!==_?(B=(0,M.jsx)(I,{side:g,variant:_,children:z}),t[34]=g,t[35]=z,t[36]=_,t[37]=B):B=t[37];let V;return t[38]!==h||t[39]!==B||t[40]!==C?(V=(0,M.jsxs)(P,{keepMounted:h,children:[C,B]}),t[38]=h,t[39]=B,t[40]=C,t[41]=V):V=t[41],V}function R(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`font-semibold text-xl leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(D,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function B(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(x,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V={"2xl":1536,"3xl":1600,"4xl":2e3,lg:1024,md:768,sm:640,xl:1280};function H(e){return`(min-width: ${typeof e==`number`?e:V[e]}px)`}function U(e){return`(max-width: ${(typeof e==`number`?e:V[e])-1}px)`}function ee(e){if(typeof e!=`string`){let t=[];return e.min!=null&&t.push(H(e.min)),e.max!=null&&t.push(U(e.max)),e.pointer===`coarse`&&t.push(`(pointer: coarse)`),e.pointer===`fine`&&t.push(`(pointer: fine)`),t.length===0?`(min-width: 0px)`:t.join(` and `)}if(e.startsWith(`(`))return e;let t=[];for(let n of e.split(`:`))if(n.startsWith(`max-`)){let e=n.slice(4);e in V&&t.push(U(e))}else n in V&&t.push(H(n));return t.length>0?t.join(` and `):e}function te(){return!1}function W(e){let t=(0,j.c)(6),n;t[0]===e?n=t[1]:(n=ee(e),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=e=>{if(typeof window>`u`)return ne;let t=window.matchMedia(r);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},t[2]=r,t[3]=i);let a=i,o;return t[4]===r?o=t[5]:(o=()=>typeof window>`u`?!1:window.matchMedia(r).matches,t[4]=r,t[5]=o),(0,A.useSyncExternalStore)(a,o,te)}function ne(){}function G(){return W(`max-md`)}function re(e){return(e.isMobile?e.openMobile:e.open)?`expanded`:`collapsed`}var ie=`sidebar_state`,ae=604800,K=`16rem`,q=`calc(100vw - var(--spacing(3)))`,oe=`3rem`,se=256,J=`max-sm:[--workspace-titlebar-control-size:--spacing(8)]`,Y=A.createContext(null),X=A.createContext(null);function Z(){let e=A.use(Y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ce(){let{isMobile:e,open:t,openMobile:n}=Z();return e?n:t}function le(e){let t=(0,j.c)(40),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,d=G(),[f,p]=A.useState(!1),[m,h]=A.useState(!1),g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{h(e!==null)},t[8]=g):g=t[8];let _=g,[v,y]=A.useState(l),b=i??v,x;t[9]!==b||t[10]!==o?(x=async e=>{let t=typeof e==`function`?e(b):e;o?o(t):y(t),await cookieStore.set({expires:Date.now()+ae*1e3,name:ie,path:`/`,value:String(t)})},t[9]=b,t[10]=o,t[11]=x):x=t[11];let S=x,C;t[12]!==d||t[13]!==S?(C=()=>d?p(de):S(ue),t[12]=d,t[13]=S,t[14]=C):C=t[14];let w=C,T;t[15]!==d||t[16]!==b||t[17]!==f?(T=re({isMobile:d,open:b,openMobile:f}),t[15]=d,t[16]=b,t[17]=f,t[18]=T):T=t[18];let E=T,D;t[19]!==d||t[20]!==m||t[21]!==b||t[22]!==f||t[23]!==S||t[24]!==E||t[25]!==w?(D={isMobile:d,open:b,openMobile:f,mobileSheetMounted:m,setMobileSheetElement:_,setOpen:S,setOpenMobile:p,state:E,toggleSidebar:w},t[19]=d,t[20]=m,t[21]=b,t[22]=f,t[23]=S,t[24]=E,t[25]=w,t[26]=D):D=t[26];let O=D,k;t[27]===r?k=t[28]:(k=u(`group/sidebar-wrapper flex min-h-svh w-full`,J,r),t[27]=r,t[28]=k);let N;t[29]===s?N=t[30]:(N={"--sidebar-width":K,"--sidebar-width-icon":oe,"--workspace-titlebar-content-left":`calc(var(--workspace-controls-left) + var(--workspace-titlebar-control-size) + var(--workspace-titlebar-control-gap) + var(--workspace-history-controls-width, 0px))`,...s},t[29]=s,t[30]=N);let P=N,F;t[31]!==n||t[32]!==a||t[33]!==E||t[34]!==k||t[35]!==P?(F=(0,M.jsx)(`div`,{className:k,"data-sidebar-state":E,"data-slot":`sidebar-wrapper`,style:P,...a,children:n}),t[31]=n,t[32]=a,t[33]=E,t[34]=k,t[35]=P,t[36]=F):F=t[36];let I;return t[37]!==O||t[38]!==F?(I=(0,M.jsx)(Y,{value:O,children:F}),t[37]=O,t[38]=F,t[39]=I):I=t[39],I}function ue(e){return!e}function de(e){return!e}function fe(e){let t=(0,j.c)(80),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({side:a,variant:o,collapsible:s,resizable:c,separator:l,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let d=a===void 0?`left`:a,f=o===void 0?`sidebar`:o,p=s===void 0?`offcanvas`:s,m=c!==void 0&&c,h=l===void 0||l,{isMobile:g,state:_,openMobile:v,setOpenMobile:y,setMobileSheetElement:b}=Z(),x;bb0:{if(g||p===`none`||!m){x=null;break bb0}let e;t[9]===m?e=t[10]:(e=typeof m==`boolean`?{}:m,t[9]=m,t[10]=e);let n=e,r=n.maxWidth??1/0,i=n.minWidth??se,a=n.storageKey??null,o;t[11]===n.onResize?o=t[12]:(o=n.onResize?{onResize:n.onResize}:{},t[11]=n.onResize,t[12]=o);let s;t[13]===n.shouldAcceptWidth?s=t[14]:(s=n.shouldAcceptWidth?{shouldAcceptWidth:n.shouldAcceptWidth}:{},t[13]=n.shouldAcceptWidth,t[14]=s);let c;t[15]!==a||t[16]!==o||t[17]!==s||t[18]!==r||t[19]!==i?(c={maxWidth:r,minWidth:i,storageKey:a,...o,...s},t[15]=a,t[16]=o,t[17]=s,t[18]=r,t[19]=i,t[20]=c):c=t[20],x=c}let S=x,C;t[21]!==S||t[22]!==d?(C={side:d,resizable:S},t[21]=S,t[22]=d,t[23]=C):C=t[23];let w=C;if(p===`none`){let e;t[24]===r?e=t[25]:(e=u(`flex h-full w-(--sidebar-width) flex-col bg-sidebar surface-grain text-sidebar-foreground`,r),t[24]=r,t[25]=e);let a;t[26]!==n||t[27]!==i||t[28]!==e?(a=(0,M.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[26]=n,t[27]=i,t[28]=e,t[29]=a):a=t[29];let o;return t[30]!==w||t[31]!==a?(o=(0,M.jsx)(X,{value:w,children:a}),t[30]=w,t[31]=a,t[32]=o):o=t[32],o}if(g){let e;t[33]===r?e=t[34]:(e=u(`w-(--sidebar-width) max-w-none bg-sidebar surface-grain p-0 text-sidebar-foreground`,r),t[33]=r,t[34]=e);let a;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(a={"--sidebar-width":q},t[35]=a):a=t[35];let o;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsxs)(R,{className:`sr-only`,children:[(0,M.jsx)(z,{children:`Sidebar`}),(0,M.jsx)(B,{children:`Displays the mobile sidebar.`})]}),t[36]=o):o=t[36];let s=d===`left`?`pl-safe`:`pr-safe`,c;t[37]===s?c=t[38]:(c=u(`flex h-full w-full flex-col pb-safe pt-safe`,J,s),t[37]=s,t[38]=c);let l;t[39]!==n||t[40]!==i||t[41]!==c?(l=(0,M.jsx)(`div`,{className:c,...i,children:n}),t[39]=n,t[40]=i,t[41]=c,t[42]=l):l=t[42];let f;t[43]!==b||t[44]!==d||t[45]!==l||t[46]!==e?(f=(0,M.jsxs)(L,{ref:b,className:e,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,showCloseButton:!1,side:d,style:a,children:[o,l]}),t[43]=b,t[44]=d,t[45]=l,t[46]=e,t[47]=f):f=t[47];let p;t[48]!==v||t[49]!==y||t[50]!==f?(p=(0,M.jsx)(N,{onOpenChange:y,open:v,children:f}),t[48]=v,t[49]=y,t[50]=f,t[51]=p):p=t[51];let m;return t[52]!==w||t[53]!==p?(m=(0,M.jsx)(X,{value:w,children:p}),t[52]=w,t[53]=p,t[54]=m):m=t[54],m}let T=_===`collapsed`?p:``,E=f===`floating`||f===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,D;t[55]===E?D=t[56]:(D=u(`relative w-(--sidebar-width) bg-transparent`,`[[data-panel-animations=true]_&]:transition-[width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,E),t[55]=E,t[56]=D);let O;t[57]===D?O=t[58]:(O=(0,M.jsx)(`div`,{className:D,"data-slot":`sidebar-gap`}),t[57]=D,t[58]=O);let k=d===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,A;t[59]!==r||t[60]!==h||t[61]!==k||t[62]!==f?(A=u(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex`,`[[data-panel-animations=true]_&]:transition-[left,right,width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,k,f===`floating`||f===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:u(`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,h&&`group-data-[side=left]:border-r group-data-[side=right]:border-l`),r),t[59]=r,t[60]=h,t[61]=k,t[62]=f,t[63]=A):A=t[63];let P;t[64]===n?P=t[65]:(P=(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col bg-sidebar surface-grain group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm/5`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[64]=n,t[65]=P);let F;t[66]!==i||t[67]!==A||t[68]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-slot":`sidebar-container`,...i,children:P}),t[66]=i,t[67]=A,t[68]=P,t[69]=F):F=t[69];let I;t[70]!==d||t[71]!==_||t[72]!==O||t[73]!==F||t[74]!==T||t[75]!==f?(I=(0,M.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":T,"data-side":d,"data-slot":`sidebar`,"data-state":_,"data-variant":f,children:[O,F]}),t[70]=d,t[71]=_,t[72]=O,t[73]=F,t[74]=T,t[75]=f,t[76]=I):I=t[76];let V;return t[77]!==w||t[78]!==I?(V=(0,M.jsx)(X,{value:w,children:I}),t[77]=w,t[78]=I,t[79]=V):V=t[79],V}function pe(e){let t=(0,j.c)(18),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=Z(),o=ce(),s;t[4]===n?s=t[5]:(s=u(`size-[var(--workspace-titlebar-control-size)]! [-webkit-app-region:no-drag]`,n),t[4]=n,t[5]=s);let c;t[6]!==r||t[7]!==a?(c=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=c):c=t[8];let d=o?m:p,f;t[9]===d?f=t[10]:(f=(0,M.jsx)(g,{className:`size-4`,icon:d}),t[9]=d,t[10]=f);let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[11]=h):h=t[11];let _;return t[12]!==o||t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(_=(0,M.jsxs)(l,{className:s,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,"aria-pressed":o,onClick:c,size:`icon`,variant:`ghost`,...i,children:[f,h]}),t[12]=o,t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=_):_=t[17],_}function Q(e,t){return Math.max(t.minWidth,Math.min(e,t.maxWidth))}function me(e){let t=(0,j.c)(53),r,i,s,c,l,d,f,p;t[0]===e?(r=t[1],i=t[2],s=t[3],c=t[4],l=t[5],d=t[6],f=t[7],p=t[8]):({className:r,onClick:i,onPointerCancel:c,onLostPointerCapture:s,onPointerDown:l,onPointerMove:d,onPointerUp:f,...p}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=s,t[4]=c,t[5]=l,t[6]=d,t[7]=f,t[8]=p);let{open:m,toggleSidebar:h}=Z(),g=A.use(X),_=A.useRef(null),v=A.useRef(!1),y=g?.resizable??null,b=A.useRef(y),x=y!==null&&m?`Resize Sidebar`:`Toggle Sidebar`,S;t[9]!==m||t[10]!==y||t[11]!==g?.side?(S=e=>{if(!y||!m)return null;let t=e.currentTarget,n=t.closest(`[data-slot='sidebar-wrapper']`),r=t.closest(`[data-slot='sidebar']`),i=r?.querySelector(`[data-slot='sidebar-container']`);if(!n||!r||!i)return null;let s=g?.side??`left`,c=Q(i.getBoundingClientRect().width,y),l=[r.querySelector(`[data-slot='sidebar-gap']`),i].filter(_e),u=e=>{l.forEach(t=>{t.style.setProperty(`width`,`${e}px`)})};return l.forEach(ge),u(c),{width:c,edge:s===`left`?`right`:`left`,resize(e){let i=b.current;if(!i)return c;let a=Q(e,i);return(i.shouldAcceptWidth?.({currentWidth:c,nextWidth:a,rail:t,side:s,sidebarRoot:r,wrapper:n})??!0)&&(u(a),c=a),c},finish(e,t){n.style.setProperty(`--sidebar-width`,`${e}px`),v.current=t;let r=b.current;if(r?.storageKey)try{a(r.storageKey,e,o)}catch(e){console.error(`Could not persist sidebar width.`,e)}r?.onResize?.(e)},cleanup(){l.forEach(he)}}},t[9]=m,t[10]=y,t[11]=g?.side,t[12]=S):S=t[12];let C=k(S,String(m)),w;t[13]!==C||t[14]!==y?(w=()=>{b.current=y,C.refresh()},t[13]=C,t[14]=y,t[15]=w):w=t[15];let T;t[16]===y?T=t[17]:(T=[y],t[16]=y,t[17]=T),A.useLayoutEffect(w,T);let E;t[18]!==i||t[19]!==m||t[20]!==y||t[21]!==h?(E=e=>{if(i?.(e),!e.defaultPrevented){if(v.current){v.current=!1,e.preventDefault();return}if(y&&m){e.preventDefault();return}h()}},t[18]=i,t[19]=m,t[20]=y,t[21]=h,t[22]=E):E=t[22];let D=E,O,N;t[23]===y?(O=t[24],N=t[25]):(O=()=>{if(!y?.storageKey||typeof window>`u`)return;let e=_.current;if(!e)return;let t=e.closest(`[data-slot='sidebar-wrapper']`);if(!t)return;let r;try{r=n(y.storageKey,o)}catch(e){console.error(`Could not restore persisted sidebar width.`,e);return}if(r===null)return;let i=Q(r,y);t.style.setProperty(`--sidebar-width`,`${i}px`),y.onResize?.(i)},N=[y],t[23]=y,t[24]=O,t[25]=N),A.useLayoutEffect(O,N);let P;t[26]===r?P=t[27]:(P=u(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none`,`[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),t[26]=r,t[27]=P);let F;t[28]!==s||t[29]!==C?(F=e=>{s?.(e),e.defaultPrevented||C.onLostPointerCapture(e)},t[28]=s,t[29]=C,t[30]=F):F=t[30];let I;t[31]!==c||t[32]!==C?(I=e=>{c?.(e),e.defaultPrevented||C.onPointerCancel(e)},t[31]=c,t[32]=C,t[33]=I):I=t[33];let L;t[34]!==l||t[35]!==C?(L=e=>{l?.(e),e.defaultPrevented||C.onPointerDown(e)},t[34]=l,t[35]=C,t[36]=L):L=t[36];let R;t[37]!==d||t[38]!==C?(R=e=>{d?.(e),e.defaultPrevented||C.onPointerMove(e)},t[37]=d,t[38]=C,t[39]=R):R=t[39];let z;t[40]!==f||t[41]!==C?(z=e=>{f?.(e),e.defaultPrevented||C.onPointerUp(e)},t[40]=f,t[41]=C,t[42]=z):z=t[42];let B;return t[43]!==D||t[44]!==p||t[45]!==x||t[46]!==L||t[47]!==R||t[48]!==z||t[49]!==P||t[50]!==F||t[51]!==I?(B=(0,M.jsx)(`button`,{"aria-label":x,className:P,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:D,onLostPointerCapture:F,onPointerCancel:I,onPointerDown:L,onPointerMove:R,onPointerUp:z,ref:_,tabIndex:-1,type:`button`,...p}),t[43]=D,t[44]=p,t[45]=x,t[46]=L,t[47]=R,t[48]=z,t[49]=P,t[50]=F,t[51]=I,t[52]=B):B=t[52],B}function he(e){e.style.removeProperty(`width`),e.style.removeProperty(`transition-duration`)}function ge(e){e.style.setProperty(`transition-duration`,`0ms`)}function _e(e){return e!==null}function ve(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`[&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(y,{className:i,unstyled:!0,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex min-w-0 w-full flex-1 flex-col bg-background surface-grain`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm/5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`main`,{className:i,"data-slot":`sidebar-inset`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 px-[var(--sidebar-content-inset)] py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,j.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,fixedHeader:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=r?(0,M.jsx)(`div`,{className:`w-full shrink-0`,children:r}):null,t[4]=r,t[5]=a);let o=r&&`[&>[data-sidebar=group]:first-child]:pt-0`,s;t[6]!==n||t[7]!==o?(s=u(`flex w-full min-w-0 flex-col [overflow-anchor:none] group-data-[collapsible=icon]:overflow-hidden [&>[data-sidebar=group]+[data-sidebar=group]]:pt-0`,o,n),t[6]=n,t[7]=o,t[8]=s):s=t[8];let c;t[9]!==i||t[10]!==s?(c=(0,M.jsx)(b,{hideScrollbars:!0,scrollFade:!0,scrollFadePadding:!1,viewportTabIndex:-1,className:`h-auto min-h-0 flex-1 [&>[data-slot=scroll-area-viewport]]:[--fade-size:0.75rem]`,children:(0,M.jsx)(`div`,{className:s,"data-sidebar":`content`,"data-slot":`sidebar-content`,...i})}),t[9]=i,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==a||t[13]!==c?(l=(0,M.jsxs)(M.Fragment,{children:[a,c]}),t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function xe(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex w-full min-w-0 flex-col p-[var(--sidebar-content-inset)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex w-full min-w-0 flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ce(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var we=r(`peer/menu-button flex w-full cursor-pointer items-center gap-[var(--sidebar-control-gap)] overflow-hidden text-left outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 data-[active=true]:bg-sidebar-row-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[state=open]:hover:bg-sidebar-row-hover data-[state=open]:hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-[var(--sidebar-content-inset)]! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-[var(--sidebar-icon-color)] hover:[&>svg]:text-sidebar-foreground active:[&>svg]:text-sidebar-foreground data-[active=true]:[&>svg]:text-sidebar-foreground`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 rounded-[var(--control-radius)] px-[var(--sidebar-row-content-inset)] py-1.5 text-sm`,icon:`size-8 justify-center rounded-[var(--control-radius)] p-0`,lg:`h-12 rounded-lg p-2 text-sm group-data-[collapsible=icon]:p-0!`,sm:`h-7 rounded-lg p-2 text-xs`},variant:{default:`font-medium text-sidebar-foreground`,outline:`bg-sidebar-control-surface ring-1 ring-sidebar-border`,project:`font-normal text-sidebar-muted-foreground`,settings:`h-9 gap-2.5 rounded-xl px-3 font-normal text-sidebar-foreground data-[active=true]:font-normal [&>svg:not([class*='size-'])]:size-4.5 [&>svg]:text-sidebar-foreground`}}});function Te(e){let t=(0,j.c)(13),{isActive:n,variant:r,size:i,tooltip:a,className:o,render:s,...c}=e,l=n!==void 0&&n,p=r===void 0?`default`:r,m=i===void 0?`default`:i,{isMobile:g,state:y}=Z(),b={className:u(we({size:m,variant:p}),o),"data-active":l,"data-sidebar":`menu-button`,"data-size":m,"data-slot":`sidebar-menu-button`},x=f(b,c),S;t[0]!==x||t[1]!==s?(S={defaultTagName:`button`,props:x,render:s},t[0]=x,t[1]=s,t[2]=S):S=t[2];let C=d(S);if(!a)return C;if(typeof a==`string`){let e;t[3]===a?e=t[4]:(e={children:a},t[3]=a,t[4]=e),a=e}let w=C,T;t[5]===w?T=t[6]:(T=(0,M.jsx)(h,{render:w}),t[5]=w,t[6]=T);let E=y!==`collapsed`||g,D;t[7]!==E||t[8]!==a?(D=(0,M.jsx)(_,{align:`center`,hidden:E,side:`right`,...a}),t[7]=E,t[8]=a,t[9]=D):D=t[9];let O;return t[10]!==T||t[11]!==D?(O=(0,M.jsxs)(v,{children:[T,D]}),t[10]=T,t[11]=D,t[12]=O):O=t[12],O}function Ee(e){let t=(0,j.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?`tree`:i)===`flat`?`gap-0.5`:`mx-3.5 translate-x-px gap-1 border-sidebar-border border-l px-2.5 py-0.5`,o;t[4]!==n||t[5]!==a?(o=u(`flex min-w-0 flex-col`,a,`group-data-[collapsible=icon]:hidden`,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,M.jsx)(`ul`,{className:o,"data-sidebar":`menu-sub`,"data-slot":`sidebar-menu-sub`,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function De(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-sub-item`,"data-slot":`sidebar-menu-sub-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,j.c)(9),n,r,i,a;if(t[0]!==e){let{size:o,isActive:s,className:c,render:l,...p}=e;n=l;let m=o===void 0?`md`:o,h=s!==void 0&&s,g={className:u(`-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground`,`data-[active=true]:bg-sidebar-row-selected data-[active=true]:text-sidebar-foreground`,m===`sm`&&`text-xs`,m===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,c),"data-active":h,"data-sidebar":`menu-sub-button`,"data-size":m,"data-slot":`sidebar-menu-sub-button`};a=d,r=`a`,i=f(g,p),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;return t[5]!==n||t[6]!==r||t[7]!==i?(o={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8],a(o)}export{G as _,ve as a,L as b,Te as c,Oe as d,De as f,Z as g,pe as h,xe as i,Ce as l,me as m,$ as n,ye as o,le as p,be as r,Se as s,fe as t,Ee as u,W as v,N as y};
2
+ //# sourceMappingURL=sidebar-C_I_pq_E.js.map
@@ -1,2 +1,2 @@
1
- import{o as e}from"./p4ProjectFile-CN1m1U7N.js";function t(e){let t=new Set;for(let n of e)for(let e of n.memberProjects)if(t.add(e.environmentId),t.size>1)return!0;return!1}function n(t){let n=new Map,r=e({projects:t.projects,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId});for(let e of r)for(let t of e.members)n.set(t.physicalProjectKey,e.key);return n}function r(t){return e({projects:t.projects,groupScratchProjects:t.groupScratchProjects??!1,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId}).map(e=>{let n=e.members.map(({physicalProjectKey:e,project:n})=>({...n,physicalProjectKey:e,environmentLabel:t.resolveEnvironmentLabel(n.environmentId)})),r=n.find(t=>t.environmentId===e.representative.environmentId&&t.id===e.representative.id)??n[0],i=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId===t.primaryEnvironmentId),a=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId!==t.primaryEnvironmentId),o=n.filter(e=>t.primaryEnvironmentId!==null&&e.environmentId!==t.primaryEnvironmentId),s=o.flatMap(e=>e.environmentLabel?[e.environmentLabel]:[]).filter((e,t,n)=>n.indexOf(e)===t),c=t.isDesktopLocalEnvironment??(()=>!1),l=t.isWslEnvironment??(()=>!1),u=o.length>0&&o.every(e=>c(e.environmentId)),d=o.length>0&&o.every(e=>l(e.environmentId));return{...r,projectKey:e.key,displayName:e.label,groupedProjectCount:n.length,environmentPresence:i&&a?`mixed`:a?`remote-only`:`local-only`,allRemoteMembersAreDesktopLocal:u,allRemoteMembersAreWsl:d,memberProjects:n,memberProjectRefs:e.memberProjectRefs,remoteEnvironmentLabels:s}})}function i(e){let t=e.preferredProjectRef,n=e.groups.flatMap(e=>{let n=t?e.memberProjectRefs.some(e=>e.environmentId===t.environmentId&&e.projectId===t.projectId):!1,r=(t?e.memberProjects.find(e=>e.environmentId===t.environmentId&&e.id===t.projectId)??e.memberProjects.find(e=>e.environmentId===t.environmentId):null)??e.memberProjects.find(t=>t.environmentId===e.environmentId&&t.id===e.id)??e.memberProjects[0];return r?[{group:e,targetProject:r,isPreferred:n}]:[]}),r=n.findIndex(e=>e.isPreferred);return r<=0?n:[n[r],...n.slice(0,r),...n.slice(r+1)]}export{t as i,i as n,r,n as t};
2
- //# sourceMappingURL=sidebarProjectGrouping-lWfRDsCI.js.map
1
+ import{o as e}from"./p4ProjectFile--u7SOSK5.js";function t(e){let t=new Set;for(let n of e)for(let e of n.memberProjects)if(t.add(e.environmentId),t.size>1)return!0;return!1}function n(t){let n=new Map,r=e({projects:t.projects,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId});for(let e of r)for(let t of e.members)n.set(t.physicalProjectKey,e.key);return n}function r(t){return e({projects:t.projects,groupScratchProjects:t.groupScratchProjects??!1,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId}).map(e=>{let n=e.members.map(({physicalProjectKey:e,project:n})=>({...n,physicalProjectKey:e,environmentLabel:t.resolveEnvironmentLabel(n.environmentId)})),r=n.find(t=>t.environmentId===e.representative.environmentId&&t.id===e.representative.id)??n[0],i=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId===t.primaryEnvironmentId),a=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId!==t.primaryEnvironmentId),o=n.filter(e=>t.primaryEnvironmentId!==null&&e.environmentId!==t.primaryEnvironmentId),s=o.flatMap(e=>e.environmentLabel?[e.environmentLabel]:[]).filter((e,t,n)=>n.indexOf(e)===t),c=t.isDesktopLocalEnvironment??(()=>!1),l=t.isWslEnvironment??(()=>!1),u=o.length>0&&o.every(e=>c(e.environmentId)),d=o.length>0&&o.every(e=>l(e.environmentId));return{...r,projectKey:e.key,displayName:e.label,groupedProjectCount:n.length,environmentPresence:i&&a?`mixed`:a?`remote-only`:`local-only`,allRemoteMembersAreDesktopLocal:u,allRemoteMembersAreWsl:d,memberProjects:n,memberProjectRefs:e.memberProjectRefs,remoteEnvironmentLabels:s}})}function i(e){let t=e.preferredProjectRef,n=e.groups.flatMap(e=>{let n=t?e.memberProjectRefs.some(e=>e.environmentId===t.environmentId&&e.projectId===t.projectId):!1,r=(t?e.memberProjects.find(e=>e.environmentId===t.environmentId&&e.id===t.projectId)??e.memberProjects.find(e=>e.environmentId===t.environmentId):null)??e.memberProjects.find(t=>t.environmentId===e.environmentId&&t.id===e.id)??e.memberProjects[0];return r?[{group:e,targetProject:r,isPreferred:n}]:[]}),r=n.findIndex(e=>e.isPreferred);return r<=0?n:[n[r],...n.slice(0,r),...n.slice(r+1)]}export{t as i,i as n,r,n as t};
2
+ //# sourceMappingURL=sidebarProjectGrouping-DrnsFA8t.js.map