ryco-cli 0.1.28 → 0.1.29

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 (223) hide show
  1. package/dist/bin.cjs +17 -4
  2. package/dist/bin.mjs +17 -4
  3. package/dist/client/assets/{AccountSettings-DF6okodO.js → AccountSettings-FN7pwqYA.js} +1 -1
  4. package/dist/client/assets/{AiFocusSettings-BNNr6MW3.js → AiFocusSettings-xcDAMaqH.js} +1 -1
  5. package/dist/client/assets/{AnimatedHeight-q2A-ikJ5.js → AnimatedHeight-BNg7wnTK.js} +1 -1
  6. package/dist/client/assets/{AppearanceSettings-BD0MZkm7.js → AppearanceSettings-BvsvAOsG.js} +1 -1
  7. package/dist/client/assets/{BranchToolbar.logic-DN0He2gp.js → BranchToolbar.logic-DFsXV3Qs.js} +1 -1
  8. package/dist/client/assets/{BrowserPanel-C_ddyv_7.js → BrowserPanel-D-g_xDZs.js} +1 -1
  9. package/dist/client/assets/{ChatRightPanel-B62ml3EW.js → ChatRightPanel-Bm906qNi.js} +5 -5
  10. package/dist/client/assets/{ChatThreadRouteView-BnvzR19h.js → ChatThreadRouteView-CATwakjI.js} +1 -1
  11. package/dist/client/assets/{CommandPaletteDialog-KtIlImWg.js → CommandPaletteDialog-Obv1bvxj.js} +1 -1
  12. package/dist/client/assets/{CompositeRoot-CTspN_gA.js → CompositeRoot-CfkIdky8.js} +1 -1
  13. package/dist/client/assets/{ComputerUseSettings-B4KnZnFy.js → ComputerUseSettings-ljYmTHea.js} +1 -1
  14. package/dist/client/assets/{ConnectionsSettings-BW1hWm-b.js → ConnectionsSettings-CIXs7x_E.js} +1 -1
  15. package/dist/client/assets/{ContextHandoffEndpointLabel-BCNMjnEV.js → ContextHandoffEndpointLabel-BzI4Wi1i.js} +1 -1
  16. package/dist/client/assets/{DiagnosticsSettings-Biqth29E.js → DiagnosticsSettings-DGX_2T2M.js} +1 -1
  17. package/dist/client/assets/{DialogHandle-B1kG1DEu.js → DialogHandle-CTtSYpsC.js} +1 -1
  18. package/dist/client/assets/{DialogPopup-CZ-twaqA.js → DialogPopup-DdZlhHuQ.js} +1 -1
  19. package/dist/client/assets/DialogRoot-k2_0SNKA.js +1 -0
  20. package/dist/client/assets/{DialogTitle-D8Vib3Xi.js → DialogTitle-Du7CAbaO.js} +1 -1
  21. package/dist/client/assets/{DialogTrigger-C8WNfJfY.js → DialogTrigger-VpFh8Xza.js} +1 -1
  22. package/dist/client/assets/{DialogViewport-BzuRIust.js → DialogViewport-BwuqbGLY.js} +1 -1
  23. package/dist/client/assets/{DraftChatThreadRouteView-Bf196For.js → DraftChatThreadRouteView-Cmc5HpWf.js} +1 -1
  24. package/dist/client/assets/{GlassSurface-R5jo7uZp.js → GlassSurface-BlWIlQ0s.js} +1 -1
  25. package/dist/client/assets/{HostedConnectionControls-xi9LAlqs.js → HostedConnectionControls-ySHqwr4K.js} +1 -1
  26. package/dist/client/assets/{HostedHubRoot-B5cJPL0b.js → HostedHubRoot-Caz8PElK.js} +1 -1
  27. package/dist/client/assets/{HostedNativeAuthorizationRoute-BPxYI2S8.js → HostedNativeAuthorizationRoute-BSq_AlY2.js} +1 -1
  28. package/dist/client/assets/{HostedNodeRenameDialog-CZ6B6eOA.js → HostedNodeRenameDialog-ChxJdr-Z.js} +1 -1
  29. package/dist/client/assets/{HostedRelayTrustNotice-Da0fanPZ.js → HostedRelayTrustNotice-DPVrIfj_.js} +1 -1
  30. package/dist/client/assets/{IntegrationsSettingsPanel-CVIFEYar.js → IntegrationsSettingsPanel-eAq5h-D5.js} +1 -1
  31. package/dist/client/assets/{KeybindingsSettings-FJVISTz3.js → KeybindingsSettings-D1XaEVGH.js} +1 -1
  32. package/dist/client/assets/{LazyBrowserPanel-ChCZntfd.js → LazyBrowserPanel-B6POLJh3.js} +1 -1
  33. package/dist/client/assets/{McpServersSettings-D5qSFad1.js → McpServersSettings-DqLA6n5v.js} +1 -1
  34. package/dist/client/assets/{MobileSheet-BZwVUjae.js → MobileSheet-CtQIYRlY.js} +1 -1
  35. package/dist/client/assets/{NodeSecuritySettings-C9eJS4Wt.js → NodeSecuritySettings-Skm7GQDl.js} +1 -1
  36. package/dist/client/assets/{NullStore-iCZTvdl5.js → NullStore-b8PhjwPZ.js} +1 -1
  37. package/dist/client/assets/{OnboardingDialog-lWnlzsHQ.js → OnboardingDialog-8-fKvY5H.js} +1 -1
  38. package/dist/client/assets/{OpinionatedPluginsSettings-DQ77FhYa.js → OpinionatedPluginsSettings-BIJfJ34L.js} +1 -1
  39. package/dist/client/assets/{PdfAttachmentPreview-CmCBedSk.js → PdfAttachmentPreview-CTo1AyZs.js} +1 -1
  40. package/dist/client/assets/{PhoneGetAppInterstitial-DU7Pjbrv.js → PhoneGetAppInterstitial-DwopOWnQ.js} +1 -1
  41. package/dist/client/assets/{PhoneHome-D91zzTlE.js → PhoneHome-CUzxhhR4.js} +1 -1
  42. package/dist/client/assets/{PhoneSettingsSurface-vyuCLVtH.js → PhoneSettingsSurface-BK2RHmYJ.js} +1 -1
  43. package/dist/client/assets/{ProvidersSettingsPanel-QMtod_bc.js → ProvidersSettingsPanel-DPxL7AsR.js} +1 -1
  44. package/dist/client/assets/{QuitShortcutFeedback-Bti16E53.js → QuitShortcutFeedback-eCvP_MNj.js} +1 -1
  45. package/dist/client/assets/{RedactedSensitiveText-9r8QC1lJ.js → RedactedSensitiveText-DH4mWpB6.js} +1 -1
  46. package/dist/client/assets/{RootAppShell-CYT2IfYW.js → RootAppShell-DwiWD4Cy.js} +2 -2
  47. package/dist/client/assets/{Separator-ClXl-hQH.js → Separator-BiINUUQl.js} +1 -1
  48. package/dist/client/assets/{SettingsDialog-BUcF48F9.js → SettingsDialog-CE8qy0qL.js} +1 -1
  49. package/dist/client/assets/{SettingsPanels-BydjDF1I.js → SettingsPanels-BYknk6GO.js} +1 -1
  50. package/dist/client/assets/{SettingsPanels.editor-zrq4ZT2j.js → SettingsPanels.editor-64bM0lhg.js} +1 -1
  51. package/dist/client/assets/{SourceControlSettings-CqVmc4sB.js → SourceControlSettings-BbveiAj3.js} +1 -1
  52. package/dist/client/assets/{StatisticsPage-k-gimGKE.js → StatisticsPage-CAO_tCeC.js} +1 -1
  53. package/dist/client/assets/{StatisticsPanel-CtShfsl4.js → StatisticsPanel-SNlgMv2o.js} +1 -1
  54. package/dist/client/assets/{StatisticsSettingsLink-BapVo9aC.js → StatisticsSettingsLink-BpkNubL2.js} +1 -1
  55. package/dist/client/assets/{ThreadTerminalDrawer-Bfs5NCNv.js → ThreadTerminalDrawer-9x_kqQPy.js} +1 -1
  56. package/dist/client/assets/{ThreadWorkspacePanel-L6uNQRNX.js → ThreadWorkspacePanel-BXE17C4x.js} +1 -1
  57. package/dist/client/assets/{abnfDiagram-N423BO3Z-BzwwixLv.js → abnfDiagram-N423BO3Z-DAmGykdr.js} +1 -1
  58. package/dist/client/assets/{activity-CPE_7Kqw.js → activity-DRZlu-MC.js} +1 -1
  59. package/dist/client/assets/{alert-DVbwtykC.js → alert-CwrDisFU.js} +1 -1
  60. package/dist/client/assets/architecture-7GRP2DOG-CQNNG5gU.js +1 -0
  61. package/dist/client/assets/{architectureDiagram-T3A2C74G-DEiVciWZ.js → architectureDiagram-T3A2C74G-DypU2ERW.js} +1 -1
  62. package/dist/client/assets/{arrow-left-Ce-aUiy1.js → arrow-left-XhcJWpRy.js} +1 -1
  63. package/dist/client/assets/{arrow-right-BEwkAmxp.js → arrow-right-BBs6iTUL.js} +1 -1
  64. package/dist/client/assets/{arrow-up-right-CLCNhOeC.js → arrow-up-right-CJ9Vq7nK.js} +1 -1
  65. package/dist/client/assets/{badge-DqZmJa1g.js → badge-BswOCwph.js} +1 -1
  66. package/dist/client/assets/{blockDiagram-VBNYF7ZC-C-PBzm5g.js → blockDiagram-VBNYF7ZC-B9MhR9hY.js} +1 -1
  67. package/dist/client/assets/{bot-k1yDQ5mQ.js → bot-D5wgL7pu.js} +1 -1
  68. package/dist/client/assets/{c4Diagram-5PPSVZJV-DB6SIv2V.js → c4Diagram-5PPSVZJV-C22FWSoE.js} +1 -1
  69. package/dist/client/assets/{capabilities-C9OPiefV.js → capabilities-Bj_X9FZ-.js} +1 -1
  70. package/dist/client/assets/channel-BtX-w3CK.js +1 -0
  71. package/dist/client/assets/{chart-column-CVU4MshQ.js → chart-column-D6Lnkklk.js} +1 -1
  72. package/dist/client/assets/chevron-right-Ddq5gL-L.js +1 -0
  73. package/dist/client/assets/{chunk-2GRJ4B5K-CFM4Ac_N.js → chunk-2GRJ4B5K-D1tZuCzA.js} +1 -1
  74. package/dist/client/assets/{chunk-4I5QYGJK-a9tLNjnj.js → chunk-4I5QYGJK-Clf86zK0.js} +1 -1
  75. package/dist/client/assets/{chunk-5RXB4S5H-CbEb4Ht8.js → chunk-5RXB4S5H-B36N5RYZ.js} +1 -1
  76. package/dist/client/assets/{chunk-6Q2QTUOP-DPUmSmhc.js → chunk-6Q2QTUOP-IAxdzsQJ.js} +1 -1
  77. package/dist/client/assets/{chunk-7Z6QIM7H-Ba8d__CQ.js → chunk-7Z6QIM7H-Ctqebv_4.js} +1 -1
  78. package/dist/client/assets/{chunk-GF5L2VYU-BKOdlQ2f.js → chunk-GF5L2VYU-CAfciJae.js} +1 -1
  79. package/dist/client/assets/{chunk-I66GZJ75-DAfCveu2.js → chunk-I66GZJ75-BZ7XtZf4.js} +1 -1
  80. package/dist/client/assets/{chunk-JQJVKLGR-CPzgDuD8.js → chunk-JQJVKLGR-DVuZCWnv.js} +1 -1
  81. package/dist/client/assets/{chunk-KBJHAD2P-X87J_pHD.js → chunk-KBJHAD2P-DtWbzsRm.js} +1 -1
  82. package/dist/client/assets/{chunk-NSK5VX7P-BgrjQWAz.js → chunk-NSK5VX7P-BVMz_Hc4.js} +1 -1
  83. package/dist/client/assets/{chunk-QR6OTTB3-NTX__XXO.js → chunk-QR6OTTB3-DWitTCy-.js} +1 -1
  84. package/dist/client/assets/{chunk-UBXNYLIW-BVySE3ty.js → chunk-UBXNYLIW-BuxXXP2s.js} +1 -1
  85. package/dist/client/assets/{chunk-W5SLKNZC-0-ctjkBJ.js → chunk-W5SLKNZC-Bnf3sQl4.js} +1 -1
  86. package/dist/client/assets/{chunk-WRU74C26-AGGo_1S7.js → chunk-WRU74C26-xu-KDOon.js} +1 -1
  87. package/dist/client/assets/classDiagram-JCYQIIEL-BgDa3HFl.js +1 -0
  88. package/dist/client/assets/classDiagram-v2-OCEON4UE-BgDa3HFl.js +1 -0
  89. package/dist/client/assets/{clipboard-copy-C3icJCGA.js → clipboard-copy-oDSkUUg4.js} +1 -1
  90. package/dist/client/assets/{cynefin-OW5HDTMX-BR32cltb.js → cynefin-OW5HDTMX-DGNyiNSf.js} +1 -1
  91. package/dist/client/assets/{cynefinDiagram-MW4NZA55-B7S5bXUw.js → cynefinDiagram-MW4NZA55-_ctibv4i.js} +1 -1
  92. package/dist/client/assets/{dagre-VZM6K2ZE-BZOfZvme.js → dagre-VZM6K2ZE-Bo-bS1Y0.js} +1 -1
  93. package/dist/client/assets/{data-list-E_dNBqgV.js → data-list-DLsM39Hp.js} +1 -1
  94. package/dist/client/assets/{desktopWorkspace-DIoIhyml.js → desktopWorkspace-Ocqt625W.js} +1 -1
  95. package/dist/client/assets/{deviceName-BY2WK012.js → deviceName-z0ZWSq0z.js} +1 -1
  96. package/dist/client/assets/{diagram-7IWD3JNH-CypfFHxI.js → diagram-7IWD3JNH-DSjtw1SY.js} +1 -1
  97. package/dist/client/assets/{diagram-B4RE2ZJO-CaYsJtDz.js → diagram-B4RE2ZJO-B7fWEvIa.js} +1 -1
  98. package/dist/client/assets/{diagram-LBJQPF4R-BdhZtcd2.js → diagram-LBJQPF4R-trRYCE5d.js} +1 -1
  99. package/dist/client/assets/{diagram-Q27KOJAE-CW1SMIBy.js → diagram-Q27KOJAE-_DYcRggk.js} +1 -1
  100. package/dist/client/assets/{diagram-UB23O5K3-Cq8GGDkV.js → diagram-UB23O5K3-BkMzOHX8.js} +1 -1
  101. package/dist/client/assets/{download-Fq1MsYfI.js → download-CHdS3R_v.js} +1 -1
  102. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-CE78Op8p.js → ebnfDiagram-BXEA7PRR-DubiOMCG.js} +1 -1
  103. package/dist/client/assets/{editorPreferences-DzxKMQJx.js → editorPreferences-DVhg0CXd.js} +1 -1
  104. package/dist/client/assets/{empty-DXTz-nBL.js → empty-BlBl_Vvw.js} +1 -1
  105. package/dist/client/assets/{erDiagram-JOGREHBK-Bn6BFae6.js → erDiagram-JOGREHBK-CFDiNfSJ.js} +1 -1
  106. package/dist/client/assets/eventmodeling-NTZA5JFV-DpzGHjmu.js +1 -0
  107. package/dist/client/assets/flowDiagram-UKHOOZJN-CaDVMm72.js +1 -0
  108. package/dist/client/assets/{ganttDiagram-PKOTCBZU-C8NbmUQP.js → ganttDiagram-PKOTCBZU-DT2XhE-m.js} +1 -1
  109. package/dist/client/assets/{gitGraph-4MIJSDKK-Dg7W2mOf.js → gitGraph-4MIJSDKK-BI5UGiqb.js} +1 -1
  110. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-XEC1jydW.js → gitGraphDiagram-DS77QQ5N-CzAB97Rd.js} +1 -1
  111. package/dist/client/assets/{group-CcSMHbpZ.js → group-DZJuSiJL.js} +1 -1
  112. package/dist/client/assets/{hostedConnectionCoordinator-BkxMXc2s.js → hostedConnectionCoordinator-BztHfGNt.js} +1 -1
  113. package/dist/client/assets/{hubRoutes-Ch__ge2L.js → hubRoutes-DExWSvVE.js} +1 -1
  114. package/dist/client/assets/{index-3zoAo5bo.js → index-BAJdq3TK.js} +1 -1
  115. package/dist/client/assets/{info-A6RAGUB7-CPN5xH7s.js → info-A6RAGUB7-DdGYYgLX.js} +1 -1
  116. package/dist/client/assets/{infoDiagram-6WML65LV-DbXXnE3-.js → infoDiagram-6WML65LV-zhUpER6a.js} +1 -1
  117. package/dist/client/assets/{input-zI-YDU9i.js → input-CzU08wbL.js} +1 -1
  118. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-DAjJrXWe.js → ishikawaDiagram-WSZJBQD7-BQLkqykE.js} +1 -1
  119. package/dist/client/assets/{journeyDiagram-NVQOT4AX-CaGm-K-C.js → journeyDiagram-NVQOT4AX-DBgsbKOF.js} +1 -1
  120. package/dist/client/assets/{kanban-definition-27J2QSJJ-C2YRqY28.js → kanban-definition-27J2QSJJ-DF-Rr-xs.js} +1 -1
  121. package/dist/client/assets/{kbd-DlXUKjl1.js → kbd-DKuvGqFP.js} +1 -1
  122. package/dist/client/assets/{key-round-DLUapaUr.js → key-round-CvyrSjb2.js} +1 -1
  123. package/dist/client/assets/{layers-3D4z3mrk.js → layers-CwP65mnC.js} +1 -1
  124. package/dist/client/assets/{log-out-BxEBqpSs.js → log-out-D3rICSt5.js} +1 -1
  125. package/dist/client/assets/{main-DsnAjTqg.js → main-RFllWEko.js} +2 -2
  126. package/dist/client/assets/{mermaid-parser.core-Dhd66igk.js → mermaid-parser.core-BiGKtilP.js} +2 -2
  127. package/dist/client/assets/{mermaidEngine-3NZnIFOn.js → mermaidEngine-Cjfgf3Bg.js} +3 -3
  128. package/dist/client/assets/{mindmap-definition-FAOFIHXS-SuO77jBW.js → mindmap-definition-FAOFIHXS-SiU9JwWJ.js} +1 -1
  129. package/dist/client/assets/{motion-B4mmVewo.js → motion-C9rN_t9p.js} +1 -1
  130. package/dist/client/assets/{packet-AYTQ26CC-BZwkWo3N.js → packet-AYTQ26CC-F-HuW5Dr.js} +1 -1
  131. package/dist/client/assets/{palette-BXA2I3bI.js → palette-gaqgtube.js} +1 -1
  132. package/dist/client/assets/{pegDiagram-VL7TDLO6-DgWypDaQ.js → pegDiagram-VL7TDLO6-cC-QUd7I.js} +1 -1
  133. package/dist/client/assets/{pie-WAS4IAKB-C1iJ73d9.js → pie-WAS4IAKB-BI3XUcLN.js} +1 -1
  134. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-DK1OTG7x.js → pieDiagram-7S7Q4E2Y-BP4gJ4ZK.js} +1 -1
  135. package/dist/client/assets/{play-CJNYRuck.js → play-BJZrOx6T.js} +1 -1
  136. package/dist/client/assets/{providerDriverMeta-DJ9TrG26.js → providerDriverMeta-LJ2vJxm-.js} +1 -1
  137. package/dist/client/assets/{qr-code-HMr6crTy.js → qr-code-BFO8lV1M.js} +1 -1
  138. package/dist/client/assets/{qr-code-CBzdIN1G.js → qr-code-Cmfz5JKf.js} +1 -1
  139. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-CIgZ3afX.js → quadrantDiagram-CIZ2JOQS-DO-N1m-q.js} +1 -1
  140. package/dist/client/assets/{radar-RG4KPBEZ-vq15KQ2S.js → radar-RG4KPBEZ-CfayXQ5F.js} +1 -1
  141. package/dist/client/assets/{radio-group-1yuMmVHi.js → radio-group-BueX1AVO.js} +1 -1
  142. package/dist/client/assets/{railroad-74A4TZTK-DWMARNIs.js → railroad-74A4TZTK-CT6f-etT.js} +1 -1
  143. package/dist/client/assets/railroad-abnf-HS5TGJTU-B890iayj.js +1 -0
  144. package/dist/client/assets/railroad-ebnf-LZEXJU2U-C079Tzw6.js +1 -0
  145. package/dist/client/assets/railroad-peg-WCYAUIDC-DxvOX5Rh.js +1 -0
  146. package/dist/client/assets/{railroadDiagram-AXF67PYL-rE9Jx5yK.js → railroadDiagram-AXF67PYL-DC8egbob.js} +1 -1
  147. package/dist/client/assets/{refresh-cw-DBJIPv7m.js → refresh-cw-K_hU8_ld.js} +1 -1
  148. package/dist/client/assets/{requirementDiagram-LRYGKXZP-Dkz6KTug.js → requirementDiagram-LRYGKXZP-DJMzcLk_.js} +1 -1
  149. package/dist/client/assets/{runtime-DpHhg0dl.js → runtime-OM-uAtaj.js} +2 -2
  150. package/dist/client/assets/{sankeyDiagram-W5VNT64P-qCyqmTya.js → sankeyDiagram-W5VNT64P-YR6aIYLj.js} +1 -1
  151. package/dist/client/assets/{save-BFsP9OG2.js → save-Mh-PA_2P.js} +1 -1
  152. package/dist/client/assets/{scroll-area-CxjQJZM9.js → scroll-area-BC-LB_zE.js} +1 -1
  153. package/dist/client/assets/{scrollEdges-CXvSHaVb.js → scrollEdges-Zcpuz3un.js} +1 -1
  154. package/dist/client/assets/{separator-D3j91Nju.js → separator-yx1r9ZDw.js} +1 -1
  155. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-GCGWxGKL.js → sequenceDiagram-SI44F4Z6-BVeSqWDA.js} +1 -1
  156. package/dist/client/assets/{settingsLayout-3SUkadS6.js → settingsLayout-BbjDM-p0.js} +1 -1
  157. package/dist/client/assets/{sheet-BOQ2T2gY.js → sheet-CpEwjOWn.js} +1 -1
  158. package/dist/client/assets/{shield-alert-CWQ-fgqm.js → shield-alert-CXmR7fM9.js} +1 -1
  159. package/dist/client/assets/{shield-check-Dgpx5EQs.js → shield-check-CdFhWT_o.js} +1 -1
  160. package/dist/client/assets/{shield-Colgxqw7.js → shield-i098Bm_B.js} +1 -1
  161. package/dist/client/assets/{sidebar-BIv8pHHx.js → sidebar-DayQTDZp.js} +1 -1
  162. package/dist/client/assets/{sidebarProjectFolders-BpKCw8IR.js → sidebarProjectFolders-DXqx3OlZ.js} +1 -1
  163. package/dist/client/assets/{sidebarStatusText-DSeDlb-o.js → sidebarStatusText-kdA6QMZS.js} +1 -1
  164. package/dist/client/assets/{sidebarUndo-DzblmE6P.js → sidebarUndo-BHFfJj0k.js} +1 -1
  165. package/dist/client/assets/{skeleton-BdJ4w_TS.js → skeleton-BwFgUtuE.js} +1 -1
  166. package/dist/client/assets/{smartphone-DhBEWfKK.js → smartphone-DGfizz51.js} +1 -1
  167. package/dist/client/assets/square-Cd2WS1gv.js +1 -0
  168. package/dist/client/assets/{star-BAzXRepp.js → star-J3x3fktG.js} +1 -1
  169. package/dist/client/assets/{stateDiagram-OKZ733FA-D8fRUjov.js → stateDiagram-OKZ733FA-DoIZN669.js} +1 -1
  170. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-BnzsGHaN.js +1 -0
  171. package/dist/client/assets/storeSelectors-D60AAN01.js +1 -0
  172. package/dist/client/assets/{swimlanes-SLNWSIFB-BKy9AxWZ.js → swimlanes-SLNWSIFB-BoFLigyK.js} +1 -1
  173. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BnA-oDvU.js +8 -0
  174. package/dist/client/assets/{switch-DgLijJhN.js → switch-D9inWKdd.js} +1 -1
  175. package/dist/client/assets/{timeline-definition-Z64GVDOM-DV53IwmP.js → timeline-definition-Z64GVDOM-D65EmNWc.js} +1 -1
  176. package/dist/client/assets/{toggle-group-DRIEnEQy.js → toggle-group-YNqzWsK0.js} +1 -1
  177. package/dist/client/assets/{toggle-BgR-G8hl.js → toggle-wMq3LLn1.js} +1 -1
  178. package/dist/client/assets/{tokenModePresentation-Bh3mJ9H-.js → tokenModePresentation-C0-NgmX5.js} +1 -1
  179. package/dist/client/assets/{tooltip-CsNk2GK1.js → tooltip-mwOCSCXF.js} +1 -1
  180. package/dist/client/assets/{treeView-Q6P3EWNA-BgFMn3HH.js → treeView-Q6P3EWNA-C2S-OPgI.js} +1 -1
  181. package/dist/client/assets/{treemap-WGGIJYW6-B45XVWgo.js → treemap-WGGIJYW6-6Ovsu9iH.js} +1 -1
  182. package/dist/client/assets/{unplug-0SZT8Az_.js → unplug-BEfcl9Ht.js} +1 -1
  183. package/dist/client/assets/useAppSidebarCollapsed-C0jpPtER.js +1 -0
  184. package/dist/client/assets/useBaseUiId-Bz8dcyjd.js +1 -0
  185. package/dist/client/assets/{useLabelableId-CTlGVpp_.js → useLabelableId-C8bc9a0F.js} +1 -1
  186. package/dist/client/assets/{useNavigate-xewFGSmS.js → useNavigate-01O5dMQe.js} +1 -1
  187. package/dist/client/assets/{usePhoneThreadActions-CuSwvIb4.js → usePhoneThreadActions-BIdh81kF.js} +1 -1
  188. package/dist/client/assets/{usePopupViewport-CCXjC0oV.js → usePopupViewport-DYYZwfTW.js} +1 -1
  189. package/dist/client/assets/{useScrollLock-DkiskCYn.js → useScrollLock-BO185DkJ.js} +1 -1
  190. package/dist/client/assets/{useStatistics-C5V0rg9r.js → useStatistics-D55-xLMz.js} +1 -1
  191. package/dist/client/assets/{useTriggerFocusGuards-Cd4IS7Sl.js → useTriggerFocusGuards-CMLVr18J.js} +1 -1
  192. package/dist/client/assets/{useValueChanged-DUWoN5BG.js → useValueChanged-DSyRHPje.js} +1 -1
  193. package/dist/client/assets/{user-round-BtyrzbBf.js → user-round-C-U7TZKG.js} +1 -1
  194. package/dist/client/assets/{vennDiagram-T6HMQDX7-DAr5h306.js → vennDiagram-T6HMQDX7-fZAexcYr.js} +1 -1
  195. package/dist/client/assets/{vscode-icons-LDoILSKI.js → vscode-icons-BYX6fBsM.js} +1 -1
  196. package/dist/client/assets/{wardley-WFR3VGLG-6MSUlbTx.js → wardley-WFR3VGLG-gdYWSMxK.js} +1 -1
  197. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-Bwv8xq6E.js → wardleyDiagram-T6FBY63Y-iDJxQb70.js} +1 -1
  198. package/dist/client/assets/{workspaceMetadataProjection-DzVpakWU.js → workspaceMetadataProjection-So9-wSEZ.js} +1 -1
  199. package/dist/client/assets/{wrench-BDHgkqDa.js → wrench-D79uBUSl.js} +1 -1
  200. package/dist/client/assets/{xychartDiagram-ELKLHX3M-Be0CbWLp.js → xychartDiagram-ELKLHX3M-B4cfMwpJ.js} +1 -1
  201. package/dist/client/index.html +1 -1
  202. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  203. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  204. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  205. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  206. package/package.json +1 -1
  207. package/dist/client/assets/DialogRoot-CEU7Xp57.js +0 -1
  208. package/dist/client/assets/architecture-7GRP2DOG-B6OTx_1D.js +0 -1
  209. package/dist/client/assets/channel-D_j9jK0M.js +0 -1
  210. package/dist/client/assets/chevron-right-D3dUAoht.js +0 -1
  211. package/dist/client/assets/classDiagram-JCYQIIEL-Ck79EbLj.js +0 -1
  212. package/dist/client/assets/classDiagram-v2-OCEON4UE-Ck79EbLj.js +0 -1
  213. package/dist/client/assets/eventmodeling-NTZA5JFV-COIUUd8Y.js +0 -1
  214. package/dist/client/assets/flowDiagram-UKHOOZJN-Cdhu8N9G.js +0 -1
  215. package/dist/client/assets/railroad-abnf-HS5TGJTU-DtRRa_PL.js +0 -1
  216. package/dist/client/assets/railroad-ebnf-LZEXJU2U-WQz4QHTw.js +0 -1
  217. package/dist/client/assets/railroad-peg-WCYAUIDC-1gkGEpqz.js +0 -1
  218. package/dist/client/assets/square--aW0vCo4.js +0 -1
  219. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-vKQeXqcV.js +0 -1
  220. package/dist/client/assets/storeSelectors-BFVEGU0F.js +0 -1
  221. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-qtmvcwUS.js +0 -8
  222. package/dist/client/assets/useAppSidebarCollapsed-CvO9sEQ7.js +0 -1
  223. package/dist/client/assets/useBaseUiId-B5nK6G4h.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xs as t}from"./runtime-DpHhg0dl.js";import{t as n}from"./react-CwJFpaho.js";var r=e(n(),1).forwardRef(function(e,n){let{className:r,render:i,orientation:a=`horizontal`,style:o,...s}=e;return t(`div`,e,{state:{orientation:a},ref:n,props:[{role:`separator`,"aria-orientation":a},s]})});export{r as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xs as t}from"./runtime-OM-uAtaj.js";import{t as n}from"./react-CwJFpaho.js";var r=e(n(),1).forwardRef(function(e,n){let{className:r,render:i,orientation:a=`horizontal`,style:o,...s}=e;return t(`div`,e,{state:{orientation:a},ref:n,props:[{role:`separator`,"aria-orientation":a},s]})});export{r as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-BqSANuAs.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-3zoAo5bo.js";import{K as n,i as r,q as i}from"./primary-CQh_KHGG.js";import{_i as a,mi as o,t as s}from"./src-DHNjfMxR.js";import{$ as c,$l as l,Bn as u,I as d,J as f,Jl as p,K as m,P as h,Q as g,Ql as _,Qr as v,Vl as y,Xl as b,Yl as x,Yr as S,Zl as C,b as w,ei as T,go as E,mr as D,pr as O,q as ee}from"./runtime-DpHhg0dl.js";import{t as te}from"./react-CwJFpaho.js";import{$n as ne,Cr as re,Gt as ie,Qt as ae,Zt as oe,er as k,mr as se,nr as ce,pr as le,tr as ue}from"./switch-DgLijJhN.js";import{t as A}from"./compiler-runtime-C4g8XhC5.js";import{a as j,n as de,o as M,s as N}from"./badge-DqZmJa1g.js";import{t as P}from"./activity-CPE_7Kqw.js";import{d as F,f as fe,l as I,n as L,r as R,t as z,u as pe}from"./SettingsPanels-BydjDF1I.js";import{g as me,x as B}from"./RootAppShell-CYT2IfYW.js";import{t as he}from"./chart-column-CVU4MshQ.js";import{Y as V}from"./ContextHandoffEndpointLabel-BCNMjnEV.js";import{n as H,t as ge}from"./capabilities-C9OPiefV.js";import{t as _e}from"./palette-BXA2I3bI.js";import{R as ve}from"./sidebarProjectFolders-BpKCw8IR.js";import{t as ye}from"./shield-Colgxqw7.js";import{t as be}from"./user-round-BtyrzbBf.js";import{o as xe}from"./authorization-BugIGt5e.js";import{o as Se,t as Ce}from"./desktopWorkspace-DIoIhyml.js";import{n as we,t as Te}from"./deviceName-BY2WK012.js";import{t as Ee}from"./scroll-area-CxjQJZM9.js";import{i as De,r as U}from"./settingsLayout-3SUkadS6.js";import{i as Oe}from"./hubRoutes-Ch__ge2L.js";import{t as W}from"./HostedNodeRenameDialog-CZ6B6eOA.js";var G=A(),K=e(te(),1),q=l();function J(){let e=_(),[t,n]=(0,K.useState)(!1),[r,i]=(0,K.useState)(null);if(!e)return null;let a=e.serverConfig,s=a?.environment.capabilities.environmentIcon===!0,c=e.connected&&e.canManage!==!1&&e.canMutate!==!1&&s,l=ue(a),u=a?.settings.environmentIcon??`automatic`;return(0,q.jsx)(U,{title:`Device icon`,scope:e.nodeLabel,description:`Shown across mobile, desktop, and web. Automatic uses the device’s name and operating system.`,control:(0,q.jsxs)(de,{value:u,disabled:!c||t,onValueChange:async r=>{if(c&&!t&&r!==null){n(!0),i(null);try{await w(e.environmentId,{environmentIcon:r===`automatic`?null:r})}catch{i(`Could not save the icon for ${e.nodeLabel}. Reconnect and try again.`)}finally{n(!1)}}},children:[(0,q.jsxs)(N,{"aria-label":`Device icon for ${e.nodeLabel}`,className:`w-48`,children:[(0,q.jsx)(ce,{kind:l,className:`size-4`}),(0,q.jsx)(`span`,{children:u===`automatic`?`Automatic · ${k[l]}`:k[l]})]}),(0,q.jsxs)(M,{children:[(0,q.jsx)(j,{value:`automatic`,children:`Automatic`}),o.map(e=>(0,q.jsx)(j,{value:e,children:(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(ce,{kind:e,className:`size-4`}),k[e]]})},e))]})]}),status:r?(0,q.jsx)(`span`,{role:`alert`,children:r}):e.connected?s?c?void 0:(0,q.jsx)(`span`,{children:`Your access does not allow changing this device’s settings.`}):(0,q.jsx)(`span`,{children:`Update this device to enable icon selection.`}):(0,q.jsxs)(`span`,{children:[`Connect to `,e.nodeLabel,` to change its icon.`]})})}function ke(){let e=(0,G.c)(39),t=_(),a=r(),o=Se(),s=h(Ae),[c,l]=(0,K.useState)(!1);if(!t)return null;let u=n&&t.environmentId===a?.environmentId?o.localEnvironmentId:t.environmentId,f;if(e[0]!==u||e[1]!==o.machines){let t;e[3]===u?t=e[4]:(t=e=>e.environmentId===u,e[3]=u,e[4]=t),f=o.machines.find(t),e[0]=u,e[1]=o.machines,e[2]=f}else f=e[2];let p=f,m;if(e[5]!==u||e[6]!==s){let t;e[8]===u?t=e[9]:(t=e=>e.environmentId===u,e[8]=u,e[9]=t),m=s.find(t),e[5]=u,e[6]=s,e[7]=m}else m=e[7];let g=m,y;e[10]!==p?.canRename||e[11]!==g?(y=n?p?.canRename===!0&&!!window.desktopBridge?.renameDesktopWorkspaceDevice:i()&&g?.effectiveRole===`owner`&&g.revokedAt===null,e[10]=p?.canRename,e[11]=g,e[12]=y):y=e[12];let b=y,x;e[13]!==p||e[14]!==g?(x=async e=>{if(n&&p&&window.desktopBridge?.renameDesktopWorkspaceDevice)await window.desktopBridge.renameDesktopWorkspaceDevice({environmentId:p.environmentId,label:e});else if(i()&&g)await d.renameNode(g.id,e),await xe.refreshDirectory();else throw Error(`Connect this device to your Hub to customize its name.`)},e[13]=p,e[14]=g,e[15]=x):x=e[15];let S=x,C;e[16]===b?C=e[17]:(C=b?(0,q.jsx)(v,{variant:`outline`,onClick:()=>l(!0),children:`Rename device`}):void 0,e[16]=b,e[17]=C);let w;e[18]!==b||e[19]!==u||e[20]!==p||e[21]!==g?(w=b?void 0:(0,q.jsx)(`span`,{children:u&&(p||g)?`Only the device owner can change its name.`:`Connect to your Hub to customize the device name.`}),e[18]=b,e[19]=u,e[20]=p,e[21]=g,e[22]=w):w=e[22];let T;e[23]!==C||e[24]!==w||e[25]!==t.nodeLabel?(T=(0,q.jsx)(U,{title:`Device name`,scope:t.nodeLabel,description:`Shown to everyone who can access this device. Renaming keeps its projects, conversations, and connections.`,control:C,status:w}),e[23]=C,e[24]=w,e[25]=t.nodeLabel,e[26]=T):T=e[26];let E;e[27]===t.environmentId?E=e[28]:(E=(0,q.jsx)(J,{},t.environmentId),e[27]=t.environmentId,e[28]=E);let D;e[29]!==b||e[30]!==S||e[31]!==c||e[32]!==t.environmentId||e[33]!==t.nodeLabel?(D=b&&(0,q.jsx)(W,{node:{label:t.nodeLabel},open:c,onOpenChange:l,onRename:S},t.environmentId),e[29]=b,e[30]=S,e[31]=c,e[32]=t.environmentId,e[33]=t.nodeLabel,e[34]=D):D=e[34];let O;return e[35]!==T||e[36]!==E||e[37]!==D?(O=(0,q.jsxs)(De,{title:`Device`,owner:`node`,className:`mx-6 mt-5 mb-3`,children:[T,E,D]}),e[35]=T,e[36]=E,e[37]=D,e[38]=O):O=e[38],O}function Ae(e){return e.nodes}function je(e,t,n){let[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)([]),[s,c]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(!r)return;let e=new WeakMap,i=0,a=[],s=()=>{let e=r.getBoundingClientRect().top+64,t=a.findLast(t=>t.element.getBoundingClientRect().top<=e)??a[0];c(t?.element??null)},l=!1,u=()=>{if(a=t?[]:Array.from(r.querySelectorAll(`[data-settings-section]`)).map(t=>(e.has(t)||e.set(t,`section-${++i}`),{id:e.get(t),title:t.dataset.settingsSection,element:t})),o(e=>e.length===a.length&&e.every((e,t)=>e.element===a[t]?.element&&e.title===a[t]?.title)?e:a),n&&!t&&!l){let e=Array.from(r.querySelectorAll(`h2, h3, [id], [data-settings-section]`)).find(e=>e.id===n||e.dataset.settingsSection===n||e.textContent?.trim()===n);e&&(l=!0,e.scrollIntoView({block:`center`}),e.tabIndex=-1,e.focus({preventScroll:!0}))}s()};u();let d=new MutationObserver(u);return d.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-settings-section`,`aria-current`]}),r.addEventListener(`scroll`,s,!0),()=>{d.disconnect(),r.removeEventListener(`scroll`,s,!0)}},[r,e,t,n]),{contentRef:i,sections:a,active:s}}var Me=[{section:`general`,owner:`node`,title:`Project defaults`,description:`Inherited initial model, effort, thread location, branch prefix, and worktree setup.`,keywords:`inherit override reset scope project model effort setup`},{section:`general`,owner:`client`,title:`Welcome tour`,description:`Replay provider setup, add a project, and learn the essentials.`,keywords:`onboarding first run getting started setup`,localOnboardingOnly:!0},{section:`appearance`,title:`Diff style`,owner:`client`,description:`Preview unified and split layouts for code changes.`,keywords:`diff design side by side stacked layout`},{section:`integrations`,title:`Browser Use`,owner:`client`,description:`Pair browsers and manage agent access to local tabs.`,keywords:`chrome brave edge browser extension`,desktopCapability:`computerUse`},{section:`general`,title:`Quit shortcut`,owner:`client`,description:`Prevent accidental quits: press twice, hold, or quit immediately.`,keywords:`ctrl cmd q exit desktop`,desktopCapability:`quitShortcut`},{section:`general`,title:`Device name`,owner:`node`,description:`Rename the selected device for everyone who can access it.`,keywords:`machine hostname node name rename`},{section:`integrations`,title:`Device permissions`,owner:`node`,description:`Manage permissions on the selected device or learn where local approval is required.`,keywords:`computer use accessibility screen recording capture device local remote`},{section:`integrations`,desktopCapability:`computerUse`,title:`Computer use`,owner:`client`,description:`Control local apps and browsers, manage permissions, and pair a browser.`,keywords:`accessibility screen recording capture cursor chrome brave edge app access foreground automation`},{section:`inbox`,title:`AI Focus`,owner:`client`,description:`Prioritize the Inbox with bounded, environment-local model ranking.`,keywords:`priority sort active threads model ranking focus refresh`},{section:`inbox`,title:`AI Focus models`,owner:`node`,description:`Choose or inherit the ranking model for each connected environment.`,keywords:`provider node disclosure privacy data`},{section:`general`,title:`Time format`,owner:`client`,description:`System default, 12-hour or 24-hour clock.`,keywords:`clock hours`},{section:`general`,title:`Default editor`,owner:`client`,description:`Pin which editor opens directories and files.`,keywords:`vscode cursor open in`},{section:`source-control`,title:`Diff line wrapping`,owner:`client`,description:`Default wrap state when the diff panel opens.`,keywords:`word wrap`},{section:`source-control`,title:`Hide whitespace changes`,owner:`client`,description:`Whether the diff panel ignores whitespace-only edits.`,keywords:`diff`},{section:`source-control`,title:`Remote Git status`,owner:`client`,description:`Refresh remote branch and pull request metadata.`,keywords:`git polling refresh remote`},{section:`source-control`,title:`PR & workflow updates`,owner:`client`,description:`Choose automatic, reduced, or manual pull request and workflow refreshes.`,keywords:`github actions checks ci polling refresh`},{section:`general`,title:`Stream token by token (legacy)`,owner:`node`,description:`Compatibility mode for token-by-token assistant output.`,keywords:`token streaming assistant output streaming tokens buffered`,targetId:`legacy-token-streaming`},{section:`general`,title:`Provider update checks`,owner:`node`,description:`Check installed provider CLIs for newer versions.`,keywords:`upgrade cli`},{section:`general`,title:`Auto-open overview`,owner:`client`,description:`Open the overview when plans or progress appear.`,keywords:`panel plan`},{section:`general`,title:`New threads`,owner:`node`,description:`Default workspace mode for newly created drafts.`,keywords:`local worktree draft`},{section:`general`,title:`Worktree branch prefix`,owner:`node`,description:`Default prefix for generated worktree branches on this device.`,keywords:`git namespace branch naming ryco`},{section:`general`,title:`Worktree root`,owner:`node`,description:`Environment worktree directory and project overrides. Existing checkouts keep their paths.`,keywords:`folder path location inherit reset`},{section:`general`,title:`Worktree submodules`,owner:`node`,description:`Initialization for new worktrees, with project overrides and repository configuration.`,keywords:`git recursive top-level none initialize inherit`},{section:`general`,title:`Add project starts in`,owner:`node`,description:`Starting directory for the Add Project browser.`,keywords:`folder path`},{section:`general`,title:`Archive confirmation`,owner:`client`,description:`Ask before archiving a thread.`,keywords:`confirm`},{section:`general`,title:`Delete confirmation`,owner:`client`,description:`Ask before deleting a thread.`,keywords:`confirm remove`},{section:`general`,title:`Unpin confirmation`,owner:`client`,description:`Ask before removing a thread from pinned threads.`,keywords:`confirm pin unpin favorite`},{section:`general`,title:`Update track`,owner:`client`,description:`Which release channel the app follows.`,keywords:`beta stable release channel`},{section:`appearance`,title:`Interface font`,owner:`client`,description:`Normal app text, navigation, dialogs, and controls.`,keywords:`typeface dm sans inter geist`},{section:`appearance`,title:`Code font`,owner:`client`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,keywords:`monospace jetbrains fira`},{section:`appearance`,title:`Text size`,owner:`client`,description:`Scale the interface independently from the theme.`,keywords:`zoom font size compact`},{section:`appearance`,title:`Corner radius`,owner:`client`,description:`Rounding for panels, buttons, inputs, and menus.`,keywords:`round square`},{section:`appearance`,title:`Primary color`,owner:`client`,description:`Accent color for links, focus rings, and actions.`,keywords:`accent custom violet amber`},{section:`appearance`,title:`Transparency`,owner:`client`,description:`Glass and floating surfaces like dialogs, menus, popups.`,keywords:`glass blur liquid material solid`},{section:`appearance`,title:`Theme palette`,owner:`client`,description:`Built-in and custom color themes; import and export.`,keywords:`dark midnight graphite nord dracula catppuccin`},{section:`general`,title:`Auto-collapse wide composer labels`,owner:`client`,description:`Show long composer mode labels only on hover or focus.`,keywords:`chips`},{section:`general`,title:`Always use Build mode`,owner:`client`,description:`Hide the mode selector and send every turn in Build mode.`,keywords:`composer`},{section:`appearance`,title:`Color mode`,owner:`client`,description:`Light, dark, or follow the system preference.`,keywords:`color mode dark light`},{section:`providers`,title:`Provider instances`,owner:`node`,description:`Configure Codex, Claude, Copilot, OpenCode, and Cursor.`,keywords:`api model driver accent`},{section:`integrations`,title:`Private Agent Control`,owner:`node`,description:`Pair local Codex or Claude MCP clients with scoped, revocable access.`,keywords:`model context protocol tools pairing codex claude approval agent control`},{section:`mcp-servers`,title:`MCP Servers`,owner:`node`,description:`Manage Codex, Claude, and other provider-native MCP servers.`,keywords:`model context protocol tools add server oauth profiles providers`},{section:`keybindings`,title:`Keybindings file`,owner:`node`,description:`Customize shortcuts via the keybindings configuration file.`,keywords:`shortcuts hotkeys keyboard`},{section:`source-control`,title:`Version Control`,owner:`node`,description:`Git behavior and defaults.`,keywords:`git commit`},{section:`source-control`,title:`Source Control Providers`,owner:`node`,description:`GitHub and other source control provider connections.`,keywords:`github pr pull request`},{section:`connections`,title:`Network access`,owner:`client`,description:`Expose the local backend on your network.`,keywords:`lan host remote`},{section:`connections`,title:`Pairing link`,owner:`client`,description:`Scan to open this backend on another device.`,keywords:`qr code phone mobile`},{section:`connections`,title:`Tailscale HTTPS`,owner:`client`,description:`Serve over your tailnet with HTTPS.`,keywords:`vpn remote`},{section:`connections`,title:`Authorized clients`,owner:`client`,description:`Devices and sessions allowed to connect.`,keywords:`revoke tokens`},{section:`security`,title:`Session code`,owner:`node`,description:`Compare this browser's channel against the one your node's CLI shows.`,keywords:`security verification websas e2ee compare short authentication string`},{section:`security`,title:`Enrollment fingerprint`,owner:`node`,description:`This node's identity, and the prekey and continuity behind it.`,keywords:`security e2ee key fingerprint rotate lineage`},{section:`security`,title:`Authorized client keys`,owner:`node`,description:`Approve, reduce, revoke, or delete a client key, and open a pairing window.`,keywords:`security e2ee pairing fingerprint refused attempts`},{section:`security`,title:`Admission policy`,owner:`node`,description:`Require E2EE, require approved clients, and advance the policy generation.`,keywords:`security e2ee strict fallback plaintext`},{section:`diagnostics`,title:`Diagnostics`,owner:`node`,description:`Logs, tracing, resource history, and live activity.`,keywords:`debug performance slow`},{section:`diagnostics`,title:`Test notification`,owner:`client`,description:`Fire sample notifications to preview the toast design and stacking.`,keywords:`toast notifications preview trigger sample`},{section:`statistics`,title:`Statistics`,owner:`node`,description:`Usage activity and history.`,keywords:`heatmap usage tokens`},{section:`archived`,title:`Archive`,owner:`node`,description:`Archived threads; restore or delete permanently.`,keywords:`trash restore`}],Ne=[{id:`account`,label:`Account`,icon:be},{id:`general`,label:`General`,icon:ve},{id:`inbox`,label:`Inbox`,icon:H},{id:`providers`,label:`Providers`,icon:fe},{id:`opinionated-plugins`,label:`Plugins`,icon:I},{id:`mcp-servers`,label:`MCP`,icon:le},{id:`integrations`,label:`Integrations`,icon:I},{id:`appearance`,label:`Appearance`,icon:_e},{id:`keybindings`,label:`Keybindings`,icon:F},{id:`source-control`,label:`Source Control`,icon:re},{id:`connections`,label:`Connections`,icon:pe},{id:`security`,label:`Node security`,icon:ye},{id:`diagnostics`,label:`Diagnostics`,icon:P},{id:`statistics`,label:`Statistics`,icon:he},{id:`archived`,label:`Archive`,icon:B}];Ne.map(e=>e.id),new Map(Ne.map(e=>[e.id,e.label]));var Y=(0,K.lazy)(()=>t(()=>import(`./AccountSettings-DF6okodO.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),X=(0,K.lazy)(()=>t(()=>import(`./ProvidersSettingsPanel-QMtod_bc.js`).then(e=>({default:e.ProvidersSettingsPanel})),__vite__mapDeps([0]))),Pe=(0,K.lazy)(()=>t(()=>import(`./AiFocusSettings-BNNr6MW3.js`).then(e=>({default:e.AiFocusSettings})),__vite__mapDeps([0]))),Z=(0,K.lazy)(()=>t(()=>import(`./OpinionatedPluginsSettings-DQ77FhYa.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),__vite__mapDeps([0]))),Fe=(0,K.lazy)(()=>t(()=>import(`./IntegrationsSettingsPanel-CVIFEYar.js`).then(e=>({default:e.IntegrationsSettingsPanel})),__vite__mapDeps([0]))),Q=(0,K.lazy)(()=>t(()=>import(`./McpServersSettings-D5qSFad1.js`).then(e=>({default:e.McpServersSettings})),__vite__mapDeps([0]))),Ie=(0,K.lazy)(()=>t(()=>import(`./AppearanceSettings-BD0MZkm7.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),Le=(0,K.lazy)(()=>t(()=>import(`./KeybindingsSettings-FJVISTz3.js`).then(e=>({default:e.KeybindingsSettingsPanel})),__vite__mapDeps([0]))),Re=(0,K.lazy)(()=>t(()=>import(`./SourceControlSettings-CqVmc4sB.js`).then(e=>({default:e.SourceControlSettingsPanel})),__vite__mapDeps([0]))),ze=(0,K.lazy)(()=>t(()=>import(`./ConnectionsSettings-BW1hWm-b.js`).then(e=>({default:e.ConnectionsSettings})),__vite__mapDeps([0]))),Be=(0,K.lazy)(()=>t(()=>import(`./NodeSecuritySettings-C9eJS4Wt.js`).then(e=>({default:e.NodeSecuritySettings})),__vite__mapDeps([0]))),$=(0,K.lazy)(()=>t(()=>import(`./DiagnosticsSettings-Biqth29E.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Ve=(0,K.lazy)(()=>t(()=>import(`./StatisticsSettingsLink-BapVo9aC.js`).then(e=>({default:e.StatisticsSettingsLink})),__vite__mapDeps([0])));function He(e){let t=(0,G.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=R(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(V,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,q.jsxs)(v,{size:`xs`,variant:`outline`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}function Ue(e){let t=(0,G.c)(49),{section:n,searchTargetId:r}=e,a=C(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=n===`account`?(0,q.jsx)(Y,{}):null,t[1]=n,t[2]=s);let c;t[3]!==r||t[4]!==n?(c=n===`general`?(0,q.jsx)(L,{searchTargetId:r}):null,t[3]=r,t[4]=n,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===`inbox`?(0,q.jsx)(Pe,{}):null,t[6]=n,t[7]=l);let u;t[8]===n?u=t[9]:(u=n===`providers`?(0,q.jsx)(X,{}):null,t[8]=n,t[9]=u);let d;t[10]===n?d=t[11]:(d=n===`opinionated-plugins`?(0,q.jsx)(Z,{}):null,t[10]=n,t[11]=d);let f;t[12]===n?f=t[13]:(f=n===`mcp-servers`?(0,q.jsx)(Q,{}):null,t[12]=n,t[13]=f);let p;t[14]===n?p=t[15]:(p=n===`integrations`?(0,q.jsx)(Fe,{}):null,t[14]=n,t[15]=p);let m;t[16]===n?m=t[17]:(m=n===`appearance`?(0,q.jsx)(Ie,{}):null,t[16]=n,t[17]=m);let h;t[18]===n?h=t[19]:(h=n===`keybindings`?(0,q.jsx)(Le,{}):null,t[18]=n,t[19]=h);let g;t[20]===n?g=t[21]:(g=n===`source-control`?(0,q.jsx)(Re,{}):null,t[20]=n,t[21]=g);let _;t[22]!==a||t[23]!==n?(_=n===`connections`?a===`node`||i()?(0,q.jsxs)(`div`,{className:`space-y-5 p-6`,children:[(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Connections`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Ryco manages your connection automatically. Advanced details for this node are available below.`})]}),(0,q.jsxs)(v,{variant:`outline`,onClick:We,children:[(0,q.jsx)(ye,{className:`size-4`}),`Device security · Advanced`]})]}):(0,q.jsx)(ze,{}):null,t[22]=a,t[23]=n,t[24]=_):_=t[24];let y;t[25]===n?y=t[26]:(y=n===`security`?(0,q.jsx)(Be,{}):null,t[25]=n,t[26]=y);let b;t[27]===n?b=t[28]:(b=n===`diagnostics`?(0,q.jsx)($,{}):null,t[27]=n,t[28]=b);let x;t[29]===n?x=t[30]:(x=n===`statistics`?(0,q.jsx)(Ve,{}):null,t[29]=n,t[30]=x);let S;t[31]===n?S=t[32]:(S=n===`archived`?(0,q.jsx)(z,{}):null,t[31]=n,t[32]=S);let w;return t[33]!==h||t[34]!==g||t[35]!==_||t[36]!==y||t[37]!==b||t[38]!==x||t[39]!==S||t[40]!==s||t[41]!==c||t[42]!==l||t[43]!==u||t[44]!==d||t[45]!==f||t[46]!==p||t[47]!==m?(w=(0,q.jsxs)(K.Suspense,{fallback:o,children:[s,c,l,u,d,f,p,m,h,g,_,y,b,x,S]}),t[33]=h,t[34]=g,t[35]=_,t[36]=y,t[37]=b,t[38]=x,t[39]=S,t[40]=s,t[41]=c,t[42]=l,t[43]=u,t[44]=d,t[45]=f,t[46]=p,t[47]=m,t[48]=w):w=t[48],w}function We(){return m.getState().setSection(`security`)}function Ge(){let e=E({strict:!1,select:e=>S(e)?.environmentId??null}),t=r(),o=y(),l=u(e=>e.activeEnvironmentId),d=Se(),_=m(e=>e.open),C=m(e=>e.section),w=m(e=>e.editingScope),te=m(e=>e.setEditingScope),re=m(e=>e.setTargetEnvironmentId),k=O(e=>e.byId),ce=ge(s.serverUpdateSettings),le=m(e=>e.targetEnvironmentId),ue=m(e=>e.closeSettings),A=m(e=>e.setSection),j=i()?t?.environmentId??null:b({requestedEnvironmentId:le,routedEnvironmentId:e,activeEnvironmentId:l,primaryEnvironmentId:t?.environmentId??null,desktopLocalEnvironmentId:n?d.localEnvironmentId:null}),de=O(e=>j?e.byId[j]??null:null),M=D(e=>j?e.byId[j]??null:null),N=j!==null&&j===t?.environmentId,P=j?d.machines.find(e=>e.environmentId===j)??null:null,F=N?o:M?.serverConfig??null,fe=we(),I=Te(),L=we(j,N?t?.label??F?.environment.label:M?.descriptor?.label??F?.environment.label??de?.label),R=P?P.canConnect?P.effectiveRole:null:M?.role===`owner`?`owner`:M?.role?`viewer`:null,z=j?{environmentId:j,nodeLabel:L,serverConfig:F,primary:N,canManage:N?!i():R===`owner`,canMutate:N||(P?P.canMutate:M?.role===`owner`||M?.role===`client`),connected:F!==null&&(N||M?.connectionState===`connected`||P?.connectionState===`connected`)}:null;(0,K.useEffect)(()=>{if(_&&w===`node`&&n&&j&&!N)return Ce(j)},[_,w,j,N]);let pe=h(e=>e.effectiveRole),B=h(e=>e.directoryStatus),he=h(e=>e.transportStatus),V=i(),H=ee(B,he),ve=f(pe,B,he),xe=V?ve:N?`owner`:R,De=z?{...z,canManage:z.connected&&(V?ve===`owner`&&H&&ce.allowed:z.canManage===!0)}:null,U=new Map;t&&U.set(t.environmentId,fe);for(let e of Object.values(k))t&&e.environmentId===d.localEnvironmentId||U.set(e.environmentId,e.label);for(let e of d.machines)t&&e.environmentId===d.localEnvironmentId||U.set(e.environmentId,e.label);j&&U.set(j,L);let W=Ne.filter(e=>g(e.id,w,n&&!!window.desktopBridge?.computerUse)?w===`client`?e.id!==`connections`||!V:c(e.id===`connections`?`security`:e.id,{hosted:V||!N,role:z?.connected?xe:null,desktop:!1}):!1),G=C===`computer-use`&&window.desktopBridge?.computerUse?`integrations`:C,J=W.some(e=>e.id===G)?G:W[0]?.id??`appearance`,Ae=w===`node`?L:I;(0,K.useEffect)(()=>{(!V||H)&&_&&C!==J&&A(J)},[J,V,_,H,C,A]);let[Y,X]=(0,K.useState)(``),[Pe,Z]=(0,K.useState)(null);(0,K.useEffect)(()=>{_||(X(``),Z(null))},[_]);let Fe=new Set(W.map(e=>e.id)),Q=Y.trim().toLowerCase(),Ie=Q.length===0?[]:Me.filter(e=>Fe.has(e.section)&&e.owner===w&&(!e.localOnboardingOnly||me())&&(!e.desktopCapability||!!window.desktopBridge?.[e.desktopCapability])&&`${e.title} ${e.description} ${e.keywords??``}`.toLowerCase().includes(Q)),[Le,Re]=(0,K.useState)(0),ze=(0,K.useCallback)(()=>{Re(e=>e+1)},[]),Be=J===`general`,$=je(`${_}:${J}`,Q.length>0,Pe);return(0,q.jsx)(ie,{open:_,onOpenChange:e=>{e||ue()},children:(0,q.jsx)(p,{value:w,children:(0,q.jsx)(x,{value:w===`node`?De:null,children:(0,q.jsxs)(oe,{className:`project-glass-surface h-[min(88dvh,880px)] max-w-[1180px] overflow-hidden p-0`,bottomStickOnMobile:!1,showCloseButton:!0,surface:`glass`,children:[(0,q.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center justify-between border-b border-border px-5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-baseline gap-2`,children:[(0,q.jsx)(ae,{className:`text-base font-semibold`,children:`Settings`}),(0,q.jsx)(`span`,{"data-testid":`settings-scope-label`,className:`max-w-48 truncate text-xs text-muted-foreground`,children:Ae})]}),(0,q.jsxs)(`div`,{className:`relative w-72 max-w-[40vw]`,children:[(0,q.jsx)(se,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,q.jsx)(`input`,{type:`search`,value:Y,onChange:e=>{Z(null),X(e.target.value)},placeholder:`Search settings…`,"aria-label":`Search settings`,className:`h-8 w-full rounded-md border border-input bg-muted/40 pr-3 pl-8 text-[13px] outline-none transition-colors placeholder:text-muted-foreground/60 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`})]})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 pr-9`,children:Be?(0,q.jsx)(He,{onRestored:ze}):null})]}),(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-row`,children:[(0,q.jsxs)(`nav`,{className:`relative isolate flex w-12 shrink-0 flex-col gap-1 overflow-y-auto border-r border-border p-2 sm:w-52`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex flex-col gap-1 border-b pb-2`,role:`group`,"aria-label":`Settings destination`,children:[(0,q.jsxs)(v,{variant:w===`client`?`secondary`:`ghost`,"aria-pressed":w===`client`,onClick:()=>te(`client`),className:`justify-start px-2`,children:[(0,q.jsx)(_e,{className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`App preferences`})]}),(0,q.jsxs)(v,{variant:w===`node`?`secondary`:`ghost`,"aria-pressed":w===`node`,onClick:()=>te(`node`),disabled:!z,className:`justify-start px-2`,"aria-label":`Device settings: ${L}`,children:[(0,q.jsx)(ne,{environmentId:j,label:L,className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden truncate sm:inline`,children:L})]})]}),w===`node`&&!V&&U.size>1&&(0,q.jsx)(`select`,{"aria-label":`Settings device`,value:j??``,onChange:e=>re(a.make(e.target.value)),className:`mb-2 hidden w-full rounded-md border bg-background p-2 text-xs sm:block`,children:[...U].map(([e,t])=>(0,q.jsx)(`option`,{value:e,children:t},e))}),V&&w===`client`&&(0,q.jsxs)(v,{variant:`ghost`,className:`justify-start px-2`,onClick:()=>{ue(),Oe({kind:`account`,section:`overview`})},children:[(0,q.jsx)(be,{className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Hub account`})]}),W.map(e=>{if(e.id===`security`)return null;let t=e.icon,n=J===e.id||e.id===`connections`&&J===`security`;return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(null),A(e.id)},className:T(`relative z-10 flex h-9 w-full shrink-0 items-center gap-2.5 rounded-md px-2 text-left text-[13px] outline-hidden ring-ring transition-colors duration-150 focus-visible:ring-2`,n?`bg-accent font-medium text-foreground`:`text-muted-foreground/70 hover:text-foreground/80`),"aria-label":e.label,"aria-current":n?`page`:void 0,children:[(0,q.jsx)(t,{className:T(`size-4 shrink-0`,n?`text-foreground`:`text-muted-foreground/60`)}),(0,q.jsx)(`span`,{className:`hidden truncate sm:inline`,children:e.label})]}),w===`node`&&e.id===`connections`&&n&&Fe.has(`security`)&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(null),A(`security`)},"aria-current":J===`security`?`page`:void 0,"aria-label":`Advanced device security`,className:T(`flex items-center gap-2 rounded-md px-2 py-2 text-left text-xs outline-hidden focus-visible:ring-2 focus-visible:ring-ring sm:ml-7`,J===`security`?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(ye,{className:`size-3.5 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Device security · Advanced`})]}),n&&$.sections.length>1&&(0,q.jsx)(`div`,{className:`mb-2 ml-7 hidden flex-col border-l border-border sm:flex`,children:$.sections.map(({id:e,title:t,element:n})=>(0,q.jsx)(`button`,{type:`button`,"aria-current":$.active===n?`location`:void 0,className:T(`rounded-r px-3 py-1.5 text-left text-xs focus-visible:outline-2 focus-visible:outline-ring`,$.active===n?`font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>{n.hasAttribute(`data-settings-action`)&&n.click(),n.scrollIntoView({block:`start`,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},children:t},e))})]},e.id)})]}),(0,q.jsxs)(Ee,{ref:$.contentRef,className:`min-h-0 min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`border-b px-6 py-3 text-xs text-muted-foreground`,"data-testid":`settings-destination-description`,children:w===`client`?`Preferences for ${I}. Appearance and interface changes stay in this app.`:`Settings for ${L}. Changes apply to that device for everyone authorized to use it.`}),Q.length>0?(0,q.jsx)(`div`,{className:`p-4`,children:(0,q.jsx)(`div`,{className:`flex flex-col gap-0.5 rounded-xl border border-border bg-card p-1.5 shadow-sm/4`,children:Ie.length===0?(0,q.jsxs)(`p`,{className:`px-2 py-8 text-center text-sm text-muted-foreground`,children:[`No settings match “`,Y.trim(),`”.`]}):Ie.map(e=>{let t=W.find(t=>t.id===e.section)?.label;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(e.targetId??e.title),A(e.section),X(``)},className:`flex flex-col gap-0.5 rounded-md px-3 py-2.5 text-left outline-hidden ring-ring transition-colors hover:bg-accent focus-visible:ring-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),t?(0,q.jsx)(`span`,{className:`text-[11px] text-muted-foreground/70`,children:t}):null]}),(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},`${e.section}:${e.title}`)})})}):(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[w===`node`&&(0,q.jsx)(ke,{},j),w===`node`&&!De?.connected?(0,q.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:P&&!P.online?`${L} is offline. Its settings will be available when it reconnects.`:P?.canConnect?`Connecting to ${L}…`:`Connect to ${L} to manage its settings.`}):w===`node`&&W.length===0?(0,q.jsxs)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:[`Your access to `,L,` does not allow changing node settings.`]}):(0,q.jsx)(Ue,{section:J,searchTargetId:Pe})]},Le)]})]})]})})})})}export{Ge as SettingsDialog};
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-BAJdq3TK.js";import{K as n,i as r,q as i}from"./primary-CQh_KHGG.js";import{_i as a,mi as o,t as s}from"./src-DHNjfMxR.js";import{$ as c,$l as l,Bn as u,I as d,J as f,Jl as p,K as m,P as h,Q as g,Ql as _,Qr as v,Vl as y,Xl as b,Yl as x,Yr as S,Zl as C,b as w,ei as T,go as E,mr as D,pr as O,q as ee}from"./runtime-OM-uAtaj.js";import{t as te}from"./react-CwJFpaho.js";import{$n as ne,Cr as re,Gt as ie,Qt as ae,Zt as oe,er as k,mr as se,nr as ce,pr as le,tr as ue}from"./switch-D9inWKdd.js";import{t as A}from"./compiler-runtime-C4g8XhC5.js";import{a as j,n as de,o as M,s as N}from"./badge-BswOCwph.js";import{t as P}from"./activity-DRZlu-MC.js";import{d as F,f as fe,l as I,n as L,r as R,t as z,u as pe}from"./SettingsPanels-BYknk6GO.js";import{g as me,x as B}from"./RootAppShell-DwiWD4Cy.js";import{t as he}from"./chart-column-D6Lnkklk.js";import{Y as V}from"./ContextHandoffEndpointLabel-BzI4Wi1i.js";import{n as H,t as ge}from"./capabilities-Bj_X9FZ-.js";import{t as _e}from"./palette-gaqgtube.js";import{R as ve}from"./sidebarProjectFolders-DXqx3OlZ.js";import{t as ye}from"./shield-i098Bm_B.js";import{t as be}from"./user-round-C-U7TZKG.js";import{o as xe}from"./authorization-BugIGt5e.js";import{o as Se,t as Ce}from"./desktopWorkspace-Ocqt625W.js";import{n as we,t as Te}from"./deviceName-z0ZWSq0z.js";import{t as Ee}from"./scroll-area-BC-LB_zE.js";import{i as De,r as U}from"./settingsLayout-BbjDM-p0.js";import{i as Oe}from"./hubRoutes-DExWSvVE.js";import{t as W}from"./HostedNodeRenameDialog-ChxJdr-Z.js";var G=A(),K=e(te(),1),q=l();function J(){let e=_(),[t,n]=(0,K.useState)(!1),[r,i]=(0,K.useState)(null);if(!e)return null;let a=e.serverConfig,s=a?.environment.capabilities.environmentIcon===!0,c=e.connected&&e.canManage!==!1&&e.canMutate!==!1&&s,l=ue(a),u=a?.settings.environmentIcon??`automatic`;return(0,q.jsx)(U,{title:`Device icon`,scope:e.nodeLabel,description:`Shown across mobile, desktop, and web. Automatic uses the device’s name and operating system.`,control:(0,q.jsxs)(de,{value:u,disabled:!c||t,onValueChange:async r=>{if(c&&!t&&r!==null){n(!0),i(null);try{await w(e.environmentId,{environmentIcon:r===`automatic`?null:r})}catch{i(`Could not save the icon for ${e.nodeLabel}. Reconnect and try again.`)}finally{n(!1)}}},children:[(0,q.jsxs)(N,{"aria-label":`Device icon for ${e.nodeLabel}`,className:`w-48`,children:[(0,q.jsx)(ce,{kind:l,className:`size-4`}),(0,q.jsx)(`span`,{children:u===`automatic`?`Automatic · ${k[l]}`:k[l]})]}),(0,q.jsxs)(M,{children:[(0,q.jsx)(j,{value:`automatic`,children:`Automatic`}),o.map(e=>(0,q.jsx)(j,{value:e,children:(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(ce,{kind:e,className:`size-4`}),k[e]]})},e))]})]}),status:r?(0,q.jsx)(`span`,{role:`alert`,children:r}):e.connected?s?c?void 0:(0,q.jsx)(`span`,{children:`Your access does not allow changing this device’s settings.`}):(0,q.jsx)(`span`,{children:`Update this device to enable icon selection.`}):(0,q.jsxs)(`span`,{children:[`Connect to `,e.nodeLabel,` to change its icon.`]})})}function ke(){let e=(0,G.c)(39),t=_(),a=r(),o=Se(),s=h(Ae),[c,l]=(0,K.useState)(!1);if(!t)return null;let u=n&&t.environmentId===a?.environmentId?o.localEnvironmentId:t.environmentId,f;if(e[0]!==u||e[1]!==o.machines){let t;e[3]===u?t=e[4]:(t=e=>e.environmentId===u,e[3]=u,e[4]=t),f=o.machines.find(t),e[0]=u,e[1]=o.machines,e[2]=f}else f=e[2];let p=f,m;if(e[5]!==u||e[6]!==s){let t;e[8]===u?t=e[9]:(t=e=>e.environmentId===u,e[8]=u,e[9]=t),m=s.find(t),e[5]=u,e[6]=s,e[7]=m}else m=e[7];let g=m,y;e[10]!==p?.canRename||e[11]!==g?(y=n?p?.canRename===!0&&!!window.desktopBridge?.renameDesktopWorkspaceDevice:i()&&g?.effectiveRole===`owner`&&g.revokedAt===null,e[10]=p?.canRename,e[11]=g,e[12]=y):y=e[12];let b=y,x;e[13]!==p||e[14]!==g?(x=async e=>{if(n&&p&&window.desktopBridge?.renameDesktopWorkspaceDevice)await window.desktopBridge.renameDesktopWorkspaceDevice({environmentId:p.environmentId,label:e});else if(i()&&g)await d.renameNode(g.id,e),await xe.refreshDirectory();else throw Error(`Connect this device to your Hub to customize its name.`)},e[13]=p,e[14]=g,e[15]=x):x=e[15];let S=x,C;e[16]===b?C=e[17]:(C=b?(0,q.jsx)(v,{variant:`outline`,onClick:()=>l(!0),children:`Rename device`}):void 0,e[16]=b,e[17]=C);let w;e[18]!==b||e[19]!==u||e[20]!==p||e[21]!==g?(w=b?void 0:(0,q.jsx)(`span`,{children:u&&(p||g)?`Only the device owner can change its name.`:`Connect to your Hub to customize the device name.`}),e[18]=b,e[19]=u,e[20]=p,e[21]=g,e[22]=w):w=e[22];let T;e[23]!==C||e[24]!==w||e[25]!==t.nodeLabel?(T=(0,q.jsx)(U,{title:`Device name`,scope:t.nodeLabel,description:`Shown to everyone who can access this device. Renaming keeps its projects, conversations, and connections.`,control:C,status:w}),e[23]=C,e[24]=w,e[25]=t.nodeLabel,e[26]=T):T=e[26];let E;e[27]===t.environmentId?E=e[28]:(E=(0,q.jsx)(J,{},t.environmentId),e[27]=t.environmentId,e[28]=E);let D;e[29]!==b||e[30]!==S||e[31]!==c||e[32]!==t.environmentId||e[33]!==t.nodeLabel?(D=b&&(0,q.jsx)(W,{node:{label:t.nodeLabel},open:c,onOpenChange:l,onRename:S},t.environmentId),e[29]=b,e[30]=S,e[31]=c,e[32]=t.environmentId,e[33]=t.nodeLabel,e[34]=D):D=e[34];let O;return e[35]!==T||e[36]!==E||e[37]!==D?(O=(0,q.jsxs)(De,{title:`Device`,owner:`node`,className:`mx-6 mt-5 mb-3`,children:[T,E,D]}),e[35]=T,e[36]=E,e[37]=D,e[38]=O):O=e[38],O}function Ae(e){return e.nodes}function je(e,t,n){let[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)([]),[s,c]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(!r)return;let e=new WeakMap,i=0,a=[],s=()=>{let e=r.getBoundingClientRect().top+64,t=a.findLast(t=>t.element.getBoundingClientRect().top<=e)??a[0];c(t?.element??null)},l=!1,u=()=>{if(a=t?[]:Array.from(r.querySelectorAll(`[data-settings-section]`)).map(t=>(e.has(t)||e.set(t,`section-${++i}`),{id:e.get(t),title:t.dataset.settingsSection,element:t})),o(e=>e.length===a.length&&e.every((e,t)=>e.element===a[t]?.element&&e.title===a[t]?.title)?e:a),n&&!t&&!l){let e=Array.from(r.querySelectorAll(`h2, h3, [id], [data-settings-section]`)).find(e=>e.id===n||e.dataset.settingsSection===n||e.textContent?.trim()===n);e&&(l=!0,e.scrollIntoView({block:`center`}),e.tabIndex=-1,e.focus({preventScroll:!0}))}s()};u();let d=new MutationObserver(u);return d.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-settings-section`,`aria-current`]}),r.addEventListener(`scroll`,s,!0),()=>{d.disconnect(),r.removeEventListener(`scroll`,s,!0)}},[r,e,t,n]),{contentRef:i,sections:a,active:s}}var Me=[{section:`general`,owner:`node`,title:`Project defaults`,description:`Inherited initial model, effort, thread location, branch prefix, and worktree setup.`,keywords:`inherit override reset scope project model effort setup`},{section:`general`,owner:`client`,title:`Welcome tour`,description:`Replay provider setup, add a project, and learn the essentials.`,keywords:`onboarding first run getting started setup`,localOnboardingOnly:!0},{section:`appearance`,title:`Diff style`,owner:`client`,description:`Preview unified and split layouts for code changes.`,keywords:`diff design side by side stacked layout`},{section:`integrations`,title:`Browser Use`,owner:`client`,description:`Pair browsers and manage agent access to local tabs.`,keywords:`chrome brave edge browser extension`,desktopCapability:`computerUse`},{section:`general`,title:`Quit shortcut`,owner:`client`,description:`Prevent accidental quits: press twice, hold, or quit immediately.`,keywords:`ctrl cmd q exit desktop`,desktopCapability:`quitShortcut`},{section:`general`,title:`Device name`,owner:`node`,description:`Rename the selected device for everyone who can access it.`,keywords:`machine hostname node name rename`},{section:`integrations`,title:`Device permissions`,owner:`node`,description:`Manage permissions on the selected device or learn where local approval is required.`,keywords:`computer use accessibility screen recording capture device local remote`},{section:`integrations`,desktopCapability:`computerUse`,title:`Computer use`,owner:`client`,description:`Control local apps and browsers, manage permissions, and pair a browser.`,keywords:`accessibility screen recording capture cursor chrome brave edge app access foreground automation`},{section:`inbox`,title:`AI Focus`,owner:`client`,description:`Prioritize the Inbox with bounded, environment-local model ranking.`,keywords:`priority sort active threads model ranking focus refresh`},{section:`inbox`,title:`AI Focus models`,owner:`node`,description:`Choose or inherit the ranking model for each connected environment.`,keywords:`provider node disclosure privacy data`},{section:`general`,title:`Time format`,owner:`client`,description:`System default, 12-hour or 24-hour clock.`,keywords:`clock hours`},{section:`general`,title:`Default editor`,owner:`client`,description:`Pin which editor opens directories and files.`,keywords:`vscode cursor open in`},{section:`source-control`,title:`Diff line wrapping`,owner:`client`,description:`Default wrap state when the diff panel opens.`,keywords:`word wrap`},{section:`source-control`,title:`Hide whitespace changes`,owner:`client`,description:`Whether the diff panel ignores whitespace-only edits.`,keywords:`diff`},{section:`source-control`,title:`Remote Git status`,owner:`client`,description:`Refresh remote branch and pull request metadata.`,keywords:`git polling refresh remote`},{section:`source-control`,title:`PR & workflow updates`,owner:`client`,description:`Choose automatic, reduced, or manual pull request and workflow refreshes.`,keywords:`github actions checks ci polling refresh`},{section:`general`,title:`Stream token by token (legacy)`,owner:`node`,description:`Compatibility mode for token-by-token assistant output.`,keywords:`token streaming assistant output streaming tokens buffered`,targetId:`legacy-token-streaming`},{section:`general`,title:`Provider update checks`,owner:`node`,description:`Check installed provider CLIs for newer versions.`,keywords:`upgrade cli`},{section:`general`,title:`Auto-open overview`,owner:`client`,description:`Open the overview when plans or progress appear.`,keywords:`panel plan`},{section:`general`,title:`New threads`,owner:`node`,description:`Default workspace mode for newly created drafts.`,keywords:`local worktree draft`},{section:`general`,title:`Worktree branch prefix`,owner:`node`,description:`Default prefix for generated worktree branches on this device.`,keywords:`git namespace branch naming ryco`},{section:`general`,title:`Worktree root`,owner:`node`,description:`Environment worktree directory and project overrides. Existing checkouts keep their paths.`,keywords:`folder path location inherit reset`},{section:`general`,title:`Worktree submodules`,owner:`node`,description:`Initialization for new worktrees, with project overrides and repository configuration.`,keywords:`git recursive top-level none initialize inherit`},{section:`general`,title:`Add project starts in`,owner:`node`,description:`Starting directory for the Add Project browser.`,keywords:`folder path`},{section:`general`,title:`Archive confirmation`,owner:`client`,description:`Ask before archiving a thread.`,keywords:`confirm`},{section:`general`,title:`Delete confirmation`,owner:`client`,description:`Ask before deleting a thread.`,keywords:`confirm remove`},{section:`general`,title:`Unpin confirmation`,owner:`client`,description:`Ask before removing a thread from pinned threads.`,keywords:`confirm pin unpin favorite`},{section:`general`,title:`Update track`,owner:`client`,description:`Which release channel the app follows.`,keywords:`beta stable release channel`},{section:`appearance`,title:`Interface font`,owner:`client`,description:`Normal app text, navigation, dialogs, and controls.`,keywords:`typeface dm sans inter geist`},{section:`appearance`,title:`Code font`,owner:`client`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,keywords:`monospace jetbrains fira`},{section:`appearance`,title:`Text size`,owner:`client`,description:`Scale the interface independently from the theme.`,keywords:`zoom font size compact`},{section:`appearance`,title:`Corner radius`,owner:`client`,description:`Rounding for panels, buttons, inputs, and menus.`,keywords:`round square`},{section:`appearance`,title:`Primary color`,owner:`client`,description:`Accent color for links, focus rings, and actions.`,keywords:`accent custom violet amber`},{section:`appearance`,title:`Transparency`,owner:`client`,description:`Glass and floating surfaces like dialogs, menus, popups.`,keywords:`glass blur liquid material solid`},{section:`appearance`,title:`Theme palette`,owner:`client`,description:`Built-in and custom color themes; import and export.`,keywords:`dark midnight graphite nord dracula catppuccin`},{section:`general`,title:`Auto-collapse wide composer labels`,owner:`client`,description:`Show long composer mode labels only on hover or focus.`,keywords:`chips`},{section:`general`,title:`Always use Build mode`,owner:`client`,description:`Hide the mode selector and send every turn in Build mode.`,keywords:`composer`},{section:`appearance`,title:`Color mode`,owner:`client`,description:`Light, dark, or follow the system preference.`,keywords:`color mode dark light`},{section:`providers`,title:`Provider instances`,owner:`node`,description:`Configure Codex, Claude, Copilot, OpenCode, and Cursor.`,keywords:`api model driver accent`},{section:`integrations`,title:`Private Agent Control`,owner:`node`,description:`Pair local Codex or Claude MCP clients with scoped, revocable access.`,keywords:`model context protocol tools pairing codex claude approval agent control`},{section:`mcp-servers`,title:`MCP Servers`,owner:`node`,description:`Manage Codex, Claude, and other provider-native MCP servers.`,keywords:`model context protocol tools add server oauth profiles providers`},{section:`keybindings`,title:`Keybindings file`,owner:`node`,description:`Customize shortcuts via the keybindings configuration file.`,keywords:`shortcuts hotkeys keyboard`},{section:`source-control`,title:`Version Control`,owner:`node`,description:`Git behavior and defaults.`,keywords:`git commit`},{section:`source-control`,title:`Source Control Providers`,owner:`node`,description:`GitHub and other source control provider connections.`,keywords:`github pr pull request`},{section:`connections`,title:`Network access`,owner:`client`,description:`Expose the local backend on your network.`,keywords:`lan host remote`},{section:`connections`,title:`Pairing link`,owner:`client`,description:`Scan to open this backend on another device.`,keywords:`qr code phone mobile`},{section:`connections`,title:`Tailscale HTTPS`,owner:`client`,description:`Serve over your tailnet with HTTPS.`,keywords:`vpn remote`},{section:`connections`,title:`Authorized clients`,owner:`client`,description:`Devices and sessions allowed to connect.`,keywords:`revoke tokens`},{section:`security`,title:`Session code`,owner:`node`,description:`Compare this browser's channel against the one your node's CLI shows.`,keywords:`security verification websas e2ee compare short authentication string`},{section:`security`,title:`Enrollment fingerprint`,owner:`node`,description:`This node's identity, and the prekey and continuity behind it.`,keywords:`security e2ee key fingerprint rotate lineage`},{section:`security`,title:`Authorized client keys`,owner:`node`,description:`Approve, reduce, revoke, or delete a client key, and open a pairing window.`,keywords:`security e2ee pairing fingerprint refused attempts`},{section:`security`,title:`Admission policy`,owner:`node`,description:`Require E2EE, require approved clients, and advance the policy generation.`,keywords:`security e2ee strict fallback plaintext`},{section:`diagnostics`,title:`Diagnostics`,owner:`node`,description:`Logs, tracing, resource history, and live activity.`,keywords:`debug performance slow`},{section:`diagnostics`,title:`Test notification`,owner:`client`,description:`Fire sample notifications to preview the toast design and stacking.`,keywords:`toast notifications preview trigger sample`},{section:`statistics`,title:`Statistics`,owner:`node`,description:`Usage activity and history.`,keywords:`heatmap usage tokens`},{section:`archived`,title:`Archive`,owner:`node`,description:`Archived threads; restore or delete permanently.`,keywords:`trash restore`}],Ne=[{id:`account`,label:`Account`,icon:be},{id:`general`,label:`General`,icon:ve},{id:`inbox`,label:`Inbox`,icon:H},{id:`providers`,label:`Providers`,icon:fe},{id:`opinionated-plugins`,label:`Plugins`,icon:I},{id:`mcp-servers`,label:`MCP`,icon:le},{id:`integrations`,label:`Integrations`,icon:I},{id:`appearance`,label:`Appearance`,icon:_e},{id:`keybindings`,label:`Keybindings`,icon:F},{id:`source-control`,label:`Source Control`,icon:re},{id:`connections`,label:`Connections`,icon:pe},{id:`security`,label:`Node security`,icon:ye},{id:`diagnostics`,label:`Diagnostics`,icon:P},{id:`statistics`,label:`Statistics`,icon:he},{id:`archived`,label:`Archive`,icon:B}];Ne.map(e=>e.id),new Map(Ne.map(e=>[e.id,e.label]));var Y=(0,K.lazy)(()=>t(()=>import(`./AccountSettings-FN7pwqYA.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),X=(0,K.lazy)(()=>t(()=>import(`./ProvidersSettingsPanel-DPxL7AsR.js`).then(e=>({default:e.ProvidersSettingsPanel})),__vite__mapDeps([0]))),Pe=(0,K.lazy)(()=>t(()=>import(`./AiFocusSettings-xcDAMaqH.js`).then(e=>({default:e.AiFocusSettings})),__vite__mapDeps([0]))),Z=(0,K.lazy)(()=>t(()=>import(`./OpinionatedPluginsSettings-BIJfJ34L.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),__vite__mapDeps([0]))),Fe=(0,K.lazy)(()=>t(()=>import(`./IntegrationsSettingsPanel-eAq5h-D5.js`).then(e=>({default:e.IntegrationsSettingsPanel})),__vite__mapDeps([0]))),Q=(0,K.lazy)(()=>t(()=>import(`./McpServersSettings-DqLA6n5v.js`).then(e=>({default:e.McpServersSettings})),__vite__mapDeps([0]))),Ie=(0,K.lazy)(()=>t(()=>import(`./AppearanceSettings-BvsvAOsG.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),Le=(0,K.lazy)(()=>t(()=>import(`./KeybindingsSettings-D1XaEVGH.js`).then(e=>({default:e.KeybindingsSettingsPanel})),__vite__mapDeps([0]))),Re=(0,K.lazy)(()=>t(()=>import(`./SourceControlSettings-BbveiAj3.js`).then(e=>({default:e.SourceControlSettingsPanel})),__vite__mapDeps([0]))),ze=(0,K.lazy)(()=>t(()=>import(`./ConnectionsSettings-CIXs7x_E.js`).then(e=>({default:e.ConnectionsSettings})),__vite__mapDeps([0]))),Be=(0,K.lazy)(()=>t(()=>import(`./NodeSecuritySettings-Skm7GQDl.js`).then(e=>({default:e.NodeSecuritySettings})),__vite__mapDeps([0]))),$=(0,K.lazy)(()=>t(()=>import(`./DiagnosticsSettings-DGX_2T2M.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Ve=(0,K.lazy)(()=>t(()=>import(`./StatisticsSettingsLink-BpkNubL2.js`).then(e=>({default:e.StatisticsSettingsLink})),__vite__mapDeps([0])));function He(e){let t=(0,G.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=R(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(V,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,q.jsxs)(v,{size:`xs`,variant:`outline`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}function Ue(e){let t=(0,G.c)(49),{section:n,searchTargetId:r}=e,a=C(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=n===`account`?(0,q.jsx)(Y,{}):null,t[1]=n,t[2]=s);let c;t[3]!==r||t[4]!==n?(c=n===`general`?(0,q.jsx)(L,{searchTargetId:r}):null,t[3]=r,t[4]=n,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===`inbox`?(0,q.jsx)(Pe,{}):null,t[6]=n,t[7]=l);let u;t[8]===n?u=t[9]:(u=n===`providers`?(0,q.jsx)(X,{}):null,t[8]=n,t[9]=u);let d;t[10]===n?d=t[11]:(d=n===`opinionated-plugins`?(0,q.jsx)(Z,{}):null,t[10]=n,t[11]=d);let f;t[12]===n?f=t[13]:(f=n===`mcp-servers`?(0,q.jsx)(Q,{}):null,t[12]=n,t[13]=f);let p;t[14]===n?p=t[15]:(p=n===`integrations`?(0,q.jsx)(Fe,{}):null,t[14]=n,t[15]=p);let m;t[16]===n?m=t[17]:(m=n===`appearance`?(0,q.jsx)(Ie,{}):null,t[16]=n,t[17]=m);let h;t[18]===n?h=t[19]:(h=n===`keybindings`?(0,q.jsx)(Le,{}):null,t[18]=n,t[19]=h);let g;t[20]===n?g=t[21]:(g=n===`source-control`?(0,q.jsx)(Re,{}):null,t[20]=n,t[21]=g);let _;t[22]!==a||t[23]!==n?(_=n===`connections`?a===`node`||i()?(0,q.jsxs)(`div`,{className:`space-y-5 p-6`,children:[(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Connections`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Ryco manages your connection automatically. Advanced details for this node are available below.`})]}),(0,q.jsxs)(v,{variant:`outline`,onClick:We,children:[(0,q.jsx)(ye,{className:`size-4`}),`Device security · Advanced`]})]}):(0,q.jsx)(ze,{}):null,t[22]=a,t[23]=n,t[24]=_):_=t[24];let y;t[25]===n?y=t[26]:(y=n===`security`?(0,q.jsx)(Be,{}):null,t[25]=n,t[26]=y);let b;t[27]===n?b=t[28]:(b=n===`diagnostics`?(0,q.jsx)($,{}):null,t[27]=n,t[28]=b);let x;t[29]===n?x=t[30]:(x=n===`statistics`?(0,q.jsx)(Ve,{}):null,t[29]=n,t[30]=x);let S;t[31]===n?S=t[32]:(S=n===`archived`?(0,q.jsx)(z,{}):null,t[31]=n,t[32]=S);let w;return t[33]!==h||t[34]!==g||t[35]!==_||t[36]!==y||t[37]!==b||t[38]!==x||t[39]!==S||t[40]!==s||t[41]!==c||t[42]!==l||t[43]!==u||t[44]!==d||t[45]!==f||t[46]!==p||t[47]!==m?(w=(0,q.jsxs)(K.Suspense,{fallback:o,children:[s,c,l,u,d,f,p,m,h,g,_,y,b,x,S]}),t[33]=h,t[34]=g,t[35]=_,t[36]=y,t[37]=b,t[38]=x,t[39]=S,t[40]=s,t[41]=c,t[42]=l,t[43]=u,t[44]=d,t[45]=f,t[46]=p,t[47]=m,t[48]=w):w=t[48],w}function We(){return m.getState().setSection(`security`)}function Ge(){let e=E({strict:!1,select:e=>S(e)?.environmentId??null}),t=r(),o=y(),l=u(e=>e.activeEnvironmentId),d=Se(),_=m(e=>e.open),C=m(e=>e.section),w=m(e=>e.editingScope),te=m(e=>e.setEditingScope),re=m(e=>e.setTargetEnvironmentId),k=O(e=>e.byId),ce=ge(s.serverUpdateSettings),le=m(e=>e.targetEnvironmentId),ue=m(e=>e.closeSettings),A=m(e=>e.setSection),j=i()?t?.environmentId??null:b({requestedEnvironmentId:le,routedEnvironmentId:e,activeEnvironmentId:l,primaryEnvironmentId:t?.environmentId??null,desktopLocalEnvironmentId:n?d.localEnvironmentId:null}),de=O(e=>j?e.byId[j]??null:null),M=D(e=>j?e.byId[j]??null:null),N=j!==null&&j===t?.environmentId,P=j?d.machines.find(e=>e.environmentId===j)??null:null,F=N?o:M?.serverConfig??null,fe=we(),I=Te(),L=we(j,N?t?.label??F?.environment.label:M?.descriptor?.label??F?.environment.label??de?.label),R=P?P.canConnect?P.effectiveRole:null:M?.role===`owner`?`owner`:M?.role?`viewer`:null,z=j?{environmentId:j,nodeLabel:L,serverConfig:F,primary:N,canManage:N?!i():R===`owner`,canMutate:N||(P?P.canMutate:M?.role===`owner`||M?.role===`client`),connected:F!==null&&(N||M?.connectionState===`connected`||P?.connectionState===`connected`)}:null;(0,K.useEffect)(()=>{if(_&&w===`node`&&n&&j&&!N)return Ce(j)},[_,w,j,N]);let pe=h(e=>e.effectiveRole),B=h(e=>e.directoryStatus),he=h(e=>e.transportStatus),V=i(),H=ee(B,he),ve=f(pe,B,he),xe=V?ve:N?`owner`:R,De=z?{...z,canManage:z.connected&&(V?ve===`owner`&&H&&ce.allowed:z.canManage===!0)}:null,U=new Map;t&&U.set(t.environmentId,fe);for(let e of Object.values(k))t&&e.environmentId===d.localEnvironmentId||U.set(e.environmentId,e.label);for(let e of d.machines)t&&e.environmentId===d.localEnvironmentId||U.set(e.environmentId,e.label);j&&U.set(j,L);let W=Ne.filter(e=>g(e.id,w,n&&!!window.desktopBridge?.computerUse)?w===`client`?e.id!==`connections`||!V:c(e.id===`connections`?`security`:e.id,{hosted:V||!N,role:z?.connected?xe:null,desktop:!1}):!1),G=C===`computer-use`&&window.desktopBridge?.computerUse?`integrations`:C,J=W.some(e=>e.id===G)?G:W[0]?.id??`appearance`,Ae=w===`node`?L:I;(0,K.useEffect)(()=>{(!V||H)&&_&&C!==J&&A(J)},[J,V,_,H,C,A]);let[Y,X]=(0,K.useState)(``),[Pe,Z]=(0,K.useState)(null);(0,K.useEffect)(()=>{_||(X(``),Z(null))},[_]);let Fe=new Set(W.map(e=>e.id)),Q=Y.trim().toLowerCase(),Ie=Q.length===0?[]:Me.filter(e=>Fe.has(e.section)&&e.owner===w&&(!e.localOnboardingOnly||me())&&(!e.desktopCapability||!!window.desktopBridge?.[e.desktopCapability])&&`${e.title} ${e.description} ${e.keywords??``}`.toLowerCase().includes(Q)),[Le,Re]=(0,K.useState)(0),ze=(0,K.useCallback)(()=>{Re(e=>e+1)},[]),Be=J===`general`,$=je(`${_}:${J}`,Q.length>0,Pe);return(0,q.jsx)(ie,{open:_,onOpenChange:e=>{e||ue()},children:(0,q.jsx)(p,{value:w,children:(0,q.jsx)(x,{value:w===`node`?De:null,children:(0,q.jsxs)(oe,{className:`project-glass-surface h-[min(88dvh,880px)] max-w-[1180px] overflow-hidden p-0`,bottomStickOnMobile:!1,showCloseButton:!0,surface:`glass`,children:[(0,q.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center justify-between border-b border-border px-5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-baseline gap-2`,children:[(0,q.jsx)(ae,{className:`text-base font-semibold`,children:`Settings`}),(0,q.jsx)(`span`,{"data-testid":`settings-scope-label`,className:`max-w-48 truncate text-xs text-muted-foreground`,children:Ae})]}),(0,q.jsxs)(`div`,{className:`relative w-72 max-w-[40vw]`,children:[(0,q.jsx)(se,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,q.jsx)(`input`,{type:`search`,value:Y,onChange:e=>{Z(null),X(e.target.value)},placeholder:`Search settings…`,"aria-label":`Search settings`,className:`h-8 w-full rounded-md border border-input bg-muted/40 pr-3 pl-8 text-[13px] outline-none transition-colors placeholder:text-muted-foreground/60 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`})]})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 pr-9`,children:Be?(0,q.jsx)(He,{onRestored:ze}):null})]}),(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-row`,children:[(0,q.jsxs)(`nav`,{className:`relative isolate flex w-12 shrink-0 flex-col gap-1 overflow-y-auto border-r border-border p-2 sm:w-52`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex flex-col gap-1 border-b pb-2`,role:`group`,"aria-label":`Settings destination`,children:[(0,q.jsxs)(v,{variant:w===`client`?`secondary`:`ghost`,"aria-pressed":w===`client`,onClick:()=>te(`client`),className:`justify-start px-2`,children:[(0,q.jsx)(_e,{className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`App preferences`})]}),(0,q.jsxs)(v,{variant:w===`node`?`secondary`:`ghost`,"aria-pressed":w===`node`,onClick:()=>te(`node`),disabled:!z,className:`justify-start px-2`,"aria-label":`Device settings: ${L}`,children:[(0,q.jsx)(ne,{environmentId:j,label:L,className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden truncate sm:inline`,children:L})]})]}),w===`node`&&!V&&U.size>1&&(0,q.jsx)(`select`,{"aria-label":`Settings device`,value:j??``,onChange:e=>re(a.make(e.target.value)),className:`mb-2 hidden w-full rounded-md border bg-background p-2 text-xs sm:block`,children:[...U].map(([e,t])=>(0,q.jsx)(`option`,{value:e,children:t},e))}),V&&w===`client`&&(0,q.jsxs)(v,{variant:`ghost`,className:`justify-start px-2`,onClick:()=>{ue(),Oe({kind:`account`,section:`overview`})},children:[(0,q.jsx)(be,{className:`size-4 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Hub account`})]}),W.map(e=>{if(e.id===`security`)return null;let t=e.icon,n=J===e.id||e.id===`connections`&&J===`security`;return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(null),A(e.id)},className:T(`relative z-10 flex h-9 w-full shrink-0 items-center gap-2.5 rounded-md px-2 text-left text-[13px] outline-hidden ring-ring transition-colors duration-150 focus-visible:ring-2`,n?`bg-accent font-medium text-foreground`:`text-muted-foreground/70 hover:text-foreground/80`),"aria-label":e.label,"aria-current":n?`page`:void 0,children:[(0,q.jsx)(t,{className:T(`size-4 shrink-0`,n?`text-foreground`:`text-muted-foreground/60`)}),(0,q.jsx)(`span`,{className:`hidden truncate sm:inline`,children:e.label})]}),w===`node`&&e.id===`connections`&&n&&Fe.has(`security`)&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(null),A(`security`)},"aria-current":J===`security`?`page`:void 0,"aria-label":`Advanced device security`,className:T(`flex items-center gap-2 rounded-md px-2 py-2 text-left text-xs outline-hidden focus-visible:ring-2 focus-visible:ring-ring sm:ml-7`,J===`security`?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(ye,{className:`size-3.5 shrink-0`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Device security · Advanced`})]}),n&&$.sections.length>1&&(0,q.jsx)(`div`,{className:`mb-2 ml-7 hidden flex-col border-l border-border sm:flex`,children:$.sections.map(({id:e,title:t,element:n})=>(0,q.jsx)(`button`,{type:`button`,"aria-current":$.active===n?`location`:void 0,className:T(`rounded-r px-3 py-1.5 text-left text-xs focus-visible:outline-2 focus-visible:outline-ring`,$.active===n?`font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>{n.hasAttribute(`data-settings-action`)&&n.click(),n.scrollIntoView({block:`start`,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},children:t},e))})]},e.id)})]}),(0,q.jsxs)(Ee,{ref:$.contentRef,className:`min-h-0 min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`border-b px-6 py-3 text-xs text-muted-foreground`,"data-testid":`settings-destination-description`,children:w===`client`?`Preferences for ${I}. Appearance and interface changes stay in this app.`:`Settings for ${L}. Changes apply to that device for everyone authorized to use it.`}),Q.length>0?(0,q.jsx)(`div`,{className:`p-4`,children:(0,q.jsx)(`div`,{className:`flex flex-col gap-0.5 rounded-xl border border-border bg-card p-1.5 shadow-sm/4`,children:Ie.length===0?(0,q.jsxs)(`p`,{className:`px-2 py-8 text-center text-sm text-muted-foreground`,children:[`No settings match “`,Y.trim(),`”.`]}):Ie.map(e=>{let t=W.find(t=>t.id===e.section)?.label;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{Z(e.targetId??e.title),A(e.section),X(``)},className:`flex flex-col gap-0.5 rounded-md px-3 py-2.5 text-left outline-hidden ring-ring transition-colors hover:bg-accent focus-visible:ring-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),t?(0,q.jsx)(`span`,{className:`text-[11px] text-muted-foreground/70`,children:t}):null]}),(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},`${e.section}:${e.title}`)})})}):(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[w===`node`&&(0,q.jsx)(ke,{},j),w===`node`&&!De?.connected?(0,q.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:P&&!P.online?`${L} is offline. Its settings will be available when it reconnects.`:P?.canConnect?`Connecting to ${L}…`:`Connect to ${L} to manage its settings.`}):w===`node`&&W.length===0?(0,q.jsxs)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:[`Your access to `,L,` does not allow changing node settings.`]}):(0,q.jsx)(Ue,{section:J,searchTargetId:Pe})]},Le)]})]})]})})})})}export{Ge as SettingsDialog};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,a as n,dt as r,qt as i}from"./primary-CQh_KHGG.js";import{$ as a,A as o,Et as s,Fa as c,L as l,N as u,R as d,bi as f,bt as p,ou as m,t as h}from"./src-DHNjfMxR.js";import{$l as g,$s as _,Aa as v,Bl as y,Bn as b,Dn as x,Er as S,Gc as C,Gl as w,Hr as T,K as E,Kr as D,Ks as O,Ln as k,Na as A,Nl as j,Ol as M,Pl as N,Ql as P,Qr as F,Qs as I,Ss as L,V as R,Vl as z,Vr as B,X as ee,Xs as V,Zl as H,b as te,bl as ne,dl as re,ei as ie,gr as ae,ho as oe,hr as se,js as ce,kr as le,ks as ue,mu as de,nu as fe,or as pe,os as me,p as he,pl as ge,qc as _e,qs as ve,ts as ye,wa as be}from"./runtime-DpHhg0dl.js";import{t as xe}from"./react-CwJFpaho.js";import{dn as Se,en as Ce,or as we,t as Te}from"./switch-DgLijJhN.js";import{t as Ee}from"./compiler-runtime-C4g8XhC5.js";import{v as De}from"./NullStore-iCZTvdl5.js";import{i as Oe,n as ke,t as Ae}from"./tooltip-CsNk2GK1.js";import{a as U,c as W,n as G,o as K,s as q}from"./badge-DqZmJa1g.js";import{c as je,d as Me,f as Ne,g as Pe,h as Fe,l as Ie,p as Le,s as Re,u as ze,x as Be}from"./RootAppShell-CYT2IfYW.js";import{t as Ve}from"./chevron-right-D3dUAoht.js";import{t as He}from"./capabilities-C9OPiefV.js";import{a as Ue,l as We,n as Ge,t as Ke}from"./SettingsPanels.editor-zrq4ZT2j.js";import{r as qe,t as Je}from"./editorPreferences-DzxKMQJx.js";import{t as J}from"./toastHelpers-CSQRKo4F.js";import{P as Ye}from"./sidebarUndo-DzblmE6P.js";import{t as Xe}from"./usePresentationTier-hxB7Yv_Q.js";import{t as Ze}from"./deviceName-BY2WK012.js";import{t as Qe}from"./shallow-B--PNURq.js";import{t as $e}from"./useBaseUiId-B5nK6G4h.js";import{t as et}from"./useControlled-CgAAWIy9.js";import{t as tt}from"./input-zI-YDU9i.js";import{t as nt}from"./useLongPress-CUmLovQ7.js";import{t as rt}from"./useTheme-B441xg4F.js";import{a as it,i as at,o as ot,r as st,t as ct}from"./empty-DXTz-nBL.js";import{i as lt,n as ut,r as Y,t as X}from"./settingsLayout-3SUkadS6.js";import{P as dt}from"./main-DsnAjTqg.js";var ft={name:`archive-x`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`m9.5 17 5-5`,key:`nakeu6`}],[`path`,{d:`m9.5 12 5 5`,key:`1hccrj`}]]};ft.node;var pt=oe(ft),mt={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};mt.node;var ht=oe(mt),gt={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};gt.node;var _t=oe(gt),vt={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};vt.node;var yt=oe(vt),bt={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};bt.node;var xt=oe(bt),Z=e(xe(),1);function St(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=et({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=De(a,!0,!0),u=$e(),[d,f]=Z.useState(),p=d===null?void 0:d??u,m=M(e=>{let t=!a,n=me(ue,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return Z.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var Ct=Z.createContext(void 0);function wt(){let e=Z.useContext(Ct);if(e===void 0)throw Error(j(15));return e}var Tt=`data-open`,Et=`data-closed`,Dt=_e,Ot=`data-panel-open`,kt={[Tt]:``},At={[Et]:``},jt={open(e){return e?{[Ot]:``}:null}},Mt={open(e){return e?kt:At},...C},Q=g(),Nt=Z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=M(o),d=St({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=Z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=Z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=V(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Mt});return(0,Q.jsx)(Ct.Provider,{value:p,children:m})}),Pt={...jt,...C},Ft=Z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=wt(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=ce({disabled:c,focusableWhenDisabled:!0,native:u});return V(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Pt})}),It={height:void 0,width:void 0};function Lt(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=Z.useRef(null),f=Z.useRef(null),[p,m]=Z.useState(It),h=Z.useRef(It),g=Z.useRef(!1),v=Z.useRef(s),y=Z.useRef(!1),[b,x]=Z.useState(!1),S=Z.useRef(null),C=_(t,d),w=ye(s),T=ve(d),E=!s&&!a,D=b?`idle`:u,k=s&&(v.current||y.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,j=n&&E&&f.current!==`css-animation`,P=M((e,t=!0)=>{t&&(h.current=e),m(e)}),F=M(()=>{S.current?.(),S.current=null}),I=M(e=>{F(),S.current=()=>{S.current=null,e()}}),R=M(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});N(()=>{b&&u!==`starting`&&x(!1)},[b,u]),Z.useEffect(()=>()=>{R(),F()},[R,F]),N(()=>{let e=d.current;if(!e)return;!s&&S.current&&F();let t=zt(e,k);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){h.current=Rt(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){P(Rt(e)),x(!0);return}if(t===`css-transition`){let t=Ht(e);if(P(Rt(e)),!n)return t;let r=Vt(e,`transition-duration`,`0s`);return I(r),x(!0),t}P(Rt(e));let r=Vt(e,`animation-name`,`none`);if(!n){r();return}let i=Vt(e,`animation-duration`,`0s`);r(),I(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(v.current=!1,y.current=!1,t===`none`){P(It,!1),c(!1);return}P(Rt(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Rt(e);if(!(n.height>0||n.width>0)){c(!1);return}P(n),t===`css-animation`&&Vt(e,`animation-name`,`none`)()},[a,s,F,P,c,I,k,u]),O({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&P(It,!1)}}),Z.useEffect(()=>{if(s||!a||D!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){w.current||(c(!1),P(It,!1))}return t=re.request(()=>{T(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[w,a,s,D,T,P,c]),N(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),Z.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=me(L,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return ge(e,`beforematch`,t)},[o,l]);let z=i||n||a||s;return{height:A.height,props:{...j?{[Dt]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:k,shouldRender:z,transitionStatus:D,width:A.width}}function Rt(e){return{height:e.scrollHeight,width:e.scrollWidth}}function zt(e,t){let n=ne(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Bt(n.animationDuration),i=Bt(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Bt(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function Vt(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function Ht(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var Ut=`--collapsible-panel-height`,Wt=`--collapsible-panel-width`,Gt=Z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=wt(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;N(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=Lt({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=I(s,k),j=V(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[Ut]:S===void 0?`auto`:`${S}px`,[Wt]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Mt});return E?j:null}),$=Ee();function Kt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Nt,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function qt(e){let t=(0,$.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=ie(`cursor-pointer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Ft,{className:i,"data-slot":`collapsible-trigger`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Jt(e){let t=(0,$.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=ie(`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0 data-open:data-ending-style:[height:var(--collapsible-panel-height)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Gt,{className:i,"data-slot":`collapsible-panel`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Yt(e,t){let n=(0,$.c)(12),[r,i]=(0,Z.useState)(e),a=(0,Z.useRef)(!1),o,s;n[0]===e?(o=n[1],s=n[2]):(o=()=>{a.current||i(e)},s=[e],n[0]=e,n[1]=o,n[2]=s),(0,Z.useEffect)(o,s);let c,l;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{i(e.target.value)},l=()=>{a.current=!0},n[3]=c,n[4]=l):(c=n[3],l=n[4]);let u;n[5]!==r||n[6]!==t||n[7]!==e?(u=()=>{a.current=!1,r!==e&&t(r)},n[5]=r,n[6]=t,n[7]=e,n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==u?(d={value:r,onChange:c,onFocus:l,onBlur:u,onKeyDown:Xt},n[9]=r,n[10]=u,n[11]=d):d=n[11],d}function Xt(e){e.key===`Enter`&&(e.preventDefault(),e.target.blur())}function Zt(e){let t=(0,$.c)(7),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({value:i,onCommit:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=Yt(i,n),o;return t[4]!==a||t[5]!==r?(o=(0,Q.jsx)(tt,{...r,...a}),t[4]=a,t[5]=r,t[6]=o):o=t[6],o}function Qt(){let e=(0,$.c)(10),t=z(),n=P(),r=H(),i=He(h.serverUpdateSettings),a=b(Qe(x)),o=n?.environmentId??t?.environment.environmentId,s=!i.allowed||r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1);if(t?.environment.capabilities.projectPreferences!==!0){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Y,{title:`Project defaults`,owner:`node`,description:`Update this node to configure inherited project defaults.`,control:null}),e[0]=t):t=e[0],t}let c;if(e[1]!==o||e[2]!==a){let t;e[4]===o?t=e[5]:(t=e=>e.environmentId===o,e[4]=o,e[5]=t),c=a.filter(t).map($t),e[1]=o,e[2]=a,e[3]=c}else c=e[3];let l;return e[6]!==s||e[7]!==o||e[8]!==c?(l=(0,Q.jsx)(en,{disabled:s,projects:c},o),e[6]=s,e[7]=o,e[8]=c,e[9]=l):l=e[9],l}function $t(e){return{id:e.id,title:e.name}}function en(e){let t=z(),n=P(),[i,a]=(0,Z.useState)(``),s=i,d=!(!s||e.projects.some(e=>e.id===s)),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1),[_,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(0),S=(0,Z.useRef)(0);(0,Z.useEffect)(()=>{let n=++S.current;if(m(null),y(null),d){y(`Project no longer exists.`);return}if(t&&!e.disabled)return Promise.resolve().then(()=>Ye({api:pe(t.environment.environmentId),config:t,...s?{projectId:f.make(s)}:{}})).then(e=>{S.current===n&&m(e)}).catch(e=>{S.current===n&&y(e instanceof Error?e.message:`Could not load project defaults.`)}),()=>{S.current++}},[t,s,e.disabled,b,d]);let C=e.disabled||d||h||p===null;async function w(e){if(C||!t)return;let i=S.current;g(!0),y(null);let a=p?.overrides??{},o=Object.fromEntries(Object.keys(e).map(e=>[e,e===`initialModelSelection`&&!Object.hasOwn(a,e)?`absent`:a[e]??null])),c=s?{projectPreferences:{[s]:e},expectedProjectPreferences:{[s]:o}}:{...e,expectedNodePreferences:Object.fromEntries(Object.keys(e).map(e=>[e,e===`initialModelSelection`&&p?.initialModelSelection.source===`builtin`?null:p?.[e]?.value]))};try{n?await te(n.environmentId,c):r(await se().server.updateSettings(c)),S.current===i&&x(e=>e+1)}catch(e){S.current===i&&y(e instanceof Error?e.message:`Could not save project defaults.`)}finally{g(!1)}}function T(e){let t=p?.[e];return t?t.source===`project`||t.source===`legacy-project`?`Overridden for this project`:s?`Inherited from ${t.source===`builtin`?`Ryco defaults`:`node defaults`}`:t.source===`builtin`?`Ryco default`:`Node default`:`Loading effective value…`}function E(e){let t=p?.[e]?.source===`project`||p?.[e]?.source===`legacy-project`;return s&&!t?null:(0,Q.jsx)(F,{variant:`outline`,size:`sm`,disabled:C,onClick:()=>{let t=s||e===`initialModelSelection`?null:o[e];w({[e]:t})},children:s?`Use node default`:`Reset`})}let D=p?.initialModelSelection.value,O=A(v(t?.providers??[])),k=O.find(e=>e.instanceId===D?.instanceId);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Project default scope`,owner:`node`,scope:n?.nodeLabel??`This node`,description:`Defaults apply to new threads and worktrees. Each project can inherit or override individual fields. Existing threads keep their choices.`,control:(0,Q.jsxs)(G,{value:s?`project:${s}`:`node`,disabled:e.disabled||h,onValueChange:(e,t)=>{if(t.reason===`none`){t.cancel();return}e===`node`?a(``):typeof e==`string`&&e.startsWith(`project:`)&&a(e.slice(8))},children:[(0,Q.jsx)(q,{"aria-label":`Project default scope`,children:(0,Q.jsx)(W,{children:e.projects.find(e=>e.id===s)?.title??(s?`Project removed`:`Node defaults`)})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`node`,children:`Node defaults`}),e.projects.map(e=>(0,Q.jsx)(U,{value:`project:${e.id}`,children:e.title},e.id))]})]})}),(0,Q.jsx)(Y,{title:`Initial model and effort`,owner:`node`,description:T(`initialModelSelection`),resetAction:E(`initialModelSelection`),control:D&&t?(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,Q.jsx)(We,{activeInstanceId:D.instanceId,model:D.model,modelOptions:D.options,lockedProvider:null,instanceEntries:O,modelOptionsByInstance:be({...o,...t.settings},t.providers,D.instanceId,D.model),disabled:C,triggerVariant:`outline`,onInstanceModelChange:(e,t,n)=>void w({initialModelSelection:fe(e,t,n?.filter(e=>u.includes(e.id)))})}),k&&(0,Q.jsx)(Ue,{provider:k.driverKind,models:k.models,model:D.model,prompt:``,onPromptChange:()=>{},modelOptions:D.options,allowPromptInjectedEffort:!1,hideAgent:!0,disabled:C,triggerVariant:`outline`,onModelOptionsChange:e=>void w({initialModelSelection:fe(D.instanceId,D.model,e)})})]}):null}),(0,Q.jsx)(Y,{title:`New threads`,owner:`node`,description:T(`defaultThreadEnvMode`),resetAction:E(`defaultThreadEnvMode`),control:(0,Q.jsxs)(G,{value:p?.defaultThreadEnvMode.value??`local`,disabled:C,onValueChange:e=>{(e===`local`||e===`worktree`)&&w({defaultThreadEnvMode:e})},children:[(0,Q.jsx)(q,{"aria-label":`Default thread mode`,children:(0,Q.jsx)(W,{children:p?.defaultThreadEnvMode.value===`worktree`?`New worktree`:`Local`})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`local`,children:`Local`}),(0,Q.jsx)(U,{value:`worktree`,children:`New worktree`})]})]})}),(0,Q.jsx)(Y,{title:`Worktree branch prefix`,owner:`node`,description:`${T(`worktreeBranchPrefix`)}. Empty means no prefix; existing branches keep their names.`,resetAction:E(`worktreeBranchPrefix`),control:(0,Q.jsx)(Zt,{value:p?.worktreeBranchPrefix.value??``,disabled:C,"aria-label":`Worktree branch prefix`,spellCheck:!1,autoCapitalize:`none`,onCommit:e=>{let t=e.trim();if(!c(l)(t)){y(`Use a valid Git namespace of up to 128 characters without a trailing slash.`);return}w({worktreeBranchPrefix:t})}})}),(0,Q.jsx)(Y,{title:`Worktree setup`,owner:`node`,description:`${T(`runSetupScript`)}. Run the project's existing setup script after creating a worktree.`,resetAction:E(`runSetupScript`),control:(0,Q.jsxs)(G,{value:p?.runSetupScript.value===!1?`skip`:`run`,disabled:C,onValueChange:e=>void w({runSetupScript:e===`run`}),children:[(0,Q.jsx)(q,{"aria-label":`Worktree setup`,children:(0,Q.jsx)(W,{children:p?.runSetupScript.value===!1?`Skip setup`:`Run setup`})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`run`,children:`Run setup`}),(0,Q.jsx)(U,{value:`skip`,children:`Skip setup`})]})]})}),h&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),_&&(0,Q.jsxs)(`div`,{role:`alert`,className:`text-sm text-destructive`,children:[_,` `,(0,Q.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>x(e=>e+1),children:`Reload`})]})]})}function tn(e){let t={busy:!1,snapshot:null,preview:null,result:null,error:null},n,r=()=>n??e.canManage?.()??!1,i=0,a=null,o=new Set,s=e=>{t={...t,...e};for(let e of o)e()},c=async n=>{if(t.busy)return;let o=e.readClient();if(!o||!r()){s({preview:null,error:`Connect as this node's owner and wait for synchronization.`});return}let c=++i;s({busy:!0,error:null});try{let t=await n(o);c===i&&e.readClient()===o&&r()?(t.preview&&(a=o),s(t)):c===i&&s({preview:null,error:`Connection changed. Scan and review again.`})}catch(e){c===i&&s({preview:null,error:e instanceof Error?e.message:`Storage request failed. Scan and review again.`})}finally{c===i&&s({busy:!1})}};return{setReady:e=>{n=e,e||(i++,a=null,s({busy:!1,preview:null,error:null}))},getSnapshot:()=>t,subscribe:e=>(o.add(e),()=>{o.delete(e)}),invalidatePreview:()=>{i++,a=null,s({busy:!1,preview:null,result:null,error:null})},reset:()=>{i++,a=null,s({busy:!1,snapshot:null,preview:null,result:null,error:null})},scan:(e,t)=>c(async n=>({snapshot:await n.storage.scan({...e?{projectId:e}:{},...t?{cursor:t}:{}}),preview:null,result:null})),preview:e=>c(async t=>({preview:await t.storage.preview({entryIds:e}),result:null})),execute:e=>c(async n=>{if(!e||!t.preview||a!==n||Date.parse(t.preview.expiresAt)<=Date.now())throw Error(`Cleanup requires a current reviewed preview and explicit confirmation.`);return{result:await n.storage.execute({token:t.preview.token,confirmation:`delete reviewed data`}),preview:null,snapshot:null}})}}function nn(e,t){return(t?e.projectStorageRetention[t]:null)??e.storageRetention}function rn(e,t){if(e===null||t===`unknown`)return`Size unavailable`;let n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=Math.min(Math.floor(Math.log2(Math.max(1,e))/10),n.length-1);return`${t===`bounded`?`At least `:``}${(e/1024**r).toFixed(r===0?0:1)} ${n[r]}`}function an(){let e=(0,$.c)(4),t=z(),n=P(),r=H(),i=n?.environmentId??t?.environment.environmentId,a=i??`offline`,o=r===`client`||!t||t.environment.capabilities.storageManagement!==!0||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),s;return e[0]!==i||e[1]!==a||e[2]!==o?(s=(0,Q.jsx)(on,{environmentId:i,disabled:o},a),e[0]=i,e[1]=a,e[2]=o,e[3]=s):s=e[3],s}function on({environmentId:e,disabled:t}){let n=z(),r=P(),i=(0,Z.useMemo)(()=>tn({readClient:()=>e?he(e)?.client??null:null}),[e]);(0,Z.useLayoutEffect)(()=>{i.setReady(!t)},[i,t]);let a=(0,Z.useSyncExternalStore)(i.subscribe,i.getSnapshot),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=n?.settings,y=v?nn(v,o||null):{automatic:!1,completedWorktreeDays:null,temporaryDataDays:null},b=a.snapshot?.entries.filter(e=>e.category===`repository`)??[],x=t||m||a.busy;async function S(t){if(x||!e||!o&&!t)return;h(!0),_(null),i.invalidatePreview(),l([]),p(null);let n=o?{projectStorageRetention:{[o]:t}}:{storageRetention:t};try{await te(e,n)}catch(e){_(e instanceof Error?e.message:`Could not save retention policy.`)}finally{h(!1)}}return(0,Q.jsx)(Y,{title:`Node storage and cleanup`,owner:`node`,scope:r?.nodeLabel??`This node`,description:`Measure project storage, review protected data and clean up inactive Ryco-owned checkouts. Automatic cleanup starts disabled.`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-sm`,children:[(0,Q.jsxs)(F,{variant:`outline`,disabled:x,onClick:()=>{l([]),d(``),i.scan()},children:[` `,a.busy?`Working…`:`Scan node storage`,` `]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Scans have a shared time and entry budget. Sizes are apparent bytes; unavailable sizes and lower bounds are labelled. Provider archives, credentials, repositories and persistent attachments stay protected.`}),a.snapshot&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Scanned `,new Date(a.snapshot.scannedAt).toLocaleString(),a.snapshot.truncated?` · Scan limit reached; some sizes or entries are unavailable.`:``]}),(0,Q.jsxs)(`select`,{"aria-label":`Retention policy scope`,className:`rounded-md border bg-background p-2`,value:o,disabled:x,onChange:e=>{s(e.target.value),p(null),l([]),d(``),i.invalidatePreview()},children:[(0,Q.jsx)(`option`,{value:``,children:`Node default`}),b.map(e=>(0,Q.jsx)(`option`,{value:e.projectId,children:e.label},e.id))]}),(0,Q.jsx)(`p`,{children:o&&!v?.projectStorageRetention[o]?`Inherited node retention policy`:o?`Project retention policy`:`Node retention policy`}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:y.automatic,disabled:x,onChange:e=>{e.target.checked?p({...y,automatic:!0,completedWorktreeDays:y.completedWorktreeDays??30}):S({...y,automatic:!1})}}),`Automatic retention cleanup`]}),[`completedWorktreeDays`,`temporaryDataDays`].map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[e===`completedWorktreeDays`?`Keep completed checkouts`:`Keep completed temporary staging data`,(0,Q.jsxs)(`select`,{"aria-label":e===`completedWorktreeDays`?`Completed worktree retention`:`Temporary data retention`,className:`rounded-md border bg-background p-2`,disabled:x,value:y[e]??`forever`,onChange:t=>{S({...y,[e]:t.target.value===`forever`?null:Number(t.target.value)})},children:[(0,Q.jsx)(`option`,{value:`forever`,children:`Forever`}),[1,7,30,90,365].map(e=>(0,Q.jsxs)(`option`,{value:e,children:[e,` days`]},e)),y[e]!==null&&![1,7,30,90,365].includes(y[e])&&(0,Q.jsxs)(`option`,{value:y[e],children:[y[e],` days`]})]})]},e)),o&&v?.projectStorageRetention[o]&&(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{S(null)},children:`Use node retention policy`}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Retention applies hourly after the node starts. Only archived, stopped, clean, unshared owned checkouts qualify. Abandoned checkouts have a 24-hour grace period. Temporary cleanup applies only to completed Ryco staging allocations.`}),f&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Enable automatic cleanup`,className:`rounded-md border p-3`,children:[(0,Q.jsxs)(`p`,{children:[`Enable automatic deletion on `,o?`this project`:`this node`,`? Qualifying checkouts are removed after `,f.completedWorktreeDays,` `,`days. Branches, messages and usage history are retained. Dirty, untracked, ignored, shared and running work stay protected.`]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Q.jsx)(F,{disabled:x,onClick:()=>{S(f)},children:`Enable automatic cleanup`}),(0,Q.jsx)(F,{variant:`outline`,onClick:()=>p(null),children:`Cancel`})]})]}),(0,Q.jsx)(`div`,{className:`max-h-96 space-y-3 overflow-y-auto`,children:a.snapshot.entries.filter(e=>!o||e.projectId===o).map(e=>(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 rounded-md border p-3`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`mt-1`,disabled:x||!e.eligible,checked:c.includes(e.id),onChange:t=>l(n=>t.target.checked?[...n,e.id].slice(0,20):n.filter(t=>t!==e.id))}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsxs)(`span`,{className:`block font-medium`,children:[e.label,` · `,e.category,` ·`,` `,rn(e.bytes,e.sizeStatus)]}),e.path&&(0,Q.jsx)(`span`,{className:`block break-all text-xs text-muted-foreground`,children:e.path}),(0,Q.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.reason})]})]},e.id))}),a.snapshot.nextCursor&&(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{l([]),i.scan(void 0,a.snapshot.nextCursor)},children:`Next inventory page`}),(0,Q.jsxs)(F,{disabled:x||!c.length,variant:`outline`,onClick:()=>{d(``),i.preview(c)},children:[`Preview cleanup (`,c.length,`)`]}),a.snapshot.history.length>0&&(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{children:[`Historical measured usage (`,a.snapshot.history.length,` recent samples)`]}),a.snapshot.history.filter(e=>!o||e.projectId===o).map(e=>(0,Q.jsxs)(`p`,{className:`text-xs`,children:[new Date(e.sampledAt).toLocaleString(),` ·`,` `,b.find(t=>t.projectId===e.projectId)?.label??`Node data`,` `,`·`,` `,rn(e.measuredBytes,e.incompleteEntries?`bounded`:`complete`),` `,`· `,e.incompleteEntries,` incomplete entries`]},`${e.projectId??`node`}:${e.sampledAt}`))]})]}),a.preview&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm storage cleanup`,className:`rounded-md border p-3`,children:[(0,Q.jsx)(`p`,{children:`Delete these reviewed checkouts/data? This cannot be undone. Branches and conversation history are retained.`}),a.preview.entries.map(e=>(0,Q.jsxs)(`p`,{className:`my-1 break-all text-xs`,children:[e.path,` · `,rn(e.bytes,e.sizeStatus)]},e.id)),(0,Q.jsxs)(`p`,{className:`my-2 text-xs text-muted-foreground`,children:[`Preview expires `,new Date(a.preview.expiresAt).toLocaleTimeString(),`. The server checks safety again before each removal.`]}),(0,Q.jsx)(tt,{"aria-label":`Type DELETE to confirm cleanup`,placeholder:`Type DELETE to confirm`,value:u,onChange:e=>d(e.target.value)}),(0,Q.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Q.jsx)(F,{variant:`destructive`,disabled:x||u!==`DELETE`,onClick:()=>{i.execute(!0)},children:`Delete reviewed data`}),(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{i.invalidatePreview(),l([])},children:`Cancel`})]})]}),a.result?.results.map(e=>(0,Q.jsxs)(`p`,{role:`status`,children:[e.status,`: `,e.detail]},e.id)),(a.error||g)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:a.error??g})]})})}function sn({nodeLabel:e,allowed:t,projects:n,providerOptions:r,client:i}){let a=(0,Z.useRef)(0);(0,Z.useEffect)(()=>()=>{a.current++},[]);let[o,s]=(0,Z.useState)(`codex`),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(``),[m,h]=(0,Z.useState)({}),g=(0,Z.useRef)({allowed:t,source:o,client:i}),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)([]),[C,w]=(0,Z.useState)(new Set),[T,E]=(0,Z.useState)(``),[D,O]=(0,Z.useState)(``),[k,A]=(0,Z.useState)(``),[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(!1),[I,L]=(0,Z.useState)([]),[R,z]=(0,Z.useState)({});(0,Z.useLayoutEffect)(()=>{(g.current.allowed!==t||g.current.source!==o)&&a.current++,g.current={allowed:t,source:o,client:i}},[t,o,i]),(0,Z.useEffect)(()=>{let e=a.current;t&&Promise.resolve().then(()=>g.current.client().sources({source:o})).then(t=>{e===a.current&&(l(t),h({}))}).catch(t=>{e===a.current&&L([t instanceof Error?t.message:`Source stores unavailable.`])}).finally(()=>{e===a.current&&P(!1)})},[o,t]);let B=u?c.find(e=>e.key===u):c.find(e=>e.isDefault),ee=r.filter(e=>e.driver===o&&e.enabled&&e.installed&&e.availability!==`unavailable`&&!!B?.instanceIds.includes(e.instanceId)),V=ee.find(e=>e.instanceId===D)??ee[0],H=V?.models.find(e=>e.slug===k)??V?.models.find(e=>e.isDefault)??V?.models[0],te=async(e=0)=>{if(!g.current.allowed)return;P(!0);let t=a.current;try{let n=await i().discover({source:o,...B?{storeKey:B.key}:{},search:_,offset:e,includeArchived:y});if(t!==a.current)return;S(t=>e?[...t,...n.items]:n.items),e||(h({}),w(new Set),z({})),M(n.nextOffset),L(n.notices)}catch(e){t===a.current&&L([e instanceof Error?e.message:`Discovery failed.`])}finally{t===a.current&&P(!1)}},ne=async()=>{if(!g.current.allowed)return;P(!0);let e=a.current,t=f.make(T),n=p.make(V.instanceId);for(let r of x.filter(e=>C.has(e.key)&&!e.importedThreadId&&!e.quarantined&&R[e.key]!==`Imported`)){if(e!==a.current)break;z(e=>({...e,[r.key]:`Importing…`}));try{if(await i().run({source:r.source,key:r.key,...B?{storeKey:B.key}:{},projectId:t,modelSelection:{instanceId:n,model:H.slug}}),e!==a.current)break;z(e=>({...e,[r.key]:`Imported`}))}catch(t){if(e!==a.current)break;z(e=>({...e,[r.key]:t instanceof Error?t.message:`Import failed. Retry this item.`}))}}e===a.current&&P(!1)},re=async(e,t)=>{if(!g.current.allowed)return;P(!0);let n=a.current;try{let r=await i().reconcile({source:e.source,key:e.key,...t?{cursor:t}:{}});n===a.current&&h(t=>({...t,[e.key]:r}))}catch(t){n===a.current&&(h(t=>{let n={...t};return delete n[e.key],n}),z(n=>({...n,[e.key]:t instanceof Error?t.message:`Inspection failed. Import remains paused.`})))}finally{n===a.current&&P(!1)}},ie=async(e,t)=>{if(!g.current.allowed)return;P(!0);let n=a.current;try{let r=await i().adopt({source:e.source,key:e.key,adoptionToken:t});n===a.current&&(S(t=>t.map(t=>t.key===e.key?{...t,quarantined:!1,importedThreadId:r.threadId}:t)),h(t=>{let n={...t};return delete n[e.key],n}),z(t=>({...t,[e.key]:`Imported`})))}catch(t){n===a.current&&(h(t=>{let n={...t};return delete n[e.key],n}),z(n=>({...n,[e.key]:t instanceof Error?t.message:`Adoption failed. Refresh and retry the saved import.`})))}finally{n===a.current&&P(!1)}};return(0,Q.jsxs)(`section`,{"aria-label":`Import local conversations`,className:`space-y-4`,children:[(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Read Codex or Claude history from `,e,`. Originals stay unchanged. New turns use separate native session copies. Only supported user and assistant text is displayed.`]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsxs)(`label`,{children:[`Source`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Import source`,value:o,disabled:N,onChange:e=>{s(e.target.value),a.current++,l([]),h({}),d(``),S([]),M(null),O(``),A(``),w(new Set),z({})},children:[(0,Q.jsx)(`option`,{value:`codex`,children:`Codex`}),(0,Q.jsx)(`option`,{value:`claudeAgent`,children:`Claude Code`})]})]}),(0,Q.jsxs)(`label`,{children:[`Source store`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Import source store`,value:B?.key??``,disabled:N||!t,onChange:e=>{a.current++,d(e.target.value),S([]),w(new Set),h({}),M(null),z({})},children:[!B&&(0,Q.jsx)(`option`,{value:``,children:`Choose a configured store`}),c.map(e=>(0,Q.jsxs)(`option`,{value:e.key,children:[e.label,e.instanceIds.length?``:` (no enabled continuation instance)`]},e.key))]})]}),(0,Q.jsx)(tt,{"aria-label":`Search local conversations`,placeholder:`Search title or project folder`,value:_,maxLength:200,disabled:N,onChange:e=>v(e.target.value)}),(0,Q.jsxs)(`label`,{className:`flex gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:y,disabled:N,onChange:e=>b(e.target.checked)}),`Include archived`]}),(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t||!B,onClick:()=>void te(),children:`Find conversations`})]}),(0,Q.jsx)(`div`,{role:`status`,className:`text-sm`,children:I.map(e=>(0,Q.jsx)(`p`,{children:e},e))}),(0,Q.jsx)(`div`,{className:`max-h-80 overflow-auto divide-y`,children:(t?x:[]).map(e=>(0,Q.jsxs)(`div`,{className:`flex gap-3 py-3 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Select ${e.title}`,disabled:N||!!e.importedThreadId||e.quarantined||R[e.key]===`Imported`,checked:C.has(e.key),onChange:t=>w(n=>{let r=new Set(n);return t.target.checked?r.add(e.key):r.delete(e.key),r})}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`span`,{className:`block break-words`,children:[e.title,e.archived?` (archived)`:``]}),(0,Q.jsxs)(`span`,{className:`block break-all text-muted-foreground`,children:[e.cwd||`Original folder unknown`,` · `,e.messageCount,` messages`]}),(0,Q.jsx)(`span`,{role:`status`,children:e.quarantined?R[e.key]||`Import outcome uncertain — item quarantined`:e.importedThreadId?`Already imported`:R[e.key]}),e.quarantined&&(0,Q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void re(e),children:`Inspect existing copies`}),m[e.key]&&(0,Q.jsxs)(`div`,{"aria-label":`Recovery for ${e.title}`,children:[(0,Q.jsx)(`p`,{role:`status`,children:m[e.key].notice}),m[e.key].candidates.map(e=>(0,Q.jsxs)(`p`,{children:[`Copy `,e.id,` · `,e.messageCount,` messages`]},e.id)),m[e.key].nextCursor&&(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void re(e,m[e.key].nextCursor),children:`Inspect next page`}),m[e.key].state===`unique`&&m[e.key].adoptionToken&&(0,Q.jsx)(F,{disabled:N||!t,onClick:()=>void ie(e,m[e.key].adoptionToken),children:`Adopt proven copy`})]})]})]})]},e.key))}),j!==null&&(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void te(j),children:`Search next page`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Target project (also for moved or missing folders)`,(0,Q.jsxs)(`select`,{className:`ml-2 max-w-full`,"aria-label":`Import target project`,value:T,disabled:N,onChange:e=>E(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`Choose an existing project`}),n.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),!n.length&&(0,Q.jsx)(`p`,{className:`text-sm`,children:`Add a project folder in the sidebar, then return here to import.`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Continue with`,(0,Q.jsx)(`select`,{className:`ml-2`,"aria-label":`Import provider instance`,value:V?.instanceId||``,disabled:N,onChange:e=>{O(e.target.value),A(``)},children:ee.map(e=>(0,Q.jsx)(`option`,{value:e.instanceId,children:e.displayName||e.driver},e.instanceId))})]}),!ee.length&&(0,Q.jsx)(`p`,{className:`text-sm`,children:`Enable a matching provider instance to import and continue these conversations.`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Model for new turns`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Continuation model`,value:H?.slug??``,disabled:N||!H,onChange:e=>A(e.target.value),children:[!H&&(0,Q.jsx)(`option`,{value:``,children:`No available models — refresh Providers settings`}),V?.models.map(e=>(0,Q.jsx)(`option`,{value:e.slug,children:e.name},e.slug))]})]}),(0,Q.jsx)(F,{disabled:N||!t||!T||!ee.length||!H||!C.size,onClick:()=>void ne(),children:N?`Working…`:`Import selected / retry failed`})]})}function cn(){let e=(0,$.c)(22),t=P(),n=H(),r=Xe(),i=He(h.sessionImportRun),a=b(Qe(x)),o=t?.environmentId,s;e[0]===o?s=e[1]:(s={allowed:!1,environmentId:o},e[0]=o,e[1]=s);let c=(0,Z.useRef)(s),l=!!t?.connected&&t.canManage===!0&&t.canMutate!==!1&&i.allowed,u=t?.environmentId,d,f;if(e[2]!==l||e[3]!==u?(d=()=>{c.current={allowed:l,environmentId:u}},f=[l,u],e[2]=l,e[3]=u,e[4]=d,e[5]=f):(d=e[4],f=e[5]),(0,Z.useLayoutEffect)(d,f),r===`phone`||n===`client`||!t)return null;let p=t.environmentId,m=t.nodeLabel,g;if(e[6]!==a||e[7]!==t.environmentId){let n;e[9]===t.environmentId?n=e[10]:(n=e=>e.environmentId===t.environmentId,e[9]=t.environmentId,e[10]=n),g=a.filter(n),e[6]=a,e[7]=t.environmentId,e[8]=g}else g=e[8];let _;e[11]===t.serverConfig?.providers?_=e[12]:(_=t.serverConfig?.providers??[],e[11]=t.serverConfig?.providers,e[12]=_);let v;e[13]===t.environmentId?v=e[14]:(v=()=>{let e=he(t.environmentId);if(!e||!c.current.allowed||c.current.environmentId!==t.environmentId)throw Error(`Reconnect with owner access before importing.`);return e.client.sessionImport},e[13]=t.environmentId,e[14]=v);let y;return e[15]!==l||e[16]!==g||e[17]!==_||e[18]!==v||e[19]!==t.environmentId||e[20]!==t.nodeLabel?(y=(0,Q.jsx)(lt,{title:`Import local conversations`,owner:`node`,children:(0,Q.jsx)(sn,{nodeLabel:m,allowed:l,projects:g,providerOptions:_,client:v},p)}),e[15]=l,e[16]=g,e[17]=_,e[18]=v,e[19]=t.environmentId,e[20]=t.nodeLabel,e[21]=y):y=e[21],y}var ln={timestampFormat:`Time format`,diffWordWrap:`Diff line wrapping`,diffIgnoreWhitespace:`Diff whitespace changes`,gitStatusPollIntervalMs:`Remote Git status`,sourceControlRefreshMode:`PR & workflow updates`,autoOpenPlanSidebar:`Auto-open overview`,enableLegacyTokenStreaming:`Stream token by token`,enableProviderUpdateChecks:`Provider update checks`,defaultThreadEnvMode:`New thread mode`,addProjectBaseDirectory:`Add project base directory`,confirmThreadArchive:`Archive confirmation`,confirmThreadDelete:`Delete confirmation`,confirmThreadUnpin:`Unpin confirmation`,textGenerationModelSelection:`Git writing model`};function un(e,t,n){let r=n!==`node`&&t!==`system`,i=r?[`Theme`]:[],a={};for(let t of Object.keys(ln))(n===`all`||de(t)===(n===`node`))&&(m(e[t],o[t])||(i.push(ln[t]),a[t]=o[t]));return{labels:i,resetTheme:r,patch:a}}function dn(e,t,n){return e.filter(e=>n===void 0||e.environmentId===n).map(e=>({project:e,threads:t.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id&&t.archivedAt!==null).toSorted((e,t)=>(t.archivedAt??t.createdAt).localeCompare(e.archivedAt??e.createdAt)||t.id.localeCompare(e.id))})).filter(e=>e.threads.length>0)}function fn(){let e=(0,$.c)(5),t=n(),r=Xe(),i=H();if(r===`phone`||i===`node`||!Pe())return null;let a=!t,o;e[0]===t?o=e[1]:(o=()=>{t&&(Fe.getState().replay(t),E.getState().closeSettings())},e[0]=t,e[1]=o);let s;return e[2]!==a||e[3]!==o?(s=(0,Q.jsx)(Y,{title:`Welcome tour`,description:`Replay provider setup, add a project, and learn the essentials.`,owner:`client`,control:(0,Q.jsx)(F,{variant:`outline`,disabled:a,onClick:o,children:`Open welcome tour`})}),e[2]=a,e[3]=o,e[4]=s):s=e[4],s}function pn(){let e=(0,$.c)(9),t=z(),n=P(),r=H(),i=b(Qe(x)),a=n?.environmentId??t?.environment.environmentId,o=a??`disconnected`,s;if(e[0]!==a||e[1]!==i){let t;e[3]===a?t=e[4]:(t=e=>e.environmentId===a,e[3]=a,e[4]=t),s=i.filter(t).map(mn),e[0]=a,e[1]=i,e[2]=s}else s=e[2];let c=r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),l;return e[5]!==o||e[6]!==s||e[7]!==c?(l=(0,Q.jsx)(hn,{projects:s,disabled:c},o),e[5]=o,e[6]=s,e[7]=c,e[8]=l):l=e[8],l}function mn(e){return{id:e.id,title:e.name}}function hn({projects:e,disabled:t}){let n=z(),i=P(),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),d=e.some(e=>e.id===a)?a:``,f=n?.settings,p=d&&f&&Object.hasOwn(f.projectWorktreeRoots,d)?f.projectWorktreeRoots[d]:null,m=d!==``&&!p,h=d?p??``:f?.worktreeRoot??``,g=p||f?.worktreeRoot||`Ryco-managed directory`;async function _(e){if(t||s)return;c(!0),u(null);let n=d?{projectWorktreeRoots:{[d]:e.trim()||null}}:{worktreeRoot:e.trim()};try{i?await te(i.environmentId,n):r(await se().server.updateSettings(n))}catch(e){u(e instanceof Error?e.message:`Could not save worktree root. Try again.`)}finally{c(!1)}}return(0,Q.jsx)(Y,{title:`Worktree root`,owner:`node`,scope:i?.nodeLabel??`This node`,description:`Choose where new worktrees are created on this node. Existing checkouts keep their paths.`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-72`,children:[(0,Q.jsxs)(G,{value:d||`environment`,disabled:t||s,onValueChange:e=>{o(e===`environment`?``:e??``),u(null)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree root scope`,children:(0,Q.jsx)(W,{children:e.find(e=>e.id===d)?.title??`Environment default`})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{value:`environment`,children:`Environment default`}),e.map(e=>(0,Q.jsx)(U,{value:e.id,children:e.title},e.id))]})]}),(0,Q.jsx)(Zt,{value:h,disabled:t||s,onCommit:e=>{_(e)},placeholder:d?`Inherit environment default`:`Ryco-managed directory`,"aria-label":`Worktree root directory`,spellCheck:!1,autoCapitalize:`none`},d),(0,Q.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[m?`Inherited: `:`Effective: `,g]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Use an absolute path or ~/. Leave empty to `,d?`inherit`:`reset`,`.`]}),h&&(0,Q.jsx)(F,{size:`sm`,variant:`outline`,disabled:t||s,onClick:()=>{_(``)},children:d?`Use environment default`:`Reset worktree root`}),s&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),l&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:l})]})})}var gn=[{value:`recursive`,label:`Recursive`,description:`Initialize all submodules, including nested submodules.`},{value:`top-level`,label:`Top-level only`,description:`Initialize direct submodules; leave nested submodules uninitialized.`},{value:`none`,label:`None`,description:`Skip initialization; use a setup script or initialize manually.`}];function _n(e,t){return e?{projectWorktreeSubmodules:{[e]:t}}:{worktreeSubmodules:t??`recursive`}}function vn(){let e=(0,$.c)(9),t=z(),n=P(),r=H(),i=b(Qe(x)),a=n?.environmentId??t?.environment.environmentId,o=a??`disconnected`,s;if(e[0]!==a||e[1]!==i){let t;e[3]===a?t=e[4]:(t=e=>e.environmentId===a,e[3]=a,e[4]=t),s=i.filter(t).map(yn),e[0]=a,e[1]=i,e[2]=s}else s=e[2];let c=r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),l;return e[5]!==o||e[6]!==s||e[7]!==c?(l=(0,Q.jsx)(bn,{projects:s,disabled:c},o),e[5]=o,e[6]=s,e[7]=c,e[8]=l):l=e[8],l}function yn(e){return{id:e.id,title:e.name}}function bn({projects:e,disabled:t}){let n=z(),i=P(),a=n?.environment.capabilities.worktreeSubmoduleSettings===!0,o=t||!a,[s,l]=(0,Z.useState)(``),[u,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(null),h=e.some(e=>e.id===s)?s:``,g=n?.settings,_=h&&g&&Object.hasOwn(g.projectWorktreeSubmodules,h)?g.projectWorktreeSubmodules[h]:null,v=h?_??`inherit`:g?.worktreeSubmodules??`recursive`;async function y(e){if(o||u||!e)return;let t=e===`inherit`?null:e;if(t===null||c(d)(t)){f(!0),m(null);try{let e=_n(h||null,t);i?await te(i.environmentId,e):r(await se().server.updateSettings(e))}catch(e){m(e instanceof Error?e.message:`Could not save submodule initialization. Try again.`)}finally{f(!1)}}}return(0,Q.jsx)(Y,{title:`Worktree submodules`,description:`Choose how new worktrees initialize submodules. Existing checkouts are unaffected. Project overrides take precedence over repository configuration and the node default.`,owner:`node`,scope:i?.nodeLabel??`This node`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-72`,children:[(0,Q.jsxs)(G,{value:h?`project:${h}`:`environment`,disabled:o||u,onValueChange:e=>{l(e?.startsWith(`project:`)?e.slice(8):``),m(null)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree submodules scope`,children:(0,Q.jsx)(W,{children:e.find(e=>e.id===h)?.title??`Node default`})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{value:`environment`,children:`Node default`}),e.map(e=>(0,Q.jsx)(U,{value:`project:${e.id}`,children:e.title},e.id))]})]}),(0,Q.jsxs)(G,{value:v,disabled:o||u,onValueChange:e=>{y(e)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree submodule initialization`,children:(0,Q.jsx)(W,{children:v===`inherit`?`Inherit`:gn.find(e=>e.value===v)?.label})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[h&&(0,Q.jsx)(U,{value:`inherit`,children:`Inherit`}),gn.map(e=>(0,Q.jsx)(U,{value:e.value,children:e.label},e.value))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a?v===`inherit`?`Use repository configuration when present, otherwise the node default.`:gn.find(e=>e.value===v)?.description:`This node does not support configurable submodules. Update the node to change this setting.`}),u&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),p&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p})]})})}var xn={0:`Off`,1e4:`10 seconds`,3e4:`30 seconds`,6e4:`1 minute`,3e5:`5 minutes`},Sn=[0,1e4,3e4,6e4,3e5],Cn={automatic:`Automatic`,reduced:`Reduced`,manual:`Manual`},wn=[`automatic`,`reduced`,`manual`];function Tn(e){if(e===null)return null;let t=Number.parseInt(e,10);return Sn.includes(t)?t:null}function En(e){return wn.find(t=>t===e)??null}function Dn(){let e=(0,$.c)(65),t=B(),{updateSettings:n}=T(),r=Ze(),i;e[0]!==t.diffWordWrap||e[1]!==n?(i=t.diffWordWrap===o.diffWordWrap?null:(0,Q.jsx)(X,{label:`diff line wrapping`,onClick:()=>n({diffWordWrap:o.diffWordWrap})}),e[0]=t.diffWordWrap,e[1]=n,e[2]=i):i=e[2];let a;e[3]===n?a=e[4]:(a=e=>n({diffWordWrap:!!e}),e[3]=n,e[4]=a);let s;e[5]!==t.diffWordWrap||e[6]!==a?(s=(0,Q.jsx)(Te,{checked:t.diffWordWrap,onCheckedChange:a,"aria-label":`Wrap diff lines by default`}),e[5]=t.diffWordWrap,e[6]=a,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==i||e[10]!==s?(c=(0,Q.jsx)(Y,{title:`Diff line wrapping`,description:`Set the default wrap state when the diff panel opens.`,scope:r,resetAction:i,control:s}),e[8]=r,e[9]=i,e[10]=s,e[11]=c):c=e[11];let l;e[12]!==t.diffIgnoreWhitespace||e[13]!==n?(l=t.diffIgnoreWhitespace===o.diffIgnoreWhitespace?null:(0,Q.jsx)(X,{label:`diff whitespace changes`,onClick:()=>n({diffIgnoreWhitespace:o.diffIgnoreWhitespace})}),e[12]=t.diffIgnoreWhitespace,e[13]=n,e[14]=l):l=e[14];let u;e[15]===n?u=e[16]:(u=e=>n({diffIgnoreWhitespace:!!e}),e[15]=n,e[16]=u);let d;e[17]!==t.diffIgnoreWhitespace||e[18]!==u?(d=(0,Q.jsx)(Te,{checked:t.diffIgnoreWhitespace,onCheckedChange:u,"aria-label":`Hide whitespace changes by default`}),e[17]=t.diffIgnoreWhitespace,e[18]=u,e[19]=d):d=e[19];let f;e[20]!==r||e[21]!==l||e[22]!==d?(f=(0,Q.jsx)(Y,{title:`Hide whitespace changes`,description:`Set whether the diff panel ignores whitespace-only edits by default.`,scope:r,resetAction:l,control:d}),e[20]=r,e[21]=l,e[22]=d,e[23]=f):f=e[23];let p;e[24]!==c||e[25]!==f?(p=(0,Q.jsxs)(lt,{title:`Diff display`,children:[c,f]}),e[24]=c,e[25]=f,e[26]=p):p=e[26];let m;e[27]!==t.gitStatusPollIntervalMs||e[28]!==n?(m=t.gitStatusPollIntervalMs===o.gitStatusPollIntervalMs?null:(0,Q.jsx)(X,{label:`git status polling`,onClick:()=>n({gitStatusPollIntervalMs:o.gitStatusPollIntervalMs})}),e[27]=t.gitStatusPollIntervalMs,e[28]=n,e[29]=m):m=e[29];let h=String(t.gitStatusPollIntervalMs),g;e[30]===n?g=e[31]:(g=e=>{let t=Tn(e);t!==null&&n({gitStatusPollIntervalMs:t})},e[30]=n,e[31]=g);let _=xn[t.gitStatusPollIntervalMs],v;e[32]===_?v=e[33]:(v=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`Git status polling interval`,children:(0,Q.jsx)(W,{children:_})}),e[32]=_,e[33]=v);let y;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(K,{align:`end`,alignItemWithTrigger:!1,children:Sn.map(kn)}),e[34]=y):y=e[34];let b;e[35]!==h||e[36]!==g||e[37]!==v?(b=(0,Q.jsxs)(G,{value:h,onValueChange:g,children:[v,y]}),e[35]=h,e[36]=g,e[37]=v,e[38]=b):b=e[38];let x;e[39]!==r||e[40]!==b||e[41]!==m?(x=(0,Q.jsx)(Y,{title:`Remote Git status`,description:`Refresh remote branch and pull request metadata while a repository is open.`,scope:r,resetAction:m,control:b}),e[39]=r,e[40]=b,e[41]=m,e[42]=x):x=e[42];let S;e[43]!==t.sourceControlRefreshMode||e[44]!==n?(S=t.sourceControlRefreshMode===o.sourceControlRefreshMode?null:(0,Q.jsx)(X,{label:`PR and workflow updates`,onClick:()=>n({sourceControlRefreshMode:o.sourceControlRefreshMode})}),e[43]=t.sourceControlRefreshMode,e[44]=n,e[45]=S):S=e[45];let C;e[46]===n?C=e[47]:(C=e=>{let t=En(e);t!==null&&n({sourceControlRefreshMode:t})},e[46]=n,e[47]=C);let w=Cn[t.sourceControlRefreshMode],E;e[48]===w?E=e[49]:(E=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`PR and workflow update mode`,children:(0,Q.jsx)(W,{children:w})}),e[48]=w,e[49]=E);let D;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(K,{align:`end`,alignItemWithTrigger:!1,children:wn.map(On)}),e[50]=D):D=e[50];let O;e[51]!==t.sourceControlRefreshMode||e[52]!==C||e[53]!==E?(O=(0,Q.jsxs)(G,{value:t.sourceControlRefreshMode,onValueChange:C,children:[E,D]}),e[51]=t.sourceControlRefreshMode,e[52]=C,e[53]=E,e[54]=O):O=e[54];let k;e[55]!==r||e[56]!==S||e[57]!==O?(k=(0,Q.jsx)(Y,{title:`PR & workflow updates`,description:`Control automatic pull request and workflow refreshes. Automatic is fast after pushes and stops when checks settle.`,scope:r,resetAction:S,control:O}),e[55]=r,e[56]=S,e[57]=O,e[58]=k):k=e[58];let A;e[59]!==x||e[60]!==k?(A=(0,Q.jsxs)(lt,{title:`Git & pull requests`,children:[x,k]}),e[59]=x,e[60]=k,e[61]=A):A=e[61];let j;return e[62]!==A||e[63]!==p?(j=(0,Q.jsxs)(Q.Fragment,{children:[p,A]}),e[62]=A,e[63]=p,e[64]=j):j=e[64],j}function On(e){return(0,Q.jsx)(U,{hideIndicator:!0,value:e,children:Cn[e]},e)}function kn(e){return(0,Q.jsx)(U,{hideIndicator:!0,value:String(e),children:xn[e]},e)}function An(){let e=(0,$.c)(25),t=R(Pn),n=R(Nn),r=R(Mn),i=R(jn),a;e[0]!==n||e[1]!==t?(a=t?null:(0,Q.jsx)(X,{label:`wide composer labels`,onClick:()=>n(!0)}),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===n?o=e[4]:(o=e=>n(!!e),e[3]=n,e[4]=o);let s;e[5]!==o||e[6]!==t?(s=(0,Q.jsx)(Te,{checked:t,onCheckedChange:o,"aria-label":`Auto-collapse wide composer labels`}),e[5]=o,e[6]=t,e[7]=s):s=e[7];let c;e[8]!==a||e[9]!==s?(c=(0,Q.jsx)(Y,{title:`Auto-collapse wide composer labels`,description:`Show long composer mode labels only on hover or focus.`,resetAction:a,control:s}),e[8]=a,e[9]=s,e[10]=c):c=e[10];let l;e[11]!==r||e[12]!==i?(l=r?null:(0,Q.jsx)(X,{label:`always use Build mode`,onClick:()=>i(!0)}),e[11]=r,e[12]=i,e[13]=l):l=e[13];let u;e[14]===i?u=e[15]:(u=e=>i(!!e),e[14]=i,e[15]=u);let d;e[16]!==r||e[17]!==u?(d=(0,Q.jsx)(Te,{checked:r,onCheckedChange:u,"aria-label":`Always use Build mode`}),e[16]=r,e[17]=u,e[18]=d):d=e[18];let f;e[19]!==l||e[20]!==d?(f=(0,Q.jsx)(Y,{title:`Always use Build mode`,description:`Hide the mode selector in the composer and send every turn in Build mode.`,resetAction:l,control:d}),e[19]=l,e[20]=d,e[21]=f):f=e[21];let p;return e[22]!==c||e[23]!==f?(p=(0,Q.jsxs)(lt,{title:`Composer controls`,children:[c,f]}),e[22]=c,e[23]=f,e[24]=p):p=e[24],p}function jn(e){return e.setAlwaysUseBuildMode}function Mn(e){return e.alwaysUseBuildMode}function Nn(e){return e.setWideComposerControlsAutoCollapse}function Pn(e){return e.wideComposerControlsAutoCollapse}var Fn={"press-twice":`Press twice`,hold:`Hold for 1 second`,immediately:`Immediately`};function In(){let e=(0,$.c)(16),t=Ze(),n=window.desktopBridge?.quitShortcut,[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(null),l,u;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!0;return n?.getMode().then(t=>{e&&i(t)}).catch(()=>{e&&c(`Could not load quit shortcut preference.`)}),()=>{e=!1}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Z.useEffect)(l,u),!n)return null;let d;e[2]===s?d=e[3]:(d=s?(0,Q.jsx)(`span`,{role:`alert`,children:s}):void 0,e[2]=s,e[3]=d);let f=r===null||a,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{(e===`press-twice`||e===`hold`||e===`immediately`)&&(o(!0),c(null),n.setMode(e).then(()=>i(e)).catch(()=>c(`Could not save quit shortcut preference.`)).finally(()=>o(!1)))},e[4]=p):p=e[4];let m=r?Fn[r]:`Loading…`,h;e[5]===m?h=e[6]:(h=(0,Q.jsx)(q,{"aria-label":`Quit shortcut`,className:`w-full sm:w-44`,children:(0,Q.jsx)(W,{children:m})}),e[5]=m,e[6]=h);let g;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(K,{children:Object.entries(Fn).map(Ln)}),e[7]=g):g=e[7];let _;e[8]!==r||e[9]!==f||e[10]!==h?(_=(0,Q.jsxs)(G,{value:r,disabled:f,onValueChange:p,children:[h,g]}),e[8]=r,e[9]=f,e[10]=h,e[11]=_):_=e[11];let v;return e[12]!==t||e[13]!==d||e[14]!==_?(v=(0,Q.jsx)(Y,{title:`Quit shortcut`,scope:t,description:`Prevent accidental quits with a second press within 1.5 seconds, or hold for 1 second and release.`,status:d,control:_}),e[12]=t,e[13]=d,e[14]=_,e[15]=v):v=e[15],v}function Ln(e){let[t,n]=e;return(0,Q.jsx)(U,{value:t,children:n},t)}var Rn={locale:`System default`,"12-hour":`12-hour`,"24-hour":`24-hour`};function zn(e){let t=(0,$.c)(2),{editor:n}=e,r=Ke[n];if(!r)return null;let i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(r,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),t[0]=r,t[1]=i),i}function Bn(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`Version`}),(0,Q.jsx)(`code`,{className:`text-[11px] font-medium text-muted-foreground`,children:le})]}),e[0]=t):t=e[0],t}var Vn=`https://github.com/sak0a/ryco`;function Hn(e){se().shell.openExternal(e).catch(e=>{D.add(J({type:`error`,title:`Could not open link`,description:e instanceof Error?e.message:`Failed to open external link.`}))})}function Un(){let e=(0,$.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(dt,{className:`h-14 text-foreground`}),n=(0,Q.jsx)(`h3`,{className:`text-base font-semibold tracking-tight text-foreground`,children:S}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 pt-6 pb-5 text-center sm:px-5`,children:[t,n,(0,Q.jsx)(`div`,{className:`space-y-0.5 text-[11px] text-muted-foreground`,children:(0,Q.jsx)(`p`,{children:(0,Q.jsx)(`button`,{type:`button`,onClick:Wn,className:`underline-offset-2 hover:text-foreground hover:underline`,children:`github.com/sak0a/ryco`})})})]}),e[2]=r):r=e[2],r}function Wn(){return Hn(Vn)}function Gn(e){let t=(0,$.c)(46),{scopeLabel:n}=e,r=je(),[i,a]=(0,Z.useState)(!1),o=typeof window<`u`&&!!window.desktopBridge,s=r?.channel??`latest`,c;t[0]===s?c=t[1]:(c=e=>{let t=window.desktopBridge;t&&typeof t.setUpdateChannel==`function`&&e!==s&&(a(!0),t.setUpdateChannel(e).then($n).catch(Qn).finally(()=>{a(!1)}))},t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=()=>{let e=window.desktopBridge;if(!e)return;let t=r?Le(r):`none`;if(t===`download`){e.downloadUpdate().then(Zn).catch(Xn);return}if(t===`install`){if(!window.confirm(Me(r??{availableVersion:null,downloadedVersion:null})))return;e.installUpdate().then(Yn).catch(Jn);return}typeof e.checkForUpdate==`function`&&e.checkForUpdate().then(qn).catch(Kn)},t[2]=r,t[3]=u);let d=u,f;t[4]===r?f=t[5]:(f=r?Le(r):`none`,t[4]=r,t[5]=f);let p=f,m;t[6]===r?m=t[7]:(m=r?ze(r):null,t[6]=r,t[7]=m);let h=m,g;t[8]!==p||t[9]!==r?(g=p===`none`?!Ie(r):Ne(r),t[8]=p,t[9]=r,t[10]=g):g=t[10];let _=g,v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v={download:`Download`,install:`Install`},t[11]=v):v=t[11];let y=v,b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b={checking:`Checking…`,downloading:`Downloading…`,"up-to-date":`Up to Date`},t[12]=b):b=t[12];let x=b,S=y[p]??x[r?.status??``]??`Check for Updates`,C=p===`download`||p===`install`?`Update available.`:`Current version of the application.`,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(Bn,{}),t[13]=w):w=t[13];let T=p===`install`?`default`:`outline`,E;t[14]!==_||t[15]!==S||t[16]!==d||t[17]!==T?(E=(0,Q.jsx)(Oe,{render:(0,Q.jsx)(F,{size:`xs`,variant:T,disabled:_,onClick:d,children:S})}),t[14]=_,t[15]=S,t[16]=d,t[17]=T,t[18]=E):E=t[18];let D;t[19]===h?D=t[20]:(D=h?(0,Q.jsx)(ke,{children:h}):null,t[19]=h,t[20]=D);let O;t[21]!==E||t[22]!==D?(O=(0,Q.jsxs)(Ae,{children:[E,D]}),t[21]=E,t[22]=D,t[23]=O):O=t[23];let k;t[24]!==C||t[25]!==n||t[26]!==O?(k=(0,Q.jsx)(Y,{title:w,description:C,scope:n,control:O}),t[24]=C,t[25]=n,t[26]=O,t[27]=k):k=t[27];let A;t[28]===l?A=t[29]:(A=e=>{l(e)},t[28]=l,t[29]=A);let j=!o||i,M=s===`nightly`?`Nightly`:`Stable`,N;t[30]===M?N=t[31]:(N=(0,Q.jsx)(W,{children:M}),t[30]=M,t[31]=N);let P;t[32]!==j||t[33]!==N?(P=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`Update track`,disabled:j,children:N}),t[32]=j,t[33]=N,t[34]=P):P=t[34];let I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{hideIndicator:!0,value:`latest`,children:`Stable`}),(0,Q.jsx)(U,{hideIndicator:!0,value:`nightly`,children:`Nightly`})]}),t[35]=I):I=t[35];let L;t[36]!==s||t[37]!==A||t[38]!==P?(L=(0,Q.jsxs)(G,{value:s,onValueChange:A,children:[P,I]}),t[36]=s,t[37]=A,t[38]=P,t[39]=L):L=t[39];let R;t[40]!==n||t[41]!==L?(R=(0,Q.jsx)(Y,{title:`Update track`,description:`Stable follows full releases. Nightly follows the nightly desktop channel and can switch back to stable immediately.`,scope:n,control:L}),t[40]=n,t[41]=L,t[42]=R):R=t[42];let z;return t[43]!==k||t[44]!==R?(z=(0,Q.jsxs)(Q.Fragment,{children:[k,R]}),t[43]=k,t[44]=R,t[45]=z):z=t[45],z}function Kn(e){D.add(J({type:`error`,title:`Could not check for updates`,description:e instanceof Error?e.message:`Update check failed.`}))}function qn(e){Re(e.state),e.checked||D.add(J({type:`error`,title:`Could not check for updates`,description:e.state.message??`Automatic updates are not available in this build.`}))}function Jn(e){D.add(J({type:`error`,title:`Could not install update`,description:e instanceof Error?e.message:`Install failed.`}))}function Yn(e){Re(e.state)}function Xn(e){D.add(J({type:`error`,title:`Could not download update`,description:e instanceof Error?e.message:`Download failed.`}))}function Zn(e){Re(e.state)}function Qn(e){D.add(J({type:`error`,title:`Could not change update track`,description:e instanceof Error?e.message:`Update track change failed.`}))}function $n(e){Re(e)}function er(e){let t=(0,$.c)(14),{theme:n,setTheme:r}=rt(),i=B(),{updateSettings:a}=T(),o=H(),s;t[0]!==o||t[1]!==i||t[2]!==n?(s=un(i,n,o),t[0]=o,t[1]=i,t[2]=n,t[3]=s):s=t[3];let c=s,l=c.labels,u;t[4]!==e||t[5]!==c.labels||t[6]!==c.patch||t[7]!==c.resetTheme||t[8]!==r||t[9]!==a?(u=async()=>{c.labels.length!==0&&await(ae()??se()).dialogs.confirm([`Restore default settings?`,`This will reset: ${c.labels.join(`, `)}.`].join(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,a as n,dt as r,qt as i}from"./primary-CQh_KHGG.js";import{$ as a,A as o,Et as s,Fa as c,L as l,N as u,R as d,bi as f,bt as p,ou as m,t as h}from"./src-DHNjfMxR.js";import{$l as g,$s as _,Aa as v,Bl as y,Bn as b,Dn as x,Er as S,Gc as C,Gl as w,Hr as T,K as E,Kr as D,Ks as O,Ln as k,Na as A,Nl as j,Ol as M,Pl as N,Ql as P,Qr as F,Qs as I,Ss as L,V as R,Vl as z,Vr as B,X as ee,Xs as V,Zl as H,b as te,bl as ne,dl as re,ei as ie,gr as ae,ho as oe,hr as se,js as ce,kr as le,ks as ue,mu as de,nu as fe,or as pe,os as me,p as he,pl as ge,qc as _e,qs as ve,ts as ye,wa as be}from"./runtime-OM-uAtaj.js";import{t as xe}from"./react-CwJFpaho.js";import{dn as Se,en as Ce,or as we,t as Te}from"./switch-D9inWKdd.js";import{t as Ee}from"./compiler-runtime-C4g8XhC5.js";import{v as De}from"./NullStore-b8PhjwPZ.js";import{i as Oe,n as ke,t as Ae}from"./tooltip-mwOCSCXF.js";import{a as U,c as W,n as G,o as K,s as q}from"./badge-BswOCwph.js";import{c as je,d as Me,f as Ne,g as Pe,h as Fe,l as Ie,p as Le,s as Re,u as ze,x as Be}from"./RootAppShell-DwiWD4Cy.js";import{t as Ve}from"./chevron-right-Ddq5gL-L.js";import{t as He}from"./capabilities-Bj_X9FZ-.js";import{a as Ue,l as We,n as Ge,t as Ke}from"./SettingsPanels.editor-64bM0lhg.js";import{r as qe,t as Je}from"./editorPreferences-DVhg0CXd.js";import{t as J}from"./toastHelpers-CSQRKo4F.js";import{P as Ye}from"./sidebarUndo-BHFfJj0k.js";import{t as Xe}from"./usePresentationTier-hxB7Yv_Q.js";import{t as Ze}from"./deviceName-z0ZWSq0z.js";import{t as Qe}from"./shallow-B--PNURq.js";import{t as $e}from"./useBaseUiId-Bz8dcyjd.js";import{t as et}from"./useControlled-CgAAWIy9.js";import{t as tt}from"./input-CzU08wbL.js";import{t as nt}from"./useLongPress-CUmLovQ7.js";import{t as rt}from"./useTheme-B441xg4F.js";import{a as it,i as at,o as ot,r as st,t as ct}from"./empty-BlBl_Vvw.js";import{i as lt,n as ut,r as Y,t as X}from"./settingsLayout-BbjDM-p0.js";import{P as dt}from"./main-RFllWEko.js";var ft={name:`archive-x`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`m9.5 17 5-5`,key:`nakeu6`}],[`path`,{d:`m9.5 12 5 5`,key:`1hccrj`}]]};ft.node;var pt=oe(ft),mt={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};mt.node;var ht=oe(mt),gt={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};gt.node;var _t=oe(gt),vt={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};vt.node;var yt=oe(vt),bt={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};bt.node;var xt=oe(bt),Z=e(xe(),1);function St(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=et({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=De(a,!0,!0),u=$e(),[d,f]=Z.useState(),p=d===null?void 0:d??u,m=M(e=>{let t=!a,n=me(ue,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return Z.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var Ct=Z.createContext(void 0);function wt(){let e=Z.useContext(Ct);if(e===void 0)throw Error(j(15));return e}var Tt=`data-open`,Et=`data-closed`,Dt=_e,Ot=`data-panel-open`,kt={[Tt]:``},At={[Et]:``},jt={open(e){return e?{[Ot]:``}:null}},Mt={open(e){return e?kt:At},...C},Q=g(),Nt=Z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=M(o),d=St({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=Z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=Z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=V(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Mt});return(0,Q.jsx)(Ct.Provider,{value:p,children:m})}),Pt={...jt,...C},Ft=Z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=wt(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=ce({disabled:c,focusableWhenDisabled:!0,native:u});return V(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Pt})}),It={height:void 0,width:void 0};function Lt(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=Z.useRef(null),f=Z.useRef(null),[p,m]=Z.useState(It),h=Z.useRef(It),g=Z.useRef(!1),v=Z.useRef(s),y=Z.useRef(!1),[b,x]=Z.useState(!1),S=Z.useRef(null),C=_(t,d),w=ye(s),T=ve(d),E=!s&&!a,D=b?`idle`:u,k=s&&(v.current||y.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,j=n&&E&&f.current!==`css-animation`,P=M((e,t=!0)=>{t&&(h.current=e),m(e)}),F=M(()=>{S.current?.(),S.current=null}),I=M(e=>{F(),S.current=()=>{S.current=null,e()}}),R=M(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});N(()=>{b&&u!==`starting`&&x(!1)},[b,u]),Z.useEffect(()=>()=>{R(),F()},[R,F]),N(()=>{let e=d.current;if(!e)return;!s&&S.current&&F();let t=zt(e,k);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){h.current=Rt(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){P(Rt(e)),x(!0);return}if(t===`css-transition`){let t=Ht(e);if(P(Rt(e)),!n)return t;let r=Vt(e,`transition-duration`,`0s`);return I(r),x(!0),t}P(Rt(e));let r=Vt(e,`animation-name`,`none`);if(!n){r();return}let i=Vt(e,`animation-duration`,`0s`);r(),I(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(v.current=!1,y.current=!1,t===`none`){P(It,!1),c(!1);return}P(Rt(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Rt(e);if(!(n.height>0||n.width>0)){c(!1);return}P(n),t===`css-animation`&&Vt(e,`animation-name`,`none`)()},[a,s,F,P,c,I,k,u]),O({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&P(It,!1)}}),Z.useEffect(()=>{if(s||!a||D!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){w.current||(c(!1),P(It,!1))}return t=re.request(()=>{T(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[w,a,s,D,T,P,c]),N(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),Z.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=me(L,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return ge(e,`beforematch`,t)},[o,l]);let z=i||n||a||s;return{height:A.height,props:{...j?{[Dt]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:k,shouldRender:z,transitionStatus:D,width:A.width}}function Rt(e){return{height:e.scrollHeight,width:e.scrollWidth}}function zt(e,t){let n=ne(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Bt(n.animationDuration),i=Bt(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Bt(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function Vt(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function Ht(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var Ut=`--collapsible-panel-height`,Wt=`--collapsible-panel-width`,Gt=Z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=wt(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;N(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=Lt({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=I(s,k),j=V(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[Ut]:S===void 0?`auto`:`${S}px`,[Wt]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Mt});return E?j:null}),$=Ee();function Kt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Nt,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function qt(e){let t=(0,$.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=ie(`cursor-pointer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Ft,{className:i,"data-slot":`collapsible-trigger`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Jt(e){let t=(0,$.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=ie(`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0 data-open:data-ending-style:[height:var(--collapsible-panel-height)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Gt,{className:i,"data-slot":`collapsible-panel`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Yt(e,t){let n=(0,$.c)(12),[r,i]=(0,Z.useState)(e),a=(0,Z.useRef)(!1),o,s;n[0]===e?(o=n[1],s=n[2]):(o=()=>{a.current||i(e)},s=[e],n[0]=e,n[1]=o,n[2]=s),(0,Z.useEffect)(o,s);let c,l;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{i(e.target.value)},l=()=>{a.current=!0},n[3]=c,n[4]=l):(c=n[3],l=n[4]);let u;n[5]!==r||n[6]!==t||n[7]!==e?(u=()=>{a.current=!1,r!==e&&t(r)},n[5]=r,n[6]=t,n[7]=e,n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==u?(d={value:r,onChange:c,onFocus:l,onBlur:u,onKeyDown:Xt},n[9]=r,n[10]=u,n[11]=d):d=n[11],d}function Xt(e){e.key===`Enter`&&(e.preventDefault(),e.target.blur())}function Zt(e){let t=(0,$.c)(7),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({value:i,onCommit:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=Yt(i,n),o;return t[4]!==a||t[5]!==r?(o=(0,Q.jsx)(tt,{...r,...a}),t[4]=a,t[5]=r,t[6]=o):o=t[6],o}function Qt(){let e=(0,$.c)(10),t=z(),n=P(),r=H(),i=He(h.serverUpdateSettings),a=b(Qe(x)),o=n?.environmentId??t?.environment.environmentId,s=!i.allowed||r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1);if(t?.environment.capabilities.projectPreferences!==!0){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Y,{title:`Project defaults`,owner:`node`,description:`Update this node to configure inherited project defaults.`,control:null}),e[0]=t):t=e[0],t}let c;if(e[1]!==o||e[2]!==a){let t;e[4]===o?t=e[5]:(t=e=>e.environmentId===o,e[4]=o,e[5]=t),c=a.filter(t).map($t),e[1]=o,e[2]=a,e[3]=c}else c=e[3];let l;return e[6]!==s||e[7]!==o||e[8]!==c?(l=(0,Q.jsx)(en,{disabled:s,projects:c},o),e[6]=s,e[7]=o,e[8]=c,e[9]=l):l=e[9],l}function $t(e){return{id:e.id,title:e.name}}function en(e){let t=z(),n=P(),[i,a]=(0,Z.useState)(``),s=i,d=!(!s||e.projects.some(e=>e.id===s)),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1),[_,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(0),S=(0,Z.useRef)(0);(0,Z.useEffect)(()=>{let n=++S.current;if(m(null),y(null),d){y(`Project no longer exists.`);return}if(t&&!e.disabled)return Promise.resolve().then(()=>Ye({api:pe(t.environment.environmentId),config:t,...s?{projectId:f.make(s)}:{}})).then(e=>{S.current===n&&m(e)}).catch(e=>{S.current===n&&y(e instanceof Error?e.message:`Could not load project defaults.`)}),()=>{S.current++}},[t,s,e.disabled,b,d]);let C=e.disabled||d||h||p===null;async function w(e){if(C||!t)return;let i=S.current;g(!0),y(null);let a=p?.overrides??{},o=Object.fromEntries(Object.keys(e).map(e=>[e,e===`initialModelSelection`&&!Object.hasOwn(a,e)?`absent`:a[e]??null])),c=s?{projectPreferences:{[s]:e},expectedProjectPreferences:{[s]:o}}:{...e,expectedNodePreferences:Object.fromEntries(Object.keys(e).map(e=>[e,e===`initialModelSelection`&&p?.initialModelSelection.source===`builtin`?null:p?.[e]?.value]))};try{n?await te(n.environmentId,c):r(await se().server.updateSettings(c)),S.current===i&&x(e=>e+1)}catch(e){S.current===i&&y(e instanceof Error?e.message:`Could not save project defaults.`)}finally{g(!1)}}function T(e){let t=p?.[e];return t?t.source===`project`||t.source===`legacy-project`?`Overridden for this project`:s?`Inherited from ${t.source===`builtin`?`Ryco defaults`:`node defaults`}`:t.source===`builtin`?`Ryco default`:`Node default`:`Loading effective value…`}function E(e){let t=p?.[e]?.source===`project`||p?.[e]?.source===`legacy-project`;return s&&!t?null:(0,Q.jsx)(F,{variant:`outline`,size:`sm`,disabled:C,onClick:()=>{let t=s||e===`initialModelSelection`?null:o[e];w({[e]:t})},children:s?`Use node default`:`Reset`})}let D=p?.initialModelSelection.value,O=A(v(t?.providers??[])),k=O.find(e=>e.instanceId===D?.instanceId);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Project default scope`,owner:`node`,scope:n?.nodeLabel??`This node`,description:`Defaults apply to new threads and worktrees. Each project can inherit or override individual fields. Existing threads keep their choices.`,control:(0,Q.jsxs)(G,{value:s?`project:${s}`:`node`,disabled:e.disabled||h,onValueChange:(e,t)=>{if(t.reason===`none`){t.cancel();return}e===`node`?a(``):typeof e==`string`&&e.startsWith(`project:`)&&a(e.slice(8))},children:[(0,Q.jsx)(q,{"aria-label":`Project default scope`,children:(0,Q.jsx)(W,{children:e.projects.find(e=>e.id===s)?.title??(s?`Project removed`:`Node defaults`)})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`node`,children:`Node defaults`}),e.projects.map(e=>(0,Q.jsx)(U,{value:`project:${e.id}`,children:e.title},e.id))]})]})}),(0,Q.jsx)(Y,{title:`Initial model and effort`,owner:`node`,description:T(`initialModelSelection`),resetAction:E(`initialModelSelection`),control:D&&t?(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,Q.jsx)(We,{activeInstanceId:D.instanceId,model:D.model,modelOptions:D.options,lockedProvider:null,instanceEntries:O,modelOptionsByInstance:be({...o,...t.settings},t.providers,D.instanceId,D.model),disabled:C,triggerVariant:`outline`,onInstanceModelChange:(e,t,n)=>void w({initialModelSelection:fe(e,t,n?.filter(e=>u.includes(e.id)))})}),k&&(0,Q.jsx)(Ue,{provider:k.driverKind,models:k.models,model:D.model,prompt:``,onPromptChange:()=>{},modelOptions:D.options,allowPromptInjectedEffort:!1,hideAgent:!0,disabled:C,triggerVariant:`outline`,onModelOptionsChange:e=>void w({initialModelSelection:fe(D.instanceId,D.model,e)})})]}):null}),(0,Q.jsx)(Y,{title:`New threads`,owner:`node`,description:T(`defaultThreadEnvMode`),resetAction:E(`defaultThreadEnvMode`),control:(0,Q.jsxs)(G,{value:p?.defaultThreadEnvMode.value??`local`,disabled:C,onValueChange:e=>{(e===`local`||e===`worktree`)&&w({defaultThreadEnvMode:e})},children:[(0,Q.jsx)(q,{"aria-label":`Default thread mode`,children:(0,Q.jsx)(W,{children:p?.defaultThreadEnvMode.value===`worktree`?`New worktree`:`Local`})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`local`,children:`Local`}),(0,Q.jsx)(U,{value:`worktree`,children:`New worktree`})]})]})}),(0,Q.jsx)(Y,{title:`Worktree branch prefix`,owner:`node`,description:`${T(`worktreeBranchPrefix`)}. Empty means no prefix; existing branches keep their names.`,resetAction:E(`worktreeBranchPrefix`),control:(0,Q.jsx)(Zt,{value:p?.worktreeBranchPrefix.value??``,disabled:C,"aria-label":`Worktree branch prefix`,spellCheck:!1,autoCapitalize:`none`,onCommit:e=>{let t=e.trim();if(!c(l)(t)){y(`Use a valid Git namespace of up to 128 characters without a trailing slash.`);return}w({worktreeBranchPrefix:t})}})}),(0,Q.jsx)(Y,{title:`Worktree setup`,owner:`node`,description:`${T(`runSetupScript`)}. Run the project's existing setup script after creating a worktree.`,resetAction:E(`runSetupScript`),control:(0,Q.jsxs)(G,{value:p?.runSetupScript.value===!1?`skip`:`run`,disabled:C,onValueChange:e=>void w({runSetupScript:e===`run`}),children:[(0,Q.jsx)(q,{"aria-label":`Worktree setup`,children:(0,Q.jsx)(W,{children:p?.runSetupScript.value===!1?`Skip setup`:`Run setup`})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(U,{value:`run`,children:`Run setup`}),(0,Q.jsx)(U,{value:`skip`,children:`Skip setup`})]})]})}),h&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),_&&(0,Q.jsxs)(`div`,{role:`alert`,className:`text-sm text-destructive`,children:[_,` `,(0,Q.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>x(e=>e+1),children:`Reload`})]})]})}function tn(e){let t={busy:!1,snapshot:null,preview:null,result:null,error:null},n,r=()=>n??e.canManage?.()??!1,i=0,a=null,o=new Set,s=e=>{t={...t,...e};for(let e of o)e()},c=async n=>{if(t.busy)return;let o=e.readClient();if(!o||!r()){s({preview:null,error:`Connect as this node's owner and wait for synchronization.`});return}let c=++i;s({busy:!0,error:null});try{let t=await n(o);c===i&&e.readClient()===o&&r()?(t.preview&&(a=o),s(t)):c===i&&s({preview:null,error:`Connection changed. Scan and review again.`})}catch(e){c===i&&s({preview:null,error:e instanceof Error?e.message:`Storage request failed. Scan and review again.`})}finally{c===i&&s({busy:!1})}};return{setReady:e=>{n=e,e||(i++,a=null,s({busy:!1,preview:null,error:null}))},getSnapshot:()=>t,subscribe:e=>(o.add(e),()=>{o.delete(e)}),invalidatePreview:()=>{i++,a=null,s({busy:!1,preview:null,result:null,error:null})},reset:()=>{i++,a=null,s({busy:!1,snapshot:null,preview:null,result:null,error:null})},scan:(e,t)=>c(async n=>({snapshot:await n.storage.scan({...e?{projectId:e}:{},...t?{cursor:t}:{}}),preview:null,result:null})),preview:e=>c(async t=>({preview:await t.storage.preview({entryIds:e}),result:null})),execute:e=>c(async n=>{if(!e||!t.preview||a!==n||Date.parse(t.preview.expiresAt)<=Date.now())throw Error(`Cleanup requires a current reviewed preview and explicit confirmation.`);return{result:await n.storage.execute({token:t.preview.token,confirmation:`delete reviewed data`}),preview:null,snapshot:null}})}}function nn(e,t){return(t?e.projectStorageRetention[t]:null)??e.storageRetention}function rn(e,t){if(e===null||t===`unknown`)return`Size unavailable`;let n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=Math.min(Math.floor(Math.log2(Math.max(1,e))/10),n.length-1);return`${t===`bounded`?`At least `:``}${(e/1024**r).toFixed(r===0?0:1)} ${n[r]}`}function an(){let e=(0,$.c)(4),t=z(),n=P(),r=H(),i=n?.environmentId??t?.environment.environmentId,a=i??`offline`,o=r===`client`||!t||t.environment.capabilities.storageManagement!==!0||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),s;return e[0]!==i||e[1]!==a||e[2]!==o?(s=(0,Q.jsx)(on,{environmentId:i,disabled:o},a),e[0]=i,e[1]=a,e[2]=o,e[3]=s):s=e[3],s}function on({environmentId:e,disabled:t}){let n=z(),r=P(),i=(0,Z.useMemo)(()=>tn({readClient:()=>e?he(e)?.client??null:null}),[e]);(0,Z.useLayoutEffect)(()=>{i.setReady(!t)},[i,t]);let a=(0,Z.useSyncExternalStore)(i.subscribe,i.getSnapshot),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=n?.settings,y=v?nn(v,o||null):{automatic:!1,completedWorktreeDays:null,temporaryDataDays:null},b=a.snapshot?.entries.filter(e=>e.category===`repository`)??[],x=t||m||a.busy;async function S(t){if(x||!e||!o&&!t)return;h(!0),_(null),i.invalidatePreview(),l([]),p(null);let n=o?{projectStorageRetention:{[o]:t}}:{storageRetention:t};try{await te(e,n)}catch(e){_(e instanceof Error?e.message:`Could not save retention policy.`)}finally{h(!1)}}return(0,Q.jsx)(Y,{title:`Node storage and cleanup`,owner:`node`,scope:r?.nodeLabel??`This node`,description:`Measure project storage, review protected data and clean up inactive Ryco-owned checkouts. Automatic cleanup starts disabled.`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-sm`,children:[(0,Q.jsxs)(F,{variant:`outline`,disabled:x,onClick:()=>{l([]),d(``),i.scan()},children:[` `,a.busy?`Working…`:`Scan node storage`,` `]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Scans have a shared time and entry budget. Sizes are apparent bytes; unavailable sizes and lower bounds are labelled. Provider archives, credentials, repositories and persistent attachments stay protected.`}),a.snapshot&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Scanned `,new Date(a.snapshot.scannedAt).toLocaleString(),a.snapshot.truncated?` · Scan limit reached; some sizes or entries are unavailable.`:``]}),(0,Q.jsxs)(`select`,{"aria-label":`Retention policy scope`,className:`rounded-md border bg-background p-2`,value:o,disabled:x,onChange:e=>{s(e.target.value),p(null),l([]),d(``),i.invalidatePreview()},children:[(0,Q.jsx)(`option`,{value:``,children:`Node default`}),b.map(e=>(0,Q.jsx)(`option`,{value:e.projectId,children:e.label},e.id))]}),(0,Q.jsx)(`p`,{children:o&&!v?.projectStorageRetention[o]?`Inherited node retention policy`:o?`Project retention policy`:`Node retention policy`}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:y.automatic,disabled:x,onChange:e=>{e.target.checked?p({...y,automatic:!0,completedWorktreeDays:y.completedWorktreeDays??30}):S({...y,automatic:!1})}}),`Automatic retention cleanup`]}),[`completedWorktreeDays`,`temporaryDataDays`].map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[e===`completedWorktreeDays`?`Keep completed checkouts`:`Keep completed temporary staging data`,(0,Q.jsxs)(`select`,{"aria-label":e===`completedWorktreeDays`?`Completed worktree retention`:`Temporary data retention`,className:`rounded-md border bg-background p-2`,disabled:x,value:y[e]??`forever`,onChange:t=>{S({...y,[e]:t.target.value===`forever`?null:Number(t.target.value)})},children:[(0,Q.jsx)(`option`,{value:`forever`,children:`Forever`}),[1,7,30,90,365].map(e=>(0,Q.jsxs)(`option`,{value:e,children:[e,` days`]},e)),y[e]!==null&&![1,7,30,90,365].includes(y[e])&&(0,Q.jsxs)(`option`,{value:y[e],children:[y[e],` days`]})]})]},e)),o&&v?.projectStorageRetention[o]&&(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{S(null)},children:`Use node retention policy`}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Retention applies hourly after the node starts. Only archived, stopped, clean, unshared owned checkouts qualify. Abandoned checkouts have a 24-hour grace period. Temporary cleanup applies only to completed Ryco staging allocations.`}),f&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Enable automatic cleanup`,className:`rounded-md border p-3`,children:[(0,Q.jsxs)(`p`,{children:[`Enable automatic deletion on `,o?`this project`:`this node`,`? Qualifying checkouts are removed after `,f.completedWorktreeDays,` `,`days. Branches, messages and usage history are retained. Dirty, untracked, ignored, shared and running work stay protected.`]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Q.jsx)(F,{disabled:x,onClick:()=>{S(f)},children:`Enable automatic cleanup`}),(0,Q.jsx)(F,{variant:`outline`,onClick:()=>p(null),children:`Cancel`})]})]}),(0,Q.jsx)(`div`,{className:`max-h-96 space-y-3 overflow-y-auto`,children:a.snapshot.entries.filter(e=>!o||e.projectId===o).map(e=>(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 rounded-md border p-3`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`mt-1`,disabled:x||!e.eligible,checked:c.includes(e.id),onChange:t=>l(n=>t.target.checked?[...n,e.id].slice(0,20):n.filter(t=>t!==e.id))}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsxs)(`span`,{className:`block font-medium`,children:[e.label,` · `,e.category,` ·`,` `,rn(e.bytes,e.sizeStatus)]}),e.path&&(0,Q.jsx)(`span`,{className:`block break-all text-xs text-muted-foreground`,children:e.path}),(0,Q.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.reason})]})]},e.id))}),a.snapshot.nextCursor&&(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{l([]),i.scan(void 0,a.snapshot.nextCursor)},children:`Next inventory page`}),(0,Q.jsxs)(F,{disabled:x||!c.length,variant:`outline`,onClick:()=>{d(``),i.preview(c)},children:[`Preview cleanup (`,c.length,`)`]}),a.snapshot.history.length>0&&(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{children:[`Historical measured usage (`,a.snapshot.history.length,` recent samples)`]}),a.snapshot.history.filter(e=>!o||e.projectId===o).map(e=>(0,Q.jsxs)(`p`,{className:`text-xs`,children:[new Date(e.sampledAt).toLocaleString(),` ·`,` `,b.find(t=>t.projectId===e.projectId)?.label??`Node data`,` `,`·`,` `,rn(e.measuredBytes,e.incompleteEntries?`bounded`:`complete`),` `,`· `,e.incompleteEntries,` incomplete entries`]},`${e.projectId??`node`}:${e.sampledAt}`))]})]}),a.preview&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm storage cleanup`,className:`rounded-md border p-3`,children:[(0,Q.jsx)(`p`,{children:`Delete these reviewed checkouts/data? This cannot be undone. Branches and conversation history are retained.`}),a.preview.entries.map(e=>(0,Q.jsxs)(`p`,{className:`my-1 break-all text-xs`,children:[e.path,` · `,rn(e.bytes,e.sizeStatus)]},e.id)),(0,Q.jsxs)(`p`,{className:`my-2 text-xs text-muted-foreground`,children:[`Preview expires `,new Date(a.preview.expiresAt).toLocaleTimeString(),`. The server checks safety again before each removal.`]}),(0,Q.jsx)(tt,{"aria-label":`Type DELETE to confirm cleanup`,placeholder:`Type DELETE to confirm`,value:u,onChange:e=>d(e.target.value)}),(0,Q.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Q.jsx)(F,{variant:`destructive`,disabled:x||u!==`DELETE`,onClick:()=>{i.execute(!0)},children:`Delete reviewed data`}),(0,Q.jsx)(F,{variant:`outline`,disabled:x,onClick:()=>{i.invalidatePreview(),l([])},children:`Cancel`})]})]}),a.result?.results.map(e=>(0,Q.jsxs)(`p`,{role:`status`,children:[e.status,`: `,e.detail]},e.id)),(a.error||g)&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:a.error??g})]})})}function sn({nodeLabel:e,allowed:t,projects:n,providerOptions:r,client:i}){let a=(0,Z.useRef)(0);(0,Z.useEffect)(()=>()=>{a.current++},[]);let[o,s]=(0,Z.useState)(`codex`),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(``),[m,h]=(0,Z.useState)({}),g=(0,Z.useRef)({allowed:t,source:o,client:i}),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)([]),[C,w]=(0,Z.useState)(new Set),[T,E]=(0,Z.useState)(``),[D,O]=(0,Z.useState)(``),[k,A]=(0,Z.useState)(``),[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(!1),[I,L]=(0,Z.useState)([]),[R,z]=(0,Z.useState)({});(0,Z.useLayoutEffect)(()=>{(g.current.allowed!==t||g.current.source!==o)&&a.current++,g.current={allowed:t,source:o,client:i}},[t,o,i]),(0,Z.useEffect)(()=>{let e=a.current;t&&Promise.resolve().then(()=>g.current.client().sources({source:o})).then(t=>{e===a.current&&(l(t),h({}))}).catch(t=>{e===a.current&&L([t instanceof Error?t.message:`Source stores unavailable.`])}).finally(()=>{e===a.current&&P(!1)})},[o,t]);let B=u?c.find(e=>e.key===u):c.find(e=>e.isDefault),ee=r.filter(e=>e.driver===o&&e.enabled&&e.installed&&e.availability!==`unavailable`&&!!B?.instanceIds.includes(e.instanceId)),V=ee.find(e=>e.instanceId===D)??ee[0],H=V?.models.find(e=>e.slug===k)??V?.models.find(e=>e.isDefault)??V?.models[0],te=async(e=0)=>{if(!g.current.allowed)return;P(!0);let t=a.current;try{let n=await i().discover({source:o,...B?{storeKey:B.key}:{},search:_,offset:e,includeArchived:y});if(t!==a.current)return;S(t=>e?[...t,...n.items]:n.items),e||(h({}),w(new Set),z({})),M(n.nextOffset),L(n.notices)}catch(e){t===a.current&&L([e instanceof Error?e.message:`Discovery failed.`])}finally{t===a.current&&P(!1)}},ne=async()=>{if(!g.current.allowed)return;P(!0);let e=a.current,t=f.make(T),n=p.make(V.instanceId);for(let r of x.filter(e=>C.has(e.key)&&!e.importedThreadId&&!e.quarantined&&R[e.key]!==`Imported`)){if(e!==a.current)break;z(e=>({...e,[r.key]:`Importing…`}));try{if(await i().run({source:r.source,key:r.key,...B?{storeKey:B.key}:{},projectId:t,modelSelection:{instanceId:n,model:H.slug}}),e!==a.current)break;z(e=>({...e,[r.key]:`Imported`}))}catch(t){if(e!==a.current)break;z(e=>({...e,[r.key]:t instanceof Error?t.message:`Import failed. Retry this item.`}))}}e===a.current&&P(!1)},re=async(e,t)=>{if(!g.current.allowed)return;P(!0);let n=a.current;try{let r=await i().reconcile({source:e.source,key:e.key,...t?{cursor:t}:{}});n===a.current&&h(t=>({...t,[e.key]:r}))}catch(t){n===a.current&&(h(t=>{let n={...t};return delete n[e.key],n}),z(n=>({...n,[e.key]:t instanceof Error?t.message:`Inspection failed. Import remains paused.`})))}finally{n===a.current&&P(!1)}},ie=async(e,t)=>{if(!g.current.allowed)return;P(!0);let n=a.current;try{let r=await i().adopt({source:e.source,key:e.key,adoptionToken:t});n===a.current&&(S(t=>t.map(t=>t.key===e.key?{...t,quarantined:!1,importedThreadId:r.threadId}:t)),h(t=>{let n={...t};return delete n[e.key],n}),z(t=>({...t,[e.key]:`Imported`})))}catch(t){n===a.current&&(h(t=>{let n={...t};return delete n[e.key],n}),z(n=>({...n,[e.key]:t instanceof Error?t.message:`Adoption failed. Refresh and retry the saved import.`})))}finally{n===a.current&&P(!1)}};return(0,Q.jsxs)(`section`,{"aria-label":`Import local conversations`,className:`space-y-4`,children:[(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Read Codex or Claude history from `,e,`. Originals stay unchanged. New turns use separate native session copies. Only supported user and assistant text is displayed.`]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsxs)(`label`,{children:[`Source`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Import source`,value:o,disabled:N,onChange:e=>{s(e.target.value),a.current++,l([]),h({}),d(``),S([]),M(null),O(``),A(``),w(new Set),z({})},children:[(0,Q.jsx)(`option`,{value:`codex`,children:`Codex`}),(0,Q.jsx)(`option`,{value:`claudeAgent`,children:`Claude Code`})]})]}),(0,Q.jsxs)(`label`,{children:[`Source store`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Import source store`,value:B?.key??``,disabled:N||!t,onChange:e=>{a.current++,d(e.target.value),S([]),w(new Set),h({}),M(null),z({})},children:[!B&&(0,Q.jsx)(`option`,{value:``,children:`Choose a configured store`}),c.map(e=>(0,Q.jsxs)(`option`,{value:e.key,children:[e.label,e.instanceIds.length?``:` (no enabled continuation instance)`]},e.key))]})]}),(0,Q.jsx)(tt,{"aria-label":`Search local conversations`,placeholder:`Search title or project folder`,value:_,maxLength:200,disabled:N,onChange:e=>v(e.target.value)}),(0,Q.jsxs)(`label`,{className:`flex gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:y,disabled:N,onChange:e=>b(e.target.checked)}),`Include archived`]}),(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t||!B,onClick:()=>void te(),children:`Find conversations`})]}),(0,Q.jsx)(`div`,{role:`status`,className:`text-sm`,children:I.map(e=>(0,Q.jsx)(`p`,{children:e},e))}),(0,Q.jsx)(`div`,{className:`max-h-80 overflow-auto divide-y`,children:(t?x:[]).map(e=>(0,Q.jsxs)(`div`,{className:`flex gap-3 py-3 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Select ${e.title}`,disabled:N||!!e.importedThreadId||e.quarantined||R[e.key]===`Imported`,checked:C.has(e.key),onChange:t=>w(n=>{let r=new Set(n);return t.target.checked?r.add(e.key):r.delete(e.key),r})}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`span`,{className:`block break-words`,children:[e.title,e.archived?` (archived)`:``]}),(0,Q.jsxs)(`span`,{className:`block break-all text-muted-foreground`,children:[e.cwd||`Original folder unknown`,` · `,e.messageCount,` messages`]}),(0,Q.jsx)(`span`,{role:`status`,children:e.quarantined?R[e.key]||`Import outcome uncertain — item quarantined`:e.importedThreadId?`Already imported`:R[e.key]}),e.quarantined&&(0,Q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void re(e),children:`Inspect existing copies`}),m[e.key]&&(0,Q.jsxs)(`div`,{"aria-label":`Recovery for ${e.title}`,children:[(0,Q.jsx)(`p`,{role:`status`,children:m[e.key].notice}),m[e.key].candidates.map(e=>(0,Q.jsxs)(`p`,{children:[`Copy `,e.id,` · `,e.messageCount,` messages`]},e.id)),m[e.key].nextCursor&&(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void re(e,m[e.key].nextCursor),children:`Inspect next page`}),m[e.key].state===`unique`&&m[e.key].adoptionToken&&(0,Q.jsx)(F,{disabled:N||!t,onClick:()=>void ie(e,m[e.key].adoptionToken),children:`Adopt proven copy`})]})]})]})]},e.key))}),j!==null&&(0,Q.jsx)(F,{variant:`outline`,disabled:N||!t,onClick:()=>void te(j),children:`Search next page`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Target project (also for moved or missing folders)`,(0,Q.jsxs)(`select`,{className:`ml-2 max-w-full`,"aria-label":`Import target project`,value:T,disabled:N,onChange:e=>E(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`Choose an existing project`}),n.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),!n.length&&(0,Q.jsx)(`p`,{className:`text-sm`,children:`Add a project folder in the sidebar, then return here to import.`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Continue with`,(0,Q.jsx)(`select`,{className:`ml-2`,"aria-label":`Import provider instance`,value:V?.instanceId||``,disabled:N,onChange:e=>{O(e.target.value),A(``)},children:ee.map(e=>(0,Q.jsx)(`option`,{value:e.instanceId,children:e.displayName||e.driver},e.instanceId))})]}),!ee.length&&(0,Q.jsx)(`p`,{className:`text-sm`,children:`Enable a matching provider instance to import and continue these conversations.`}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[`Model for new turns`,` `,(0,Q.jsxs)(`select`,{"aria-label":`Continuation model`,value:H?.slug??``,disabled:N||!H,onChange:e=>A(e.target.value),children:[!H&&(0,Q.jsx)(`option`,{value:``,children:`No available models — refresh Providers settings`}),V?.models.map(e=>(0,Q.jsx)(`option`,{value:e.slug,children:e.name},e.slug))]})]}),(0,Q.jsx)(F,{disabled:N||!t||!T||!ee.length||!H||!C.size,onClick:()=>void ne(),children:N?`Working…`:`Import selected / retry failed`})]})}function cn(){let e=(0,$.c)(22),t=P(),n=H(),r=Xe(),i=He(h.sessionImportRun),a=b(Qe(x)),o=t?.environmentId,s;e[0]===o?s=e[1]:(s={allowed:!1,environmentId:o},e[0]=o,e[1]=s);let c=(0,Z.useRef)(s),l=!!t?.connected&&t.canManage===!0&&t.canMutate!==!1&&i.allowed,u=t?.environmentId,d,f;if(e[2]!==l||e[3]!==u?(d=()=>{c.current={allowed:l,environmentId:u}},f=[l,u],e[2]=l,e[3]=u,e[4]=d,e[5]=f):(d=e[4],f=e[5]),(0,Z.useLayoutEffect)(d,f),r===`phone`||n===`client`||!t)return null;let p=t.environmentId,m=t.nodeLabel,g;if(e[6]!==a||e[7]!==t.environmentId){let n;e[9]===t.environmentId?n=e[10]:(n=e=>e.environmentId===t.environmentId,e[9]=t.environmentId,e[10]=n),g=a.filter(n),e[6]=a,e[7]=t.environmentId,e[8]=g}else g=e[8];let _;e[11]===t.serverConfig?.providers?_=e[12]:(_=t.serverConfig?.providers??[],e[11]=t.serverConfig?.providers,e[12]=_);let v;e[13]===t.environmentId?v=e[14]:(v=()=>{let e=he(t.environmentId);if(!e||!c.current.allowed||c.current.environmentId!==t.environmentId)throw Error(`Reconnect with owner access before importing.`);return e.client.sessionImport},e[13]=t.environmentId,e[14]=v);let y;return e[15]!==l||e[16]!==g||e[17]!==_||e[18]!==v||e[19]!==t.environmentId||e[20]!==t.nodeLabel?(y=(0,Q.jsx)(lt,{title:`Import local conversations`,owner:`node`,children:(0,Q.jsx)(sn,{nodeLabel:m,allowed:l,projects:g,providerOptions:_,client:v},p)}),e[15]=l,e[16]=g,e[17]=_,e[18]=v,e[19]=t.environmentId,e[20]=t.nodeLabel,e[21]=y):y=e[21],y}var ln={timestampFormat:`Time format`,diffWordWrap:`Diff line wrapping`,diffIgnoreWhitespace:`Diff whitespace changes`,gitStatusPollIntervalMs:`Remote Git status`,sourceControlRefreshMode:`PR & workflow updates`,autoOpenPlanSidebar:`Auto-open overview`,enableLegacyTokenStreaming:`Stream token by token`,enableProviderUpdateChecks:`Provider update checks`,defaultThreadEnvMode:`New thread mode`,addProjectBaseDirectory:`Add project base directory`,confirmThreadArchive:`Archive confirmation`,confirmThreadDelete:`Delete confirmation`,confirmThreadUnpin:`Unpin confirmation`,textGenerationModelSelection:`Git writing model`};function un(e,t,n){let r=n!==`node`&&t!==`system`,i=r?[`Theme`]:[],a={};for(let t of Object.keys(ln))(n===`all`||de(t)===(n===`node`))&&(m(e[t],o[t])||(i.push(ln[t]),a[t]=o[t]));return{labels:i,resetTheme:r,patch:a}}function dn(e,t,n){return e.filter(e=>n===void 0||e.environmentId===n).map(e=>({project:e,threads:t.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id&&t.archivedAt!==null).toSorted((e,t)=>(t.archivedAt??t.createdAt).localeCompare(e.archivedAt??e.createdAt)||t.id.localeCompare(e.id))})).filter(e=>e.threads.length>0)}function fn(){let e=(0,$.c)(5),t=n(),r=Xe(),i=H();if(r===`phone`||i===`node`||!Pe())return null;let a=!t,o;e[0]===t?o=e[1]:(o=()=>{t&&(Fe.getState().replay(t),E.getState().closeSettings())},e[0]=t,e[1]=o);let s;return e[2]!==a||e[3]!==o?(s=(0,Q.jsx)(Y,{title:`Welcome tour`,description:`Replay provider setup, add a project, and learn the essentials.`,owner:`client`,control:(0,Q.jsx)(F,{variant:`outline`,disabled:a,onClick:o,children:`Open welcome tour`})}),e[2]=a,e[3]=o,e[4]=s):s=e[4],s}function pn(){let e=(0,$.c)(9),t=z(),n=P(),r=H(),i=b(Qe(x)),a=n?.environmentId??t?.environment.environmentId,o=a??`disconnected`,s;if(e[0]!==a||e[1]!==i){let t;e[3]===a?t=e[4]:(t=e=>e.environmentId===a,e[3]=a,e[4]=t),s=i.filter(t).map(mn),e[0]=a,e[1]=i,e[2]=s}else s=e[2];let c=r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),l;return e[5]!==o||e[6]!==s||e[7]!==c?(l=(0,Q.jsx)(hn,{projects:s,disabled:c},o),e[5]=o,e[6]=s,e[7]=c,e[8]=l):l=e[8],l}function mn(e){return{id:e.id,title:e.name}}function hn({projects:e,disabled:t}){let n=z(),i=P(),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),d=e.some(e=>e.id===a)?a:``,f=n?.settings,p=d&&f&&Object.hasOwn(f.projectWorktreeRoots,d)?f.projectWorktreeRoots[d]:null,m=d!==``&&!p,h=d?p??``:f?.worktreeRoot??``,g=p||f?.worktreeRoot||`Ryco-managed directory`;async function _(e){if(t||s)return;c(!0),u(null);let n=d?{projectWorktreeRoots:{[d]:e.trim()||null}}:{worktreeRoot:e.trim()};try{i?await te(i.environmentId,n):r(await se().server.updateSettings(n))}catch(e){u(e instanceof Error?e.message:`Could not save worktree root. Try again.`)}finally{c(!1)}}return(0,Q.jsx)(Y,{title:`Worktree root`,owner:`node`,scope:i?.nodeLabel??`This node`,description:`Choose where new worktrees are created on this node. Existing checkouts keep their paths.`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-72`,children:[(0,Q.jsxs)(G,{value:d||`environment`,disabled:t||s,onValueChange:e=>{o(e===`environment`?``:e??``),u(null)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree root scope`,children:(0,Q.jsx)(W,{children:e.find(e=>e.id===d)?.title??`Environment default`})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{value:`environment`,children:`Environment default`}),e.map(e=>(0,Q.jsx)(U,{value:e.id,children:e.title},e.id))]})]}),(0,Q.jsx)(Zt,{value:h,disabled:t||s,onCommit:e=>{_(e)},placeholder:d?`Inherit environment default`:`Ryco-managed directory`,"aria-label":`Worktree root directory`,spellCheck:!1,autoCapitalize:`none`},d),(0,Q.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[m?`Inherited: `:`Effective: `,g]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Use an absolute path or ~/. Leave empty to `,d?`inherit`:`reset`,`.`]}),h&&(0,Q.jsx)(F,{size:`sm`,variant:`outline`,disabled:t||s,onClick:()=>{_(``)},children:d?`Use environment default`:`Reset worktree root`}),s&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),l&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:l})]})})}var gn=[{value:`recursive`,label:`Recursive`,description:`Initialize all submodules, including nested submodules.`},{value:`top-level`,label:`Top-level only`,description:`Initialize direct submodules; leave nested submodules uninitialized.`},{value:`none`,label:`None`,description:`Skip initialization; use a setup script or initialize manually.`}];function _n(e,t){return e?{projectWorktreeSubmodules:{[e]:t}}:{worktreeSubmodules:t??`recursive`}}function vn(){let e=(0,$.c)(9),t=z(),n=P(),r=H(),i=b(Qe(x)),a=n?.environmentId??t?.environment.environmentId,o=a??`disconnected`,s;if(e[0]!==a||e[1]!==i){let t;e[3]===a?t=e[4]:(t=e=>e.environmentId===a,e[3]=a,e[4]=t),s=i.filter(t).map(yn),e[0]=a,e[1]=i,e[2]=s}else s=e[2];let c=r===`client`||!t||r===`node`&&!n||!(!n||n.connected&&n.canManage!==!1&&n.canMutate!==!1),l;return e[5]!==o||e[6]!==s||e[7]!==c?(l=(0,Q.jsx)(bn,{projects:s,disabled:c},o),e[5]=o,e[6]=s,e[7]=c,e[8]=l):l=e[8],l}function yn(e){return{id:e.id,title:e.name}}function bn({projects:e,disabled:t}){let n=z(),i=P(),a=n?.environment.capabilities.worktreeSubmoduleSettings===!0,o=t||!a,[s,l]=(0,Z.useState)(``),[u,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(null),h=e.some(e=>e.id===s)?s:``,g=n?.settings,_=h&&g&&Object.hasOwn(g.projectWorktreeSubmodules,h)?g.projectWorktreeSubmodules[h]:null,v=h?_??`inherit`:g?.worktreeSubmodules??`recursive`;async function y(e){if(o||u||!e)return;let t=e===`inherit`?null:e;if(t===null||c(d)(t)){f(!0),m(null);try{let e=_n(h||null,t);i?await te(i.environmentId,e):r(await se().server.updateSettings(e))}catch(e){m(e instanceof Error?e.message:`Could not save submodule initialization. Try again.`)}finally{f(!1)}}}return(0,Q.jsx)(Y,{title:`Worktree submodules`,description:`Choose how new worktrees initialize submodules. Existing checkouts are unaffected. Project overrides take precedence over repository configuration and the node default.`,owner:`node`,scope:i?.nodeLabel??`This node`,control:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-72`,children:[(0,Q.jsxs)(G,{value:h?`project:${h}`:`environment`,disabled:o||u,onValueChange:e=>{l(e?.startsWith(`project:`)?e.slice(8):``),m(null)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree submodules scope`,children:(0,Q.jsx)(W,{children:e.find(e=>e.id===h)?.title??`Node default`})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{value:`environment`,children:`Node default`}),e.map(e=>(0,Q.jsx)(U,{value:`project:${e.id}`,children:e.title},e.id))]})]}),(0,Q.jsxs)(G,{value:v,disabled:o||u,onValueChange:e=>{y(e)},children:[(0,Q.jsx)(q,{className:`w-full`,"aria-label":`Worktree submodule initialization`,children:(0,Q.jsx)(W,{children:v===`inherit`?`Inherit`:gn.find(e=>e.value===v)?.label})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[h&&(0,Q.jsx)(U,{value:`inherit`,children:`Inherit`}),gn.map(e=>(0,Q.jsx)(U,{value:e.value,children:e.label},e.value))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a?v===`inherit`?`Use repository configuration when present, otherwise the node default.`:gn.find(e=>e.value===v)?.description:`This node does not support configurable submodules. Update the node to change this setting.`}),u&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Saving…`}),p&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p})]})})}var xn={0:`Off`,1e4:`10 seconds`,3e4:`30 seconds`,6e4:`1 minute`,3e5:`5 minutes`},Sn=[0,1e4,3e4,6e4,3e5],Cn={automatic:`Automatic`,reduced:`Reduced`,manual:`Manual`},wn=[`automatic`,`reduced`,`manual`];function Tn(e){if(e===null)return null;let t=Number.parseInt(e,10);return Sn.includes(t)?t:null}function En(e){return wn.find(t=>t===e)??null}function Dn(){let e=(0,$.c)(65),t=B(),{updateSettings:n}=T(),r=Ze(),i;e[0]!==t.diffWordWrap||e[1]!==n?(i=t.diffWordWrap===o.diffWordWrap?null:(0,Q.jsx)(X,{label:`diff line wrapping`,onClick:()=>n({diffWordWrap:o.diffWordWrap})}),e[0]=t.diffWordWrap,e[1]=n,e[2]=i):i=e[2];let a;e[3]===n?a=e[4]:(a=e=>n({diffWordWrap:!!e}),e[3]=n,e[4]=a);let s;e[5]!==t.diffWordWrap||e[6]!==a?(s=(0,Q.jsx)(Te,{checked:t.diffWordWrap,onCheckedChange:a,"aria-label":`Wrap diff lines by default`}),e[5]=t.diffWordWrap,e[6]=a,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==i||e[10]!==s?(c=(0,Q.jsx)(Y,{title:`Diff line wrapping`,description:`Set the default wrap state when the diff panel opens.`,scope:r,resetAction:i,control:s}),e[8]=r,e[9]=i,e[10]=s,e[11]=c):c=e[11];let l;e[12]!==t.diffIgnoreWhitespace||e[13]!==n?(l=t.diffIgnoreWhitespace===o.diffIgnoreWhitespace?null:(0,Q.jsx)(X,{label:`diff whitespace changes`,onClick:()=>n({diffIgnoreWhitespace:o.diffIgnoreWhitespace})}),e[12]=t.diffIgnoreWhitespace,e[13]=n,e[14]=l):l=e[14];let u;e[15]===n?u=e[16]:(u=e=>n({diffIgnoreWhitespace:!!e}),e[15]=n,e[16]=u);let d;e[17]!==t.diffIgnoreWhitespace||e[18]!==u?(d=(0,Q.jsx)(Te,{checked:t.diffIgnoreWhitespace,onCheckedChange:u,"aria-label":`Hide whitespace changes by default`}),e[17]=t.diffIgnoreWhitespace,e[18]=u,e[19]=d):d=e[19];let f;e[20]!==r||e[21]!==l||e[22]!==d?(f=(0,Q.jsx)(Y,{title:`Hide whitespace changes`,description:`Set whether the diff panel ignores whitespace-only edits by default.`,scope:r,resetAction:l,control:d}),e[20]=r,e[21]=l,e[22]=d,e[23]=f):f=e[23];let p;e[24]!==c||e[25]!==f?(p=(0,Q.jsxs)(lt,{title:`Diff display`,children:[c,f]}),e[24]=c,e[25]=f,e[26]=p):p=e[26];let m;e[27]!==t.gitStatusPollIntervalMs||e[28]!==n?(m=t.gitStatusPollIntervalMs===o.gitStatusPollIntervalMs?null:(0,Q.jsx)(X,{label:`git status polling`,onClick:()=>n({gitStatusPollIntervalMs:o.gitStatusPollIntervalMs})}),e[27]=t.gitStatusPollIntervalMs,e[28]=n,e[29]=m):m=e[29];let h=String(t.gitStatusPollIntervalMs),g;e[30]===n?g=e[31]:(g=e=>{let t=Tn(e);t!==null&&n({gitStatusPollIntervalMs:t})},e[30]=n,e[31]=g);let _=xn[t.gitStatusPollIntervalMs],v;e[32]===_?v=e[33]:(v=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`Git status polling interval`,children:(0,Q.jsx)(W,{children:_})}),e[32]=_,e[33]=v);let y;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(K,{align:`end`,alignItemWithTrigger:!1,children:Sn.map(kn)}),e[34]=y):y=e[34];let b;e[35]!==h||e[36]!==g||e[37]!==v?(b=(0,Q.jsxs)(G,{value:h,onValueChange:g,children:[v,y]}),e[35]=h,e[36]=g,e[37]=v,e[38]=b):b=e[38];let x;e[39]!==r||e[40]!==b||e[41]!==m?(x=(0,Q.jsx)(Y,{title:`Remote Git status`,description:`Refresh remote branch and pull request metadata while a repository is open.`,scope:r,resetAction:m,control:b}),e[39]=r,e[40]=b,e[41]=m,e[42]=x):x=e[42];let S;e[43]!==t.sourceControlRefreshMode||e[44]!==n?(S=t.sourceControlRefreshMode===o.sourceControlRefreshMode?null:(0,Q.jsx)(X,{label:`PR and workflow updates`,onClick:()=>n({sourceControlRefreshMode:o.sourceControlRefreshMode})}),e[43]=t.sourceControlRefreshMode,e[44]=n,e[45]=S):S=e[45];let C;e[46]===n?C=e[47]:(C=e=>{let t=En(e);t!==null&&n({sourceControlRefreshMode:t})},e[46]=n,e[47]=C);let w=Cn[t.sourceControlRefreshMode],E;e[48]===w?E=e[49]:(E=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`PR and workflow update mode`,children:(0,Q.jsx)(W,{children:w})}),e[48]=w,e[49]=E);let D;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(K,{align:`end`,alignItemWithTrigger:!1,children:wn.map(On)}),e[50]=D):D=e[50];let O;e[51]!==t.sourceControlRefreshMode||e[52]!==C||e[53]!==E?(O=(0,Q.jsxs)(G,{value:t.sourceControlRefreshMode,onValueChange:C,children:[E,D]}),e[51]=t.sourceControlRefreshMode,e[52]=C,e[53]=E,e[54]=O):O=e[54];let k;e[55]!==r||e[56]!==S||e[57]!==O?(k=(0,Q.jsx)(Y,{title:`PR & workflow updates`,description:`Control automatic pull request and workflow refreshes. Automatic is fast after pushes and stops when checks settle.`,scope:r,resetAction:S,control:O}),e[55]=r,e[56]=S,e[57]=O,e[58]=k):k=e[58];let A;e[59]!==x||e[60]!==k?(A=(0,Q.jsxs)(lt,{title:`Git & pull requests`,children:[x,k]}),e[59]=x,e[60]=k,e[61]=A):A=e[61];let j;return e[62]!==A||e[63]!==p?(j=(0,Q.jsxs)(Q.Fragment,{children:[p,A]}),e[62]=A,e[63]=p,e[64]=j):j=e[64],j}function On(e){return(0,Q.jsx)(U,{hideIndicator:!0,value:e,children:Cn[e]},e)}function kn(e){return(0,Q.jsx)(U,{hideIndicator:!0,value:String(e),children:xn[e]},e)}function An(){let e=(0,$.c)(25),t=R(Pn),n=R(Nn),r=R(Mn),i=R(jn),a;e[0]!==n||e[1]!==t?(a=t?null:(0,Q.jsx)(X,{label:`wide composer labels`,onClick:()=>n(!0)}),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===n?o=e[4]:(o=e=>n(!!e),e[3]=n,e[4]=o);let s;e[5]!==o||e[6]!==t?(s=(0,Q.jsx)(Te,{checked:t,onCheckedChange:o,"aria-label":`Auto-collapse wide composer labels`}),e[5]=o,e[6]=t,e[7]=s):s=e[7];let c;e[8]!==a||e[9]!==s?(c=(0,Q.jsx)(Y,{title:`Auto-collapse wide composer labels`,description:`Show long composer mode labels only on hover or focus.`,resetAction:a,control:s}),e[8]=a,e[9]=s,e[10]=c):c=e[10];let l;e[11]!==r||e[12]!==i?(l=r?null:(0,Q.jsx)(X,{label:`always use Build mode`,onClick:()=>i(!0)}),e[11]=r,e[12]=i,e[13]=l):l=e[13];let u;e[14]===i?u=e[15]:(u=e=>i(!!e),e[14]=i,e[15]=u);let d;e[16]!==r||e[17]!==u?(d=(0,Q.jsx)(Te,{checked:r,onCheckedChange:u,"aria-label":`Always use Build mode`}),e[16]=r,e[17]=u,e[18]=d):d=e[18];let f;e[19]!==l||e[20]!==d?(f=(0,Q.jsx)(Y,{title:`Always use Build mode`,description:`Hide the mode selector in the composer and send every turn in Build mode.`,resetAction:l,control:d}),e[19]=l,e[20]=d,e[21]=f):f=e[21];let p;return e[22]!==c||e[23]!==f?(p=(0,Q.jsxs)(lt,{title:`Composer controls`,children:[c,f]}),e[22]=c,e[23]=f,e[24]=p):p=e[24],p}function jn(e){return e.setAlwaysUseBuildMode}function Mn(e){return e.alwaysUseBuildMode}function Nn(e){return e.setWideComposerControlsAutoCollapse}function Pn(e){return e.wideComposerControlsAutoCollapse}var Fn={"press-twice":`Press twice`,hold:`Hold for 1 second`,immediately:`Immediately`};function In(){let e=(0,$.c)(16),t=Ze(),n=window.desktopBridge?.quitShortcut,[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(null),l,u;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!0;return n?.getMode().then(t=>{e&&i(t)}).catch(()=>{e&&c(`Could not load quit shortcut preference.`)}),()=>{e=!1}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Z.useEffect)(l,u),!n)return null;let d;e[2]===s?d=e[3]:(d=s?(0,Q.jsx)(`span`,{role:`alert`,children:s}):void 0,e[2]=s,e[3]=d);let f=r===null||a,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{(e===`press-twice`||e===`hold`||e===`immediately`)&&(o(!0),c(null),n.setMode(e).then(()=>i(e)).catch(()=>c(`Could not save quit shortcut preference.`)).finally(()=>o(!1)))},e[4]=p):p=e[4];let m=r?Fn[r]:`Loading…`,h;e[5]===m?h=e[6]:(h=(0,Q.jsx)(q,{"aria-label":`Quit shortcut`,className:`w-full sm:w-44`,children:(0,Q.jsx)(W,{children:m})}),e[5]=m,e[6]=h);let g;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(K,{children:Object.entries(Fn).map(Ln)}),e[7]=g):g=e[7];let _;e[8]!==r||e[9]!==f||e[10]!==h?(_=(0,Q.jsxs)(G,{value:r,disabled:f,onValueChange:p,children:[h,g]}),e[8]=r,e[9]=f,e[10]=h,e[11]=_):_=e[11];let v;return e[12]!==t||e[13]!==d||e[14]!==_?(v=(0,Q.jsx)(Y,{title:`Quit shortcut`,scope:t,description:`Prevent accidental quits with a second press within 1.5 seconds, or hold for 1 second and release.`,status:d,control:_}),e[12]=t,e[13]=d,e[14]=_,e[15]=v):v=e[15],v}function Ln(e){let[t,n]=e;return(0,Q.jsx)(U,{value:t,children:n},t)}var Rn={locale:`System default`,"12-hour":`12-hour`,"24-hour":`24-hour`};function zn(e){let t=(0,$.c)(2),{editor:n}=e,r=Ke[n];if(!r)return null;let i;return t[0]===r?i=t[1]:(i=(0,Q.jsx)(r,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),t[0]=r,t[1]=i),i}function Bn(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`Version`}),(0,Q.jsx)(`code`,{className:`text-[11px] font-medium text-muted-foreground`,children:le})]}),e[0]=t):t=e[0],t}var Vn=`https://github.com/sak0a/ryco`;function Hn(e){se().shell.openExternal(e).catch(e=>{D.add(J({type:`error`,title:`Could not open link`,description:e instanceof Error?e.message:`Failed to open external link.`}))})}function Un(){let e=(0,$.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(dt,{className:`h-14 text-foreground`}),n=(0,Q.jsx)(`h3`,{className:`text-base font-semibold tracking-tight text-foreground`,children:S}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 pt-6 pb-5 text-center sm:px-5`,children:[t,n,(0,Q.jsx)(`div`,{className:`space-y-0.5 text-[11px] text-muted-foreground`,children:(0,Q.jsx)(`p`,{children:(0,Q.jsx)(`button`,{type:`button`,onClick:Wn,className:`underline-offset-2 hover:text-foreground hover:underline`,children:`github.com/sak0a/ryco`})})})]}),e[2]=r):r=e[2],r}function Wn(){return Hn(Vn)}function Gn(e){let t=(0,$.c)(46),{scopeLabel:n}=e,r=je(),[i,a]=(0,Z.useState)(!1),o=typeof window<`u`&&!!window.desktopBridge,s=r?.channel??`latest`,c;t[0]===s?c=t[1]:(c=e=>{let t=window.desktopBridge;t&&typeof t.setUpdateChannel==`function`&&e!==s&&(a(!0),t.setUpdateChannel(e).then($n).catch(Qn).finally(()=>{a(!1)}))},t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=()=>{let e=window.desktopBridge;if(!e)return;let t=r?Le(r):`none`;if(t===`download`){e.downloadUpdate().then(Zn).catch(Xn);return}if(t===`install`){if(!window.confirm(Me(r??{availableVersion:null,downloadedVersion:null})))return;e.installUpdate().then(Yn).catch(Jn);return}typeof e.checkForUpdate==`function`&&e.checkForUpdate().then(qn).catch(Kn)},t[2]=r,t[3]=u);let d=u,f;t[4]===r?f=t[5]:(f=r?Le(r):`none`,t[4]=r,t[5]=f);let p=f,m;t[6]===r?m=t[7]:(m=r?ze(r):null,t[6]=r,t[7]=m);let h=m,g;t[8]!==p||t[9]!==r?(g=p===`none`?!Ie(r):Ne(r),t[8]=p,t[9]=r,t[10]=g):g=t[10];let _=g,v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v={download:`Download`,install:`Install`},t[11]=v):v=t[11];let y=v,b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b={checking:`Checking…`,downloading:`Downloading…`,"up-to-date":`Up to Date`},t[12]=b):b=t[12];let x=b,S=y[p]??x[r?.status??``]??`Check for Updates`,C=p===`download`||p===`install`?`Update available.`:`Current version of the application.`,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(Bn,{}),t[13]=w):w=t[13];let T=p===`install`?`default`:`outline`,E;t[14]!==_||t[15]!==S||t[16]!==d||t[17]!==T?(E=(0,Q.jsx)(Oe,{render:(0,Q.jsx)(F,{size:`xs`,variant:T,disabled:_,onClick:d,children:S})}),t[14]=_,t[15]=S,t[16]=d,t[17]=T,t[18]=E):E=t[18];let D;t[19]===h?D=t[20]:(D=h?(0,Q.jsx)(ke,{children:h}):null,t[19]=h,t[20]=D);let O;t[21]!==E||t[22]!==D?(O=(0,Q.jsxs)(Ae,{children:[E,D]}),t[21]=E,t[22]=D,t[23]=O):O=t[23];let k;t[24]!==C||t[25]!==n||t[26]!==O?(k=(0,Q.jsx)(Y,{title:w,description:C,scope:n,control:O}),t[24]=C,t[25]=n,t[26]=O,t[27]=k):k=t[27];let A;t[28]===l?A=t[29]:(A=e=>{l(e)},t[28]=l,t[29]=A);let j=!o||i,M=s===`nightly`?`Nightly`:`Stable`,N;t[30]===M?N=t[31]:(N=(0,Q.jsx)(W,{children:M}),t[30]=M,t[31]=N);let P;t[32]!==j||t[33]!==N?(P=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`Update track`,disabled:j,children:N}),t[32]=j,t[33]=N,t[34]=P):P=t[34];let I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{hideIndicator:!0,value:`latest`,children:`Stable`}),(0,Q.jsx)(U,{hideIndicator:!0,value:`nightly`,children:`Nightly`})]}),t[35]=I):I=t[35];let L;t[36]!==s||t[37]!==A||t[38]!==P?(L=(0,Q.jsxs)(G,{value:s,onValueChange:A,children:[P,I]}),t[36]=s,t[37]=A,t[38]=P,t[39]=L):L=t[39];let R;t[40]!==n||t[41]!==L?(R=(0,Q.jsx)(Y,{title:`Update track`,description:`Stable follows full releases. Nightly follows the nightly desktop channel and can switch back to stable immediately.`,scope:n,control:L}),t[40]=n,t[41]=L,t[42]=R):R=t[42];let z;return t[43]!==k||t[44]!==R?(z=(0,Q.jsxs)(Q.Fragment,{children:[k,R]}),t[43]=k,t[44]=R,t[45]=z):z=t[45],z}function Kn(e){D.add(J({type:`error`,title:`Could not check for updates`,description:e instanceof Error?e.message:`Update check failed.`}))}function qn(e){Re(e.state),e.checked||D.add(J({type:`error`,title:`Could not check for updates`,description:e.state.message??`Automatic updates are not available in this build.`}))}function Jn(e){D.add(J({type:`error`,title:`Could not install update`,description:e instanceof Error?e.message:`Install failed.`}))}function Yn(e){Re(e.state)}function Xn(e){D.add(J({type:`error`,title:`Could not download update`,description:e instanceof Error?e.message:`Download failed.`}))}function Zn(e){Re(e.state)}function Qn(e){D.add(J({type:`error`,title:`Could not change update track`,description:e instanceof Error?e.message:`Update track change failed.`}))}function $n(e){Re(e)}function er(e){let t=(0,$.c)(14),{theme:n,setTheme:r}=rt(),i=B(),{updateSettings:a}=T(),o=H(),s;t[0]!==o||t[1]!==i||t[2]!==n?(s=un(i,n,o),t[0]=o,t[1]=i,t[2]=n,t[3]=s):s=t[3];let c=s,l=c.labels,u;t[4]!==e||t[5]!==c.labels||t[6]!==c.patch||t[7]!==c.resetTheme||t[8]!==r||t[9]!==a?(u=async()=>{c.labels.length!==0&&await(ae()??se()).dialogs.confirm([`Restore default settings?`,`This will reset: ${c.labels.join(`, `)}.`].join(`
2
2
  `))&&(c.resetTheme&&r(`system`),a(c.patch),e?.())},t[4]=e,t[5]=c.labels,t[6]=c.patch,t[7]=c.resetTheme,t[8]=r,t[9]=a,t[10]=u):u=t[10];let d=u,f;return t[11]!==l||t[12]!==d?(f={changedSettingLabels:l,restoreDefaults:d},t[11]=l,t[12]=d,t[13]=f):f=t[13],f}function tr(e){let t=(0,$.c)(19),{searchTargetId:n,nodeScopeLabel:r}=e,i=B(),{updateSettings:a}=T(),s=n===`legacy-token-streaming`,[c,l]=(0,Z.useState)(s),u=(0,Z.useRef)(null),d,f;t[0]===s?(d=t[1],f=t[2]):(d=()=>{if(!s)return;l(!0);let e=requestAnimationFrame(()=>{u.current?.scrollIntoView({block:`center`}),u.current?.querySelector(`[role=switch]`)?.focus()});return()=>cancelAnimationFrame(e)},f=[s],t[0]=s,t[1]=d,t[2]=f),(0,Z.useEffect)(d,f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsxs)(qt,{className:`group flex w-full items-center justify-between rounded-lg px-1 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`inline-block h-px w-3 bg-border`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-foreground/50 transition-colors group-hover:text-foreground/70`,children:`Legacy features`}),(0,Q.jsx)(`span`,{className:`hidden text-[11px] text-muted-foreground/55 sm:inline`,children:`Compatibility controls`})]}),(0,Q.jsx)(Ve,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground/60 transition-transform duration-200 group-data-panel-open:rotate-90`})]}),t[3]=p):p=t[3];let m;t[4]!==i.enableLegacyTokenStreaming||t[5]!==a?(m=i.enableLegacyTokenStreaming===o.enableLegacyTokenStreaming?null:(0,Q.jsx)(X,{label:`legacy token streaming`,onClick:()=>a({enableLegacyTokenStreaming:o.enableLegacyTokenStreaming})}),t[4]=i.enableLegacyTokenStreaming,t[5]=a,t[6]=m):m=t[6];let h;t[7]===a?h=t[8]:(h=e=>{if(!e){a({enableLegacyTokenStreaming:!1});return}(async()=>{await(ae()??se()).dialogs.confirm([`Turn on token-by-token output?`,`It is significantly slower than buffered output and makes long responses harder to follow. This switch exists only for backwards compatibility.`].join(`
3
3
  `))&&a({enableLegacyTokenStreaming:!0})})()},t[7]=a,t[8]=h);let g;t[9]!==i.enableLegacyTokenStreaming||t[10]!==h?(g=(0,Q.jsx)(Te,{checked:i.enableLegacyTokenStreaming,onCheckedChange:h,"aria-label":`Stream token by token (legacy)`}),t[9]=i.enableLegacyTokenStreaming,t[10]=h,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==m||t[14]!==g?(_=(0,Q.jsx)(Jt,{children:(0,Q.jsx)(`div`,{className:`pt-2`,children:(0,Q.jsx)(`div`,{className:`relative overflow-hidden rounded-2xl border border-border/80 bg-card text-card-foreground shadow-sm/4 dark:shadow-none`,children:(0,Q.jsx)(`div`,{ref:u,id:`legacy-token-streaming`,children:(0,Q.jsx)(Y,{title:`Stream token by token (legacy)`,description:`Paint assistant output token by token instead of in complete chunks. This legacy mode is significantly slower and makes long responses harder to follow.`,owner:`node`,scope:r,resetAction:m,control:g})})})})}),t[12]=r,t[13]=m,t[14]=g,t[15]=_):_=t[15];let v;return t[16]!==c||t[17]!==_?(v=(0,Q.jsx)(`section`,{className:`space-y-2.5`,children:(0,Q.jsxs)(Kt,{open:c,onOpenChange:l,children:[p,_]})}),t[16]=c,t[17]=_,t[18]=v):v=t[18],v}function nr(e){let n=(0,$.c)(219),{searchTargetId:r}=e,i=r===void 0?null:r,a=B(),{updateSettings:u}=T(),d=Xe()===`phone`,f=z()?.environment.capabilities.projectPreferences===!0,p=P(),m=H(),h=Ze(),g=p?.nodeLabel??null,_,v,b;if(n[0]!==h||n[1]!==g){let e={appLabel:h,nativeClient:t,nodeLabel:g};v=ee(`browser`,e),_=ee(`device`,e),b=ee(`node`,e),n[0]=h,n[1]=g,n[2]=_,n[3]=v,n[4]=b}else _=n[2],v=n[3],b=n[4];let x=b,S;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(S={logsDirectory:!1},n[5]=S):S=n[5];let[C,E]=(0,Z.useState)(S),O;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(O={},n[6]=O):O=n[6];let[k,A]=(0,Z.useState)(O),j=y(),M=w(),N=M?.logsDirectoryPath??null,I=!p||p.primary,L;n[7]===M?L=n[8]:(L=[],M?.otlpTracesEnabled&&M.otlpTracesUrl&&L.push(`traces to ${M.otlpTracesUrl}`),M?.otlpMetricsEnabled&&M.otlpMetricsUrl&&L.push(`metrics to ${M.otlpMetricsUrl}`),n[7]=M,n[8]=L);let R=M?.localTracingEnabled?`Local trace file`:`Terminal logs only`,V=L.length>0?`${R}. OTLP exporting ${L.join(` and `)}.`:`${R}.`,te;n[9]===j?te=n[10]:(te=(e,t,n)=>{if(!t)return;A(t=>({...t,[e]:null})),E(t=>({...t,[e]:!0}));let r=qe(j??[]);if(!r){A(t=>({...t,[e]:`No available editors found.`})),E(t=>({...t,[e]:!1}));return}se().shell.openInEditor(t,r).catch(t=>{A(r=>({...r,[e]:t instanceof Error?t.message:n}))}).finally(()=>{E(t=>({...t,[e]:!1}))})},n[9]=j,n[10]=te);let ne=te,re;n[11]!==N||n[12]!==ne?(re=()=>{ne(`logsDirectory`,N,`Unable to open logs folder.`)},n[11]=N,n[12]=ne,n[13]=re):re=n[13];let ie=re,ae=k.logsDirectory??null,oe=C.logsDirectory,ce;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(cn,{}),n[14]=ce):ce=n[14];let le;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(fn,{}),n[15]=le):le=n[15];let ue;n[16]!==a.timestampFormat||n[17]!==u?(ue=a.timestampFormat===o.timestampFormat?null:(0,Q.jsx)(X,{label:`time format`,onClick:()=>u({timestampFormat:o.timestampFormat})}),n[16]=a.timestampFormat,n[17]=u,n[18]=ue):ue=n[18];let de;n[19]===u?de=n[20]:(de=e=>{(e===`locale`||e===`12-hour`||e===`24-hour`)&&u({timestampFormat:e})},n[19]=u,n[20]=de);let fe=Rn[a.timestampFormat],pe;n[21]===fe?pe=n[22]:(pe=(0,Q.jsx)(q,{className:`w-full sm:w-40`,"aria-label":`Timestamp format`,children:(0,Q.jsx)(W,{children:fe})}),n[21]=fe,n[22]=pe);let me;n[23]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{hideIndicator:!0,value:`locale`,children:Rn.locale}),(0,Q.jsx)(U,{hideIndicator:!0,value:`12-hour`,children:Rn[`12-hour`]}),(0,Q.jsx)(U,{hideIndicator:!0,value:`24-hour`,children:Rn[`24-hour`]})]}),n[23]=me):me=n[23];let he;n[24]!==a.timestampFormat||n[25]!==de||n[26]!==pe?(he=(0,Q.jsxs)(G,{value:a.timestampFormat,onValueChange:de,children:[pe,me]}),n[24]=a.timestampFormat,n[25]=de,n[26]=pe,n[27]=he):he=n[27];let ge;n[28]!==v||n[29]!==ue||n[30]!==he?(ge=(0,Q.jsx)(Y,{title:`Time format`,description:`System default follows your browser or OS clock preference.`,owner:`client`,scope:v,resetAction:ue,control:he}),n[28]=v,n[29]=ue,n[30]=he,n[31]=ge):ge=n[31];let _e=(j??[]).length>0?`Pin which editor opens directories and files. Auto uses your last selection from the Open menu.`:`No installed editors detected. Install a supported IDE to pick a default.`,ve;n[32]!==a.preferredEditor||n[33]!==u?(ve=a.preferredEditor===o.preferredEditor?null:(0,Q.jsx)(X,{label:`default editor`,onClick:()=>u({preferredEditor:o.preferredEditor})}),n[32]=a.preferredEditor,n[33]=u,n[34]=ve):ve=n[34];let ye=a.preferredEditor??`__auto__`,be;n[35]===u?be=n[36]:(be=e=>{if(e===`__auto__`){u({preferredEditor:null});return}let t=s.find(t=>t.id===e);t&&u({preferredEditor:t.id})},n[35]=u,n[36]=be);let xe;n[37]===a.preferredEditor?xe=n[38]:(xe=a.preferredEditor?(0,Q.jsx)(zn,{editor:a.preferredEditor}):null,n[37]=a.preferredEditor,n[38]=xe);let Se;n[39]===a.preferredEditor?Se=n[40]:(Se=a.preferredEditor?Ge(a.preferredEditor,navigator.platform):`Auto (last used)`,n[39]=a.preferredEditor,n[40]=Se);let Ce;n[41]===Se?Ce=n[42]:(Ce=(0,Q.jsx)(W,{children:Se}),n[41]=Se,n[42]=Ce);let we;n[43]!==xe||n[44]!==Ce?(we=(0,Q.jsxs)(q,{className:`w-full sm:w-56`,"aria-label":`Default editor`,children:[xe,Ce]}),n[43]=xe,n[44]=Ce,n[45]=we):we=n[45];let Ee;n[46]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(U,{hideIndicator:!0,value:`__auto__`,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-4`}),`Auto (last used)`]})}),n[46]=Ee):Ee=n[46];let De;n[47]===j?De=n[48]:(De=s.filter(e=>(j??[]).includes(e.id)&&Je(e.id)).map(rr),n[47]=j,n[48]=De);let Oe;n[49]===De?Oe=n[50]:(Oe=(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[Ee,De]}),n[49]=De,n[50]=Oe);let ke;n[51]!==ye||n[52]!==be||n[53]!==we||n[54]!==Oe?(ke=(0,Q.jsxs)(G,{value:ye,onValueChange:be,children:[we,Oe]}),n[51]=ye,n[52]=be,n[53]=we,n[54]=Oe,n[55]=ke):ke=n[55];let Ae;n[56]!==v||n[57]!==_e||n[58]!==ve||n[59]!==ke?(Ae=(0,Q.jsx)(Y,{title:`Default editor`,description:_e,owner:`client`,scope:v,resetAction:ve,control:ke}),n[56]=v,n[57]=_e,n[58]=ve,n[59]=ke,n[60]=Ae):Ae=n[60];let je;n[61]!==ge||n[62]!==Ae?(je=(0,Q.jsxs)(lt,{title:`Behavior`,owner:`client`,children:[le,ge,Ae]}),n[61]=ge,n[62]=Ae,n[63]=je):je=n[63];let Me;n[64]===d?Me=n[65]:(Me=d&&(0,Q.jsx)(Dn,{}),n[64]=d,n[65]=Me);let Ne;n[66]!==a.enableProviderUpdateChecks||n[67]!==u?(Ne=a.enableProviderUpdateChecks===o.enableProviderUpdateChecks?null:(0,Q.jsx)(X,{label:`provider update checks`,onClick:()=>u({enableProviderUpdateChecks:o.enableProviderUpdateChecks})}),n[66]=a.enableProviderUpdateChecks,n[67]=u,n[68]=Ne):Ne=n[68];let Pe;n[69]===u?Pe=n[70]:(Pe=e=>u({enableProviderUpdateChecks:!!e}),n[69]=u,n[70]=Pe);let Fe;n[71]!==a.enableProviderUpdateChecks||n[72]!==Pe?(Fe=(0,Q.jsx)(Te,{checked:a.enableProviderUpdateChecks,onCheckedChange:Pe,"aria-label":`Check providers for updates`}),n[71]=a.enableProviderUpdateChecks,n[72]=Pe,n[73]=Fe):Fe=n[73];let Ie;n[74]!==x||n[75]!==Ne||n[76]!==Fe?(Ie=(0,Q.jsx)(lt,{title:`Provider updates`,owner:`node`,children:(0,Q.jsx)(Y,{title:`Provider update checks`,description:`Check installed provider CLIs for newer versions. Disable if you install providers with Nix or another package manager.`,owner:`node`,scope:x,resetAction:Ne,control:Fe})}),n[74]=x,n[75]=Ne,n[76]=Fe,n[77]=Ie):Ie=n[77];let Le;n[78]!==m||n[79]!==d?(Le=!d&&m!==`node`&&(0,Q.jsx)(An,{}),n[78]=m,n[79]=d,n[80]=Le):Le=n[80];let Re;n[81]!==a.autoOpenPlanSidebar||n[82]!==u?(Re=a.autoOpenPlanSidebar===o.autoOpenPlanSidebar?null:(0,Q.jsx)(X,{label:`auto-open overview`,onClick:()=>u({autoOpenPlanSidebar:o.autoOpenPlanSidebar})}),n[81]=a.autoOpenPlanSidebar,n[82]=u,n[83]=Re):Re=n[83];let ze;n[84]===u?ze=n[85]:(ze=e=>u({autoOpenPlanSidebar:!!e}),n[84]=u,n[85]=ze);let Be;n[86]!==a.autoOpenPlanSidebar||n[87]!==ze?(Be=(0,Q.jsx)(Te,{checked:a.autoOpenPlanSidebar,onCheckedChange:ze,"aria-label":`Open the overview automatically`}),n[86]=a.autoOpenPlanSidebar,n[87]=ze,n[88]=Be):Be=n[88];let Ve;n[89]!==v||n[90]!==Re||n[91]!==Be?(Ve=(0,Q.jsx)(Y,{title:`Auto-open overview`,description:`Open the overview automatically when plans, progress, or implementation steps appear.`,owner:`client`,scope:v,resetAction:Re,control:Be}),n[89]=v,n[90]=Re,n[91]=Be,n[92]=Ve):Ve=n[92];let He;n[93]!==d||n[94]!==x||n[95]!==a.defaultThreadEnvMode||n[96]!==a.worktreeBranchPrefix||n[97]!==f||n[98]!==u?(He=(!f||d)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`New threads`,description:`Pick the default workspace mode for newly created draft threads.`,owner:`node`,scope:x,resetAction:a.defaultThreadEnvMode===o.defaultThreadEnvMode?null:(0,Q.jsx)(X,{label:`new threads`,onClick:()=>u({defaultThreadEnvMode:o.defaultThreadEnvMode})}),control:(0,Q.jsxs)(G,{value:a.defaultThreadEnvMode,onValueChange:e=>{(e===`local`||e===`worktree`)&&u({defaultThreadEnvMode:e})},children:[(0,Q.jsx)(q,{className:`w-full sm:w-44`,"aria-label":`Default thread mode`,children:(0,Q.jsx)(W,{children:a.defaultThreadEnvMode===`worktree`?`New worktree`:`Local`})}),(0,Q.jsxs)(K,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(U,{hideIndicator:!0,value:`local`,children:`Local`}),(0,Q.jsx)(U,{hideIndicator:!0,value:`worktree`,children:`New worktree`})]})]})}),!d&&(0,Q.jsx)(Y,{title:`Worktree branch prefix`,description:`Prefix for generated branches on this device. Use a Git namespace such as team/agent, without a trailing slash. Leave empty for no prefix. Existing branches keep their names.`,owner:`node`,scope:x,resetAction:a.worktreeBranchPrefix===o.worktreeBranchPrefix?null:(0,Q.jsx)(X,{label:`worktree branch prefix`,onClick:()=>u({worktreeBranchPrefix:o.worktreeBranchPrefix})}),control:(0,Q.jsx)(Zt,{className:`w-full sm:w-72`,value:a.worktreeBranchPrefix,onCommit:e=>{let t=e.trim();if(!c(l)(t)){D.add({type:`error`,title:`Invalid worktree branch prefix`,description:`Use a valid Git namespace of up to 128 characters without a trailing slash, or leave it empty.`});return}u({worktreeBranchPrefix:t})},placeholder:`ryco`,spellCheck:!1,autoCapitalize:`none`,"aria-label":`Worktree branch prefix`})})]}),n[93]=d,n[94]=x,n[95]=a.defaultThreadEnvMode,n[96]=a.worktreeBranchPrefix,n[97]=f,n[98]=u,n[99]=He):He=n[99];let Ue;n[100]!==d||n[101]!==f?(Ue=f&&!d&&(0,Q.jsx)(Qt,{}),n[100]=d,n[101]=f,n[102]=Ue):Ue=n[102];let We;n[103]===d?We=n[104]:(We=!d&&(0,Q.jsx)(pn,{}),n[103]=d,n[104]=We);let Ke;n[105]===d?Ke=n[106]:(Ke=!d&&(0,Q.jsx)(vn,{}),n[105]=d,n[106]=Ke);let J;n[107]===d?J=n[108]:(J=!d&&(0,Q.jsx)(an,{}),n[107]=d,n[108]=J);let Ye;n[109]!==a.addProjectBaseDirectory||n[110]!==u?(Ye=a.addProjectBaseDirectory===o.addProjectBaseDirectory?null:(0,Q.jsx)(X,{label:`add project base directory`,onClick:()=>u({addProjectBaseDirectory:o.addProjectBaseDirectory})}),n[109]=a.addProjectBaseDirectory,n[110]=u,n[111]=Ye):Ye=n[111];let Qe;n[112]===u?Qe=n[113]:(Qe=e=>u({addProjectBaseDirectory:e}),n[112]=u,n[113]=Qe);let $e;n[114]!==a.addProjectBaseDirectory||n[115]!==Qe?($e=(0,Q.jsx)(Zt,{className:`w-full sm:w-72`,value:a.addProjectBaseDirectory,onCommit:Qe,placeholder:`~/`,spellCheck:!1,"aria-label":`Add project base directory`}),n[114]=a.addProjectBaseDirectory,n[115]=Qe,n[116]=$e):$e=n[116];let et;n[117]!==x||n[118]!==Ye||n[119]!==$e?(et=(0,Q.jsx)(Y,{title:`Add project starts in`,description:`Leave empty to use "~/" when the Add Project browser opens.`,owner:`node`,scope:x,resetAction:Ye,control:$e}),n[117]=x,n[118]=Ye,n[119]=$e,n[120]=et):et=n[120];let tt;n[121]!==Ve||n[122]!==He||n[123]!==Ue||n[124]!==We||n[125]!==Ke||n[126]!==J||n[127]!==et?(tt=(0,Q.jsxs)(lt,{title:`Projects & threads`,children:[Ve,He,Ue,We,Ke,J,et]}),n[121]=Ve,n[122]=He,n[123]=Ue,n[124]=We,n[125]=Ke,n[126]=J,n[127]=et,n[128]=tt):tt=n[128];let nt;n[129]===d?nt=n[130]:(nt=!d&&(0,Q.jsx)(In,{}),n[129]=d,n[130]=nt);let rt;n[131]!==a.confirmThreadArchive||n[132]!==u?(rt=a.confirmThreadArchive===o.confirmThreadArchive?null:(0,Q.jsx)(X,{label:`archive confirmation`,onClick:()=>u({confirmThreadArchive:o.confirmThreadArchive})}),n[131]=a.confirmThreadArchive,n[132]=u,n[133]=rt):rt=n[133];let it;n[134]===u?it=n[135]:(it=e=>u({confirmThreadArchive:!!e}),n[134]=u,n[135]=it);let at;n[136]!==a.confirmThreadArchive||n[137]!==it?(at=(0,Q.jsx)(Te,{checked:a.confirmThreadArchive,onCheckedChange:it,"aria-label":`Confirm thread archiving`}),n[136]=a.confirmThreadArchive,n[137]=it,n[138]=at):at=n[138];let ot;n[139]!==v||n[140]!==rt||n[141]!==at?(ot=(0,Q.jsx)(Y,{title:`Archive confirmation`,description:`Require a second click on the inline archive action before a thread is archived.`,owner:`client`,scope:v,resetAction:rt,control:at}),n[139]=v,n[140]=rt,n[141]=at,n[142]=ot):ot=n[142];let st;n[143]!==a.confirmThreadDelete||n[144]!==u?(st=a.confirmThreadDelete===o.confirmThreadDelete?null:(0,Q.jsx)(X,{label:`delete confirmation`,onClick:()=>u({confirmThreadDelete:o.confirmThreadDelete})}),n[143]=a.confirmThreadDelete,n[144]=u,n[145]=st):st=n[145];let ct;n[146]===u?ct=n[147]:(ct=e=>u({confirmThreadDelete:!!e}),n[146]=u,n[147]=ct);let dt;n[148]!==a.confirmThreadDelete||n[149]!==ct?(dt=(0,Q.jsx)(Te,{checked:a.confirmThreadDelete,onCheckedChange:ct,"aria-label":`Confirm thread deletion`}),n[148]=a.confirmThreadDelete,n[149]=ct,n[150]=dt):dt=n[150];let ft;n[151]!==v||n[152]!==st||n[153]!==dt?(ft=(0,Q.jsx)(Y,{title:`Delete confirmation`,description:`Ask before deleting a thread and its chat history.`,owner:`client`,scope:v,resetAction:st,control:dt}),n[151]=v,n[152]=st,n[153]=dt,n[154]=ft):ft=n[154];let pt;n[155]!==a.confirmThreadUnpin||n[156]!==u?(pt=a.confirmThreadUnpin===o.confirmThreadUnpin?null:(0,Q.jsx)(X,{label:`unpin confirmation`,onClick:()=>u({confirmThreadUnpin:o.confirmThreadUnpin})}),n[155]=a.confirmThreadUnpin,n[156]=u,n[157]=pt):pt=n[157];let mt;n[158]===u?mt=n[159]:(mt=e=>u({confirmThreadUnpin:!!e}),n[158]=u,n[159]=mt);let ht;n[160]!==a.confirmThreadUnpin||n[161]!==mt?(ht=(0,Q.jsx)(Te,{checked:a.confirmThreadUnpin,onCheckedChange:mt,"aria-label":`Confirm thread unpinning`}),n[160]=a.confirmThreadUnpin,n[161]=mt,n[162]=ht):ht=n[162];let gt;n[163]!==v||n[164]!==pt||n[165]!==ht?(gt=(0,Q.jsx)(Y,{title:`Unpin confirmation`,description:`Ask before removing a thread from the pinned section.`,owner:`client`,scope:v,resetAction:pt,control:ht}),n[163]=v,n[164]=pt,n[165]=ht,n[166]=gt):gt=n[166];let _t;n[167]!==nt||n[168]!==ot||n[169]!==ft||n[170]!==gt?(_t=(0,Q.jsxs)(lt,{title:`Confirmations`,owner:`client`,children:[nt,ot,ft,gt]}),n[167]=nt,n[168]=ot,n[169]=ft,n[170]=gt,n[171]=_t):_t=n[171];let vt;n[172]!==_||n[173]!==a.notifyOnTurnCompleteWhenUnfocused||n[174]!==u?(vt=t&&(0,Q.jsx)(lt,{title:`Notifications`,owner:`client`,children:(0,Q.jsx)(Y,{title:`Turn-complete notifications`,description:`Show a desktop notification when an agent finishes a turn while the Ryco window is unfocused.`,owner:`client`,scope:_,resetAction:a.notifyOnTurnCompleteWhenUnfocused===o.notifyOnTurnCompleteWhenUnfocused?null:(0,Q.jsx)(X,{label:`turn-complete notifications`,onClick:()=>u({notifyOnTurnCompleteWhenUnfocused:o.notifyOnTurnCompleteWhenUnfocused})}),control:(0,Q.jsx)(Te,{checked:a.notifyOnTurnCompleteWhenUnfocused,onCheckedChange:e=>u({notifyOnTurnCompleteWhenUnfocused:!!e}),"aria-label":`Notify when a turn completes while unfocused`})})}),n[172]=_,n[173]=a.notifyOnTurnCompleteWhenUnfocused,n[174]=u,n[175]=vt):vt=n[175];let yt;n[176]!==m||n[177]!==d||n[178]!==x||n[179]!==i?(yt=d?null:m!==`client`&&(0,Q.jsx)(tr,{searchTargetId:i,nodeScopeLabel:x}),n[176]=m,n[177]=d,n[178]=x,n[179]=i,n[180]=yt):yt=n[180];let bt;n[181]===m?bt=n[182]:(bt=m!==`node`&&(0,Q.jsx)(Un,{}),n[181]=m,n[182]=bt);let xt;n[183]!==_||n[184]!==m||n[185]!==v?(xt=t&&m!==`node`?(0,Q.jsx)(Gn,{scopeLabel:_}):(0,Q.jsx)(Y,{title:(0,Q.jsx)(Bn,{}),description:`Current version of the application.`,owner:`client`,scope:v}),n[183]=_,n[184]=m,n[185]=v,n[186]=xt):xt=n[186];let St=N??`Resolving logs directory...`,Ct;n[187]===St?Ct=n[188]:(Ct=(0,Q.jsx)(`span`,{className:`block break-all font-mono text-[11px] text-foreground`,children:St}),n[187]=St,n[188]=Ct);let wt;n[189]!==I||n[190]!==ae||n[191]!==p?.nodeLabel?(wt=ae?(0,Q.jsx)(`span`,{className:`mt-1 block text-destructive`,children:ae}):I?null:(0,Q.jsxs)(`span`,{className:`mt-1 block`,children:[`This path is on `,p?.nodeLabel,`; open it from that machine.`]}),n[189]=I,n[190]=ae,n[191]=p?.nodeLabel,n[192]=wt):wt=n[192];let Tt;n[193]!==Ct||n[194]!==wt?(Tt=(0,Q.jsxs)(Q.Fragment,{children:[Ct,wt]}),n[193]=Ct,n[194]=wt,n[195]=Tt):Tt=n[195];let Et=!I||!N||oe,Dt=oe?`Opening...`:`Open logs folder`,Ot;n[196]!==ie||n[197]!==Et||n[198]!==Dt?(Ot=(0,Q.jsx)(F,{size:`xs`,variant:`outline`,disabled:Et,onClick:ie,children:Dt}),n[196]=ie,n[197]=Et,n[198]=Dt,n[199]=Ot):Ot=n[199];let kt;n[200]!==V||n[201]!==x||n[202]!==Tt||n[203]!==Ot?(kt=(0,Q.jsx)(Y,{title:`Diagnostics`,description:V,owner:`node`,scope:x,status:Tt,control:Ot}),n[200]=V,n[201]=x,n[202]=Tt,n[203]=Ot,n[204]=kt):kt=n[204];let At;n[205]!==bt||n[206]!==xt||n[207]!==kt?(At=(0,Q.jsxs)(lt,{title:`About`,children:[bt,xt,kt]}),n[205]=bt,n[206]=xt,n[207]=kt,n[208]=At):At=n[208];let jt;return n[209]!==je||n[210]!==Me||n[211]!==Ie||n[212]!==Le||n[213]!==tt||n[214]!==_t||n[215]!==vt||n[216]!==yt||n[217]!==At?(jt=(0,Q.jsxs)(ut,{children:[ce,je,Me,Ie,Le,tt,_t,vt,yt,At]}),n[209]=je,n[210]=Me,n[211]=Ie,n[212]=Le,n[213]=tt,n[214]=_t,n[215]=vt,n[216]=yt,n[217]=At,n[218]=jt):jt=n[218],jt}function rr(e){return(0,Q.jsx)(U,{hideIndicator:!0,value:e.id,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(zn,{editor:e.id}),Ge(e.id,navigator.platform)]})},e.id)}function ir(){let e=(0,$.c)(17),t=P(),n=He(a.dispatchCommand),r=n.allowed&&(!t||t.connected&&t.canMutate!==!1),i=b(Qe(x)),o=b(Qe(k)),{unarchiveThread:s,confirmAndDeleteThread:c}=Ce();t?.environmentId;let l=t?.environmentId,u;e[0]!==i||e[1]!==l||e[2]!==o?(u=dn(i,o,l),e[0]=i,e[1]=l,e[2]=o,e[3]=u):u=e[3];let d=u,f;e[4]!==c||e[5]!==r||e[6]!==n.reason||e[7]!==s?(f=async(e,t)=>{if(!r){D.add(J({type:`warning`,title:`Archived thread is read-only`,description:n.reason??`This action is unavailable.`}));return}let i=ae();if(!i)return;let a=await i.contextMenu.show([{id:`unarchive`,label:`Unarchive`},{id:`delete`,label:`Delete`,destructive:!0}],t);if(a===`unarchive`){try{await s(e)}catch(e){let t=e;D.add(J({type:`error`,title:`Failed to unarchive thread`,description:t instanceof Error?t.message:`An error occurred.`}))}return}a===`delete`&&await c(e)},e[4]=c,e[5]=r,e[6]=n.reason,e[7]=s,e[8]=f):f=e[8];let p=f,m;e[9]!==d||e[10]!==p||e[11]!==r||e[12]!==n.reason||e[13]!==s?(m=d.length===0?(0,Q.jsx)(lt,{title:`Archived threads`,children:(0,Q.jsxs)(ct,{className:`min-h-88`,children:[(0,Q.jsx)(it,{variant:`icon`,children:(0,Q.jsx)(Be,{})}),(0,Q.jsxs)(at,{children:[(0,Q.jsx)(ot,{children:`No archived threads`}),(0,Q.jsx)(st,{children:`Archived threads will appear here.`})]})]})}):d.map(e=>{let{project:t,threads:i}=e;return(0,Q.jsx)(lt,{title:t.name,icon:(0,Q.jsx)(Se,{environmentId:t.environmentId,cwd:t.cwd,projectId:t.id,customAvatarContentHash:t.customAvatarContentHash??null}),children:i.map(e=>(0,Q.jsx)(ar,{thread:e,mutationAllowed:r,mutationReason:n.reason??null,onOpenMenu:p,onUnarchive:s},e.id))},`${t.environmentId}:${t.id}`)}),e[9]=d,e[10]=p,e[11]=r,e[12]=n.reason,e[13]=s,e[14]=m):m=e[14];let h;return e[15]===m?h=e[16]:(h=(0,Q.jsx)(ut,{children:m}),e[15]=m,e[16]=h),h}function ar(e){let t=(0,$.c)(38),{thread:n,mutationAllowed:r,mutationReason:a,onOpenMenu:o,onUnarchive:s}=e,c=Xe()===`phone`,l;t[0]!==o||t[1]!==n.environmentId||t[2]!==n.id?(l=e=>{o(i(n.environmentId,n.id),e)},t[0]=o,t[1]=n.environmentId,t[2]=n.id,t[3]=l):l=t[3];let u=!c,d;t[4]===u?d=t[5]:(d={disabled:u},t[4]=u,t[5]=d);let f=nt(l,d),p;t[6]!==f||t[7]!==o||t[8]!==n.environmentId||t[9]!==n.id?(p=e=>{f.onContextMenu(e),!e.defaultPrevented&&(e.preventDefault(),o(i(n.environmentId,n.id),{x:e.clientX,y:e.clientY}))},t[6]=f,t[7]=o,t[8]=n.environmentId,t[9]=n.id,t[10]=p):p=t[10];let m;t[11]===n.title?m=t[12]:(m=(0,Q.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:n.title}),t[11]=n.title,t[12]=m);let h=n.archivedAt??n.createdAt,g;t[13]===h?g=t[14]:(g=we(h),t[13]=h,t[14]=g);let _;t[15]===n.createdAt?_=t[16]:(_=we(n.createdAt),t[15]=n.createdAt,t[16]=_);let v;t[17]!==g||t[18]!==_?(v=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Archived `,g,` · Created `,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==m||t[21]!==v?(y=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,v]}),t[20]=m,t[21]=v,t[22]=y):y=t[22];let b=!r,x=a??void 0,S;t[23]!==s||t[24]!==n.environmentId||t[25]!==n.id?(S=()=>void s(i(n.environmentId,n.id)).catch(or),t[23]=s,t[24]=n.environmentId,t[25]=n.id,t[26]=S):S=t[26];let C,w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(pt,{className:`size-3.5`}),w=(0,Q.jsx)(`span`,{children:`Unarchive`}),t[27]=C,t[28]=w):(C=t[27],w=t[28]);let T;t[29]!==b||t[30]!==x||t[31]!==S?(T=(0,Q.jsxs)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 shrink-0 cursor-pointer gap-1.5 px-2.5`,disabled:b,title:x,onClick:S,children:[C,w]}),t[29]=b,t[30]=x,t[31]=S,t[32]=T):T=t[32];let E;return t[33]!==f||t[34]!==T||t[35]!==p||t[36]!==y?(E=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border px-4 py-3 first:border-t-0 sm:px-5`,...f,onContextMenu:p,children:[y,T]}),t[33]=f,t[34]=T,t[35]=p,t[36]=y,t[37]=E):E=t[37],E}function or(e){D.add(J({type:`error`,title:`Failed to unarchive thread`,description:e instanceof Error?e.message:`An error occurred.`}))}export{Zt as a,qt as c,_t as d,ht as f,Dn as i,xt as l,nr as n,Kt as o,er as r,Jt as s,ir as t,yt as u};